OASIS
Open Algebra Software
Loading...
Searching...
No Matches
Add.hpp
Go to the documentation of this file.
1//
2// Created by Matthew McCall on 7/2/23.
3//
4
5#ifndef OASIS_ADD_HPP
6#define OASIS_ADD_HPP
7
9#include "Real.hpp"
10
11namespace Oasis {
12
14template <>
15class Add<
16 Expression, Expression> : public BinaryExpression<Add> {
17public:
19
20 [[deprecated]] [[nodiscard]] auto Simplify() const -> std::unique_ptr<Expression> final;
21
22 [[nodiscard]] auto Integrate(const Expression& integrationVariable) const -> std::unique_ptr<Expression> final;
23 [[nodiscard]] auto Differentiate(const Expression& differentiationVariable) const -> std::unique_ptr<Expression> final;
24
27};
29
140template <typename AugendT = Expression, typename AddendT = AugendT>
141class Add : public BinaryExpression<Add, AugendT, AddendT> {
142public:
143 Add() = default;
145 : BinaryExpression<Add, AugendT, AddendT>(other)
146 {
147 }
148
149 Add(const AugendT& addend1, const AddendT& addend2)
150 : BinaryExpression<Add, AugendT, AddendT>(addend1, addend2)
151 {
152 }
153
154 auto operator=(const Add& other) -> Add& = default;
155
158};
159
160} // namespace Oasis
161
162#endif // OASIS_ADD_HPP
#define EXPRESSION_CATEGORY(category)
Definition Expression.hpp:231
#define EXPRESSION_TYPE(type)
Definition Expression.hpp:220
The Add expression adds two expressions together.
Definition Add.hpp:141
Add()=default
Add(const Add< AugendT, AddendT > &other)
Definition Add.hpp:144
Add(const AugendT &addend1, const AddendT &addend2)
Definition Add.hpp:149
auto operator=(const Add &other) -> Add &=default
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
auto Integrate(const Expression &integrationVariable) const -> std::unique_ptr< Expression > override
Attempts to integrate this expression using integration rules.
Definition BinaryExpression.hpp:215
An expression.
Definition Expression.hpp:63
Definition Add.hpp:11
@ Commutative
Definition Expression.hpp:51
@ Associative
Definition Expression.hpp:50
@ BinExp
Definition Expression.hpp:52