OASIS
Open Algebra Software
Loading...
Searching...
No Matches
Real.hpp
Go to the documentation of this file.
1//
2// Created by Matthew McCall on 7/2/23.
3//
4
5#ifndef OASIS_REAL_HPP
6#define OASIS_REAL_HPP
7
8#include "LeafExpression.hpp"
9
10namespace Oasis {
11
15class Real : public LeafExpression<Real> {
16public:
17 Real() = default;
18 Real(const Real& other) = default;
19
20 explicit Real(double value);
21
22 [[nodiscard]] auto Equals(const Expression& other) const -> bool final;
23
26
27
31 [[nodiscard]] auto GetValue() const -> double;
32
33 [[nodiscard]] auto Integrate(const Expression& integrationVariable) const -> std::unique_ptr<Expression> final;
34
35 [[nodiscard]] auto Differentiate(const Expression&) const -> std::unique_ptr<Expression> final;
36
37 auto operator=(const Real& other) -> Real& = default;
38
39private:
40 double value {};
41};
42
43} // Oasis
44
45#endif // OASIS_REAL_HPP
#define EXPRESSION_CATEGORY(category)
Definition Expression.hpp:192
#define EXPRESSION_TYPE(type)
Definition Expression.hpp:181
An expression.
Definition Expression.hpp:56
A leaf expression.
Definition LeafExpression.hpp:21
A real number.
Definition Real.hpp:15
Real()=default
auto Differentiate(const Expression &) const -> std::unique_ptr< Expression > final
Tries to differentiate this function.
Definition Real.cpp:21
auto GetValue() const -> double
Gets the value of the real number.
Definition Real.cpp:31
auto Integrate(const Expression &integrationVariable) const -> std::unique_ptr< Expression > final
Attempts to integrate this expression using integration rules.
Definition Real.cpp:36
Real(const Real &other)=default
auto Equals(const Expression &other) const -> bool final
Compares this expression to another expression for equality.
Definition Real.cpp:26
Definition Add.hpp:11
@ UnExp
Definition Expression.hpp:46