Graphite Version 3
An experimental 3D geometry processing program
Loading...
Searching...
No Matches
GEO::Numeric Namespace Reference

Defines numeric types used in Vorpaline. More...

Classes

struct  LimitsHelper
 Limits helper class that extends std::numeric_limits. More...
struct  LimitsHelper< T, true >
 Specialization of LimitsHelper for numeric types. More...
struct  Limits
 Extends std::numeric_limits with additional information. More...

Typedefs

typedef void * pointer
typedef int8_t int8
typedef int16_t int16
typedef int32_t int32
typedef int64_t int64
typedef uint8_t uint8
typedef uint16_t uint16
typedef uint32_t uint32
typedef uint64_t uint64
typedef float float32
typedef double float64

Functions

constexpr float32 max_float32 ()
 Gets 32 bits float maximum positive value.
constexpr float32 min_float32 ()
 Gets 32 bits float minimum negative value.
constexpr float64 max_float64 ()
 Gets 64 bits float maximum positive value.
constexpr float64 min_float64 ()
 Gets 64 bits float minimum negative value.
bool is_nan (float32 x)
 Checks whether a 32 bits float is "not a number".
bool is_nan (float64 x)
 Checks whether a 64 bits float is "not a number".
void random_reset ()
 Resets the random number generator.
void random_reset (int seed)
 Resets the random number generator.
int32 random_int32 ()
 Returns a 32 bits integer between 0 and RAND_MAX.
float32 random_float32 ()
 Returns a 32 bits float between 0 and 1.
float64 random_float64 ()
 Returns a 64 bits float between 0 and 1.
template<class T>
void optimize_number_representation (T &x)
 place holder for optimizing internal number representation
template<class T>
Sign ratio_compare (const T &a_num, const T &a_denom, const T &b_num, const T &b_denom)
 Compares two rational numbers given as separate numerators and denominators.
template<class T>
void optimize_number_representation (rationalg< T > &x)
template<class T>
void optimize_number_representation (vecng< 2, T > &v)
template<class T>
void optimize_number_representation (vecng< 3, T > &v)
template<class T>
void optimize_number_representation (vec2Hg< T > &v)
template<class T>
void optimize_number_representation (vec3Hg< T > &v)
template<>
void optimize_number_representation (expansion_nt &x)
template<>
Sign ratio_compare (const expansion_nt &a_num, const expansion_nt &a_denom, const expansion_nt &b_num, const expansion_nt &b_denom)
 Compares two rational numbers given as separate numerators and denominators. Specialization for exact_nt.

Detailed Description

Defines numeric types used in Vorpaline.

These types names have the form (u)int<size> or float<size>, where the (optional) u denotes an unsigned type, and the size is in bits.

Typedef Documentation

◆ float32

typedef float GEO::Numeric::float32

Floating point type with a width of 32 bits

Definition at line 152 of file numeric.h.

◆ float64

typedef double GEO::Numeric::float64

Floating point type with a width of 64 bits

Definition at line 155 of file numeric.h.

◆ int16

typedef int16_t GEO::Numeric::int16

Integer type with a width of 16 bits

Definition at line 131 of file numeric.h.

◆ int32

typedef int32_t GEO::Numeric::int32

Integer type with a width of 32 bits

Definition at line 134 of file numeric.h.

◆ int64

typedef int64_t GEO::Numeric::int64

Integer type with a width of 64 bits

Definition at line 137 of file numeric.h.

◆ int8

typedef int8_t GEO::Numeric::int8

Integer type with a width of 8 bits

Definition at line 128 of file numeric.h.

◆ pointer

typedef void* GEO::Numeric::pointer

Generic pointer type

Definition at line 125 of file numeric.h.

◆ uint16

typedef uint16_t GEO::Numeric::uint16

Unsigned integer type with a width of 16 bits

Definition at line 143 of file numeric.h.

◆ uint32

