Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
Loading...
Searching...
No Matches
num_traits.hpp File Reference

Provides an Eigen-like NumTraits struct for querying traits of a number type. More...

#include <random>
#include "bertini2/records/draw_functions.hpp"
#include <complex>
#include <cmath>
#include "bertini2/mpfr_complex.hpp"
#include "bertini2/random.hpp"
Include dependency graph for num_traits.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  bertini::NumTraits< T >
 Numeric traits for a bertini number type: digit counts, conversions, and companion types. More...
struct  bertini::NumTraits< double >
 Numeric traits for the built-in double type. More...
struct  bertini::NumTraits< complex_dbl >
 Numeric traits for double-precision complex numbers. More...
struct  bertini::NumTraits< real_mp >
 Numeric traits for multiprecision reals (digit counts follow the thread precision). More...
struct  bertini::NumTraits< complex_mp >
 Numeric traits for multiprecision complex numbers (digit counts follow the thread precision). More...
struct  bertini::NumTraits< mpq_rational >
 Numeric traits for exact rationals (provides decimal-string parsing). More...

Namespaces

namespace  bertini

Typedefs

using bertini::NumErrorT = double
 The numeric type used to hold error/tolerance magnitudes throughout Bertini2 – tracking tolerances, Newton residuals, condition numbers, same-point tolerances.

Functions

template<typename T>
T bertini::RandomUnit ()
 Get a random complex number of unit modulus, in number type T.
unsigned bertini::PrecisionIncrement ()
 The number of digits by which adaptive precision is increased at each step.
constexpr unsigned bertini::DoublePrecision ()
 The number of digits considered "double precision" (16).
constexpr unsigned bertini::LowestMultiplePrecision ()
 The lowest multiple-precision digit count used (20).
constexpr unsigned bertini::MaxPrecisionAllowed ()
 The maximum precision (digits) the library will escalate to.
unsigned bertini::Precision (double)
 Get the precision of a number.
void bertini::Precision (double, unsigned prec)
 For complex doubles, throw if the requested precision is not DoublePrecision.
unsigned bertini::Precision (complex_dbl)
 Get the precision of a number.
void bertini::Precision (complex_dbl, unsigned prec)
 For complex doubles, throw if the requested precision is not DoublePrecision.
complex_dbl bertini::rand_complex ()
 Get a random double-precision complex number (not unit modulus; see RandomUnit).
template<>
complex_dbl bertini::RandomUnit< complex_dbl > ()
 Get a random double-precision complex number of unit modulus.
template<>
complex_mp bertini::RandomUnit< complex_mp > ()
 Get a random multiprecision complex number of unit modulus.
template<>
real_mp bertini::RandomUnit< real_mp > ()
 Get a random multiprecision real number of unit modulus (i.e.
template<typename NumberType>
NumberType bertini::RandomOrthonormalSeed ()
 The entry a random orthonormal matrix is seeded with before its QR factorization: a unit draw for the complex types.
template<>
real_mp bertini::RandomOrthonormalSeed< real_mp > ()
 A real orthonormal seed entry: uniform on [-1, 1], never a bare sign.

Detailed Description

Provides an Eigen-like NumTraits struct for querying traits of a number type.

The bertini::NumTraits struct provides NumDigits and NumFuzzyDigits functions.