fmatvec  0.0.0
Fast Matrix/Vector Library
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
fmatvec::AST::Symbol Class Reference

A vertex of the AST representing a independent variable. More...

#include <ast.h>

Inheritance diagram for fmatvec::AST::Symbol:
[legend]

Public Member Functions

double eval () const override
 
SymbolicExpression parDer (const IndependentVariable &x) const override
 Generate a new AST being the partial derivate of this AST with respect to the variable x.
 
void setValue (double x_) const
 
unsigned long getVersion () const
 
std::string getUUIDStr () const
 
- Public Member Functions inherited from fmatvec::AST::Vertex
virtual bool isConstantInt () const
 Rreturn true if this Vertex is a constant integer.
 
bool isZero () const
 
bool isOne () const
 
const std::map< std::shared_ptr< const Symbol >, unsigned long > & getDependsOn () const
 Return a list of all variables this AST depends on.
 

Static Public Member Functions

static IndependentVariable create (const boost::uuids::uuid &uuid_=boost::uuids::random_generator()())
 

Private Types

typedef boost::uuids::uuid CacheKey
 

Private Member Functions

 Symbol (const boost::uuids::uuid &uuid_)
 
bool equal (const SymbolicExpression &b, std::map< IndependentVariable, SymbolicExpression > &m) const override
 

Private Attributes

friend SymbolicExpression
 
friend IndependentVariable
 
double x = 0.0
 
unsigned long version
 
boost::uuids::uuid uuid
 

Static Private Attributes

static std::map< CacheKey, std::weak_ptr< const Symbol > > cache
 

Additional Inherited Members

- Protected Attributes inherited from fmatvec::AST::Vertex
std::map< std::shared_ptr< const Symbol >, unsigned long > dependsOn
 

Detailed Description

A vertex of the AST representing a independent variable.

Member Function Documentation

◆ eval()

double fmatvec::AST::Symbol::eval ( ) const
inlineoverridevirtual

Evaluate the AST. The returned value depends on the AST and on the current values of all independent variables this AST depends on. Also see Symbol ant Vertex::getDependsOn().

Implements fmatvec::AST::Vertex.

◆ getVersion()

unsigned long fmatvec::AST::Symbol::getVersion ( ) const
inline

Eeturn the "version" of this variable. Each call to Symbol::set increased this "version count". This is used for caching evaluations.

◆ setValue()

void fmatvec::AST::Symbol::setValue ( double  x_) const
inline

Set the value of this independent variable. This has an influence on the evaluation of all ASTs which depend on this independent variable.


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