OASIS
Open Algebra Software
Loading...
Searching...
No Matches
Log.hpp
Go to the documentation of this file.
1//
2// Created by Matthew McCall on 10/6/23.
3//
4
5#ifndef OASIS_LOG_HPP
6#define OASIS_LOG_HPP
7
9#include "Real.hpp"
10
11namespace Oasis {
12
13template <IExpression BaseT, IExpression ArgumentT>
14class Log;
15
17template <>
18class Log<Expression, Expression> : public BinaryExpression<Log> {
19public:
20 Log() = default;
21 Log(const Log<Expression, Expression>& other) = default;
22
23 Log(const Expression& base, const Expression& argument);
24
25 [[nodiscard]] auto Simplify() const -> std::unique_ptr<Expression> final;
26
27 [[nodiscard]] auto Integrate(const Expression& integrationVariable) const -> std::unique_ptr<Expression> final;
28 [[nodiscard]] auto Differentiate(const Expression& differentiationVariable) const -> std::unique_ptr<Expression> final;
29
32};
34
41template <IExpression BaseT = Expression, IExpression ArgumentT = BaseT>
42class Log : public BinaryExpression<Log, BaseT, ArgumentT> {
43public:
44 Log() = default;
46 : BinaryExpression<Log, BaseT, ArgumentT>(other)
47 {
48 }
49
50 Log(const BaseT& base, const ArgumentT& argument)
51 : BinaryExpression<Log, BaseT, ArgumentT>(base, argument) {}
52
53 ;
54
55 auto operator=(const Log& other) -> Log& = default;
56
59};
60
61} // Oasis
62
63#endif // OASIS_LOG_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 Log expression represents the logarithm of a base and an argument.
Definition Log.hpp:42
EXPRESSION_CATEGORY(BinExp)
auto operator=(const Log &other) -> Log &=default
Log(const Log< BaseT, ArgumentT > &other)
Definition Log.hpp:45
Log(const BaseT &base, const ArgumentT &argument)
Definition Log.hpp:50
EXPRESSION_TYPE(Log)
Log()=default
Definition Add.hpp:11
@ BinExp
Definition Expression.hpp:45