|
fmatvec
0.0.0
Fast Matrix/Vector Library
|
A abstract class for a Vertex of the AST (abstract syntax tree). More...
#include <ast.h>
Public Member Functions | |
| virtual double | eval () const =0 |
| virtual SymbolicExpression | parDer (const IndependentVariable &x) const =0 |
| Generate a new AST being the partial derivate of this AST with respect to the variable x. | |
| 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. | |
Protected Member Functions | |
| virtual bool | equal (const SymbolicExpression &b, std::map< IndependentVariable, SymbolicExpression > &m) const =0 |
Protected Attributes | |
| std::map< std::shared_ptr< const Symbol >, unsigned long > | dependsOn |
Private Attributes | |
| friend | Operation |
A abstract class for a Vertex of the AST (abstract syntax tree).
|
pure virtual |
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().
Implemented in fmatvec::AST::Operation, fmatvec::AST::Symbol, and fmatvec::AST::Constant< T >.
| bool fmatvec::AST::Vertex::isOne | ( | ) | const |
Returns true if this Vertex is a constant with value 1. Note that only integer constants can be 1. Double constants are never treated as 1 by this function.
| bool fmatvec::AST::Vertex::isZero | ( | ) | const |
Returns true if this Vertex is a constant with value 0. Note that only integer constants can be 0. Double constants are never treated as 0 by this function.