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:
Exception – 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
-
virtual std::wstring to_latex() const override¶
- Returns:
the string representation of
thisin the LaTeX format
-
virtual type_id_type type_id() const override¶
Computes and returns the derived type identifier
See also
- Returns:
the hash value for this Expr
-
virtual bool is_scalar() const override¶
Reports if this is a pure scalar (number-like) expression.
Note
This is distinct from is_cnumber()
Warning
this returns false for all leaves by default, hence must be overridden for scalar leaf types.
- Returns:
true if this is a scalar
-
virtual ExprPtr clone() const override¶
- Returns:
a clone of this object, i.e. an object that is equal to
this
-
virtual bool is_zero() const final¶
- Returns:
Constant::is_zero(this->value())
Public Static Functions
-
static bool is_zero(scalar_type v)¶
- Parameters:
v – [in] a scalar
- Returns:
true if this is zero
-
Constant() = delete¶