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
15template <>
16class Integral<Expression, Expression> : public BinaryExpression<Integral> {
17public:
19
20 Integral() = default;
21 Integral(const Integral<Expression, Expression>& other) = default;
22
23 Integral(const Expression& integrand, const Expression& differential);
24 auto operator=(const Integral& integral) const -> Integral<Expression, Expression>;
25
26 [[nodiscard]] auto IntegrateWithBounds(const Expression& lower, const Expression& upper) const -> std::unique_ptr<Expression>;
27
30};
32
61template <typename IntegrandT = Expression, typename DifferentialT = IntegrandT>
62class Integral : public BinaryExpression<Integral, IntegrandT, DifferentialT> {
63public:
64 Integral() = default;
66 : BinaryExpression<Integral, IntegrandT, DifferentialT>(other)
67 {
68 }
69
70 Integral(const IntegrandT& integrand, const DifferentialT& differential)
71 : BinaryExpression<Integral, IntegrandT, DifferentialT>(integrand, differential)
72 {
73 }
74
75 auto operator=(const Integral& other) -> Integral& = default;
76
79};
80
81} // namespace Oasis
82
83#endif // OASIS_INTEGRATE_HPP
#define EXPRESSION_CATEGORY(category)
Definition Expression.hpp:237
#define EXPRESSION_TYPE(type)
Definition Expression.hpp:226
A binary expression.
Definition BinaryExpression.hpp:83
virtual auto IntegrateWithBounds(const Expression &, const Expression &, const Expression &) -> std::unique_ptr< Expression >
Attempts to integrate this expression using integration rules Then plugs in the bounds of the integra...
Definition Expression.cpp:253
The Integral expression integrates the two expressions together.
Definition Integral.hpp:62
Integral(const Integral< IntegrandT, DifferentialT > &other)
Definition Integral.hpp:65
Integral()=default
Integral(const IntegrandT &integrand, const DifferentialT &differential)
Definition Integral.hpp:70
auto operator=(const Integral &other) -> Integral &=default
Definition Add.hpp:11
@ Commutative
Definition Expression.hpp:51
@ Associative
Definition Expression.hpp:50