34 #include <o2scl/misc.h>
35 #include <o2scl/cli.h>
36 #include <o2scl/fit_nonlin.h>
37 #include <o2scl/table_units.h>
38 #include <o2scl/table3d.h>
39 #include <o2scl/format_float.h>
40 #include <o2scl/hdf_file.h>
41 #include <o2scl/hdf_io.h>
42 #include <o2scl/lib_settings.h>
45 #include <o2scl/cli_readline.h>
47 #include <o2scl/cli.h>
51 namespace o2scl_acol {
97 #ifndef DOXYGEN_INTERNAL
216 virtual int run(
int argv,
char *argc[]);
231 virtual int comm_assign(std::vector<std::string> &sv,
bool itive_com);
234 virtual int comm_calc(std::vector<std::string> &sv,
bool itive_com);
237 virtual int comm_create(std::vector<std::string> &sv,
bool itive_com);
240 virtual int comm_delete_col(std::vector<std::string> &sv,
bool itive_com);
246 virtual int comm_deriv(std::vector<std::string> &sv,
bool itive_com);
249 virtual int comm_deriv2(std::vector<std::string> &sv,
bool itive_com);
262 const H5L_info_t *inf,
void *op_data);
266 const H5L_info_t *inf,
void *op_data);
269 virtual int comm_read(std::vector<std::string> &sv,
bool itive_com);
272 virtual int comm_filelist(std::vector<std::string> &sv,
bool itive_com);
275 virtual int comm_find_row(std::vector<std::string> &sv,
bool itive_com);
278 virtual int comm_function(std::vector<std::string> &sv,
bool itive_com);
281 virtual int comm_generic(std::vector<std::string> &sv,
bool itive_com);
284 virtual int comm_get_row(std::vector<std::string> &sv,
bool itive_com);
287 virtual int comm_fit(std::vector<std::string> &sv,
bool itive_com);
290 virtual int comm_html(std::vector<std::string> &sv,
bool itive_com);
293 virtual int comm_insert(std::vector<std::string> &sv,
bool itive_com);
299 virtual int comm_integ(std::vector<std::string> &sv,
bool itive_com);
305 virtual int comm_internal(std::vector<std::string> &sv,
bool itive_com);
308 virtual int comm_interp(std::vector<std::string> &sv,
bool itive_com);
311 virtual int comm_list(std::vector<std::string> &sv,
bool itive_com);
314 virtual int comm_max(std::vector<std::string> &sv,
bool itive_com);
317 virtual int comm_min(std::vector<std::string> &sv,
bool itive_com);
320 virtual int comm_index(std::vector<std::string> &sv,
bool itive_com);
323 virtual int comm_output(std::vector<std::string> &sv,
bool itive_com);
329 virtual int comm_preview(std::vector<std::string> &sv,
bool itive_com);
332 virtual int comm_add(std::vector<std::string> &sv,
bool itive_com);
335 virtual int comm_rename(std::vector<std::string> &sv,
bool itive_com);
338 virtual int comm_select(std::vector<std::string> &sv,
bool itive_com);
344 virtual int comm_set(std::vector<std::string> &sv,
bool itive_com);
347 virtual int comm_set_data(std::vector<std::string> &sv,
bool itive_com);
350 virtual int comm_set_unit(std::vector<std::string> &sv,
bool itive_com);
353 virtual int comm_show_units(std::vector<std::string> &sv,
bool itive_com);
356 virtual int comm_get_unit(std::vector<std::string> &sv,
bool itive_com);
363 virtual int comm_sort(std::vector<std::string> &sv,
bool itive_com);
366 virtual int comm_stats(std::vector<std::string> &sv,
bool itive_com);
369 virtual int comm_version(std::vector<std::string> &sv,
bool itive_com);
372 virtual int comm_get_conv(std::vector<std::string> &sv,
bool itive_com);
385 int separate(std::string str, std::vector<std::string> &sv);
388 int get_input(std::vector<std::string> &sv,
389 std::vector<std::string> &directions,
390 std::vector<std::string> &in, std::string comm_name,
394 int get_input_one(std::vector<std::string> &sv, std::string directions,
395 std::string &in, std::string comm_name,
virtual int comm_function(std::vector< std::string > &sv, bool itive_com)
Create a column from a function.
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_integ(std::vector< std::string > &sv, bool itive_com)
Create a column which is the integral of another.
std::string table_name
The name of the table.
The driver for 'acol' command-line utility.
table_units * tabp
A pointer to the table.
virtual int comm_delete_col(std::vector< std::string > &sv, bool itive_com)
Delete a column.
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_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 comm_stats(std::vector< std::string > &sv, bool itive_com)
Get column stats.
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 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.
virtual int comm_find_row(std::vector< std::string > &sv, bool itive_com)
Find a row from a function.
virtual int comm_version(std::vector< std::string > &sv, bool itive_com)
Print version.
virtual int comm_interp(std::vector< std::string > &sv, bool itive_com)
Create an html file.
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.
virtual int comm_interactive(std::vector< std::string > &sv, bool itive_com)
Toggle interactive mode.
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.
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.
virtual int comm_read(std::vector< std::string > &sv, bool itive_com)
Read 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.
bool names_out
True if we should output column names.
virtual int comm_get_row(std::vector< std::string > &sv, bool itive_com)
Print out an entire row.
table3d * t3p
Pointer to the three dimensional table.
int verbose
The verbosity level (default 1)
bool threed
If true, the table table is 3d.
int separate(std::string str, std::vector< std::string > &sv)
Separate string into words delimited by whitespace (for comm_fit())
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.
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_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.
virtual int run(int argv, char *argc[])
Main run function.
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.
virtual int setup_cli()
Create the cli object (with readline support if available)
virtual int comm_add(std::vector< std::string > &sv, bool itive_com)
Add two table3d objects.
virtual int comm_html(std::vector< std::string > &sv, bool itive_com)
Create an html file.
virtual int comm_interp_type(std::vector< std::string > &sv, bool itive_com)
Get or set the current interpolation type.
A data structure containing many slices of two-dimensional data points defined on a grid...
int make_unique_name(std::string &col, std::vector< std::string > &cnames)
Ensure col is unique from entries in cnames.
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$scl...
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_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.
virtual int comm_create(std::vector< std::string > &sv, bool itive_com)
Create a table from a column of equally spaced values.
virtual int comm_set_data(std::vector< std::string > &sv, bool itive_com)
Set an individual data point at a specified row and column.
virtual int comm_set_unit(std::vector< std::string > &sv, bool itive_com)
Set units of a column.