sokobo
Loading...
Searching...
No Matches
BinaryOp Class Reference
Inheritance diagram for BinaryOp:
Expression

Public Types

enum  TypeBinaryOp {
  ADD , SUB , MUL , DIV ,
  POW
}
 
- Public Types inherited from Expression
enum  Type {
  CONSTANT , VARIABLE , BINARY_OP , UNARY_OP ,
  FUNCTION
}
 

Public Member Functions

 BinaryOp (std::shared_ptr< Expression > l, char operation, std::shared_ptr< Expression >r)
 
std::string toString () const override
 
std::shared_ptr< Expressionderivative (const std::string &var) const override
 
std::shared_ptr< Expressionsimplify () const override
 
double evaluate (const std::map< std::string, double > &vars={}) const override
 
Type getType () const override
 
std::shared_ptr< Expressionclone () const override
 
std::shared_ptr< ExpressiongetLeft () const
 
std::shared_ptr< ExpressiongetRight () const
 
char getOperator () const
 
virtual std::string toString () const =0
 
virtual std::shared_ptr< Expressionderivative (const std::string &var) const =0
 
virtual std::shared_ptr< Expressionsimplify () const =0
 
virtual double evaluate (const std::map< std::string, double > &vars={}) const =0
 
virtual Type getType () const =0
 
virtual std::shared_ptr< Expressionclone () const =0
 

Detailed Description

Definition at line 66 of file expression.h.

Member Enumeration Documentation

◆ TypeBinaryOp

enum BinaryOp::TypeBinaryOp

Definition at line 69 of file expression.h.

Constructor & Destructor Documentation

◆ BinaryOp()

BinaryOp::BinaryOp ( std::shared_ptr< Expression l,
char  operation,
std::shared_ptr< Expression r 
)

Definition at line 94 of file expression.cpp.

Member Function Documentation

◆ clone()

std::shared_ptr< Expression > BinaryOp::clone ( ) const
overridevirtual

Implements Expression.

Definition at line 317 of file expression.cpp.

◆ derivative()

std::shared_ptr< Expression > BinaryOp::derivative ( const std::string &  var) const
overridevirtual

Implements Expression.

Definition at line 140 of file expression.cpp.

◆ evaluate()

double BinaryOp::evaluate ( const std::map< std::string, double > &  vars = {}) const
overridevirtual

Implements Expression.

Definition at line 288 of file expression.cpp.

◆ getLeft()

std::shared_ptr< Expression > BinaryOp::getLeft ( ) const
inline

Definition at line 99 of file expression.h.

◆ getOperator()

char BinaryOp::getOperator ( ) const
inline

Definition at line 102 of file expression.h.

◆ getRight()

std::shared_ptr< Expression > BinaryOp::getRight ( ) const
inline

Definition at line 100 of file expression.h.

◆ getType()

Expression::Type BinaryOp::getType ( ) const
overridevirtual

Implements Expression.

Definition at line 312 of file expression.cpp.

◆ simplify()

std::shared_ptr< Expression > BinaryOp::simplify ( ) const
overridevirtual

Implements Expression.

Definition at line 181 of file expression.cpp.

◆ toString()

auto BinaryOp::toString ( ) const
overridevirtual

Implements Expression.

Definition at line 125 of file expression.cpp.


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