Ereal Class Template Reference

Defines an extension of 'real' (e.g. More...

#include <Ereal.h>

List of all members.

Public Methods

 Ereal (const Type num=0.0)
 Constructor that initializes the Ereal with a value.

Ereal operator+= (const Ereal< Type > &num)
 The plus-equals operator.

Ereal operator-= (const Ereal< Type > &)
 Thus minus-equals operator.

Ereal operator *= (const Ereal< Type > &)
 The times-equals operator.

Ereal operator/= (const Ereal< Type > &)
 The divide-equals operator.

 operator Type () const
 Coerces the Ereal to type Type.

std::ostream & write (std::ostream &os) const
 Write the Ereal to a stream.

std::istream & read (std::istream &is)
 Read an Ereal from a stream.

PackBufferwrite (PackBuffer &os) const
 Pack an Ereal into a PackBuffer.

UnPackBufferread (UnPackBuffer &is)
 Unpack an Ereal from a PackBuffer.


Static Public Attributes

Ereal< Type > positive_infinity
 A standard definition of positive infinity.

Ereal< Type > negative_infinity
 A standard definition of negative infinity.


Protected Methods

 Ereal (const Type num, const bool f_flag)
 A constructor that specifies the internal states of the Ereal.


Static Protected Methods

void plus (const Type xval, const bool xFinite, const Type yval, const bool yFinite, Type &rval, bool &rFinite)
 A plus operator.

void minus (const Type xval, const bool xFinite, const Type yval, const bool yFinite, Type &rval, bool &rFinite)
 A minus operator.

void mult (const Type xval, const bool xFinite, const Type yval, const bool yFinite, Type &rval, bool &rFinite)
 A multiplication operator.

void div (const Type xval, const bool xFinite, const Type yval, const bool yFinite, Type &rval, bool &rFinite)
 A division operator.

void check_if_infinite (Type &val, bool &Finite)
 Set the flag Finite to true if val is large enough to be infinite.


Protected Attributes

Type val
 The double value of the Ereal.

bool Finite
 A flag that indicates whether or not the Ereal is finite.


Static Protected Attributes

Type positive_infinity_val = (Type) 1e16
 The value of Type that represents positive infininity.

Type negative_infinity_val = (Type) -1e16
 The value of Type that represents negative infininity.


Friends

Ereal< Type > operator+ (const Ereal< Type > &x, const Ereal< Type > &y)
Ereal< Type > operator+ (const Ereal< Type > &x, const Type y)
Ereal< Type > operator+ (const Type x, const Ereal< Type > &y)
Ereal< Type > operator- (const Ereal< Type > &x, const Ereal< Type > &y)
Ereal< Type > operator- (const Ereal< Type > &x, const Type y)
Ereal< Type > operator- (const Type x, const Ereal< Type > &y)
Ereal< Type > operator * (const Ereal< Type > &x, const Ereal< Type > &y)
Ereal< Type > operator * (const Ereal< Type > &x, const Type y)
Ereal< Type > operator * (const Type x, const Ereal< Type > &y)
Ereal< Type > operator/ (const Ereal< Type > &x, const Ereal< Type > y)
Ereal< Type > operator/ (const Ereal< Type > &x, const Type y)
Ereal< Type > operator/ (const Type x, const Ereal< Type > &y)
Ereal< Type > operator+ (const Ereal< Type > &x)
Ereal< Type > operator- (const Ereal< Type > &num)
bool operator== (const Type x, const Ereal< Type > &y)
bool operator== (const Ereal< Type > &, const Ereal< Type > &)
bool operator== (const Ereal< Type > &, const Type)
bool operator< (const Ereal< Type > &, const Ereal< Type > &)
bool operator< (const Ereal< Type > &, const Type)
bool operator< (const Type x, const Ereal< Type > &y)
bool operator<= (const Ereal< Type > &, const Ereal< Type > &)
bool operator<= (const Ereal< Type > &, const Type)
bool operator<= (const Type x, const Ereal< Type > &y)
bool isinf (const Ereal< Type > &num)
bool isnan (const Ereal< Type > &num)
bool isind (const Ereal< Type > &num)
bool finite (const Ereal< Type > &num)


Detailed Description

template<class Type>
class Ereal< Type >

Defines an extension of 'real' (e.g.

double, float, long doulb) that can 'assume' all 'real' values, as well as -infinity and +infinity.


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