fmatvec  0.0.0
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

SymbolicExpression parDer (const IndependentVariable &x) const override
 Generate a new AST being the partial derivate of this AST with respect to the variable x. More...
 
void setValue (double x_) const
 
std::string getUUIDStr () const
 
std::vector< ByteCode >::iterator dumpByteCode (std::vector< ByteCode > &byteCode, std::map< const Vertex *, std::vector< AST::ByteCode >::iterator > &existingVertex) const override
 
void walkVertex (const std::function< void(const std::shared_ptr< const Vertex > &)> &func) const override
 
- Public Member Functions inherited from fmatvec::AST::Vertex
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. More...
 
virtual bool isConstantInt () const
 Rreturn true if this Vertex is a constant integer. More...
 
bool isZero () const
 
bool isOne () const
 
virtual std::vector< ByteCode >::iterator dumpByteCode (std::vector< ByteCode > &byteCode, std::map< const Vertex *, std::vector< AST::ByteCode >::iterator > &existingVertex) const =0
 
virtual void walkVertex (const std::function< void(const std::shared_ptr< const Vertex > &)> &func) const =0
 

Static Public Member Functions

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

Private Types

using CacheKey = boost::uuids::uuid
 

Private Member Functions

 Symbol (const boost::uuids::uuid &uuid_)
 
bool equal (const SymbolicExpression &b, MapIVSE &m) const override
 

Private Attributes

friend SymbolicExpression
 
friend IndependentVariable
 
double x = 0.0
 
boost::uuids::uuid uuid
 

Static Private Attributes

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

Additional Inherited Members

- Protected Types inherited from fmatvec::AST::Vertex
using MapIVSE = std::map< IndependentVariable, SymbolicExpression, LessIV >
 
virtual bool equal (const SymbolicExpression &b, MapIVSE &m) const =0
 

Detailed Description

A vertex of the AST representing a independent variable.

Member Function Documentation

◆ dumpByteCode()

std::vector< ByteCode >::iterator fmatvec::AST::Symbol::dumpByteCode ( std::vector< ByteCode > &  byteCode,
std::map< const Vertex *, std::vector< AST::ByteCode >::iterator > &  existingVertex 
) const
overridevirtual

Implements fmatvec::AST::Vertex.

◆ equal()

bool fmatvec::AST::Symbol::equal ( const SymbolicExpression b,
MapIVSE &  m 
) const
overrideprivatevirtual

Implements fmatvec::AST::Vertex.

◆ parDer()

SymbolicExpression fmatvec::AST::Symbol::parDer ( const IndependentVariable x) const
overridevirtual

Generate a new AST being the partial derivate of this AST with respect to the variable x.

Implements fmatvec::AST::Vertex.

◆ 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.

◆ walkVertex()

void fmatvec::AST::Symbol::walkVertex ( const std::function< void(const std::shared_ptr< const Vertex > &)> &  func) const
overridevirtual

Implements fmatvec::AST::Vertex.


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