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

#include <expression_cell.h>

Inheritance diagram for smats::UnaryExpressionCell< T >:
smats::ExpressionCell< T >

Public Member Functions

const Expression< T > & get_argument () const
 
- Public Member Functions inherited from smats::ExpressionCell< T >
long use_count () const
 
ExpressionKind kind () const
 
virtual void hash (DelegatingHasher &) const =0
 
const Variablesvariables () const
 
bool is_polynomial () const
 
bool is_expanded () const
 
virtual bool equal_to (const ExpressionCell< T > &o) const =0
 
virtual bool less (const ExpressionCell< T > &o) const =0
 
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
 
virtual T evaluate (const Environment< T > &env) const =0
 
virtual Expression< T > expand () const =0
 
virtual Expression< T > evaluate_partial (const Environment< T > &env) const =0
 
virtual Expression< T > substitute (const Substitution< T > &s) const =0
 
virtual Expression< T > differentiate (const Variable &x) const =0
 
virtual std::ostream & display (std::ostream &os) const =0
 
void invalidate_cache ()
 

Protected Member Functions

 UnaryExpressionCell (ExpressionKind k, Expression< T > e, bool is_expanded)
 
 UnaryExpressionCell (ExpressionKind k, Expression< T > e, bool is_polynomial, bool is_expanded)
 
virtual T do_evaluate (T v) const =0
 
- Protected Member Functions inherited from smats::ExpressionCell< T >
 ExpressionCell (ExpressionKind kind, bool is_expanded)
 
 ExpressionCell (ExpressionKind kind, bool is_polynomial, bool is_expanded)
 
virtual void compute_variables (std::optional< Variables > &variables) const =0
 
virtual void compute_is_polynomial (std::optional< bool > &is_polynomial) const =0
 

Private Attributes

const Expression< T > e_
 The argument of the unary expression.
 

Detailed Description

template<class T>
class smats::UnaryExpressionCell< T >

Symbolic expression used as a base for unary expressions.

The expression holds another expression internally. Some example include

\[ \log(x) \\ \exp(x) \\ \sin(x) \\ \cos(x) \\ \tan(x) \\ \]

Template Parameters
Ttype of the expression evaluation

Constructor & Destructor Documentation

◆ UnaryExpressionCell() [1/2]

template<class T >
smats::UnaryExpressionCell< T >::UnaryExpressionCell ( ExpressionKind kind,
Expression< T > e,
bool is_expanded )
protected

Construct a new UnaryExpressionCell of kind with e, is_polynomial, and is_expanded.

Parameters
kindkind of the expression
eexpression
is_expandedwhether the expression is already expanded

UnaryExpressionCell

◆ UnaryExpressionCell() [2/2]

template<class T >
smats::UnaryExpressionCell< T >::UnaryExpressionCell ( ExpressionKind k,
Expression< T > e,
bool is_polynomial,
bool is_expanded )
protected

Construct a new UnaryExpressionCell of kind with e, is_polynomial, and is_expanded.

Parameters
kindkind of the expression
eexpression
is_polynomialwhether the expression is a polynomial
is_expandedwhether the expression is already expanded

Member Function Documentation

◆ do_evaluate()

template<class T >
virtual T smats::UnaryExpressionCell< T >::do_evaluate ( T v) const
nodiscardprotectedpure virtual

Evaluate the unary expression with the given value v of the argument.

Parameters
vvalue
Returns
evaluation result

◆ get_argument()

template<class T >
const Expression< T > & smats::UnaryExpressionCell< T >::get_argument ( ) const
inlinenodiscard

Get read-only access to the argument of the unary expression.

Returns
argument of the unary expression

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