Class Constant¶
Defined in File constant.hpp
Inheritance Relationships¶
Base Type¶
public sequant::Expr(Class Expr)
Class Documentation¶
-
class Constant : public sequant::Expr¶
a constant number
This is represented as a “compile-time” complex rational number
Public Functions
-
Constant() = delete¶
-
virtual ~Constant() = default¶
-
template<typename T = scalar_type>
inline auto value() const¶ - Template Parameters:
T – the result type; default to the type of value_
- Throws:
std::invalid_argument – if conversion to T is not possible
boost::numeric::positive_overflow – or boost::numeric::negative_overflow if cast fails
- Returns:
the value cast to ResultType
-
inline virtual std::wstring to_latex() const override¶
- Returns:
the string representation of
thisin the LaTeX format
-
inline virtual std::wstring to_wolfram() const override¶
- Returns:
the string representation of
thisin the Wolfram Language format
-
inline virtual type_id_type type_id() const override¶
Computes and returns the derived type identifier
See also
Note
this function must be overridden in the derived class
- Returns:
the hash value for this Expr
-
inline virtual ExprPtr clone() const override¶
Note
- must be overridden in the derived class.
the default implementation throws an exception
- Returns:
a clone of this object, i.e. an object that is equal to
this
-
inline virtual Expr &operator*=(const Expr &that) override¶
in-place multiply
*thisbythat- Throws:
std::logic_error – if not implemented for this class, or cannot be implemented for the particular
that- Returns:
reference to
*this
-
inline virtual Expr &operator+=(const Expr &that) override¶
in-place add
thatto*this- Throws:
std::logic_error – if not implemented for this class, or cannot be implemented for the particular
that- Returns:
reference to
*this
-
inline virtual Expr &operator-=(const Expr &that) override¶
in-place subtract
thatfrom*this- Throws:
std::logic_error – if not implemented for this class, or cannot be implemented for the particular
that- Returns:
reference to
*this
-
inline virtual bool is_zero() const final¶
- Returns:
Constant::is_zero(this->value())
Public Static Functions
-
static inline bool is_zero(scalar_type v)¶
- Parameters:
v – [in] a scalar
- Returns:
true if this is zero
-
Constant() = delete¶