suanPan
Loading...
Searching...
No Matches
Expression Class Referenceabstract

A Expression class represents a maths expression. More...

#include <Expression.h>

Inheritance diagram for Expression:
Collaboration diagram for Expression:

Public Member Functions

 Expression (unsigned, const std::string &)
 
virtual uword input_size () const
 
virtual uword output_size () const
 
bool compile (const std::string &)
 
Mat< double > evaluate (double)
 
virtual Mat< double > evaluate (const Col< double > &)=0
 
Mat< double > gradient (double)
 
virtual Mat< double > gradient (const Col< double > &)=0
 
void print () override
 
- Public Member Functions inherited from Tag
 Tag (unsigned=0)
 
 Tag (const Tag &)=default
 
 Tag (Tag &&)=default
 
Tagoperator= (const Tag &)=delete
 
Tagoperator= (Tag &&)=delete
 
virtual ~Tag ()=default
 
void set_tag (unsigned) const
 
unsigned get_tag () const
 
void enable ()
 
void disable ()
 
void guard ()
 
void unguard ()
 
bool is_active () const
 
bool is_guarded () const
 
virtual void print ()
 

Static Public Member Functions

static string error ()
 

Protected Attributes

Col< double > x
 
exprtk::expression< double > expression
 
exprtk::symbol_table< double > symbol_table
 

Detailed Description

A Expression class represents a maths expression.

Author
tlc
Date
12/01/2023

Constructor & Destructor Documentation

◆ Expression()

Expression::Expression ( unsigned  tag,
const std::string &  variable_string 
)
explicit
Here is the call graph for this function:

Member Function Documentation

◆ compile()

bool Expression::compile ( const std::string &  expression_string)

◆ error()

string Expression::error ( )
static

◆ evaluate() [1/2]

virtual Mat< double > Expression::evaluate ( const Col< double > &  )
pure virtual

◆ evaluate() [2/2]

Mat< double > Expression::evaluate ( double  in_x)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gradient() [1/2]

virtual Mat< double > Expression::gradient ( const Col< double > &  )
pure virtual

◆ gradient() [2/2]

Mat< double > Expression::gradient ( double  in_x)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ input_size()

uword Expression::input_size ( ) const
virtual

◆ output_size()

uword Expression::output_size ( ) const
virtual

Reimplemented in SimpleVectorExpression.

◆ print()

void Expression::print ( )
overridevirtual

Reimplemented from Tag.

Member Data Documentation

◆ expression

exprtk::expression<double> Expression::expression
protected

◆ symbol_table

exprtk::symbol_table<double> Expression::symbol_table
protected

◆ x

Col<double> Expression::x
protected

The documentation for this class was generated from the following files: