|
Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
|
An exact, node-independent description of a constant baked into the program: enough to (re)produce the constant's value at any working precision, without evaluating a function-tree node (ADR-0027; node evaluation is being retired). More...
#include <straight_line_program.hpp>
Public Types | |
| enum class | Kind : int { Integer , Rational , Complex , Pi , E } |
| Which kind of constant this recipe produces. More... | |
Public Member Functions | |
| template<typename NumT> | |
| NumT | Produce () const |
| Produce the constant's value at the ambient working precision (ThreadPrecision), matching the corresponding number node's FreshEval exactly. | |
| template<typename RealT> | |
| RealT | ProduceReal () const |
| Produce just the REAL value (for a slot inferred NumType::Real). Only valid when IsReal(). | |
| bool | IsReal () const |
| Whether this constant is real-valued: Integer/Pi/E always; a Rational/Complex literal iff its imaginary part is exactly zero. | |
Public Attributes | |
| Kind | kind = Kind::Integer |
| Which kind of constant this is. | |
| mpz_int | int_value |
| Kind::Integer (exact). | |
| mpq_rational | rat_real |
| Kind::Rational real part (exact). | |
| mpq_rational | rat_imag |
| Kind::Rational imaginary part (exact). | |
| complex_mp | float_value |
| Kind::Complex (authored-precision literal; also a fixed variable's value). | |
| size_t | slot = 0 |
| where this constant lives in the register file | |
Friends | |
| class | boost::serialization::access |
An exact, node-independent description of a constant baked into the program: enough to (re)produce the constant's value at any working precision, without evaluating a function-tree node (ADR-0027; node evaluation is being retired).
Integers and rationals are stored exactly (so they downsample to any precision without loss — sidestepping any maximum-precision setting); Pi/E are recomputed at the working precision; a Complex literal carries its authored-precision value (its inherent ceiling).
|
strong |
|
inline |
Whether this constant is real-valued: Integer/Pi/E always; a Rational/Complex literal iff its imaginary part is exactly zero.
Drives NumType::Real inference for constant slots (ADR-0034).
| NumT bertini::ConstantRecipe::Produce | ( | ) | const |
Produce the constant's value at the ambient working precision (ThreadPrecision), matching the corresponding number node's FreshEval exactly.
Definition + instantiations in the cpp.
| RealT bertini::ConstantRecipe::ProduceReal | ( | ) | const |
Produce just the REAL value (for a slot inferred NumType::Real). Only valid when IsReal().
|
friend |
| complex_mp bertini::ConstantRecipe::float_value |
Kind::Complex (authored-precision literal; also a fixed variable's value).
| mpz_int bertini::ConstantRecipe::int_value |
Kind::Integer (exact).
| Kind bertini::ConstantRecipe::kind = Kind::Integer |
Which kind of constant this is.
| mpq_rational bertini::ConstantRecipe::rat_imag |
Kind::Rational imaginary part (exact).
| mpq_rational bertini::ConstantRecipe::rat_real |
Kind::Rational real part (exact).
| size_t bertini::ConstantRecipe::slot = 0 |
where this constant lives in the register file