Drake
UnaryExpressionCell Class Referenceabstract

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

#include <drake/common/symbolic_expression_cell.h>

Inheritance diagram for UnaryExpressionCell:
[legend]
Collaboration diagram for UnaryExpressionCell:
[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_argument () const
 Returns the 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

 UnaryExpressionCell ()=delete
 Default constructor (DELETED). More...
 
 UnaryExpressionCell (UnaryExpressionCell &&e)=default
 Move-constructs from an rvalue. More...
 
 UnaryExpressionCell (const UnaryExpressionCell &e)=default
 Copy-constructs from an lvalue. More...
 
UnaryExpressionCelloperator= (UnaryExpressionCell &&e)=delete
 Move-assigns (DELETED). More...
 
UnaryExpressionCelloperator= (const UnaryExpressionCell &e)=delete
 Copy-assigns (DELETED). More...
 
 UnaryExpressionCell (ExpressionKind k, const Expression &e, bool is_poly)
 Constructs UnaryExpressionCell of kind k with hash, e, and is_poly. More...
 
virtual double DoEvaluate (double v) const =0
 Returns the evaluation result f(v ). 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 unary expressions.

Constructor & Destructor Documentation

UnaryExpressionCell ( )
protecteddelete

Default constructor (DELETED).

UnaryExpressionCell ( UnaryExpressionCell &&  e)
protecteddefault

Move-constructs from an rvalue.

UnaryExpressionCell ( const UnaryExpressionCell e)
protecteddefault

Copy-constructs from an lvalue.

UnaryExpressionCell ( ExpressionKind  k,
const Expression e,
bool  is_poly 
)
protected

Constructs UnaryExpressionCell of kind k with hash, e, and is_poly.

Here is the call graph for this function:

Member Function Documentation

virtual double DoEvaluate ( double  v) const
protectedpure virtual

Returns the evaluation result f(v ).

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_argument ( ) const
inline

Returns the 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:

UnaryExpressionCell& operator= ( UnaryExpressionCell &&  e)
protecteddelete

Move-assigns (DELETED).

UnaryExpressionCell& operator= ( const UnaryExpressionCell e)
protecteddelete

Copy-assigns (DELETED).


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