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
30};
32
39template <IExpression AugendT = Expression, IExpression AddendT = AugendT>
40class Add : public BinaryExpression<Add, AugendT, AddendT> {
41public:
42 Add() = default;
44 : BinaryExpression<Add, AugendT, AddendT>(other)
45 {
46 }
47
48 Add(const AugendT& addend1, const AddendT& addend2)
49 : BinaryExpression<Add, AugendT, AddendT>(addend1, addend2)
50 {
51 }
52
53 auto operator=(const Add& other) -> Add& = default;
54
57};
58
59} // namespace Oasis
60
61#endif // OASIS_ADD_HPP
#define EXPRESSION_CATEGORY(category)
Definition Expression.hpp:212
#define EXPRESSION_TYPE(type)
Definition Expression.hpp:201
The Add expression adds two expressions together.
Definition Add.hpp:40
Add()=default
Add(const Add< AugendT, AddendT > &other)
Definition Add.hpp:43
Add(const AugendT &addend1, const AddendT &addend2)
Definition Add.hpp:48
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:59
Definition Add.hpp:11
@ Commutative
Definition Expression.hpp:47
@ Associative
Definition Expression.hpp:46
@ BinExp
Definition Expression.hpp:48