OASIS
Open Algebra Software
Loading...
Searching...
No Matches
Oasis::LeafExpression< DerivedT > Class Template Reference

A leaf expression. More...

#include <Oasis/LeafExpression.hpp>

Inheritance diagram for Oasis::LeafExpression< DerivedT >:
[legend]
Collaboration diagram for Oasis::LeafExpression< DerivedT >:
[legend]

Public Member Functions

auto Copy () const -> std::unique_ptr< Expression > final
 Copies this expression.
 
auto StructurallyEquivalent (const Expression &other) const -> bool final
 Checks whether this expression is structurally equivalent to another expression.
 
auto Integrate (const Expression &integrationVariable) const -> std::unique_ptr< Expression > override
 Attempts to integrate this expression using integration rules.
 
auto Differentiate (const Expression &differentiationVariable) const -> std::unique_ptr< Expression > override
 Tries to differentiate this function.
 
auto Substitute (const Expression &, const Expression &) -> std::unique_ptr< Expression > override
 
void Serialize (SerializationVisitor &visitor) const override
 This function serializes the expression object.
 
- Public Member Functions inherited from Oasis::Expression
virtual auto Equals (const Expression &other) const -> bool=0
 Compares this expression to another expression for equality.
 
auto FindZeros () const -> std::vector< std::unique_ptr< Expression > >
 The FindZeros function finds all rational real zeros, and up to 2 irrational/complex zeros of a polynomial.
 
virtual auto GetCategory () const -> uint32_t
 Gets the category of this expression.
 
virtual auto GetType () const -> ExpressionType
 Gets the type of this expression.
 
virtual auto Generalize () const -> std::unique_ptr< Expression >
 Converts this expression to a more general expression.
 
virtual auto IntegrateWithBounds (const Expression &, const Expression &, const Expression &) -> std::unique_ptr< Expression >
 Attempts to integrate this expression using integration rules.
 
template<IExpression T>
bool Is () const
 Gets whether this expression is of a specific type.
 
template<template< typename > typename T>
bool Is () const
 
template<template< typename, typename > typename T>
bool Is () const
 
virtual auto Simplify () const -> std::unique_ptr< Expression >
 Simplifies this expression.
 
virtual ~Expression ()=default
 

Detailed Description

template<typename DerivedT>
class Oasis::LeafExpression< DerivedT >

A leaf expression.

A leaf expression is an expression that has no children.

Template Parameters
DerivedTThe type of the derived class.

Member Function Documentation

◆ Copy()

template<typename DerivedT >
auto Oasis::LeafExpression< DerivedT >::Copy ( ) const -> std::unique_ptr< Expression >
inlinefinalvirtual

Copies this expression.

Returns
A copy of this expression.

Implements Oasis::Expression.

◆ Differentiate()

template<typename DerivedT >
auto Oasis::LeafExpression< DerivedT >::Differentiate ( const Expression & ) const -> std::unique_ptr<Expression>
inlineoverridevirtual

Tries to differentiate this function.

Returns
the differentiated expression.

Reimplemented from Oasis::Expression.

Reimplemented in Oasis::Matrix, Oasis::Real, and Oasis::Variable.

◆ Integrate()

template<typename DerivedT >
auto Oasis::LeafExpression< DerivedT >::Integrate ( const Expression & variable) const -> std::unique_ptr<Expression>
inlineoverridevirtual

Attempts to integrate this expression using integration rules.

Returns
An indefinite integral of the expression added to a constant

Reimplemented from Oasis::Expression.

Reimplemented in Oasis::Matrix, Oasis::Real, and Oasis::Variable.

◆ Serialize()

template<typename DerivedT >
void Oasis::LeafExpression< DerivedT >::Serialize ( SerializationVisitor & visitor) const
inlineoverridevirtual

This function serializes the expression object.

Parameters
visitorThe serializer class object to write the Expression data.

Implements Oasis::Expression.

◆ StructurallyEquivalent()

template<typename DerivedT >
auto Oasis::LeafExpression< DerivedT >::StructurallyEquivalent ( const Expression & other) const -> bool
inlinefinalvirtual

Checks whether this expression is structurally equivalent to another expression.

Two expressions are structurally equivalent if the share the same tree structure. For example, Add<Real>(Real(1), Real(2)) and Add<Real>(Real(2), Real(1)) are structurally equivalent despite having different values.

Parameters
otherThe other expression.
Returns
Whether the two expressions are structurally equivalent.

Implements Oasis::Expression.

◆ Substitute()

template<typename DerivedT >
auto Oasis::LeafExpression< DerivedT >::Substitute ( const Expression & ,
const Expression &  ) -> std::unique_ptr<Expression>
inlineoverridevirtual

Implements Oasis::Expression.

Reimplemented in Oasis::Variable.


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