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 [[nodiscard]] auto Integrate(const Expression& integrationVariable) const -> std::unique_ptr<Expression> final;
21 [[nodiscard]] auto Differentiate(const Expression& differentiationVariable) const -> std::unique_ptr<Expression> final;
22
25};
27
138template <typename AugendT = Expression, typename AddendT = AugendT>
139class Add : public BinaryExpression<Add, AugendT, AddendT> {
140public:
141 Add() = default;
143 : BinaryExpression<Add, AugendT, AddendT>(other)
144 {
145 }
146
147 Add(const AugendT& addend1, const AddendT& addend2)
148 : BinaryExpression<Add, AugendT, AddendT>(addend1, addend2)
149 {
150 }
151
152 auto operator=(const Add& other) -> Add& = default;
153
156};
157
158} // namespace Oasis
159
160#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:139
Add()=default
Add(const Add< AugendT, AddendT > &other)
Definition Add.hpp:142
Add(const AugendT &addend1, const AddendT &addend2)
Definition Add.hpp:147
auto operator=(const Add &other) -> Add &=default
A binary expression.
Definition BinaryExpression.hpp:83
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:204
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