fraction Class Reference

#include <fraction.h>

Public Types

enum  ostream_fmt { sparse, verbose }

Public Member Functions

 fraction ()
 fraction (int64_t n)
 fraction (int64_t n, int64_t d)
int64_t getNumer () const
int64_t getDenom () const
int64_t getI () const
double getD () const
int64_t getInterimMultOverflowPt () const
int64_t getFinalMultOverflowPt () const
int64_t multReturnInt64 (int64_t b) const
fraction reciprocal () const
void setNumer (int64_t n)
void setDenom (int64_t d)
void set (int64_t n, int64_t d)
void calcOverflowPts () const
void reduce () const

Static Public Attributes

static ostream_fmt curFmt = sparse

Private Member Functions

int64_t multNoInterimOverflow (int64_t b) const
void setRaw (int64_t n, int64_t d)

Private Attributes

int64_t numer
int64_t denom
int64_t interimMultOverflowPt
int64_t finalMultOverflowPt

Detailed Description

Definition at line 44 of file fraction.h.


Member Enumeration Documentation

Enumerator:
sparse 
verbose 

Definition at line 54 of file fraction.h.


Constructor & Destructor Documentation

fraction::fraction (  )  [inline]

Definition at line 57 of file fraction.h.

fraction::fraction ( int64_t  n  )  [inline, explicit]

Definition at line 59 of file fraction.h.

fraction::fraction ( int64_t  n,
int64_t  d 
) [inline, explicit]

Definition at line 62 of file fraction.h.


Member Function Documentation

void fraction::calcOverflowPts (  )  const
double fraction::getD (  )  const [inline]

Definition at line 75 of file fraction.h.

Referenced by calcOverflowPts(), and operator*().

int64_t fraction::getDenom (  )  const [inline]
int64_t fraction::getFinalMultOverflowPt (  )  const [inline]

Definition at line 79 of file fraction.h.

Referenced by multReturnInt64(), operator*(), and operator<<().

int64_t fraction::getI (  )  const [inline]

Definition at line 71 of file fraction.h.

Referenced by multReturnInt64().

int64_t fraction::getInterimMultOverflowPt (  )  const [inline]

Definition at line 76 of file fraction.h.

Referenced by multReturnInt64(), operator*(), and operator<<().

int64_t fraction::getNumer (  )  const [inline]
int64_t fraction::multNoInterimOverflow ( int64_t  b  )  const [inline, private]

Definition at line 96 of file fraction.h.

Referenced by calcOverflowPts(), and multReturnInt64().

int64_t fraction::multReturnInt64 ( int64_t  b  )  const
fraction fraction::reciprocal (  )  const [inline]

Definition at line 92 of file fraction.h.

Referenced by timeUnit::set_ns_per_unit().

void fraction::reduce (  )  const [inline]

Definition at line 143 of file fraction.h.

References calcOverflowPts(), denom, gcd(), and numer.

Referenced by operator!=(), operator==(), and timeUnit::timeUnit().

void fraction::set ( int64_t  n,
int64_t  d 
) [inline]

Definition at line 118 of file fraction.h.

void fraction::setDenom ( int64_t  d  )  [inline]

Definition at line 108 of file fraction.h.

void fraction::setNumer ( int64_t  n  )  [inline]

Definition at line 104 of file fraction.h.

void fraction::setRaw ( int64_t  n,
int64_t  d 
) [inline, private]

Definition at line 113 of file fraction.h.

Referenced by calcOverflowPts().


Field Documentation

Definition at line 55 of file fraction.h.

Referenced by operator<<().

int64_t fraction::denom [mutable, private]

Definition at line 46 of file fraction.h.

Referenced by reduce().

Definition at line 52 of file fraction.h.

Referenced by calcOverflowPts().

Definition at line 49 of file fraction.h.

Referenced by calcOverflowPts().

int64_t fraction::numer [mutable, private]

Definition at line 45 of file fraction.h.

Referenced by reduce().


The documentation for this class was generated from the following files:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 12 Jul 2013 for SymtabAPI by  doxygen 1.6.1