suanPan
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, std::vector< std::string > &&)
 
 Expression (const Expression &)=delete
 
 Expression (Expression &&) noexcept=delete
 
Expressionoperator= (const Expression &)=delete
 
Expressionoperator= (Expression &&) noexcept=delete
 
 ~Expression () override=default
 
virtual unique_ptr< Expressionget_copy () const =0
 
virtual uword input_size () const
 
virtual uword output_size () const
 
bool compile (const std::string_view &)
 
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 std::string error ()
 

Protected Attributes

Col< double > x
 
std::string expression_text
 
std::vector< std::string > variable_text_list
 
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() [1/3]

Expression::Expression ( unsigned  tag,
std::vector< std::string > &&  variable_string 
)
Here is the call graph for this function:

◆ Expression() [2/3]

Expression::Expression ( const Expression )
delete

◆ Expression() [3/3]

Expression::Expression ( Expression &&  )
deletenoexcept

◆ ~Expression()

Expression::~Expression ( )
overridedefault

Member Function Documentation

◆ compile()

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

◆ error()

std::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:

◆ get_copy()

virtual unique_ptr< Expression > Expression::get_copy ( ) const
pure virtual

◆ 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
Here is the caller graph for this function:

◆ operator=() [1/2]

Expression & Expression::operator= ( const Expression )
delete

◆ operator=() [2/2]

Expression & Expression::operator= ( Expression &&  )
deletenoexcept

◆ output_size()

uword Expression::output_size ( ) const
virtual

Reimplemented in SimpleVectorExpression.

Here is the caller graph for this function:

◆ print()

void Expression::print ( )
overridevirtual

Reimplemented from Tag.

Here is the caller graph for this function:

Member Data Documentation

◆ expression

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

◆ expression_text

std::string Expression::expression_text
protected

◆ symbol_table

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

◆ variable_text_list

std::vector<std::string> Expression::variable_text_list
protected

◆ x

Col<double> Expression::x
protected

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