fmatvec  2.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::Constant< T > Class Template Reference

A vertex of the AST representing a constant (int or double) More...

#include <ast.h>

Inheritance diagram for fmatvec::AST::Constant< T >:
[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.
 
bool isConstantInt () const override
 Rreturn true if this Vertex is a constant integer.
 
const T & getValue () const
 Get the constant value of the vertex.
 
template<>
bool isConstantInt () const
 Rreturn true if this Vertex is a constant integer.
 
template<>
bool isConstantInt () const
 Rreturn true if this Vertex is a constant integer.
 
- Public Member Functions inherited from fmatvec::AST::Vertex
bool isZero () const
 
bool isOne () const
 
const std::map< std::weak_ptr< const Symbol >, unsigned long, std::owner_less< std::weak_ptr< const Symbol > > > & getDependsOn () const
 Return a list of all variables this AST depends on.
 

Static Public Member Functions

static SymbolicExpression create (const T &c_)
 

Private Types

typedef T CacheKey
 

Private Member Functions

 Constant (const T &c_)
 
bool equal (const SymbolicExpression &b, std::map< IndependentVariable, SymbolicExpression > &m) const override
 

Private Attributes

friend SymbolicExpression
 
const T c
 

Static Private Attributes

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

Additional Inherited Members

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

Detailed Description

template<class T>
class fmatvec::AST::Constant< T >

A vertex of the AST representing a constant (int or double)

Member Function Documentation

◆ eval()

template<class T >
double fmatvec::AST::Constant< T >::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.


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