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
41template <IExpression DividendT = Expression, IExpression DivisorT = DividendT>
42class Divide : public BinaryExpression<Divide, DividendT, DivisorT> {
43public:
44 Divide() = default;
46 : BinaryExpression<Divide, DividendT, DivisorT>(other)
47 {
48 }
49
50 Divide(const DividendT& addend1, const DivisorT& addend2)
51 : BinaryExpression<Divide, DividendT, DivisorT>(addend1, addend2)
52 {
53 }
54
55 auto operator=(const Divide& other) -> Divide& = default;
56
59};
60
61} // Oasis
62
63#endif // OASIS_DIVIDE_HPP
#define EXPRESSION_CATEGORY(category)
Definition Expression.hpp:192
#define EXPRESSION_TYPE(type)
Definition Expression.hpp:181
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
The Divide expression divides two expressions.
Definition Divide.hpp:42
Divide(const Divide< DividendT, DivisorT > &other)
Definition Divide.hpp:45
Divide()=default
Divide(const DividendT &addend1, const DivisorT &addend2)
Definition Divide.hpp:50
auto operator=(const Divide &other) -> Divide &=default
Definition Add.hpp:11
@ BinExp
Definition Expression.hpp:45