OASIS
Open Algebra Software
Loading...
Searching...
No Matches
Multiply.hpp
Go to the documentation of this file.
1//
2// Created by Matthew McCall on 8/10/23.
3//
4
5#ifndef OASIS_MULTIPLY_HPP
6#define OASIS_MULTIPLY_HPP
7
9#include "Real.hpp"
10
11namespace Oasis {
12
13template <IExpression MultiplicandT, IExpression MultiplierT>
14class Multiply;
15
17template <>
18class Multiply<Expression, Expression> : public BinaryExpression<Multiply> {
19public:
21
22 [[nodiscard]] auto Simplify() const -> std::unique_ptr<Expression> final;
23
24 [[nodiscard]] auto Differentiate(const Expression& differentiationVariable) const -> std::unique_ptr<Expression> final;
25
26 [[nodiscard]] auto Integrate(const Expression& integrationVariable) const -> std::unique_ptr<Expression> final;
27
30};
32
39template <IExpression MultiplicandT = Expression, IExpression MultiplierT = MultiplicandT>
40class Multiply : public BinaryExpression<Multiply, MultiplicandT, MultiplierT> {
41public:
42 Multiply() = default;
44 : BinaryExpression<Multiply, MultiplicandT, MultiplierT>(other)
45 {
46 }
47
48 Multiply(const MultiplicandT& addend1, const MultiplierT& addend2)
49 : BinaryExpression<Multiply, MultiplicandT, MultiplierT>(addend1, addend2)
50 {
51 }
52
53 auto operator=(const Multiply& other) -> Multiply& = default;
54
57};
58
59} // Oasis
60
61#endif // OASIS_MULTIPLY_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 Multiply expression multiplies two expressions.
Definition Multiply.hpp:40
Multiply(const MultiplicandT &addend1, const MultiplierT &addend2)
Definition Multiply.hpp:48
auto operator=(const Multiply &other) -> Multiply &=default
Multiply(const Multiply< MultiplicandT, MultiplierT > &other)
Definition Multiply.hpp:43
Multiply()=default
Definition Add.hpp:11
@ Commutative
Definition Expression.hpp:44
@ Associative
Definition Expression.hpp:43
@ BinExp
Definition Expression.hpp:45