typedef uint32_t GEO::Numeric::uint32

Unsigned integer type with a width of 32 bits

Definition at line 146 of file numeric.h.

◆ uint64

typedef uint64_t GEO::Numeric::uint64

Unsigned integer type with a width of 64 bits

Definition at line 149 of file numeric.h.

◆ uint8

typedef uint8_t GEO::Numeric::uint8

Unsigned integer type with a width of 8 bits

Definition at line 140 of file numeric.h.

Function Documentation

◆ max_float32()

float32 GEO::Numeric::max_float32 ( )
inlineconstexpr

Gets 32 bits float maximum positive value.

Definition at line 160 of file numeric.h.

◆ max_float64()

float64 GEO::Numeric::max_float64 ( )
inlineconstexpr

Gets 64 bits float maximum positive value.

Definition at line 177 of file numeric.h.

◆ min_float32()

float32 GEO::Numeric::min_float32 ( )
inlineconstexpr

Gets 32 bits float minimum negative value.

Definition at line 167 of file numeric.h.

◆ min_float64()

float64 GEO::Numeric::min_float64 ( )
inlineconstexpr

Gets 64 bits float minimum negative value.

Definition at line 184 of file numeric.h.

◆ optimize_number_representation() [1/7]

template<>
void GEO::Numeric::optimize_number_representation ( expansion_nt & x)
inline

Definition at line 1060 of file expansion_nt.h.

◆ optimize_number_representation() [2/7]

template<class T>
void GEO::Numeric::optimize_number_representation ( rationalg< T > & x)
inline

Definition at line 738 of file rationalg.h.

◆ optimize_number_representation() [3/7]

template<class T>
void GEO::Numeric::optimize_number_representation ( T & x)
inline

place holder for optimizing internal number representation

there are specializations for expansion_nt, rational_nt

Definition at line 279 of file numeric.h.

◆ optimize_number_representation() [4/7]

template<class T>
void GEO::Numeric::optimize_number_representation ( vec2Hg< T > & v)
inline

Definition at line 417 of file vechg.h.

◆ optimize_number_representation() [5/7]

template<class T>
void GEO::Numeric::optimize_number_representation ( vec3Hg< T > & v)
inline

Definition at line 422 of file vechg.h.

◆ optimize_number_representation() [6/7]

template<class T>
void GEO::Numeric::optimize_number_representation ( vecng< 2, T > & v)
inline

Definition at line 1811 of file vecg.h.

◆ optimize_number_representation() [7/7]

template<class T>
void GEO::Numeric::optimize_number_representation ( vecng< 3, T > & v)
inline

Definition at line 1818 of file vecg.h.

◆ random_reset() [1/2]

void GEO::Numeric::random_reset ( )

Resets the random number generator.

Uses "algo:random_seed"

◆ random_reset() [2/2]

void GEO::Numeric::random_reset ( int seed)

Resets the random number generator.

Parameters
[in]seedthe random seed or -1 to use default

◆ ratio_compare() [1/2]

template<>
Sign GEO::Numeric::ratio_compare ( const expansion_nt & a_num,
const expansion_nt & a_denom,
const expansion_nt & b_num,
const expansion_nt & b_denom )

Compares two rational numbers given as separate numerators and denominators. Specialization for exact_nt.

Parameters
[in]a_num,a_denomdefines a = a_num / a_denom
[in]b_num,b_denomdefines b = b_num / b_denom
Returns
the sign of a - b

◆ ratio_compare() [2/2]

template<class T>
Sign GEO::Numeric::ratio_compare ( const T & a_num,
const T & a_denom,
const T & b_num,
const T & b_denom )
inline

Compares two rational numbers given as separate numerators and denominators.

Parameters
[in]a_num,a_denomdefines a = a_num / a_denom
[in]b_num,b_denomdefines b = b_num / b_denom
Returns
the sign of a - b

Definition at line 290 of file numeric.h.