smats  0.0.1
Satisfability Modulo Arithmetic Theories Symbols
Loading...
Searching...
No Matches
smats::ExpressionDiv< T > Class Template Reference

#include <expression_cell.h>

Inheritance diagram for smats::ExpressionDiv< T >:
smats::BinaryExpressionCell< T > smats::ExpressionCell< T >

Public Member Functions

 NEW_OPERATOR_PARAMS (ExpressionDiv, PARAMS(const Expression< T > &e1, const Expression< T > &e2), PARAMS(e1, e2))
 
Expression< T > expand () const override
 
Expression< T > evaluate_partial (const Environment< T > &env) const override
 
Expression< T > substitute (const Substitution< T > &s) const override
 
Expression< T > differentiate (const Variable &x) const override
 
std::ostream & display (std::ostream &os) const override
 
- Public Member Functions inherited from smats::BinaryExpressionCell< T >
void hash (DelegatingHasher &hasher) const override
 
bool equal_to (const ExpressionCell< T > &o) const override
 
bool less (const ExpressionCell< T > &o) const override
 
evaluate (const Environment< T > &env) const override
 
const Expression< T > & lhs () const
 
const Expression< T > & rhs () const
 
- Public Member Functions inherited from smats::ExpressionCell< T >
long use_count () const
 
ExpressionKind kind () const
 
const Variablesvariables () const
 
bool is_polynomial () const
 
bool is_expanded () const
 
void set_expanded ()
 
template<template< class > class E>
const E< T > & to () const
 
template<template< class > class E>
E< T > & to ()
 
Expression< T > to_expression () const
 
void invalidate_cache ()
 

Static Public Member Functions

static void check_domain (const T &v1, const T &v2)
 

Static Public Attributes

static const ExpressionKind expression_kind = ExpressionKind::Div
 

Private Member Functions

do_evaluate (const T &v1, const T &v2) const override
 

Additional Inherited Members

- Protected Member Functions inherited from smats::BinaryExpressionCell< T >
 BinaryExpressionCell (ExpressionKind kind, Expression< T > e1, Expression< T > e2, bool is_expanded)
 
void compute_variables (std::optional< Variables > &variables) const override
 
void compute_is_polynomial (std::optional< bool > &is_polynomial) const override
 
- Protected Member Functions inherited from smats::ExpressionCell< T >
 ExpressionCell (ExpressionKind kind, bool is_expanded)
 
 ExpressionCell (ExpressionKind kind, bool is_polynomial, bool is_expanded)
 

Detailed Description

template<class T>
class smats::ExpressionDiv< T >

Symbolic expression representing the power function.

The expression holds two other expressions internally. Let \( x \) be the first expression and \( y \) be the second expression. The ExpressionPow cell represents the following expression:

\[ x^y \]

Template Parameters
Ttype of the expression evaluation

Member Function Documentation

◆ differentiate()

template<class T >
Expression< T > smats::ExpressionDiv< T >::differentiate ( const Variable & x) const
overridevirtual

Differentiates this symbolic expression with respect to the variable var.

Parameters
xvariable
Exceptions
std::runtime_exceptionif it is not differentiable.

Implements smats::ExpressionCell< T >.

◆ display()

template<class T >
std::ostream & smats::ExpressionDiv< T >::display ( std::ostream & os) const
overridevirtual

Displays the expression in a human-readable format.

Parameters
osoutput stream
Returns
updated output stream

Implements smats::ExpressionCell< T >.

◆ do_evaluate()

template<class T >
T smats::ExpressionDiv< T >::do_evaluate ( const T & v1,
const T & v2 ) const
overrideprivatevirtual

Evaluate the binary expression, given the two values v1 and v2 of the arguments.

Parameters
v1first value
v2second value
Returns
evaluation result

Implements smats::BinaryExpressionCell< T >.

◆ evaluate_partial()

template<class T >
Expression< T > smats::ExpressionDiv< T >::evaluate_partial ( const Environment< T > & env) const
overridevirtual

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

Parameters
envenvironment
Exceptions
std::runtime_exceptionif NaN is detected during substitution.

Implements smats::ExpressionCell< T >.

◆ expand()

template<class T >
Expression< T > smats::ExpressionDiv< T >::expand ( ) const
overridevirtual

Expands out products and positive integer powers in expression.

Exceptions
std::runtime_exceptionif NaN is detected during expansion.

Implements smats::ExpressionCell< T >.

◆ substitute()

template<class T >
Expression< T > smats::ExpressionDiv< T >::substitute ( const Substitution< T > & s) const
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.

Parameters
ssubstitution
Exceptions
std::runtime_exceptionif NaN is detected during substitution.

Implements smats::ExpressionCell< T >.


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