37 #include <o2scl/misc.h> 38 #include <o2scl/cli.h> 39 #include <o2scl/fit_nonlin.h> 40 #include <o2scl/table_units.h> 41 #include <o2scl/table3d.h> 42 #include <o2scl/format_float.h> 43 #include <o2scl/hdf_file.h> 44 #include <o2scl/hdf_io.h> 45 #include <o2scl/lib_settings.h> 46 #include <o2scl/contour.h> 47 #include <o2scl/tensor_grid.h> 50 #include <o2scl/cli_readline.h> 52 #include <o2scl/cli.h> 96 #ifndef DOXYGEN_INTERNAL 205 std::string string_obj;
207 std::vector<o2scl::contour_line> cont_obj;
210 std::vector<int> intv_obj;
211 std::vector<double> doublev_obj;
212 std::vector<size_t> size_tv_obj;
213 std::vector<std::string> stringv_obj;
254 virtual int run(
int argv,
char *argc[],
bool set_o2graph_mode=
false);
269 virtual int comm_assign(std::vector<std::string> &sv,
bool itive_com);
272 virtual int comm_calc(std::vector<std::string> &sv,
bool itive_com);
276 virtual int comm_help(std::vector<std::string> &sv,
bool itive_com);
280 virtual int comm_commands(std::vector<std::string> &sv,
bool itive_com);
283 virtual int comm_create(std::vector<std::string> &sv,
bool itive_com);
285 virtual int comm_set_grid(std::vector<std::string> &sv,
bool itive_com);
288 virtual int comm_download(std::vector<std::string> &sv,
bool itive_com);
291 virtual int comm_delete_col(std::vector<std::string> &sv,
bool itive_com);
297 virtual int comm_deriv(std::vector<std::string> &sv,
bool itive_com);
301 virtual int comm_to_table(std::vector<std::string> &sv,
bool itive_com);
305 virtual int comm_to_table3d(std::vector<std::string> &sv,
bool itive_com);
309 virtual int comm_autocorr(std::vector<std::string> &sv,
bool itive_com);
312 virtual int comm_deriv_x(std::vector<std::string> &sv,
bool itive_com);
315 virtual int comm_deriv_y(std::vector<std::string> &sv,
bool itive_com);
318 virtual int comm_deriv2(std::vector<std::string> &sv,
bool itive_com);
332 const H5L_info_t *inf,
void *op_data);
336 const H5L_info_t *inf,
void *op_data);
339 virtual int comm_filelist(std::vector<std::string> &sv,
bool itive_com);
342 virtual int comm_read(std::vector<std::string> &sv,
bool itive_com);
345 virtual int comm_nlines(std::vector<std::string> &sv,
bool itive_com);
348 virtual int comm_to_hist(std::vector<std::string> &sv,
bool itive_com);
351 virtual int comm_type(std::vector<std::string> &sv,
bool itive_com);
354 virtual int comm_find_row(std::vector<std::string> &sv,
bool itive_com);
357 virtual int comm_function(std::vector<std::string> &sv,
bool itive_com);
360 virtual int comm_generic(std::vector<std::string> &sv,
bool itive_com);
363 virtual int comm_get_row(std::vector<std::string> &sv,
bool itive_com);
366 virtual int comm_slice(std::vector<std::string> &sv,
bool itive_com);
369 virtual int comm_fit(std::vector<std::string> &sv,
bool itive_com);
371 #ifdef O2SCL_NEVER_DEFINED 377 virtual int comm_insert(std::vector<std::string> &sv,
bool itive_com);
383 virtual int comm_integ(std::vector<std::string> &sv,
bool itive_com);
389 virtual int comm_internal(std::vector<std::string> &sv,
bool itive_com);
392 virtual int comm_interp(std::vector<std::string> &sv,
bool itive_com);
395 virtual int comm_list(std::vector<std::string> &sv,
bool itive_com);
398 virtual int comm_max(std::vector<std::string> &sv,
bool itive_com);
401 virtual int comm_min(std::vector<std::string> &sv,
bool itive_com);
404 virtual int comm_index(std::vector<std::string> &sv,
bool itive_com);
407 virtual int comm_output(std::vector<std::string> &sv,
bool itive_com);
410 virtual int comm_preview(std::vector<std::string> &sv,
bool itive_com);
411 virtual int comm_value(std::vector<std::string> &sv,
bool itive_com);
414 virtual int comm_cat(std::vector<std::string> &sv,
bool itive_com);
417 virtual int comm_sum(std::vector<std::string> &sv,
bool itive_com);
420 virtual int comm_rename(std::vector<std::string> &sv,
bool itive_com);
423 virtual int comm_select(std::vector<std::string> &sv,
bool itive_com);
436 virtual int comm_set(std::vector<std::string> &sv,
bool itive_com);
439 virtual int comm_set_data(std::vector<std::string> &sv,
bool itive_com);
442 virtual int comm_set_unit(std::vector<std::string> &sv,
bool itive_com);
445 virtual int comm_contours(std::vector<std::string> &sv,
bool itive_com);
448 virtual int comm_show_units(std::vector<std::string> &sv,
bool itive_com);
451 virtual int comm_get_unit(std::vector<std::string> &sv,
bool itive_com);
454 virtual int comm_entry(std::vector<std::string> &sv,
bool itive_com);
461 virtual int comm_sort(std::vector<std::string> &sv,
bool itive_com);
464 virtual int comm_stats(std::vector<std::string> &sv,
bool itive_com);
467 virtual int comm_version(std::vector<std::string> &sv,
bool itive_com);
470 virtual int comm_get_conv(std::vector<std::string> &sv,
bool itive_com);
481 virtual int comm_none(std::vector<std::string> &sv,
bool itive_com) {
488 int get_input(std::vector<std::string> &sv,
489 std::vector<std::string> &directions,
490 std::vector<std::string> &in, std::string comm_name,
494 int get_input_one(std::vector<std::string> &sv, std::string directions,
495 std::string &in, std::string comm_name,
502 std::vector<double> xtemp;
503 std::vector<double> ytemp;
504 std::vector<double> stemp;
530 std::string cmap, xtitle, ytitle;
531 double xlo, xhi, ylo, yhi, zlo, zhi;
532 bool xset, yset, zset, colbar, logx, logy;
534 double left_margin, right_margin, top_margin, bottom_margin;
568 (
int n_entries,
int *sizes,
char *str);
580 int &n,
double *&ptr);
617 int &nx,
double *&xptr,
618 int &ny,
double *&yptr,
625 int &nx,
double *&xptr,
626 int &ny,
double *&yptr,
virtual int comm_function(std::vector< std::string > &sv, bool itive_com)
Create a column from a function.
virtual int comm_to_hist(std::vector< std::string > &sv, bool itive_com)
Convert a o2scl::table object to a o2scl::hist object.
virtual int comm_sort(std::vector< std::string > &sv, bool itive_com)
Sort the table by a column.
Parameters for iterate_func()
virtual int comm_internal(std::vector< std::string > &sv, bool itive_com)
Output to a file in internal format.
virtual int comm_download(std::vector< std::string > &sv, bool itive_com)
Download a file from a specified URL.
Tensor class with arbitrary dimensions with a grid.
virtual int comm_integ(std::vector< std::string > &sv, bool itive_com)
Create a column which is the integral of another.
A namespace for objects associated with the command-line utility 'acol'.
Double parameter for o2scl::cli.
int o2scl_acol_get_double_arr(void *vp, int &n, double *&ptr)
Return the size and a pointer to the column named col_name in a table object.
The driver for 'acol' command-line utility.
void * o2scl_create_acol_manager()
Create an o2scl_acol::acol_manager object.
virtual int comm_help(std::vector< std::string > &sv, bool itive_com)
Desc.
virtual int comm_delete_col(std::vector< std::string > &sv, bool itive_com)
Delete a column.
virtual int comm_cat(std::vector< std::string > &sv, bool itive_com)
Concatenate two table/table3d objects.
virtual int comm_sum(std::vector< std::string > &sv, bool itive_com)
Sum two table/table3d objects.
String parameter for o2scl::cli.
virtual int comm_preview(std::vector< std::string > &sv, bool itive_com)
Preview the table.
virtual int comm_get_conv(std::vector< std::string > &sv, bool itive_com)
Get a conversion factor.
std::map< std::string, std::string * > str_params
String parameters.
virtual int comm_contours(std::vector< std::string > &sv, bool itive_com)
Compute contour lines.
virtual int comm_calc(std::vector< std::string > &sv, bool itive_com)
Compute a scalar value.
virtual int comm_index(std::vector< std::string > &sv, bool itive_com)
Add a column for line numbers.
virtual int run(int argv, char *argc[], bool set_o2graph_mode=false)
Main run function.
virtual int comm_stats(std::vector< std::string > &sv, bool itive_com)
Get column stats.
virtual int comm_slice(std::vector< std::string > &sv, bool itive_com)
Extract a slice from a table3d object to generate a table object.
virtual int comm_insert_full(std::vector< std::string > &sv, bool itive_com)
Insert an external table using interpolation.
int user_ncols
The number of columns requested by the user.
virtual int comm_nlines(std::vector< std::string > &sv, bool itive_com)
Add 'nlines' as a constant to a o2scl::table object.
virtual int setup_options()
Add the options to the cli object.
virtual int comm_filelist(std::vector< std::string > &sv, bool itive_com)
Read a file and list the O2scl objects.
format_float ffl
The number formatter for html output.
int ncols
Number of columns in screen.
int interp_type
The interpolation type.
virtual int comm_to_table3d(std::vector< std::string > &sv, bool itive_com)
Desc.
A two-dimensional histogram class.
virtual int comm_find_row(std::vector< std::string > &sv, bool itive_com)
Find a row from a function.
virtual int comm_autocorr(std::vector< std::string > &sv, bool itive_com)
Desc.
virtual int comm_version(std::vector< std::string > &sv, bool itive_com)
Print version.
void o2scl_acol_parse(void *vp, int n_entries, int *sizes, char *str)
Parse the set of commands in n_entries, sizes and str.
virtual int comm_interp(std::vector< std::string > &sv, bool itive_com)
Create an html file.
std::vector< std::string > o2scl_acol_parse_arrays(int n_entries, int *sizes, char *str)
Construct a string vector from the data in n_entries, sizes, and str.
int prec
The output precision (default 6)
static herr_t filelist_func(hid_t loc, const char *name, const H5L_info_t *inf, void *op_data)
HDF object iteration function.
void command_add(std::string new_type)
Add new commands for type new_type.
virtual int comm_interactive(std::vector< std::string > &sv, bool itive_com)
Toggle interactive mode.
int o2scl_acol_get_column(void *vp, char *col_name, int &n, double *&ptr)
Return the size and a pointer to the column named col_name in a table object.
bool o2graph_mode
If true, then run in o2graph mode.
A one-dimensional histogram class.
virtual int comm_commands(std::vector< std::string > &sv, bool itive_com)
List commands, with an optional type argument.
virtual int comm_set(std::vector< std::string > &sv, bool itive_com)
Post-processing for setting a value.
Configurable command-line interface.
cli * cl
Dummy cli object for cli::cli_gets()
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.
int o2scl_acol_contours_n(void *vp)
Return the number of contour lines associated with the current contour line vector object...
virtual int comm_insert(std::vector< std::string > &sv, bool itive_com)
Insert a column from an external table using interpolation.
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.
virtual int comm_select(std::vector< std::string > &sv, bool itive_com)
Select several columns for a new table.
static herr_t iterate_func(hid_t loc, const char *name, const H5L_info_t *inf, void *op_data)
HDF object iteration function.
std::string type
String designating the current type.
virtual int comm_read(std::vector< std::string > &sv, bool itive_com)
Read an object from a file.
virtual int comm_min(std::vector< std::string > &sv, bool itive_com)
Compute the minimum value of a colum.
std::map< std::string, int * > int_params
Integer parameters.
virtual int comm_select_rows(std::vector< std::string > &sv, bool itive_com)
Select several rows for a new table.
int set_swidth(int ncol)
Set screen witdth.
int o2scl_acol_get_hist_wgts(void *vp, int &n, double *&ptr)
Return the size and a pointer to the column named col_name in a table object.
bool names_out
True if we should output column names.
int o2scl_acol_get_hist_reps(void *vp, int &n, double *&ptr)
Return the size and a pointer to the column named col_name in a table object.
virtual int comm_get_row(std::vector< std::string > &sv, bool itive_com)
Print out an entire row.
virtual int comm_none(std::vector< std::string > &sv, bool itive_com)
A placeholder function which is used for documenting o2graph commands.
int verbose
The verbosity level (default 1)
Member function pointer for o2scl::cli command function.
std::string obj_name
The name of the table.
String parameter for o2scl::cli.
virtual int comm_show_units(std::vector< std::string > &sv, bool itive_com)
Set units of a column.
virtual int comm_deriv(std::vector< std::string > &sv, bool itive_com)
Create a column which is the derivative of another.
bool scientific
True for scientific output mode.
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.
void clear_obj()
Clear memory associated with the current object and set type to "".
virtual int comm_to_table(std::vector< std::string > &sv, bool itive_com)
Desc.
o2scl::convert_units & cng
Convert units object (initialized by constructor to global object)
virtual int comm_list(std::vector< std::string > &sv, bool itive_com)
List columns in table 'tp' named 'tname' assuming screen size 'ncol'.
virtual int setup_help()
Add the help text to the cli object.
virtual int comm_select_rows2(std::vector< std::string > &sv, bool itive_com)
A faster form of select rows which requires one to specify the columns needed for the selection crite...
virtual int comm_generic(std::vector< std::string > &sv, bool itive_com)
Read a generic data file.
Integer parameter for o2scl::cli.
virtual int comm_output(std::vector< std::string > &sv, bool itive_com)
Output to screen or file.
void o2scl_acol_get_type(void *vp, int &n, char *&str)
Return the type of the current object.
double o2scl_acol_contours_line(void *vp, int i, int &n, double *&ptrx, double *&ptry)
For the current contour line vector object, set the pointers to the x- and y-values in the contour li...
virtual int comm_deriv2(std::vector< std::string > &sv, bool itive_com)
Create a column which is the second derivative of another.
Data table table class with units.
o2scl::comm_option_mfptr< acol_manager > cset
The object for the set function.
virtual int setup_cli()
Create the cli object (with readline support if available)
virtual int comm_type(std::vector< std::string > &sv, bool itive_com)
Output the type of the current object to the screen.
A data structure containing many slices of two-dimensional data points defined on a grid...
void o2scl_free_acol_manager(void *vp)
Free memory associated with a o2scl_acol::acol_manager object.
std::string def_args
Default arguments from environment.
virtual int comm_assign(std::vector< std::string > &sv, bool itive_com)
Assign a constant.
virtual int comm_convert_unit(std::vector< std::string > &sv, bool itive_com)
Convert units of a column.
Store data in an O<span style='position: relative; top: 0.3em; font-size: 0.8em'>2</span>scl O$_2$sc...
virtual int comm_entry(std::vector< std::string > &sv, bool itive_com)
Get an entry.
virtual int comm_fit(std::vector< std::string > &sv, bool itive_com)
Fit two columns to a function.
virtual int comm_rename(std::vector< std::string > &sv, bool itive_com)
Rename a column.
std::string unit_fname
Filename for units command.
virtual int setup_parameters()
Add the parameters for 'set' to the cli object.
bool pretty
True if we should make the output into neat columns (default true)
virtual int comm_max(std::vector< std::string > &sv, bool itive_com)
Compute the maximum value of a colum.
virtual int comm_deriv_y(std::vector< std::string > &sv, bool itive_com)
Create a slice which is the derivative wrt y of another.
virtual int comm_get_unit(std::vector< std::string > &sv, bool itive_com)
Get units of a column.
virtual int comm_delete_rows(std::vector< std::string > &sv, bool itive_com)
Delete rows specified by a function.
int compress
If set, try to compress.
virtual int comm_create(std::vector< std::string > &sv, bool itive_com)
Create a table from a column of equally spaced values.
int o2scl_acol_get_slice(void *vp, char *slice_name, int &nx, double *&xptr, int &ny, double *&yptr, double *&data)
Return the size and a pointer to the column named col_name in a table object.
virtual int comm_deriv_x(std::vector< std::string > &sv, bool itive_com)
Create a slice which is the derivative wrt x of another.
virtual int comm_set_data(std::vector< std::string > &sv, bool itive_com)
Set an individual data point at a specified row and column.
int o2scl_acol_get_hist_2d(void *vp, int &nx, double *&xptr, int &ny, double *&yptr, double *&data)
For a two-dimensional histogram, return the bin edges, number of bins in both directions, and the weights in each bin.
virtual int comm_set_unit(std::vector< std::string > &sv, bool itive_com)
Set units of a column.