LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::num_traits< Rational > Struct Reference

#include <line/num/number.h>

Inheritance diagram for line::num_traits< Rational >:
Collaboration diagram for line::num_traits< Rational >:

Public Types

using type = Rational

Static Public Member Functions

static const char * name ()
static Rational from_int (long v)
static Rational from_rational (long num, long den)
static Rational from_double (double v)
 Exact: a double is a dyadic rational, so this conversion loses nothing.
static double to_double (const Rational &v)
static double log_as_double (const Rational &v)
static std::string to_string (const Rational &v)
static std::string numerator_str (const Rational &v)
static std::string denominator_str (const Rational &v)

Static Public Attributes

static constexpr bool is_exact = true
static constexpr bool has_transcendental = false

Detailed Description

Definition at line 132 of file number.h.

Member Typedef Documentation

◆ type

Definition at line 133 of file number.h.

Member Function Documentation

◆ denominator_str()

std::string line::num_traits< Rational >::denominator_str ( const Rational & v)
inlinestatic

Definition at line 148 of file number.h.

◆ from_double()

Rational line::num_traits< Rational >::from_double ( double v)
inlinestatic

Exact: a double is a dyadic rational, so this conversion loses nothing.

Definition at line 141 of file number.h.

◆ from_int()

Rational line::num_traits< Rational >::from_int ( long v)
inlinestatic

Definition at line 138 of file number.h.

◆ from_rational()

Rational line::num_traits< Rational >::from_rational ( long num,
long den )
inlinestatic

Definition at line 139 of file number.h.

◆ log_as_double()

double line::num_traits< Rational >::log_as_double ( const Rational & v)
inlinestatic

Definition at line 143 of file number.h.

References line::log_bigint().

◆ name()

const char * line::num_traits< Rational >::name ( )
inlinestatic

Definition at line 136 of file number.h.

◆ numerator_str()

std::string line::num_traits< Rational >::numerator_str ( const Rational & v)
inlinestatic

Definition at line 147 of file number.h.

◆ to_double()

double line::num_traits< Rational >::to_double ( const Rational & v)
inlinestatic

Definition at line 142 of file number.h.

◆ to_string()

std::string line::num_traits< Rational >::to_string ( const Rational & v)
inlinestatic

Definition at line 146 of file number.h.

Member Data Documentation

◆ has_transcendental

bool line::num_traits< Rational >::has_transcendental = false
staticconstexpr

Definition at line 135 of file number.h.

◆ is_exact

bool line::num_traits< Rational >::is_exact = true
staticconstexpr

Definition at line 134 of file number.h.


The documentation for this struct was generated from the following file: