dlinear  0.0.1
Delta-complete SMT solver for linear programming
Loading...
Searching...
No Matches
dlinear::drake::symbolic::ExpressionMul Class Reference

Symbolic expression representing a multiplication of powers. More...

#include <symbolic_expression_cell.h>

Inheritance diagram for dlinear::drake::symbolic::ExpressionMul:
dlinear::drake::symbolic::ExpressionCell

Public Member Functions

 ExpressionMul (const mpq_class &constant, std::map< Expression, Expression > base_to_exponent_map)
 Constructs ExpressionMul from constant and base_to_exponent_map.
 
bool EqualTo (const ExpressionCell &e) const override
 Checks structural equality.
 
bool Less (const ExpressionCell &e) const override
 Provides lexicographical ordering between expressions.
 
mpq_class Evaluate (const Environment &env) const override
 Evaluates under a given environment (by default, an empty environment).
 
Expression Expand () override
 Expands out products and positive integer powers in expression.
 
Expression Substitute (const ExpressionSubstitution &expr_subst, const FormulaSubstitution &formula_subst) override
 Returns an Expression obtained by replacing all occurrences of the variables in s in the current expression cell with the corresponding expressions in s.
 
Expression Differentiate (const Variable &x) const override
 Differentiates this symbolic expression with respect to the variable var.
 
std::ostream & Display (std::ostream &os) const override
 Outputs string representation of expression into output stream os.
 
const mpq_class & get_constant () const
 Returns constant term.
 
const std::map< Expression, Expression > & get_base_to_exponent_map () const
 Returns map from a term to its exponent.
 
std::map< Expression, Expression > & get_mutable_base_to_exponent_map ()
 Returns map from a term to its exponent.
 
- Public Member Functions inherited from dlinear::drake::symbolic::ExpressionCell
ExpressionKind get_kind () const
 Returns expression kind.
 
size_t get_hash () const
 Returns hash value.
 
const VariablesGetVariables () const
 Collects variables in expression.
 
bool is_polynomial () const
 Checks if this symbolic expression is convertible to Polynomial.
 
bool include_ite () const
 Returns true if this symbolic expression includes an ITE (If-Then-Else) expression.
 
unsigned use_count () const
 Returns the reference count of this cell.
 
 ExpressionCell (const ExpressionCell &e)=delete
 Copy-constructs an ExpressionCell from an lvalue.
 
 ExpressionCell (ExpressionCell &&e)=delete
 Move-constructs an ExpressionCell from an rvalue.
 
ExpressionCelloperator= (ExpressionCell &&e)=delete
 Move-assigns (DELETED).
 
ExpressionCelloperator= (const ExpressionCell &e)=delete
 Copy-assigns (DELETED).
 
virtual void UpdateHash ()
 Update the cached hash value.
 

Additional Inherited Members

- Protected Member Functions inherited from dlinear::drake::symbolic::ExpressionCell
 ExpressionCell (ExpressionKind k)
 Constructs ExpressionCell of kind k.
 
 ExpressionCell (ExpressionKind k, bool is_poly)
 Constructs ExpressionCell of kind k with hash, is_poly, and include_ite.
 
 ExpressionCell (ExpressionKind k, bool is_poly, bool include_ite)
 Constructs ExpressionCell of kind k with hash, is_poly, and include_ite.
 
 ExpressionCell (ExpressionKind k, bool is_poly, bool include_ite, Variables variables)
 Constructs ExpressionCell of kind k with hash, is_poly, and include_ite.
 
 ExpressionCell (ExpressionKind k, bool is_poly, bool include_ite, Variables variables, size_t hash)
 Constructs ExpressionCell of kind k with hash, is_poly, and include_ite.
 
virtual ~ExpressionCell ()=default
 Default destructor.
 
Expression GetExpression ()
 Returns an expression pointing to this ExpressionCell.
 

Detailed Description

Symbolic expression representing a multiplication of powers.

\[ c_0 \cdot \prod b_i^{e_i} \]

where \( c_0 \) is a constant and \( b_i \) and \( e_i \) are symbolic expressions.

Internally this class maintains a member variable constant_ representing \( c_0 \) and another member variable base_to_exponent_map_ representing a mapping from a base, \( b_i \) to its exponentiation \( e_i \).

Definition at line 455 of file symbolic_expression_cell.h.

Member Function Documentation

◆ Differentiate()

Expression dlinear::drake::symbolic::ExpressionMul::Differentiate ( const Variable & x) const
overridevirtual

Differentiates this symbolic expression with respect to the variable var.

Exceptions
std::runtime_errorif it is not differentiable.

Implements dlinear::drake::symbolic::ExpressionCell.

◆ Evaluate()

mpq_class dlinear::drake::symbolic::ExpressionMul::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 dlinear::drake::symbolic::ExpressionCell.

◆ Expand()

Expression dlinear::drake::symbolic::ExpressionMul::Expand ( )
overridevirtual

Expands out products and positive integer powers in expression.

Exceptions
std::runtime_errorif NaN is detected during expansion.

Implements dlinear::drake::symbolic::ExpressionCell.

◆ Substitute()

Expression dlinear::drake::symbolic::ExpressionMul::Substitute ( const ExpressionSubstitution & expr_subst,
const FormulaSubstitution & formula_subst )
overridevirtual

Returns an Expression obtained by replacing all occurrences of the variables in s in the current expression cell with the corresponding expressions in s.

Exceptions
std::runtime_errorif NaN is detected during substitution.

Implements dlinear::drake::symbolic::ExpressionCell.


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