181 int set_var(
const char * var,
double val) {
185 int set_var(
const std::string & var,
double val) {
235 {
return get_func(std::string(name));};
void eval_and_free(const char *)
Evaluates a string and frees the result if possible.
int get_func(const char *name)
Get the corresponding function number (or -1 if not defined).
Definition: session.hh:234
An expression !
Definition: expression.hh:131
std::vector< std::string > variables
The variables defined.
Definition: session.hh:78
void fill_default(double *)
const char * varname(int i)
Returns the name of variable number i.
int evaluable(Expression *expr)
int nb_funcs()
The number of defined functions.
Definition: session.hh:251
int register_varname(const std::string &str)
Registers a variable name and returns its number.
std::map< std::string, int > functions_numbers
Definition: session.hh:91
int replace_func_def(FuncDef *)
std::string version()
The version string of the library.
The result of an SCalc::Session::eval().
Definition: expression.hh:36
int nb_args_func(std::string)
Returns the number of arguments of a function.
Expression * constant(double value)
std::map< std::string, int > variables_numbers
The cross reference to the variables.
Definition: session.hh:80
int nb_vars_set()
Returns the number of variables that have a value.
Definition: session.hh:200
std::set< int > vars_set()
int nb_args_func(const char *name)
Overloaded for convenience.
Definition: session.hh:247
ParserResult * eval(const char *)
Evaluates a string.
std::vector< std::string > func_names()
The function names.
int register_func_def(FuncDef *)
A function definition with any number of parameters.
Definition: functions.hh:39
int get_func(std::string)
Get the corresponding function number (or -1 if not defined).
FuncDef * get_func_def(std::string)
Get the function definition of the given name.
std::vector< FuncDef * > functions
The function vector:
Definition: session.hh:94
std::map< int, double > values
Definition: session.hh:84
std::vector< std::string > varnames()
Returns an array of variable names.
Definition: session.hh:159
Definition: session.hh:45
int nb_vars_defined()
Returns the number of currently defined variables.
Definition: session.hh:166
FuncDef * get_func_def(const char *name)
Overloaded function for convenience.
Definition: session.hh:241