C++QEDCore  2.100.2 (v2 Milestone 10 Development branch)
a framework for simulating open quantum dynamics – core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
FormDouble Class Reference

Class representing formatting options for output (stearming) of doubles. More...

#include <FormDouble.h>

+ Inheritance diagram for FormDouble:

Public Member Functions

template<typename T >
const formdouble::Bound< T > operator() (const T &) const
 Binds a value of a double-based type (e.g. double, dcomp, std::vector<double>, etc.) to the present instant.
 
Constructors
 FormDouble (int precision, int width)
 Generic constructor.
 
 FormDouble (int precision)
 Constructor calculating an appropriate width from the maximal possible width of a number of the given precision in the representation of the given machine.
 
Getters
int getPrecision () const
 
int getWidth () const
 

Static Public Attributes

static const int defaultPrecision
 Ultimate default precision for streaming doubles for the whole framework.
 
static int overallPrecision
 Generic overall precision accessible throughout the framework. More...
 

Related Functions

(Note that these are not member functions.)

int actualPrecision (int precision)
 If precision is larger than FormDouble::defaultPrecision, returns precision, otherwise the default. More...
 
int widthPositive (int precision)
 The maximal width in characters of a positive number streamed with the given precision More...
 
int widthAny (int precision)
 The maximal width in characters of any (positive or negative) number streamed with the given precision More...
 
const FormDouble low ()
 Generic “low” precision (FormDouble::defaultPrecision/2) More...
 
const FormDouble high ()
 Generic “high” precision (FormDouble::defaultPrecision) More...
 
const FormDouble positive (int precision)
 
const FormDouble zeroAdditional (int precision)
 

Detailed Description

Class representing formatting options for output (stearming) of doubles.

It handles two characteristics, the precision (number of digits) and width of the output, where the latter can also be left calculated automatically by FormDouble::FormDouble(int)

Definition at line 35 of file FormDouble.h.

Friends And Related Function Documentation

int actualPrecision ( int  precision)
related

If precision is larger than FormDouble::defaultPrecision, returns precision, otherwise the default.

Definition at line 77 of file FormDouble.h.

const FormDouble high ( )
related

Generic “high” precision (FormDouble::defaultPrecision)

Definition at line 98 of file FormDouble.h.

const FormDouble low ( )
related

Generic “low” precision (FormDouble::defaultPrecision/2)

Definition at line 97 of file FormDouble.h.

const FormDouble positive ( int  precision)
related
Parameters
precisionFormDouble with at least FormDouble::defaultPrecision for positive-only quantities, such as time

Definition at line 101 of file FormDouble.h.

int widthAny ( int  precision)
related

The maximal width in characters of any (positive or negative) number streamed with the given precision

int widthPositive ( int  precision)
related

The maximal width in characters of a positive number streamed with the given precision

const FormDouble zeroAdditional ( int  precision)
related
Parameters
precisionFormDouble with at least FormDouble::defaultPrecision and without additional width (padding)

Definition at line 104 of file FormDouble.h.

Member Data Documentation

int FormDouble::overallPrecision
static

Generic overall precision accessible throughout the framework.

Can be set by reading in any variable of class FormDouble from the command line through the parameter-bundle.

See also
parameters::Parameter<formdouble::Zero>, and trajectory::ParsRun::precision, where the overallPrecision is set by the trajectory-bundle

Definition at line 45 of file FormDouble.h.


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