Drake
BinaryExpressionCell Class Referenceabstract

Represents the base class for binary expressions. More...

#include <drake/common/symbolic_expression_cell.h>

Inheritance diagram for BinaryExpressionCell:
[legend]
Collaboration diagram for BinaryExpressionCell:
[legend]

Public Member Functions

Variables GetVariables () const override
 Collects variables in expression. More...
 
bool EqualTo (const ExpressionCell &e) const override
 Checks structural equality. More...
 
bool Less (const ExpressionCell &e) const override
 Provides lexicographical ordering between expressions. More...
 
double Evaluate (const Environment &env) const override
 Evaluates under a given environment (by default, an empty environment). More...
 
const Expressionget_first_argument () const
 Returns the first argument. More...
 
const Expressionget_second_argument () const
 Returns the second argument. More...
 
- Public Member Functions inherited from ExpressionCell
ExpressionKind get_kind () const
 Returns expression kind. More...
 
size_t get_hash () const
 Returns hash value. More...
 
bool is_polynomial () const
 Checks if this symbolic expression is convertible to Polynomial. More...
 
virtual Polynomiald ToPolynomial () const =0
 Returns a Polynomial representing this expression. More...
 
virtual Expression Expand () const =0
 Expands out products and positive integer powers in expression. More...
 
virtual Expression Substitute (const Substitution &s) const =0
 Returns an Expression obtained by replacing all occurrences of the variables in s in the current expression cell with the corresponding expressions in s. More...
 
virtual Expression Differentiate (const Variable &x) const =0
 Differentiates this symbolic expression with respect to the variable var. More...
 
virtual std::ostream & Display (std::ostream &os) const =0
 Outputs string representation of expression into output stream os. More...
 

Protected Member Functions

 BinaryExpressionCell ()=delete
 Default constructor (DELETED). More...
 
 BinaryExpressionCell (BinaryExpressionCell &&e)=default
 Move-constructs from an rvalue. More...
 
 BinaryExpressionCell (const BinaryExpressionCell &e)=default
 Copy-constructs from an lvalue. More...
 
BinaryExpressionCelloperator= (BinaryExpressionCell &&e)=delete
 Move-assigns (DELETED). More...
 
BinaryExpressionCelloperator= (const BinaryExpressionCell &e)=delete
 Copy-assigns (DELETED). More...
 
 BinaryExpressionCell (ExpressionKind k, const Expression &e1, const Expression &e2, bool is_poly)
 Constructs BinaryExpressionCell of kind k with hash, e1, e2, is_poly. More...
 
virtual double DoEvaluate (double v1, double v2) const =0
 Returns the evaluation result f(v1, v2 ). More...
 
- Protected Member Functions inherited from ExpressionCell
 ExpressionCell ()=default
 Default constructor. More...
 
 ExpressionCell (ExpressionCell &&e)=default
 Move-constructs an ExpressionCell from an rvalue. More...
 
 ExpressionCell (const ExpressionCell &e)=default
 Copy-constructs an ExpressionCell from an lvalue. More...
 
ExpressionCelloperator= (ExpressionCell &&e)=delete
 Move-assigns (DELETED). More...
 
ExpressionCelloperator= (const ExpressionCell &e)=delete
 Copy-assigns (DELETED). More...
 
 ExpressionCell (ExpressionKind k, size_t hash, bool is_poly)
 Constructs ExpressionCell of kind k with hash and is_poly . More...
 
virtual ~ExpressionCell ()=default
 Default destructor. More...
 

Detailed Description

Represents the base class for binary expressions.

Constructor & Destructor Documentation

BinaryExpressionCell ( )
protecteddelete

Default constructor (DELETED).

BinaryExpressionCell ( BinaryExpressionCell &&  e)
protecteddefault

Move-constructs from an rvalue.

BinaryExpressionCell ( const BinaryExpressionCell e)
protecteddefault

Copy-constructs from an lvalue.

BinaryExpressionCell ( ExpressionKind  k,
const Expression e1,
const Expression e2,
bool  is_poly 
)
protected

Constructs BinaryExpressionCell of kind k with hash, e1, e2, is_poly.

Here is the call graph for this function:

Member Function Documentation

virtual double DoEvaluate ( double  v1,
double  v2 
) const
protectedpure virtual

Returns the evaluation result f(v1, v2 ).

Here is the caller graph for this function:

bool EqualTo ( const ExpressionCell c) const
overridevirtual

Checks structural equality.

Implements ExpressionCell.

Here is the call graph for this function:

double Evaluate ( const Environment env) const
overridevirtual

Evaluates under a given environment (by default, an empty environment).

Exceptions
std::runtime_errorif NaN is detected during evaluation.

Implements ExpressionCell.

Here is the call graph for this function:

const Expression& get_first_argument ( ) const
inline

Returns the first argument.

Here is the caller graph for this function:

const Expression& get_second_argument ( ) const
inline

Returns the second argument.

Here is the call graph for this function:

Here is the caller graph for this function:

Variables GetVariables ( ) const
overridevirtual

Collects variables in expression.

Implements ExpressionCell.

Here is the call graph for this function:

Here is the caller graph for this function:

bool Less ( const ExpressionCell c) const
overridevirtual

Provides lexicographical ordering between expressions.

Implements ExpressionCell.

Here is the call graph for this function:

BinaryExpressionCell& operator= ( BinaryExpressionCell &&  e)
protecteddelete

Move-assigns (DELETED).

BinaryExpressionCell& operator= ( const BinaryExpressionCell e)
protecteddelete

Copy-assigns (DELETED).


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