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
13template <IExpression AugendT, IExpression AddendT>
14class Add;
15
17template <>
18class Add<
19 Expression, Expression> : public BinaryExpression<Add> {
20public:
22
23 [[nodiscard]] auto Simplify() const -> std::unique_ptr<Expression> final;
24
25 [[nodiscard]] auto Integrate(const Expression& integrationVariable) const -> std::unique_ptr<Expression> final;
26 [[nodiscard]] auto Differentiate(const Expression& differentiationVariable) const -> std::unique_ptr<Expression> final;
27
29
32};
34
41template <IExpression AugendT = Expression, IExpression AddendT = AugendT>
42class Add : public BinaryExpression<Add, AugendT, AddendT> {
43public:
44 Add() = default;
46 : BinaryExpression<Add, AugendT, AddendT>(other)
47 {
48 }
49
50 Add(const AugendT& addend1, const AddendT& addend2)
51 : BinaryExpression<Add, AugendT, AddendT>(addend1, addend2)
52 {
53 }
54
55 auto operator=(const Add& other) -> Add& = default;
56
59};
60
61} // namespace Oasis
62
63#endif // OASIS_ADD_HPP
#define EXPRESSION_CATEGORY(category)
Definition Expression.hpp:192
#define DECL_SPECIALIZE(type)
Definition Expression.hpp:203
#define EXPRESSION_TYPE(type)
Definition Expression.hpp:181
The Add expression adds two expressions together.
Definition Add.hpp:42
Add()=default
Add(const Add< AugendT, AddendT > &other)
Definition Add.hpp:45
Add(const AugendT &addend1, const AddendT &addend2)
Definition Add.hpp:50
auto operator=(const Add &other) -> Add &=default
A binary expression.
Definition BinaryExpression.hpp:79
auto Simplify() const -> std::unique_ptr< Expression > override
Simplifies this expression.
Definition BinaryExpression.hpp:200
auto Differentiate(const Expression &differentiationVariable) const -> std::unique_ptr< Expression > override
Tries to differentiate this function.
Definition BinaryExpression.hpp:128
auto Integrate(const Expression &integrationVariable) const -> std::unique_ptr< Expression > override
Attempts to integrate this expression using integration rules.
Definition BinaryExpression.hpp:205
An expression.
Definition Expression.hpp:56
Definition Add.hpp:11
@ Commutative
Definition Expression.hpp:44
@ Associative
Definition Expression.hpp:43
@ BinExp
Definition Expression.hpp:45