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
88template <IExpression BaseT = Expression, IExpression PowerT = BaseT>
89class Exponent : public BinaryExpression<Exponent, BaseT, PowerT> {
90public:
91 Exponent() = default;
93 : BinaryExpression<Exponent, BaseT, PowerT>(other)
94 {
95 }
96
97 Exponent(const BaseT& base, const PowerT& power)
98 : BinaryExpression<Exponent, BaseT, PowerT>(base, power)
99 {
100 }
101
102 auto operator=(const Exponent& other) -> Exponent& = default;
103
106};
107
108}
109#endif // OASIS_EXPONENT_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 exponent expression creates an exponent two expressions.
Definition Exponent.hpp:89
auto operator=(const Exponent &other) -> Exponent &=default
Exponent()=default
Exponent(const Exponent< BaseT, PowerT > &other)
Definition Exponent.hpp:92
Exponent(const BaseT &base, const PowerT &power)
Definition Exponent.hpp:97
Definition Add.hpp:11
@ BinExp
Definition Expression.hpp:51