5#ifndef OASIS_LEAFEXPRESSION_HPP
6#define OASIS_LEAFEXPRESSION_HPP
20template <
typename DerivedT>
30 return this->
GetType() == other.GetType();
35 return Generalize()->Integrate(integrationVariable);
40 return Generalize()->Differentiate(differentiationVariable);
50 const auto& derivedGeneralized =
dynamic_cast<const DerivedT&
>(*generalized);
An expression.
Definition Expression.hpp:56
virtual auto GetType() const -> ExpressionType
Gets the type of this expression.
Definition Expression.cpp:220
virtual auto Generalize() const -> std::unique_ptr< Expression >
Converts this expression to a more general expression.
Definition Expression.cpp:225
A leaf expression.
Definition LeafExpression.hpp:21
auto Copy() const -> std::unique_ptr< Expression > final
Copies this expression.
Definition LeafExpression.hpp:23
auto Substitute(const Expression &, const Expression &) -> std::unique_ptr< Expression > override
Definition LeafExpression.hpp:42
auto Differentiate(const Expression &differentiationVariable) const -> std::unique_ptr< Expression > override
Tries to differentiate this function.
Definition LeafExpression.hpp:38
auto Integrate(const Expression &integrationVariable) const -> std::unique_ptr< Expression > override
Attempts to integrate this expression using integration rules.
Definition LeafExpression.hpp:33
auto StructurallyEquivalent(const Expression &other) const -> bool final
Checks whether this expression is structurally equivalent to another expression.
Definition LeafExpression.hpp:28
void Serialize(SerializationVisitor &visitor) const override
This function serializes the expression object.
Definition LeafExpression.hpp:47
Definition Serialization.hpp:50
virtual void Serialize(const Real &real)=0