OASIS
Open Algebra Software
Loading...
Searching...
No Matches
Derivative.hpp
Go to the documentation of this file.
1//
2// Created by bachia on 4/12/2024.
3//
4
5#ifndef OASIS_DERIVATIVE_HPP
6#define OASIS_DERIVATIVE_HPP
7
9
10namespace Oasis {
11
13template <>
14class Derivative<Expression, Expression> : public BinaryExpression<Derivative> {
15public:
16 Derivative() = default;
17 Derivative(const Derivative<Expression, Expression>& other) = default;
18
19 Derivative(const Expression& Exp, const Expression& Var);
20
21 [[deprecated]] [[nodiscard]] auto Simplify() const -> std::unique_ptr<Expression> final;
22
23 [[nodiscard]] auto Differentiate(const Expression& differentiationVariable) const -> std::unique_ptr<Expression> override;
24
27};
29
63template <typename DependentT = Expression, typename IndependentT = DependentT>
64class Derivative : public BinaryExpression<Derivative, DependentT, IndependentT> {
65public:
66 Derivative() = default;
68 : BinaryExpression<Derivative, DependentT, IndependentT>(other)
69 {
70 }
71
72 Derivative(const DependentT& exp, const IndependentT& var)
73 : BinaryExpression<Derivative, DependentT, IndependentT>(exp, var)
74 {
75 }
76
77 auto operator=(const Derivative& other) -> Derivative& = default;
78
81};
82
83} // namespace Oasis
84
85#endif // OASIS_DERIVATIVE_HPP
#define EXPRESSION_CATEGORY(category)
Definition Expression.hpp:231
#define EXPRESSION_TYPE(type)
Definition Expression.hpp:220
A binary expression.
Definition BinaryExpression.hpp:83
auto Simplify() const -> std::unique_ptr< Expression > override
Simplifies this expression.
Definition BinaryExpression.hpp:204
auto Differentiate(const Expression &differentiationVariable) const -> std::unique_ptr< Expression > override
Tries to differentiate this function.
Definition BinaryExpression.hpp:132
The Derivative class template calculates the derivative of given expressions.
Definition Derivative.hpp:64
auto operator=(const Derivative &other) -> Derivative &=default
Derivative()=default
Derivative(const DependentT &exp, const IndependentT &var)
Definition Derivative.hpp:72
Derivative(const Derivative< DependentT, IndependentT > &other)
Definition Derivative.hpp:67
Definition Add.hpp:11
@ BinExp
Definition Expression.hpp:52