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
12template <IExpression Exp, IExpression Var>
13class Derivative;
14
16template <>
17class Derivative<Expression, Expression> : public BinaryExpression<Derivative> {
18public:
19 Derivative() = default;
20 Derivative(const Derivative<Expression, Expression>& other) = default;
21
22 Derivative(const Expression& Exp, const Expression& Var);
23
24 [[nodiscard]] auto Simplify() const -> std::unique_ptr<Expression> final;
25
26 [[nodiscard]] auto Differentiate(const Expression& differentiationVariable) const -> std::unique_ptr<Expression> override;
27
30};
32
39template <IExpression DependentT = Expression, IExpression IndependentT = DependentT>
40class Derivative : public BinaryExpression<Derivative, DependentT, IndependentT> {
41public:
42 Derivative() = default;
44 : BinaryExpression<Derivative, DependentT, IndependentT>(other)
45 {
46 }
47
48 Derivative(const DependentT& exp, const IndependentT& var)
49 : BinaryExpression<Derivative, DependentT, IndependentT>(exp, var)
50 {
51 }
52
53 auto operator=(const Derivative& other) -> Derivative& = default;
54
57};
58
59} // namespace Oasis
60
61#endif // OASIS_DERIVATIVE_HPP
#define EXPRESSION_CATEGORY(category)
Definition Expression.hpp:192
#define EXPRESSION_TYPE(type)
Definition Expression.hpp:181
A binary expression.
Definition BinaryExpression.hpp:79
auto Simplify() const -> std::unique_ptr< Expression > override
Simplifies this expression.
Definition BinaryExpression.hpp:200
auto Differentiate(const Expression &differentiationVariable) const -> std::unique_ptr< Expression > override
Tries to differentiate this function.
Definition BinaryExpression.hpp:128
The Derivative class template calculates the derivative of given expressions.
Definition Derivative.hpp:40
auto operator=(const Derivative &other) -> Derivative &=default
Derivative()=default
Derivative(const DependentT &exp, const IndependentT &var)
Definition Derivative.hpp:48
Derivative(const Derivative< DependentT, IndependentT > &other)
Definition Derivative.hpp:43
Definition Add.hpp:11
@ BinExp
Definition Expression.hpp:45