fmatvec  0.0.0
fmatvec::AST::Vertex Class Referenceabstract

A abstract class for a Vertex of the AST (abstract syntax tree). More...

#include <ast.h>

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

Classes

struct  LessIV
 

Public Member Functions

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
 

Protected Types

using MapIVSE = std::map< IndependentVariable, SymbolicExpression, LessIV >
 

Protected Member Functions

virtual bool equal (const SymbolicExpression &b, MapIVSE &m) const =0
 

Private Attributes

friend Operation
 
friend NativeFunction
 

Detailed Description

A abstract class for a Vertex of the AST (abstract syntax tree).

Member Function Documentation

◆ isConstantInt()

bool fmatvec::AST::Vertex::isConstantInt ( ) const
inlinevirtual

Rreturn true if this Vertex is a constant integer.

Reimplemented in fmatvec::AST::Constant< T >, fmatvec::AST::Constant< T >, and fmatvec::AST::Constant< T >.

◆ isOne()

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.

◆ isZero()

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.

◆ parDer()

virtual SymbolicExpression fmatvec::AST::Vertex::parDer ( const IndependentVariable x) const
pure virtual

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

Implemented in fmatvec::AST::Constant< T >, fmatvec::AST::Symbol, fmatvec::AST::NativeFunction, and fmatvec::AST::Operation.


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