OASIS
Open Algebra Software
Loading...
Searching...
No Matches
Integral.hpp
Go to the documentation of this file.
1//
2// Created by Levy Lin on 2/09/2024.
3//
4
5#ifndef OASIS_INTEGRATE_HPP
6#define OASIS_INTEGRATE_HPP
7
9#include "Expression.hpp"
10#include "Real.hpp"
11
12namespace Oasis {
13
14template <IExpression Integrand, IExpression Differential>
15class Integral;
16
18template <>
19class Integral<Expression, Expression> : public BinaryExpression<Integral> {
20public:
21 Integral() = default;
22 Integral(const Integral<Expression, Expression>& other) = default;
23
24 Integral(const Expression& integrand, const Expression& differential);
25
26 [[nodiscard]] auto Simplify() const -> std::unique_ptr<Expression> final;
27 [[nodiscard]] auto Simplify(const Expression& upper, const Expression& lower) const -> std::unique_ptr<Expression> /* final */;
28
31};
33
40template <IExpression IntegrandT = Expression, IExpression DifferentialT = IntegrandT>
41class Integral : public BinaryExpression<Integral, IntegrandT, DifferentialT> {
42public:
43 Integral() = default;
45 : BinaryExpression<Integral, IntegrandT, DifferentialT>(other)
46 {
47 }
48
49 Integral(const IntegrandT& integrand, const DifferentialT& differential)
50 : BinaryExpression<Integral, IntegrandT, DifferentialT>(integrand, differential)
51 {
52 }
53
54 auto operator=(const Integral& other) -> Integral& = default;
55
58};
59
60} // namespace Oasis
61
62#endif // OASIS_INTEGRATE_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
The Integral expression integrates the two expressions together.
Definition Integral.hpp:41
Integral(const Integral< IntegrandT, DifferentialT > &other)
Definition Integral.hpp:44
Integral()=default
Integral(const IntegrandT &integrand, const DifferentialT &differential)
Definition Integral.hpp:49
auto operator=(const Integral &other) -> Integral &=default
Definition Add.hpp:11
@ Commutative
Definition Expression.hpp:44
@ Associative
Definition Expression.hpp:43