diff --git a/include/fintamath/core/MathObjectBody.hpp b/include/fintamath/core/MathObjectBody.hpp index 01c6f603d..e716c1699 100644 --- a/include/fintamath/core/MathObjectBody.hpp +++ b/include/fintamath/core/MathObjectBody.hpp @@ -27,29 +27,29 @@ public: \ private: \ using Class##Parser = detail::Parser>; \ \ - static Class##Parser &getParser() noexcept; \ + static Class##Parser &getParser(); \ \ public: \ - static auto parse(std::string str) noexcept { \ + static auto parse(std::string str) { \ return getParser().parse(std::move(str)); \ } \ \ - static auto parseFirst(std::string str) noexcept { \ + static auto parseFirst(std::string str) { \ return getParser().parseFirst(std::move(str)); \ } \ \ template T> \ - static void registerType() noexcept { \ + static void registerType() { \ MathObjectIdStorage::add(T::getClassStatic()); \ getParser().registerType(); \ } \ \ private: -#define FINTAMATH_PARENT_CLASS_IMPLEMENTATION(Class) \ - FINTAMATH_CLASS_IMPLEMENTATION(Class) \ - \ - Class::Class##Parser &Class::getParser() noexcept { \ - static Class##Parser parser; \ - return parser; \ +#define FINTAMATH_PARENT_CLASS_IMPLEMENTATION(Class) \ + FINTAMATH_CLASS_IMPLEMENTATION(Class) \ + \ + Class::Class##Parser &Class::getParser() { \ + static Class##Parser parser; \ + return parser; \ } diff --git a/include/fintamath/core/MathObjectIdStorage.hpp b/include/fintamath/core/MathObjectIdStorage.hpp index 643a696d3..264099eb3 100644 --- a/include/fintamath/core/MathObjectIdStorage.hpp +++ b/include/fintamath/core/MathObjectIdStorage.hpp @@ -10,12 +10,12 @@ class MathObjectIdStorage { using MathObjectClassToIdMap = std::unordered_map; public: - static size_t get(MathObjectClass objClass) noexcept; + static size_t get(MathObjectClass objClass); - static void add(MathObjectClass objClass) noexcept; + static void add(MathObjectClass objClass); private: - static MathObjectClassToIdMap &getMap() noexcept; + static MathObjectClassToIdMap &getMap(); private: static inline size_t maxId = 1; diff --git a/include/fintamath/core/None.hpp b/include/fintamath/core/None.hpp index b644f485f..b009c241f 100644 --- a/include/fintamath/core/None.hpp +++ b/include/fintamath/core/None.hpp @@ -5,7 +5,7 @@ namespace fintamath { struct None { - static constexpr MathObjectClass getClassStatic() { + static constexpr MathObjectClass getClassStatic() noexcept { return nullptr; } }; diff --git a/include/fintamath/exceptions/InvalidInputException.hpp b/include/fintamath/exceptions/InvalidInputException.hpp index de2f10aba..2fb93e578 100644 --- a/include/fintamath/exceptions/InvalidInputException.hpp +++ b/include/fintamath/exceptions/InvalidInputException.hpp @@ -10,9 +10,9 @@ namespace fintamath { class InvalidInputException : public Exception { public: - InvalidInputException() = default; + InvalidInputException() noexcept = default; - explicit InvalidInputException(const std::string &input) { + explicit InvalidInputException(const std::string &input) noexcept { content += ": " + input; } @@ -26,7 +26,7 @@ class InvalidInputException : public Exception { class InvalidInputFunctionException final : public InvalidInputException { public: - explicit InvalidInputFunctionException(const std::string &func, const std::vector &argVect) { + explicit InvalidInputFunctionException(const std::string &func, const std::vector &argVect) noexcept { content += ": " + func + "("; if (!argVect.empty()) { @@ -47,7 +47,7 @@ class InvalidInputFunctionException final : public InvalidInputException { class InvalidInputBinaryOperatorException final : public InvalidInputException { public: - explicit InvalidInputBinaryOperatorException(const std::string &oper, const std::string &lhs, const std::string &rhs) { + explicit InvalidInputBinaryOperatorException(const std::string &oper, const std::string &lhs, const std::string &rhs) noexcept { content += ": (" + lhs + ")" + oper + "(" + rhs + ")"; } }; @@ -60,7 +60,7 @@ class InvalidInputUnaryOperatorException final : public InvalidInputException { }; public: - explicit InvalidInputUnaryOperatorException(const std::string &oper, const std::string &rhs, const Type type) { + explicit InvalidInputUnaryOperatorException(const std::string &oper, const std::string &rhs, const Type type) noexcept { switch (type) { case Type::Prefix: content += ": " + oper + "(" + rhs + ")"; diff --git a/include/fintamath/exceptions/UndefinedException.hpp b/include/fintamath/exceptions/UndefinedException.hpp index 56ab666db..213fb16ea 100644 --- a/include/fintamath/exceptions/UndefinedException.hpp +++ b/include/fintamath/exceptions/UndefinedException.hpp @@ -10,9 +10,9 @@ namespace fintamath { class UndefinedException : public Exception { public: - UndefinedException() = default; + UndefinedException() noexcept = default; - explicit UndefinedException(const std::string &input) { + explicit UndefinedException(const std::string &input) noexcept { content += ": " + input; } @@ -26,7 +26,7 @@ class UndefinedException : public Exception { class UndefinedFunctionException final : public UndefinedException { public: - explicit UndefinedFunctionException(const std::string &func, const std::vector &argVect) { + explicit UndefinedFunctionException(const std::string &func, const std::vector &argVect) noexcept { content += ": " + func + "("; if (!argVect.empty()) { @@ -47,7 +47,7 @@ class UndefinedFunctionException final : public UndefinedException { class UndefinedBinaryOperatorException final : public UndefinedException { public: - explicit UndefinedBinaryOperatorException(const std::string &oper, const std::string &lhs, const std::string &rhs) { + explicit UndefinedBinaryOperatorException(const std::string &oper, const std::string &lhs, const std::string &rhs) noexcept { content += ": (" + lhs + ")" + oper + "(" + rhs + ")"; } }; @@ -60,7 +60,7 @@ class UndefinedUnaryOperatorException final : public UndefinedException { }; public: - explicit UndefinedUnaryOperatorException(const std::string &oper, const std::string &rhs, const Type type) { + explicit UndefinedUnaryOperatorException(const std::string &oper, const std::string &rhs, const Type type) noexcept { switch (type) { case Type::Prefix: content += ": " + oper + "(" + rhs + ")"; diff --git a/include/fintamath/expressions/interfaces/IPolynomExpression.hpp b/include/fintamath/expressions/interfaces/IPolynomExpression.hpp index c75d8a0c3..7b715cf8d 100644 --- a/include/fintamath/expressions/interfaces/IPolynomExpression.hpp +++ b/include/fintamath/expressions/interfaces/IPolynomExpression.hpp @@ -44,9 +44,9 @@ class IPolynomExpression : public IExpression { ArgumentPtr postSimplify() const override; - virtual bool isTermOrderInversed() const; + virtual bool isTermOrderInversed() const noexcept; - virtual bool isComparableOrderInversed() const; + virtual bool isComparableOrderInversed() const noexcept; virtual std::strong_ordering compare(const ArgumentPtr &lhs, const ArgumentPtr &rhs) const; diff --git a/include/fintamath/functions/IFunction.hpp b/include/fintamath/functions/IFunction.hpp index 9c18d92fa..5704a4236 100644 --- a/include/fintamath/functions/IFunction.hpp +++ b/include/fintamath/functions/IFunction.hpp @@ -23,15 +23,15 @@ class IFunction : public IMathObject { using ClassToOrderMap = std::unordered_map; public: - virtual const ArgumentTypeVector &getArgumentClasses() const noexcept = 0; + virtual const ArgumentTypeVector &getArgumentClasses() const = 0; virtual MathObjectClass getReturnClass() const noexcept = 0; virtual bool doArgsMatch(const ArgumentRefVector &argVect) const = 0; - virtual bool isVariadic() const = 0; + virtual bool isVariadic() const noexcept = 0; - virtual bool isEvaluatable() const = 0; + virtual bool isEvaluatable() const noexcept = 0; std::unique_ptr operator()(const std::derived_from auto &...args) const { const ArgumentRefVector argVect = {args...}; diff --git a/include/fintamath/functions/IFunctionCRTP.hpp b/include/fintamath/functions/IFunctionCRTP.hpp index 92e7322c5..6a922d927 100644 --- a/include/fintamath/functions/IFunctionCRTP.hpp +++ b/include/fintamath/functions/IFunctionCRTP.hpp @@ -14,12 +14,12 @@ class IFunctionCRTP_ : public IFunction { #undef I_MATH_OBJECT_CRTP public: - static const auto &getArgumentClassesStatic() noexcept { + static const auto &getArgumentClassesStatic() { static const std::array argClasses{Args::getClassStatic()...}; return argClasses; } - const std::vector &getArgumentClasses() const noexcept final { + const std::vector &getArgumentClasses() const final { static const auto &argClasses = getArgumentClassesStatic(); static const std::vector argClassesVect(argClasses.begin(), argClasses.end()); return argClassesVect; @@ -46,19 +46,19 @@ class IFunctionCRTP_ : public IFunction { } } - bool isVariadic() const final { + bool isVariadic() const noexcept final { return Derived::isVariadicStatic(); } - static constexpr bool isVariadicStatic() { + static constexpr bool isVariadicStatic() noexcept { return false; } - bool isEvaluatable() const final { + bool isEvaluatable() const noexcept final { return Derived::isEvaluatableStatic(); } - static constexpr bool isEvaluatableStatic() { + static constexpr bool isEvaluatableStatic() noexcept { return true; } diff --git a/include/fintamath/functions/IOperator.hpp b/include/fintamath/functions/IOperator.hpp index 7c5418014..f57338b65 100644 --- a/include/fintamath/functions/IOperator.hpp +++ b/include/fintamath/functions/IOperator.hpp @@ -32,9 +32,9 @@ class IOperator : public IFunction { }; public: - virtual Priority getPriority() const = 0; + virtual Priority getPriority() const noexcept = 0; - virtual bool isAssociative() const = 0; + virtual bool isAssociative() const noexcept = 0; }; template diff --git a/include/fintamath/functions/IOperatorCRTP.hpp b/include/fintamath/functions/IOperatorCRTP.hpp index 7b7dc4906..d8bf87c44 100644 --- a/include/fintamath/functions/IOperatorCRTP.hpp +++ b/include/fintamath/functions/IOperatorCRTP.hpp @@ -14,15 +14,15 @@ class IOperatorCRTP_ : public IOperator { #undef I_FUNCTION_CRTP public: - IOperator::Priority getPriority() const final { + IOperator::Priority getPriority() const noexcept final { return Derived::getPriorityStatic(); } - static constexpr bool isAssociativeStatic() { + static constexpr bool isAssociativeStatic() noexcept { return false; } - bool isAssociative() const final { + bool isAssociative() const noexcept final { return Derived::isAssociativeStatic(); } diff --git a/include/fintamath/functions/arithmetic/Add.hpp b/include/fintamath/functions/arithmetic/Add.hpp index 431f92313..361d2b6db 100644 --- a/include/fintamath/functions/arithmetic/Add.hpp +++ b/include/fintamath/functions/arithmetic/Add.hpp @@ -20,7 +20,7 @@ class Add : public IFunctionCRTP { return "add"; } - static constexpr bool isVariadicStatic() { + static constexpr bool isVariadicStatic() noexcept { return true; } diff --git a/include/fintamath/functions/arithmetic/AddOper.hpp b/include/fintamath/functions/arithmetic/AddOper.hpp index 2ac479fa0..35b19a58d 100644 --- a/include/fintamath/functions/arithmetic/AddOper.hpp +++ b/include/fintamath/functions/arithmetic/AddOper.hpp @@ -18,11 +18,11 @@ class AddOper : public IOperatorCRTP { return "/"; } - static constexpr Priority getPriorityStatic() { + static constexpr Priority getPriorityStatic() noexcept { return Priority::Multiplication; } diff --git a/include/fintamath/functions/arithmetic/Mul.hpp b/include/fintamath/functions/arithmetic/Mul.hpp index 2b49762a0..9571816be 100644 --- a/include/fintamath/functions/arithmetic/Mul.hpp +++ b/include/fintamath/functions/arithmetic/Mul.hpp @@ -20,7 +20,7 @@ class Mul : public IFunctionCRTP { return "mul"; } - static constexpr bool isVariadicStatic() { + static constexpr bool isVariadicStatic() noexcept { return true; } diff --git a/include/fintamath/functions/arithmetic/MulOper.hpp b/include/fintamath/functions/arithmetic/MulOper.hpp index c62371a8b..776b79f3d 100644 --- a/include/fintamath/functions/arithmetic/MulOper.hpp +++ b/include/fintamath/functions/arithmetic/MulOper.hpp @@ -18,11 +18,11 @@ class MulOper : public IOperatorCRTP { return "-"; } - static constexpr Priority getPriorityStatic() { + static constexpr Priority getPriorityStatic() noexcept { return Priority::PrefixUnary; } diff --git a/include/fintamath/functions/arithmetic/Sub.hpp b/include/fintamath/functions/arithmetic/Sub.hpp index 0569bcba1..2f93e9136 100644 --- a/include/fintamath/functions/arithmetic/Sub.hpp +++ b/include/fintamath/functions/arithmetic/Sub.hpp @@ -20,7 +20,7 @@ class Sub : public IOperatorCRTP { return "-"; } - static constexpr Priority getPriorityStatic() { + static constexpr Priority getPriorityStatic() noexcept { return Priority::Addition; } diff --git a/include/fintamath/functions/arithmetic/UnaryPlus.hpp b/include/fintamath/functions/arithmetic/UnaryPlus.hpp index 96a87729c..4885772ba 100644 --- a/include/fintamath/functions/arithmetic/UnaryPlus.hpp +++ b/include/fintamath/functions/arithmetic/UnaryPlus.hpp @@ -19,7 +19,7 @@ class UnaryPlus : public IOperatorCRTP { return "+"; } - static constexpr Priority getPriorityStatic() { + static constexpr Priority getPriorityStatic() noexcept { return Priority::PrefixUnary; } diff --git a/include/fintamath/functions/calculus/Max.hpp b/include/fintamath/functions/calculus/Max.hpp index 82ebc379a..3eba75ec1 100644 --- a/include/fintamath/functions/calculus/Max.hpp +++ b/include/fintamath/functions/calculus/Max.hpp @@ -20,7 +20,7 @@ class Max : public IFunctionCRTP { return "max"; } - static constexpr bool isVariadicStatic() { + static constexpr bool isVariadicStatic() noexcept { return true; } diff --git a/include/fintamath/functions/calculus/Min.hpp b/include/fintamath/functions/calculus/Min.hpp index f3c39cc83..61146f0c8 100644 --- a/include/fintamath/functions/calculus/Min.hpp +++ b/include/fintamath/functions/calculus/Min.hpp @@ -20,7 +20,7 @@ class Min : public IFunctionCRTP { return "min"; } - static constexpr bool isVariadicStatic() { + static constexpr bool isVariadicStatic() noexcept { return true; } diff --git a/include/fintamath/functions/comparison/Eqv.hpp b/include/fintamath/functions/comparison/Eqv.hpp index 2e3ad3d4e..c6232a3f2 100644 --- a/include/fintamath/functions/comparison/Eqv.hpp +++ b/include/fintamath/functions/comparison/Eqv.hpp @@ -21,11 +21,11 @@ class Eqv : public IOperatorCRTP { return "="; } - static constexpr bool isAssociativeStatic() { + static constexpr bool isAssociativeStatic() noexcept { return true; } - static constexpr Priority getPriorityStatic() { + static constexpr Priority getPriorityStatic() noexcept { return Priority::Comparison; } diff --git a/include/fintamath/functions/comparison/Less.hpp b/include/fintamath/functions/comparison/Less.hpp index 4d454708f..74db6df82 100644 --- a/include/fintamath/functions/comparison/Less.hpp +++ b/include/fintamath/functions/comparison/Less.hpp @@ -21,11 +21,11 @@ class Less : public IOperatorCRTP { return "<"; } - static constexpr bool isAssociativeStatic() { + static constexpr bool isAssociativeStatic() noexcept { return true; } - static constexpr Priority getPriorityStatic() { + static constexpr Priority getPriorityStatic() noexcept { return Priority::Comparison; } diff --git a/include/fintamath/functions/comparison/LessEqv.hpp b/include/fintamath/functions/comparison/LessEqv.hpp index 0ed74acb2..8f90e8151 100644 --- a/include/fintamath/functions/comparison/LessEqv.hpp +++ b/include/fintamath/functions/comparison/LessEqv.hpp @@ -21,11 +21,11 @@ class LessEqv : public IOperatorCRTP return "<="; } - static constexpr bool isAssociativeStatic() { + static constexpr bool isAssociativeStatic() noexcept { return true; } - static constexpr Priority getPriorityStatic() { + static constexpr Priority getPriorityStatic() noexcept { return Priority::Comparison; } diff --git a/include/fintamath/functions/comparison/More.hpp b/include/fintamath/functions/comparison/More.hpp index 0f6db75a5..85a9d6f5a 100644 --- a/include/fintamath/functions/comparison/More.hpp +++ b/include/fintamath/functions/comparison/More.hpp @@ -21,11 +21,11 @@ class More : public IOperatorCRTP { return ">"; } - static constexpr bool isAssociativeStatic() { + static constexpr bool isAssociativeStatic() noexcept { return true; } - static constexpr Priority getPriorityStatic() { + static constexpr Priority getPriorityStatic() noexcept { return Priority::Comparison; } diff --git a/include/fintamath/functions/comparison/MoreEqv.hpp b/include/fintamath/functions/comparison/MoreEqv.hpp index 068d3b2ca..02b1a03f5 100644 --- a/include/fintamath/functions/comparison/MoreEqv.hpp +++ b/include/fintamath/functions/comparison/MoreEqv.hpp @@ -21,11 +21,11 @@ class MoreEqv : public IOperatorCRTP return ">="; } - static constexpr bool isAssociativeStatic() { + static constexpr bool isAssociativeStatic() noexcept { return true; } - static constexpr Priority getPriorityStatic() { + static constexpr Priority getPriorityStatic() noexcept { return Priority::Comparison; } diff --git a/include/fintamath/functions/comparison/Neqv.hpp b/include/fintamath/functions/comparison/Neqv.hpp index b7e552c7f..35fc6483c 100644 --- a/include/fintamath/functions/comparison/Neqv.hpp +++ b/include/fintamath/functions/comparison/Neqv.hpp @@ -21,11 +21,11 @@ class Neqv : public IOperatorCRTP { return "!="; } - static constexpr bool isAssociativeStatic() { + static constexpr bool isAssociativeStatic() noexcept { return true; } - static constexpr Priority getPriorityStatic() { + static constexpr Priority getPriorityStatic() noexcept { return Priority::Comparison; } diff --git a/include/fintamath/functions/logic/And.hpp b/include/fintamath/functions/logic/And.hpp index 0f583d01a..567144430 100644 --- a/include/fintamath/functions/logic/And.hpp +++ b/include/fintamath/functions/logic/And.hpp @@ -21,7 +21,7 @@ class And : public IFunctionCRTP { return "and"; } - static constexpr bool isVariadicStatic() { + static constexpr bool isVariadicStatic() noexcept { return true; } diff --git a/include/fintamath/functions/logic/AndOper.hpp b/include/fintamath/functions/logic/AndOper.hpp index ecd706017..765ac4487 100644 --- a/include/fintamath/functions/logic/AndOper.hpp +++ b/include/fintamath/functions/logic/AndOper.hpp @@ -18,11 +18,11 @@ class AndOper : public IOperatorCRTP { return "&"; } - static constexpr bool isAssociativeStatic() { + static constexpr bool isAssociativeStatic() noexcept { return true; } - static constexpr Priority getPriorityStatic() { + static constexpr Priority getPriorityStatic() noexcept { return Priority::Conjunction; } diff --git a/include/fintamath/functions/logic/Equiv.hpp b/include/fintamath/functions/logic/Equiv.hpp index 0bc5ad643..5292a4e1e 100644 --- a/include/fintamath/functions/logic/Equiv.hpp +++ b/include/fintamath/functions/logic/Equiv.hpp @@ -20,11 +20,11 @@ class Equiv : public IOperatorCRTP { return "<->"; } - static constexpr bool isAssociativeStatic() { + static constexpr bool isAssociativeStatic() noexcept { return true; } - static constexpr Priority getPriorityStatic() { + static constexpr Priority getPriorityStatic() noexcept { return Priority::Equivalence; } diff --git a/include/fintamath/functions/logic/Impl.hpp b/include/fintamath/functions/logic/Impl.hpp index 356671079..71e974c13 100644 --- a/include/fintamath/functions/logic/Impl.hpp +++ b/include/fintamath/functions/logic/Impl.hpp @@ -20,7 +20,7 @@ class Impl : public IOperatorCRTP { return "->"; } - static constexpr Priority getPriorityStatic() { + static constexpr Priority getPriorityStatic() noexcept { return Priority::Implication; } diff --git a/include/fintamath/functions/logic/Nequiv.hpp b/include/fintamath/functions/logic/Nequiv.hpp index 4c3a5e012..0dc200ff4 100644 --- a/include/fintamath/functions/logic/Nequiv.hpp +++ b/include/fintamath/functions/logic/Nequiv.hpp @@ -20,11 +20,11 @@ class Nequiv : public IOperatorCRTP { return "!<->"; } - static constexpr bool isAssociativeStatic() { + static constexpr bool isAssociativeStatic() noexcept { return true; } - static constexpr Priority getPriorityStatic() { + static constexpr Priority getPriorityStatic() noexcept { return Priority::Equivalence; } diff --git a/include/fintamath/functions/logic/Not.hpp b/include/fintamath/functions/logic/Not.hpp index 7f9e31871..d4ef1215d 100644 --- a/include/fintamath/functions/logic/Not.hpp +++ b/include/fintamath/functions/logic/Not.hpp @@ -20,7 +20,7 @@ class Not : public IOperatorCRTP { return "~"; } - static constexpr Priority getPriorityStatic() { + static constexpr Priority getPriorityStatic() noexcept { return Priority::PrefixUnary; } diff --git a/include/fintamath/functions/logic/Or.hpp b/include/fintamath/functions/logic/Or.hpp index 4ad07a707..f5e6c3b5d 100644 --- a/include/fintamath/functions/logic/Or.hpp +++ b/include/fintamath/functions/logic/Or.hpp @@ -20,7 +20,7 @@ class Or : public IFunctionCRTP { return "or"; } - static constexpr bool isVariadicStatic() { + static constexpr bool isVariadicStatic() noexcept { return true; } diff --git a/include/fintamath/functions/logic/OrOper.hpp b/include/fintamath/functions/logic/OrOper.hpp index f3d71f9ba..210c810e7 100644 --- a/include/fintamath/functions/logic/OrOper.hpp +++ b/include/fintamath/functions/logic/OrOper.hpp @@ -20,11 +20,11 @@ class OrOper : public IOperatorCRTP { return "|"; } - static constexpr bool isAssociativeStatic() { + static constexpr bool isAssociativeStatic() noexcept { return true; } - static constexpr Priority getPriorityStatic() { + static constexpr Priority getPriorityStatic() noexcept { return Priority::Disjunction; } diff --git a/include/fintamath/functions/ntheory/Mod.hpp b/include/fintamath/functions/ntheory/Mod.hpp index 231474039..d5db83542 100644 --- a/include/fintamath/functions/ntheory/Mod.hpp +++ b/include/fintamath/functions/ntheory/Mod.hpp @@ -20,7 +20,7 @@ class Mod : public IOperatorCRTP { return "mod"; } - static constexpr Priority getPriorityStatic() { + static constexpr Priority getPriorityStatic() noexcept { return Priority::Modulo; } diff --git a/include/fintamath/functions/other/Comma.hpp b/include/fintamath/functions/other/Comma.hpp index 6c6723109..fc5434045 100644 --- a/include/fintamath/functions/other/Comma.hpp +++ b/include/fintamath/functions/other/Comma.hpp @@ -19,11 +19,11 @@ class Comma : public IOperatorCRTP return ","; } - static constexpr bool isAssociativeStatic() { + static constexpr bool isAssociativeStatic() noexcept { return true; } - static constexpr Priority getPriorityStatic() { + static constexpr Priority getPriorityStatic() noexcept { return Priority::Comma; } diff --git a/include/fintamath/functions/other/Deg.hpp b/include/fintamath/functions/other/Deg.hpp index c1bbadb14..7d01ecf14 100644 --- a/include/fintamath/functions/other/Deg.hpp +++ b/include/fintamath/functions/other/Deg.hpp @@ -20,7 +20,7 @@ class Deg : public IOperatorCRTP { return "deg"; } - static constexpr Priority getPriorityStatic() { + static constexpr Priority getPriorityStatic() noexcept { return Priority::PostfixUnary; } diff --git a/include/fintamath/functions/other/Factorial.hpp b/include/fintamath/functions/other/Factorial.hpp index 6412f561d..8f6fbd094 100644 --- a/include/fintamath/functions/other/Factorial.hpp +++ b/include/fintamath/functions/other/Factorial.hpp @@ -32,7 +32,7 @@ class Factorial : public IOperatorCRTP { return std::string(order, '!'); } - static constexpr Priority getPriorityStatic() { + static constexpr Priority getPriorityStatic() noexcept { return Priority::PostfixUnary; } diff --git a/include/fintamath/functions/other/Index.hpp b/include/fintamath/functions/other/Index.hpp index 5c591d557..70dd13fc9 100644 --- a/include/fintamath/functions/other/Index.hpp +++ b/include/fintamath/functions/other/Index.hpp @@ -21,7 +21,7 @@ class Index : public IOperatorCRTP { return "_"; } - static constexpr Priority getPriorityStatic() { + static constexpr Priority getPriorityStatic() noexcept { return Priority::Exponentiation; } diff --git a/include/fintamath/functions/other/Percent.hpp b/include/fintamath/functions/other/Percent.hpp index 54061f66f..af90bebae 100644 --- a/include/fintamath/functions/other/Percent.hpp +++ b/include/fintamath/functions/other/Percent.hpp @@ -20,7 +20,7 @@ class Percent : public IOperatorCRTP { return "%"; } - static constexpr Priority getPriorityStatic() { + static constexpr Priority getPriorityStatic() noexcept { return Priority::PostfixUnary; } diff --git a/include/fintamath/functions/powers/PowOper.hpp b/include/fintamath/functions/powers/PowOper.hpp index 2a00bb2d6..22c24dcff 100644 --- a/include/fintamath/functions/powers/PowOper.hpp +++ b/include/fintamath/functions/powers/PowOper.hpp @@ -20,7 +20,7 @@ class PowOper : public IOperatorCRTP { return "^"; } - static constexpr Priority getPriorityStatic() { + static constexpr Priority getPriorityStatic() noexcept { return Priority::Exponentiation; } diff --git a/include/fintamath/literals/constants/IConstant.hpp b/include/fintamath/literals/constants/IConstant.hpp index 2ee5a0a6a..e121438c2 100644 --- a/include/fintamath/literals/constants/IConstant.hpp +++ b/include/fintamath/literals/constants/IConstant.hpp @@ -15,7 +15,7 @@ class IConstant : public ILiteral { FINTAMATH_PARENT_CLASS_BODY(IConstant, ILiteral) public: - virtual MathObjectClass getReturnClass() const = 0; + virtual MathObjectClass getReturnClass() const noexcept = 0; std::unique_ptr operator()() const { return call(); diff --git a/include/fintamath/literals/constants/IConstantCRTP.hpp b/include/fintamath/literals/constants/IConstantCRTP.hpp index 8e1776ebb..e4ba07fa2 100644 --- a/include/fintamath/literals/constants/IConstantCRTP.hpp +++ b/include/fintamath/literals/constants/IConstantCRTP.hpp @@ -14,11 +14,11 @@ class IConstantCRTP_ : public IConstant { #undef I_LITERAL_CRTP public: - static constexpr MathObjectClass getReturnClassStatic() { + static constexpr MathObjectClass getReturnClassStatic() noexcept { return Return::getClassStatic(); } - MathObjectClass getReturnClass() const final { + MathObjectClass getReturnClass() const noexcept final { return getReturnClassStatic(); } diff --git a/include/fintamath/numbers/Complex.hpp b/include/fintamath/numbers/Complex.hpp index 5561399e0..0943f924a 100644 --- a/include/fintamath/numbers/Complex.hpp +++ b/include/fintamath/numbers/Complex.hpp @@ -48,13 +48,13 @@ class Complex : public INumberCRTP { std::unique_ptr toMinimalObject() const override; - bool isPrecise() const override; + bool isPrecise() const noexcept override; - bool isComplex() const override; + bool isComplex() const noexcept override; - const INumber &real() const; + const INumber &real() const noexcept; - const INumber &imag() const; + const INumber &imag() const noexcept; protected: bool equals(const Complex &rhs) const override; diff --git a/include/fintamath/numbers/INumber.hpp b/include/fintamath/numbers/INumber.hpp index 80998ca6e..8085e76c8 100644 --- a/include/fintamath/numbers/INumber.hpp +++ b/include/fintamath/numbers/INumber.hpp @@ -17,11 +17,11 @@ class INumber : public IComparable { FINTAMATH_PARENT_CLASS_BODY(INumber, IComparable) public: - virtual bool isPrecise() const { + virtual bool isPrecise() const noexcept { return true; } - virtual bool isComplex() const { + virtual bool isComplex() const noexcept { return false; } }; diff --git a/include/fintamath/numbers/Integer.hpp b/include/fintamath/numbers/Integer.hpp index f39168f46..22767819e 100644 --- a/include/fintamath/numbers/Integer.hpp +++ b/include/fintamath/numbers/Integer.hpp @@ -35,7 +35,7 @@ class Integer : public INumberCRTP { int sign() const; - const Backend &getBackend() const; + const Backend &getBackend() const noexcept; template explicit operator T() const { diff --git a/include/fintamath/numbers/Rational.hpp b/include/fintamath/numbers/Rational.hpp index de94ae1e4..a90b69155 100644 --- a/include/fintamath/numbers/Rational.hpp +++ b/include/fintamath/numbers/Rational.hpp @@ -34,9 +34,9 @@ class Rational : public INumberCRTP { int sign() const; - const Integer &numerator() const; + const Integer &numerator() const noexcept; - const Integer &denominator() const; + const Integer &denominator() const noexcept; protected: bool equals(const Rational &rhs) const override; diff --git a/include/fintamath/numbers/Real.hpp b/include/fintamath/numbers/Real.hpp index c41880b19..9f5905627 100644 --- a/include/fintamath/numbers/Real.hpp +++ b/include/fintamath/numbers/Real.hpp @@ -57,21 +57,21 @@ class Real : public INumberCRTP { std::string toString(unsigned precision) const; - bool isPrecise() const override; + bool isPrecise() const noexcept override; int sign() const; bool isZero() const; - const Backend &getBackend() const; + const Backend &getBackend() const noexcept; - unsigned getOutputPrecision() const; + unsigned getOutputPrecision() const noexcept; void setOutputPrecision(unsigned precision); - static unsigned getCalculationPrecision(); + static unsigned getCalculationPrecision() noexcept; - static unsigned getPrecision(); + static unsigned getPrecision() noexcept; static void setPrecision(unsigned precision); diff --git a/src/fintamath/core/MathObjectIdStorage.cpp b/src/fintamath/core/MathObjectIdStorage.cpp index 39a3ccc68..bba011b01 100644 --- a/src/fintamath/core/MathObjectIdStorage.cpp +++ b/src/fintamath/core/MathObjectIdStorage.cpp @@ -2,16 +2,16 @@ namespace fintamath { -size_t MathObjectIdStorage::get(const MathObjectClass objClass) noexcept { +size_t MathObjectIdStorage::get(const MathObjectClass objClass) { auto iter = getMap().find(objClass); return iter != getMap().end() ? iter->second : 0; } -void MathObjectIdStorage::add(const MathObjectClass objClass) noexcept { +void MathObjectIdStorage::add(const MathObjectClass objClass) { getMap().insert_or_assign(objClass, maxId++); } -MathObjectIdStorage::MathObjectClassToIdMap &MathObjectIdStorage::getMap() noexcept { +MathObjectIdStorage::MathObjectClassToIdMap &MathObjectIdStorage::getMap() { static MathObjectIdStorage::MathObjectClassToIdMap map; return map; } diff --git a/src/fintamath/expressions/interfaces/IPolynomExpression.cpp b/src/fintamath/expressions/interfaces/IPolynomExpression.cpp index d2b1925bc..9a7b48cf7 100644 --- a/src/fintamath/expressions/interfaces/IPolynomExpression.cpp +++ b/src/fintamath/expressions/interfaces/IPolynomExpression.cpp @@ -210,11 +210,11 @@ std::string IPolynomExpression::childToString(const IOperator &oper, const Argum return operStr + childStr; } -bool IPolynomExpression::isTermOrderInversed() const { +bool IPolynomExpression::isTermOrderInversed() const noexcept { return false; } -bool IPolynomExpression::isComparableOrderInversed() const { +bool IPolynomExpression::isComparableOrderInversed() const noexcept { return false; } diff --git a/src/fintamath/expressions/polynomial/AndExpr.cpp b/src/fintamath/expressions/polynomial/AndExpr.cpp index 5222b39fa..6ab0e78c5 100644 --- a/src/fintamath/expressions/polynomial/AndExpr.cpp +++ b/src/fintamath/expressions/polynomial/AndExpr.cpp @@ -45,7 +45,7 @@ AndExpr::SimplifyFunctionVector AndExpr::getFunctionsForPostSimplify() const { return simplifyFunctions; } -bool AndExpr::isComparableOrderInversed() const { +bool AndExpr::isComparableOrderInversed() const noexcept { return true; } diff --git a/src/fintamath/expressions/polynomial/AndExpr.hpp b/src/fintamath/expressions/polynomial/AndExpr.hpp index 16bf23a21..e81c6c150 100644 --- a/src/fintamath/expressions/polynomial/AndExpr.hpp +++ b/src/fintamath/expressions/polynomial/AndExpr.hpp @@ -20,7 +20,7 @@ class AndExpr : public IPolynomExpressionCRTP { SimplifyFunctionVector getFunctionsForPostSimplify() const override; - bool isComparableOrderInversed() const override; + bool isComparableOrderInversed() const noexcept override; private: static ArgumentPtr boolSimplify(const IFunction &func, const ArgumentPtr &lhs, const ArgumentPtr &rhs); diff --git a/src/fintamath/expressions/polynomial/MulExpr.cpp b/src/fintamath/expressions/polynomial/MulExpr.cpp index 4e370ac60..f9d0195b9 100644 --- a/src/fintamath/expressions/polynomial/MulExpr.cpp +++ b/src/fintamath/expressions/polynomial/MulExpr.cpp @@ -43,7 +43,7 @@ const std::shared_ptr &MulExpr::getOutputFunction() const { return oper; } -bool MulExpr::isTermOrderInversed() const { +bool MulExpr::isTermOrderInversed() const noexcept { return true; } diff --git a/src/fintamath/expressions/polynomial/MulExpr.hpp b/src/fintamath/expressions/polynomial/MulExpr.hpp index 6fd645c61..2d603c9e4 100644 --- a/src/fintamath/expressions/polynomial/MulExpr.hpp +++ b/src/fintamath/expressions/polynomial/MulExpr.hpp @@ -26,7 +26,7 @@ class MulExpr : public IPolynomExpressionCRTP { SimplifyFunctionVector getFunctionsForPostSimplify() const override; - bool isTermOrderInversed() const override; + bool isTermOrderInversed() const noexcept override; private: static ArgumentPtr constSimplify(const IFunction &func, const ArgumentPtr &lhs, const ArgumentPtr &rhs); diff --git a/src/fintamath/expressions/polynomial/OrExpr.cpp b/src/fintamath/expressions/polynomial/OrExpr.cpp index eea34044a..ade60f431 100644 --- a/src/fintamath/expressions/polynomial/OrExpr.cpp +++ b/src/fintamath/expressions/polynomial/OrExpr.cpp @@ -64,7 +64,7 @@ OrExpr::SimplifyFunctionVector OrExpr::getFunctionsForPostSimplify() const { return simplifyFunctions; } -bool OrExpr::isComparableOrderInversed() const { +bool OrExpr::isComparableOrderInversed() const noexcept { return true; } diff --git a/src/fintamath/expressions/polynomial/OrExpr.hpp b/src/fintamath/expressions/polynomial/OrExpr.hpp index fa479481d..ebc263979 100644 --- a/src/fintamath/expressions/polynomial/OrExpr.hpp +++ b/src/fintamath/expressions/polynomial/OrExpr.hpp @@ -24,7 +24,7 @@ class OrExpr : public IPolynomExpressionCRTP { SimplifyFunctionVector getFunctionsForPostSimplify() const override; - bool isComparableOrderInversed() const override; + bool isComparableOrderInversed() const noexcept override; private: static ArgumentPtr boolSimplify(const IFunction &func, const ArgumentPtr &lhs, const ArgumentPtr &rhs); diff --git a/src/fintamath/numbers/Complex.cpp b/src/fintamath/numbers/Complex.cpp index e29fef6cf..ddc4a3d2f 100644 --- a/src/fintamath/numbers/Complex.cpp +++ b/src/fintamath/numbers/Complex.cpp @@ -110,19 +110,19 @@ std::unique_ptr Complex::toMinimalObject() const { return clone(); } -bool Complex::isPrecise() const { +bool Complex::isPrecise() const noexcept { return !is(re) && !is(im); } -bool Complex::isComplex() const { +bool Complex::isComplex() const noexcept { return *im != Integer(0); } -const INumber &Complex::real() const { +const INumber &Complex::real() const noexcept { return *re; } -const INumber &Complex::imag() const { +const INumber &Complex::imag() const noexcept { return *im; } diff --git a/src/fintamath/numbers/Integer.cpp b/src/fintamath/numbers/Integer.cpp index 2e367ce20..d095e3537 100644 --- a/src/fintamath/numbers/Integer.cpp +++ b/src/fintamath/numbers/Integer.cpp @@ -42,7 +42,7 @@ int Integer::sign() const { return backend.sign(); } -const Integer::Backend &Integer::getBackend() const { +const Integer::Backend &Integer::getBackend() const noexcept { return backend; } diff --git a/src/fintamath/numbers/Rational.cpp b/src/fintamath/numbers/Rational.cpp index c6af945b7..c7ce3ecf3 100644 --- a/src/fintamath/numbers/Rational.cpp +++ b/src/fintamath/numbers/Rational.cpp @@ -76,11 +76,11 @@ Rational::Rational(const std::string &str) { } } -const Integer &Rational::numerator() const { +const Integer &Rational::numerator() const noexcept { return numer; } -const Integer &Rational::denominator() const { +const Integer &Rational::denominator() const noexcept { return denom; } diff --git a/src/fintamath/numbers/Real.cpp b/src/fintamath/numbers/Real.cpp index ee101f897..6955105ba 100644 --- a/src/fintamath/numbers/Real.cpp +++ b/src/fintamath/numbers/Real.cpp @@ -125,7 +125,7 @@ std::string Real::toString(unsigned precision) const { return str; } -bool Real::isPrecise() const { +bool Real::isPrecise() const noexcept { return false; } @@ -141,11 +141,11 @@ bool Real::isZero() const { return backend.is_zero(); } -const Real::Backend &Real::getBackend() const { +const Real::Backend &Real::getBackend() const noexcept { return backend; } -unsigned Real::getOutputPrecision() const { +unsigned Real::getOutputPrecision() const noexcept { return outputPrecision; } @@ -154,11 +154,11 @@ void Real::setOutputPrecision(const unsigned precision) { outputPrecision = precision; } -unsigned Real::getCalculationPrecision() { +unsigned Real::getCalculationPrecision() noexcept { return Backend::thread_default_precision(); } -unsigned Real::getPrecision() { +unsigned Real::getPrecision() noexcept { return (getCalculationPrecision() - precisionDelta) / precisionMultiplier; } diff --git a/tests/src/expressions/FunctionExpressionTests.cpp b/tests/src/expressions/FunctionExpressionTests.cpp index 830b92254..9411e5624 100644 --- a/tests/src/expressions/FunctionExpressionTests.cpp +++ b/tests/src/expressions/FunctionExpressionTests.cpp @@ -49,7 +49,7 @@ class TestBinaryOperator : public IOperatorCRTP { FINTAMATH_CLASS_BODY(TestOperator, IOperator) public: - static constexpr Priority getPriorityStatic() { + static constexpr Priority getPriorityStatic() noexcept { return Priority::Addition; }