OASIS
Open Algebra Software
Loading...
Searching...
No Matches
Divide.hpp
Go to the documentation of this file.
1//
2// Created by Matthew McCall on 8/10/23.
3//
4
5#ifndef OASIS_DIVIDE_HPP
6#define OASIS_DIVIDE_HPP
7
9
10namespace Oasis {
11
12template <IExpression DividendT, IExpression DivisorT>
13class Divide;
14
16template <>
17class Divide<Expression, Expression> : public BinaryExpression<Divide> {
18public:
19 Divide() = default;
20 Divide(const Divide<Expression, Expression>& other) = default;
21
22 Divide(const Expression& dividend, const Expression& divisor);
23
24 [[nodiscard]] auto Simplify() const -> std::unique_ptr<Expression> final;
25
26 [[nodiscard]] auto Differentiate(const Expression& differentiationVariable) const -> std::unique_ptr<Expression> final;
27
28 [[nodiscard]] auto Integrate(const Expression& integrationVariable) const -> std::unique_ptr<Expression> final;
29
32};
34
119template <IExpression DividendT = Expression, IExpression DivisorT = DividendT>
120class Divide : public BinaryExpression<Divide, DividendT, DivisorT> {
121public:
122 Divide() = default;
124 : BinaryExpression<Divide, DividendT, DivisorT>(other)
125 {
126 }
127
128 Divide(const DividendT& addend1, const DivisorT& addend2)
129 : BinaryExpression<Divide, DividendT, DivisorT>(addend1, addend2)
130 {
131 }
132
133 auto operator=(const Divide& other) -> Divide& = default;
134
137};
138
139} // Oasis
140
141#endif // OASIS_DIVIDE_HPP
#define EXPRESSION_CATEGORY(category)
Definition Expression.hpp:230
#define EXPRESSION_TYPE(type)
Definition Expression.hpp:219
A binary expression.
Definition BinaryExpression.hpp:82
auto Simplify() const -> std::unique_ptr< Expression > override
Simplifies this expression.
Definition BinaryExpression.hpp:203
auto Differentiate(const Expression &differentiationVariable) const -> std::unique_ptr< Expression > override
Tries to differentiate this function.
Definition BinaryExpression.hpp:131
auto Integrate(const Expression &integrationVariable) const -> std::unique_ptr< Expression > override
Attempts to integrate this expression using integration rules.
Definition BinaryExpression.hpp:208
The Divide expression divides two expressions.
Definition Divide.hpp:120
Divide(const Divide< DividendT, DivisorT > &other)
Definition Divide.hpp:123
Divide()=default
Divide(const DividendT &addend1, const DivisorT &addend2)
Definition Divide.hpp:128
auto operator=(const Divide &other) -> Divide &=default
Definition Add.hpp:11
@ BinExp
Definition Expression.hpp:51