Public Member Functions | Protected Attributes | Private Member Functions | List of all members
o2scl::funct_string Class Reference

One-dimensional function from a string. More...

#include <funct.h>

Detailed Description

For example,

funct_string f("pi*r^2","r");
f.set_parm("pi",o2scl_const::pi);
for(double r=1.0;r<=2.0;r+=0.1) {
cout << f(x) << endl;
}

will print out the area of circles having radii between 1 and 2.

Definition at line 78 of file funct.h.

Public Member Functions

 funct_string (std::string expr, std::string var)
 Specify the string and the parameters.
 
int set_function (std::string expr, std::string var)
 Specify the string and the parameters.
 
int set_parm (std::string name, double val)
 Set the values of the auxilliary parameters that were specified in parms in the constructor.
 
virtual double operator() (double x) const
 Compute the function at point x and return the result.
 

Protected Attributes

calculator calc
 The object for evaluating strings.
 
std::map< std::string, double > vars
 Parameter map.
 
std::string st_form
 The expr.
 
std::string st_var
 The variable.
 

Private Member Functions

 funct_string (const funct_string &)
 
funct_stringoperator= (const funct_string &)
 

The documentation for this class was generated from the following file:
o2scl_const::pi
const double pi
Definition: constants.h:65
o2scl::funct_string::funct_string
funct_string(std::string expr, std::string var)
Specify the string and the parameters.
Definition: funct.h:84

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).