Class acol_manager (o2scl_acol)¶
-
class
o2scl_acol
::
acol_manager
¶ The driver for ‘acol’ command-line utility.
- Idea for Future:
There is quite a bit of code duplication in comm_autocorr() between the “table” and “other” types. This could be streamlined.
- Idea for Future:
sum/max/min/output/interp/deriv/integ/deriv2 for hist, hist_2d, and v<c>
- Idea for Future:
Commands xindex and yindex for table3d.
- Idea for Future:
Enable set_grid() for table3d similar to tensor_grid.
- Idea for Future:
Fix fit for table.
- Idea for Future:
Use swap instead of copy in ‘select’ for table objects.
- Idea for Future:
Make sure get_input() is used more consistently.
- Idea for Future:
Make sure preview, output, internal, generic, and create work consistently across all types.
- Idea for Future:
Stack-like operations (push, pop, swap, stack-list, etc.)?
- Idea for Future:
Add functionality to ensure that three digit exponents are still handled gracefully (do this by creating a new boolean setting which, if true, always makes three spaces for exponents?)
- Idea for Future:
Fix insert and insert_full so that it automatically renames columns
- Idea for Future:
Allow “insert” commands to be restrictive, avoiding extrapolation
Parameters modifiable by the user
-
int
prec
¶ The output precision (default 6)
-
int
verbose
¶ The verbosity level (default 1)
-
bool
pretty
¶ True if we should make the output into neat columns (default true)
-
bool
names_out
¶ True if we should output column names.
-
std::string
obj_name
¶ The name of the table.
-
std::string
unit_fname
¶ Filename for units command.
-
std::string
def_args
¶ Default arguments from environment.
-
int
user_ncols
¶ The number of columns requested by the user.
-
int
interp_type
¶ The interpolation type.
-
int
compress
¶ If set, try to compress.
-
bool
scientific
¶ True for scientific output mode.
The parameter objects
-
o2scl::cli::parameter_string
p_obj_name
¶
-
o2scl::cli::parameter_string
p_unit_fname
¶
-
o2scl::cli::parameter_string
p_def_args
¶
-
o2scl::cli::parameter_int
p_verbose
¶
-
o2scl::cli::parameter_int
p_compress
¶
-
o2scl::cli::parameter_int
p_prec
¶
-
o2scl::cli::parameter_int
p_ncols
¶
-
o2scl::cli::parameter_int
p_interp_type
¶
-
o2scl::cli::parameter_bool
p_scientific
¶
-
o2scl::cli::parameter_bool
p_pretty
¶
-
o2scl::cli::parameter_bool
p_names_out
¶
-
int
ncols
¶ Number of columns in screen.
-
std::string
type
¶ String designating the current type.
-
cli *
cl
¶ Dummy cli object for cli::cli_gets()
-
acol_manager
()¶
-
~acol_manager
()¶
Object storage
-
o2scl::table_units
table_obj
¶
-
int
int_obj
¶
-
char
char_obj
¶
-
double
double_obj
¶
-
size_t
size_t_obj
¶
-
std::string
string_obj
¶
-
std::vector<o2scl::contour_line>
cont_obj
¶
-
o2scl::uniform_grid<double>
ug_obj
¶
-
std::vector<int>
intv_obj
¶
-
std::vector<double>
doublev_obj
¶
-
std::vector<size_t>
size_tv_obj
¶
-
std::vector<std::string>
stringv_obj
¶
-
o2scl::tensor_grid
tensor_grid_obj
¶
-
o2scl::prob_dens_mdim_amr
pdma_obj
¶
-
bool
post_interactive
¶ True if we should run interactive mode after parsing the command-line.
-
std::string
env_var_name
¶ The environment variable to read from.
-
std::map<std::string, int*>
int_params
¶ Integer parameters.
-
void
command_add
(std::string new_type)¶ Add new commands for type
new_type
.
-
void
command_del
(std::string ltype)¶ Remove the type-specific commands.
- Note
This needs to be public for the o2graph interface
-
int
get_verbose
()¶ Get the verbose parameter.
This function is used in o2scl_acol_mult_vectors_to_conts() .
-
int
run
(int argv, char *argc[], bool full_process = true)¶ Main run function.
Process command-line options using cli object, interface with the operating system via getenv(), instantiate and call the acol_manager object.
-
int
setup_cli
()¶ Create the cli object (with readline support if available)
-
int
setup_options
()¶ Add the options to the cli object.
-
int
setup_help
()¶ Add the help text to the cli object.
-
int
setup_parameters
()¶ Add the parameters for ‘set’ to the cli object.
-
int
comm_assign
(std::vector<std::string> &sv, bool itive_com)¶ Assign a constant.
-
int
comm_binary
(std::vector<std::string> &sv, bool itive_com)¶ Binary function for tensors.
-
int
comm_average_rows
(std::vector<std::string> &sv, bool itive_com)¶ Average rows together in a table.
-
int
comm_correl
(std::vector<std::string> &sv, bool itive_com)¶ Compute correlation between table columns.
-
int
comm_refine
(std::vector<std::string> &sv, bool itive_com)¶ Refine an object.
-
int
comm_calc
(std::vector<std::string> &sv, bool itive_com)¶ Compute a scalar value.
-
int
comm_clear
(std::vector<std::string> &sv, bool itive_com)¶ Clear the current object.
-
int
comm_help
(std::vector<std::string> &sv, bool itive_com)¶ Output the help text.
-
int
comm_commands
(std::vector<std::string> &sv, bool itive_com)¶ List commands, with an optional type argument.
-
int
comm_create
(std::vector<std::string> &sv, bool itive_com)¶ Create a table from a column of equally spaced values.
-
int
comm_set_grid
(std::vector<std::string> &sv, bool itive_com)¶ Set the grid for a o2scl::tensor_grid object.
-
int
comm_get_grid
(std::vector<std::string> &sv, bool itive_com)¶ Get the grid for a o2scl::tensor_grid object.
-
int
comm_download
(std::vector<std::string> &sv, bool itive_com)¶ Download a file from a specified URL.
-
int
comm_docs
(std::vector<std::string> &sv, bool itive_com)¶ Download a file from a specified URL.
-
int
comm_wdocs
(std::vector<std::string> &sv, bool itive_com)¶
-
int
comm_delete_col
(std::vector<std::string> &sv, bool itive_com)¶ Delete a column.
-
int
comm_delete_rows
(std::vector<std::string> &sv, bool itive_com)¶ Delete rows specified by a function.
-
int
comm_delete_rows_tol
(std::vector<std::string> &sv, bool itive_com)¶ Delete rows which match to within a specified tolerance.
-
int
comm_deriv
(std::vector<std::string> &sv, bool itive_com)¶ Create a column which is the derivative of another.
-
int
comm_to_table
(std::vector<std::string> &sv, bool itive_com)¶ Convert object to a o2scl::table object.
-
int
comm_diag
(std::vector<std::string> &sv, bool itive_com)¶ For tensor object, get entries along the main diagonal.
-
int
comm_to_table3d
(std::vector<std::string> &sv, bool itive_com)¶ Convert object to a o2scl::table3d object.
-
int
comm_to_tensor_grid
(std::vector<std::string> &sv, bool itive_com)¶ Convert object to a o2scl::tensor_grid object.
-
int
comm_to_tensor
(std::vector<std::string> &sv, bool itive_com)¶ Convert object to a o2scl::tensor object.
-
int
comm_to_table3d_sum
(std::vector<std::string> &sv, bool itive_com)¶ Convert object to a o2scl::table3d object by summing over tensor indices.
-
int
comm_autocorr
(std::vector<std::string> &sv, bool itive_com)¶ Compute the autocorrelation coefficients.
-
int
comm_ac_len
(std::vector<std::string> &sv, bool itive_com)¶ Compute the autocorrelation coefficient.
-
int
comm_deriv_x
(std::vector<std::string> &sv, bool itive_com)¶ Create a slice which is the derivative wrt x of another.
-
int
comm_deriv_y
(std::vector<std::string> &sv, bool itive_com)¶ Create a slice which is the derivative wrt y of another.
-
int
comm_deriv2
(std::vector<std::string> &sv, bool itive_com)¶ Create a column which is the second derivative of another.
-
int
comm_filelist
(std::vector<std::string> &sv, bool itive_com)¶ Read a file and list the O2scl objects.
-
int
comm_read
(std::vector<std::string> &sv, bool itive_com)¶ Read an object from a file.
-
int
comm_nlines
(std::vector<std::string> &sv, bool itive_com)¶ Add ‘nlines’ as a constant to a o2scl::table object.
-
int
comm_to_hist
(std::vector<std::string> &sv, bool itive_com)¶ Convert a o2scl::table object to a o2scl::hist object.
-
int
comm_to_hist_2d
(std::vector<std::string> &sv, bool itive_com)¶ Convert a o2scl::table object to a o2scl::hist object.
-
int
comm_type
(std::vector<std::string> &sv, bool itive_com)¶ Output the type of the current object to the screen.
-
int
comm_find_row
(std::vector<std::string> &sv, bool itive_com)¶ Find a row from a function.
-
int
comm_function
(std::vector<std::string> &sv, bool itive_com)¶ Create a column from a function.
-
int
comm_generic
(std::vector<std::string> &sv, bool itive_com)¶ Read a generic data file.
-
int
comm_get_row
(std::vector<std::string> &sv, bool itive_com)¶ Print out an entire row.
-
int
comm_slice
(std::vector<std::string> &sv, bool itive_com)¶ Extract a slice from a table3d object to generate a o2scl::table object.
-
int
comm_slice_hist
(std::vector<std::string> &sv, bool itive_com)¶
-
int
comm_fit
(std::vector<std::string> &sv, bool itive_com)¶ Fit two columns to a function.
-
int
comm_insert
(std::vector<std::string> &sv, bool itive_com)¶ Insert a column from an external table using interpolation.
-
int
comm_insert_full
(std::vector<std::string> &sv, bool itive_com)¶ Insert an external table using interpolation.
-
int
comm_integ
(std::vector<std::string> &sv, bool itive_com)¶ Create a column which is the integral of another.
-
int
comm_interactive
(std::vector<std::string> &sv, bool itive_com)¶ Toggle interactive mode.
-
int
comm_internal
(std::vector<std::string> &sv, bool itive_com)¶ Output to a file in internal format.
-
int
comm_interp
(std::vector<std::string> &sv, bool itive_com)¶ Create an html file.
-
int
comm_list
(std::vector<std::string> &sv, bool itive_com)¶ List columns in table ‘tp’ named ‘tname’ assuming screen size ‘ncol’.
-
int
comm_max
(std::vector<std::string> &sv, bool itive_com)¶ Compute the maximum value of a colum.
-
int
comm_min
(std::vector<std::string> &sv, bool itive_com)¶ Compute the minimum value of a colum.
-
int
comm_x_name
(std::vector<std::string> &sv, bool itive_com)¶ Set the name of the x grid.
-
int
comm_y_name
(std::vector<std::string> &sv, bool itive_com)¶ Set the name of the y grid.
-
int
comm_index
(std::vector<std::string> &sv, bool itive_com)¶ Add a column for line numbers.
-
int
comm_output
(std::vector<std::string> &sv, bool itive_com)¶ Output to screen or file.
-
void
rearrange_arg_process
(std::string str, std::vector<std::string> &sv)¶ Process arguments for rearrange.
-
int
comm_rearrange
(std::vector<std::string> &sv, bool itive_com)¶ Rearrange a tensor.
-
int
comm_preview
(std::vector<std::string> &sv, bool itive_com)¶ Preview the table.
-
int
comm_slack
(std::vector<std::string> &sv, bool itive_com)¶ Send a slack message.
-
int
comm_value
(std::vector<std::string> &sv, bool itive_com)¶ Get or set the value.
-
int
comm_cat
(std::vector<std::string> &sv, bool itive_com)¶ Concatenate two table/table3d objects.
-
int
comm_sum
(std::vector<std::string> &sv, bool itive_com)¶ Sum two table/table3d objects.
-
int
comm_rename
(std::vector<std::string> &sv, bool itive_com)¶ Rename a column.
-
int
comm_select
(std::vector<std::string> &sv, bool itive_com)¶ Select several columns for a new table.
-
int
comm_select_rows2
(std::vector<std::string> &sv, bool itive_com)¶ Select several rows for a new table.
A faster form of select rows which requires one to specify the columns needed for the selection criteria first
-
int
comm_set
(std::vector<std::string> &sv, bool itive_com)¶ Post-processing for setting a value.
-
int
comm_set_data
(std::vector<std::string> &sv, bool itive_com)¶ Set an individual data point at a specified row and column.
-
int
comm_set_unit
(std::vector<std::string> &sv, bool itive_com)¶ Set units of a column.
-
int
comm_contours
(std::vector<std::string> &sv, bool itive_com)¶ Compute contour lines.
-
int
comm_show_units
(std::vector<std::string> &sv, bool itive_com)¶ Set units of a column.
-
int
comm_get_unit
(std::vector<std::string> &sv, bool itive_com)¶ Get units of a column.
-
int
comm_entry
(std::vector<std::string> &sv, bool itive_com)¶ Get an entry.
-
int
comm_entry_grid
(std::vector<std::string> &sv, bool itive_com)¶ Get an entry by grid point.
-
int
comm_convert_unit
(std::vector<std::string> &sv, bool itive_com)¶ Convert units of a column.
-
int
comm_sort
(std::vector<std::string> &sv, bool itive_com)¶ Sort the table by a column.
-
int
comm_stats
(std::vector<std::string> &sv, bool itive_com)¶ Get column stats.
-
int
comm_wstats
(std::vector<std::string> &sv, bool itive_com)¶ Get column stats with weights specified in a second column.
-
int
comm_version
(std::vector<std::string> &sv, bool itive_com)¶ Print version.
-
int
comm_get_conv
(std::vector<std::string> &sv, bool itive_com)¶ Get a conversion factor.
-
int
comm_h5_copy
(std::vector<std::string> &sv, bool itive_com)¶ Desc.
-
int
comm_constant
(std::vector<std::string> &sv, bool itive_com)¶
-
int
set_swidth
(int ncol)¶ Set screen width.
-
void
clear_obj
()¶ Clear memory associated with the current object and set type to “”.
-
int
get_input
(std::vector<std::string> &sv, std::vector<std::string> &directions, std::vector<std::string> &in, std::string comm_name, bool itive_com)¶ An internal command for prompting the user for command arguments.
-
int
get_input_one
(std::vector<std::string> &sv, std::string directions, std::string &in, std::string comm_name, bool itive_com)¶ An internal command for prompting the user for one command argument.
Temporary storage
These are used in o2scl_acol_get_slice(), o2scl_acol_get_hist_reps(), o2scl_acol_get_hist_wgts(), o2scl_acol_get_hist_bins(), and o2scl_acol_get_hist_2d(),
-
std::vector<double>
xtemp
¶
-
std::vector<double>
ytemp
¶
-
std::vector<double>
stemp
¶
-
std::vector<int>
itemp
¶
-
std::vector<char>
ctemp
¶
Protected Attributes
-
o2scl::slack_messenger
smess
¶ The object which sends Slack messages.
-
std::map<std::string, std::vector<std::string>>
type_comm_list
¶ A list of all type-specific commands for each type.
-
std::vector<std::string>
type_list
¶ A list of all types.
-
bool
o2graph_mode
¶ If true, then run in o2graph mode.
-
o2scl::comm_option_mfptr<acol_manager>
cset
¶ The object for the set function.
-
format_float
ffl
¶ The number formatter for html output.
-
o2scl::convert_units<double> &
cng
¶ Convert units object (initialized by constructor to global object)