OASIS
Open Algebra Software
Loading...
Searching...
No Matches
Exponent.hpp
Go to the documentation of this file.
1//
2// Created by Andrew Nazareth on 9/19/23.
3//
4
5#ifndef OASIS_EXPONENT_HPP
6#define OASIS_EXPONENT_HPP
7
9#include "Variable.hpp"
10
11namespace Oasis {
12
13template <IExpression BaseT, IExpression PowerT>
14class Exponent;
15
17template <>
18class Exponent<Expression, Expression> : public BinaryExpression<Exponent> {
19public:
20 Exponent() = default;
21 Exponent(const Exponent<Expression, Expression>& other) = default;
22
23 Exponent(const Expression& base, const Expression& power);
24
25 [[nodiscard]] auto Simplify() const -> std::unique_ptr<Expression> final;
26
27 [[nodiscard]] auto Differentiate(const Expression& differentiationVariable) const -> std::unique_ptr<Expression> final;
28
29 [[nodiscard]] auto Integrate(const Expression& integrationVariable) const -> std::unique_ptr<Expression> final;
30
33};
35
42template <IExpression BaseT = Expression, IExpression PowerT = BaseT>
43class Exponent : public BinaryExpression<Exponent, BaseT, PowerT> {
44public:
45 Exponent() = default;
47 : BinaryExpression<Exponent, BaseT, PowerT>(other)
48 {
49 }
50
51 Exponent(const BaseT& base, const PowerT& power)
52 : BinaryExpression<Exponent, BaseT, PowerT>(base, power)
53 {
54 }
55
56 auto operator=(const Exponent& other) -> Exponent& = default;
57
60};
61
62}
63#endif // OASIS_EXPONENT_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 exponent expression creates an exponent two expressions.
Definition Exponent.hpp:43
auto operator=(const Exponent &other) -> Exponent &=default
Exponent()=default
Exponent(const Exponent< BaseT, PowerT > &other)
Definition Exponent.hpp:46
Exponent(const BaseT &base, const PowerT &power)
Definition Exponent.hpp:51
Definition Add.hpp:11
@ BinExp
Definition Expression.hpp:45