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

A vertex of the AST representing an operation. More...

#include <ast.h>

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

Classes

struct  CacheKeyComp
 
struct  OpMap
 

Public Types

enum  Operator {
  Plus, Minus, Mult, Div,
  Pow, Log, Sqrt, Neg,
  Sin, Cos, Tan, Sinh,
  Cosh, Tanh, ASin, ACos,
  ATan, ASinh, ACosh, ATanh,
  Exp, Sign, Abs
}
 Defined operations.
 

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.
 
Operator getOp () const
 
const std::vector< SymbolicExpression > & getChilds () 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 bool isConstantInt () const
 Rreturn true if this Vertex is a constant integer.
 
bool isZero () const
 
bool isOne () const
 

Static Public Member Functions

static SymbolicExpression create (Operator op_, const std::vector< SymbolicExpression > &child_)
 

Private Types

typedef std::pair< Operator, std::vector< std::weak_ptr< const Vertex > > > CacheKey
 

Private Member Functions

 Operation (Operator op_, const std::vector< SymbolicExpression > &child_)
 
bool equal (const SymbolicExpression &b, std::map< IndependentVariable, SymbolicExpression > &m) const override
 

Private Attributes

friend SymbolicExpression
 
Operator op
 
std::vector< SymbolicExpression > child
 

Static Private Attributes

static std::map< CacheKey, std::weak_ptr< const Operation >, CacheKeyComp > cache
 
static const std::map< Operator, OpMap > opMap
 

Friends

SymbolicExpression fmatvec::AST::substScalar (const SymbolicExpression &se, const IndependentVariable &a, const SymbolicExpression &b)
 
boost::spirit::qi::rule< boost::spirit::istream_iterator, SymbolicExpression()> & fmatvec::getBoostSpiritQiRule ()
 
boost::spirit::karma::rule< std::ostream_iterator< char >, SymbolicExpression()> & fmatvec::getBoostSpiritKarmaRule ()
 

Additional Inherited Members

Detailed Description

A vertex of the AST representing an operation.

Member Data Documentation

◆ opMap

const std::map< Operation::Operator, Operation::OpMap > fmatvec::AST::Operation::opMap
staticprivate
Initial value:
{
{ Plus, { "plus" , FUNC( *a[0] + *a[1] ) }},
{ Minus, { "minus", FUNC( *a[0] - *a[1] ) }},
{ Mult, { "mult" , FUNC( *a[0] * *a[1] ) }},
{ Div, { "div" , FUNC( *a[0] / *a[1] ) }},
{ Pow, { "pow" , FUNC( std::pow(*a[0], *a[1]) ) }},
{ Log, { "log" , FUNC( std::log(*a[0]) ) }},
{ Sqrt, { "sqrt" , FUNC( std::sqrt(*a[0]) ) }},
{ Neg, { "neg" , FUNC( - *a[0] ) }},
{ Sin, { "sin" , FUNC( std::sin(*a[0]) ) }},
{ Cos, { "cos" , FUNC( std::cos(*a[0]) ) }},
{ Tan, { "tan" , FUNC( std::tan(*a[0]) ) }},
{ Sinh, { "sinh" , FUNC( std::sinh(*a[0]) ) }},
{ Cosh, { "cosh" , FUNC( std::cosh(*a[0]) ) }},
{ Tanh, { "tanh" , FUNC( std::tanh(*a[0]) ) }},
{ ASin, { "asin" , FUNC( std::asin(*a[0]) ) }},
{ ACos, { "acos" , FUNC( std::acos(*a[0]) ) }},
{ ATan, { "atan" , FUNC( std::atan(*a[0]) ) }},
{ ASinh, { "asinh", FUNC( std::asinh(*a[0]) ) }},
{ ACosh, { "acosh", FUNC( std::acosh(*a[0]) ) }},
{ ATanh, { "atanh", FUNC( std::atanh(*a[0]) ) }},
{ Exp, { "exp" , FUNC( std::exp(*a[0]) ) }},
{ Sign, { "sign" , FUNC( boost::math::sign(*a[0]) ) }},
{ Abs, { "abs" , FUNC( std::abs(*a[0]) ) }}
}

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