OASIS
Open Algebra Software
Loading...
Searching...
No Matches
Subtract.hpp
Go to the documentation of this file.
1//
2// Created by Matthew McCall on 8/10/23.
3//
4
5#ifndef OASIS_SUBTRACT_HPP
6#define OASIS_SUBTRACT_HPP
7
9#include "Real.hpp"
10
11namespace Oasis {
12
14template <>
15class Subtract<Expression, Expression> : public BinaryExpression<Subtract> {
16public:
17 Subtract() = default;
18 Subtract(const Subtract<Expression, Expression>& other) = default;
19
20 Subtract(const Expression& minuend, const Expression& subtrahend);
21
22 [[nodiscard]] auto Integrate(const Expression& integrationVariable) const -> std::unique_ptr<Expression> final;
23
26};
28
156template <typename MinuendT = Expression, typename SubtrahendT = MinuendT>
157class Subtract : public BinaryExpression<Subtract, MinuendT, SubtrahendT> {
158public:
159 Subtract() = default;
161 : BinaryExpression<Subtract, MinuendT, SubtrahendT>(other)
162 {
163 }
164
165 Subtract(const MinuendT& addend1, const SubtrahendT& addend2)
166 : BinaryExpression<Subtract, MinuendT, SubtrahendT>(addend1, addend2)
167 {
168 }
169
170 auto operator=(const Subtract& other) -> Subtract& = default;
171
174};
175
176} // Oasis
177
178#endif // OASIS_SUBTRACT_HPP
#define EXPRESSION_CATEGORY(category)
Definition Expression.hpp:237
#define EXPRESSION_TYPE(type)
Definition Expression.hpp:226
A binary expression.
Definition BinaryExpression.hpp:83
auto Integrate(const Expression &integrationVariable) const -> std::unique_ptr< Expression > override
Attempts to integrate this expression using integration rules.
Definition BinaryExpression.hpp:200
The Subtract expression subtracts two expressions.
Definition Subtract.hpp:157
Subtract()=default
Subtract(const Subtract< MinuendT, SubtrahendT > &other)
Definition Subtract.hpp:160
Subtract(const MinuendT &addend1, const SubtrahendT &addend2)
Definition Subtract.hpp:165
auto operator=(const Subtract &other) -> Subtract &=default
Definition Add.hpp:11
@ BinExp
Definition Expression.hpp:52