UniverseTypeAwareTimeStep Class Reference

#include <orsa_units.h>

Collaboration diagram for UniverseTypeAwareTimeStep:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 UniverseTypeAwareTimeStep ()
 UniverseTypeAwareTimeStep (const double)
 UniverseTypeAwareTimeStep (const TimeStep &)
 UniverseTypeAwareTimeStep (const int days, const unsigned int day_fraction, const int sign=+1)
 UniverseTypeAwareTimeStep (const UniverseTypeAwareTimeStep &)
UniverseTypeAwareTimeStepoperator+= (const UniverseTypeAwareTimeStep &)
UniverseTypeAwareTimeStepoperator-= (const UniverseTypeAwareTimeStep &)
UniverseTypeAwareTimeStepoperator *= (const int)
UniverseTypeAwareTimeStepoperator *= (const double)
double GetDouble () const
UniverseTypeAwareTimeStep operator+ () const
UniverseTypeAwareTimeStep operator- () const
UniverseTypeAwareTimeStep operator+ (const UniverseTypeAwareTimeStep &) const
UniverseTypeAwareTimeStep operator- (const UniverseTypeAwareTimeStep &) const
UniverseTypeAwareTimeStep operator+ (const UniverseTypeAwareTime &) const
UniverseTypeAwareTimeStep operator- (const UniverseTypeAwareTime &) const
UniverseTypeAwareTimeStep absolute () const
bool IsZero () const
bool operator< (const UniverseTypeAwareTimeStep &) const
bool operator> (const UniverseTypeAwareTimeStep &) const
bool operator< (const UniverseTypeAwareTime &) const
bool operator> (const UniverseTypeAwareTime &) const
bool operator< (const double) const
bool operator> (const double) const
bool operator== (const UniverseTypeAwareTimeStep &) const
bool operator!= (const UniverseTypeAwareTimeStep &) const
unsigned int days () const
unsigned int day_fraction () const
int sign () const
TimeStep GetTimeStep () const
void SetTimeStep (const TimeStep &ts_in)
void SetDouble (const double d)

Protected Attributes

TimeStep ts
double dts

Constructor & Destructor Documentation

UniverseTypeAwareTimeStep  ) 
 

Definition at line 1580 of file orsa_units.cc.

01580                                                        : ts(0,0,1), dts(0.0) {
01581     
01582   }

UniverseTypeAwareTimeStep const   double  ) 
 

Definition at line 1584 of file orsa_units.cc.

01584                                                                      : ts(t), dts(t) {
01585     
01586   }

UniverseTypeAwareTimeStep const TimeStep  ) 
 

Definition at line 1588 of file orsa_units.cc.

01588                                                                              : ts(ts_in), dts(ts_in.GetDouble()) {
01589     
01590   }

UniverseTypeAwareTimeStep const int  days,
const unsigned int  day_fraction,
const int  sign = +1
 

Definition at line 1592 of file orsa_units.cc.

01592                                                                                                                       : ts(days,day_fraction,sign), dts(ts.GetDouble()) {
01593     
01594   }

UniverseTypeAwareTimeStep const UniverseTypeAwareTimeStep  ) 
 

Definition at line 1596 of file orsa_units.cc.

01596                                                                                               : ts(ts_in.ts), dts(ts_in.dts) {
01597     
01598   }


Member Function Documentation

UniverseTypeAwareTimeStep absolute  )  const
 

Definition at line 1722 of file orsa_units.cc.

References TimeStep::absolute(), UniverseTypeAwareTimeStep::dts, Universe::GetUniverseType(), orsa::Real, orsa::Simulated, UniverseTypeAwareTimeStep::ts, and orsa::universe.

Referenced by Evolution::Integrate().

01722                                                                       {
01723     UniverseTypeAwareTimeStep _ts(*this);
01724     switch (universe->GetUniverseType()) {
01725     case Real:
01726       _ts.ts = ts.absolute();
01727       break;
01728     case Simulated:
01729       _ts.dts = fabs(dts);
01730       break;
01731     }
01732     return _ts;
01733   }

Here is the call graph for this function:

unsigned int day_fraction  )  const [inline]
 

Definition at line 520 of file orsa_units.h.

00520 { return ts.day_fraction(); }

unsigned int days  )  const [inline]
 

Definition at line 519 of file orsa_units.h.

00519 { return ts.days();         }   

double GetDouble  )  const
 

Definition at line 1624 of file orsa_units.cc.

References UniverseTypeAwareTimeStep::dts, TimeStep::GetDouble(), Universe::GetUniverseType(), orsa::Real, orsa::Simulated, UniverseTypeAwareTimeStep::ts, and orsa::universe.

Referenced by Evolution::Integrate(), UniverseTypeAwareTimeStep::operator<(), UniverseTypeAwareTimeStep::operator>(), Stoer::Step(), DissipativeRungeKutta::Step(), RungeKutta::Step(), Radau15::Step(), and Leapfrog::Step().

01624                                                     {
01625     double _x = 0.0;
01626     switch (universe->GetUniverseType()) {
01627     case Real:
01628       _x = ts.GetDouble();
01629       break;
01630     case Simulated:
01631       _x = dts;
01632       break;
01633     }
01634     return _x;
01635   }

Here is the call graph for this function:

TimeStep GetTimeStep  )  const [inline]
 

Definition at line 523 of file orsa_units.h.

Referenced by UniverseTypeAwareTimeStep::operator+().

00523 { return ts; };

bool IsZero  )  const
 

Definition at line 1735 of file orsa_units.cc.

References UniverseTypeAwareTimeStep::dts, Universe::GetUniverseType(), TimeStep::IsZero(), orsa::Real, orsa::Simulated, UniverseTypeAwareTimeStep::ts, and orsa::universe.

Referenced by Evolution::Integrate().

01735                                                {
01736     bool _z = false;
01737     switch (universe->GetUniverseType()) {
01738     case Real:
01739       _z = ts.IsZero();
01740       break;
01741     case Simulated:
01742       _z = (dts == 0.0);
01743       break;
01744     }
01745     return _z;
01746   }

Here is the call graph for this function:

UniverseTypeAwareTimeStep & operator *= const   double  ) 
 

Definition at line 1618 of file orsa_units.cc.

References UniverseTypeAwareTimeStep::dts, and UniverseTypeAwareTimeStep::ts.

01618                                                                                     {
01619     ts  *= x;
01620     dts *= x;
01621     return * this;
01622   }     

UniverseTypeAwareTimeStep & operator *= const   int  ) 
 

Definition at line 1612 of file orsa_units.cc.

References UniverseTypeAwareTimeStep::dts, and UniverseTypeAwareTimeStep::ts.

01612                                                                                  {
01613     ts  *= p;
01614     dts *= p;
01615     return * this;
01616   }

bool operator!= const UniverseTypeAwareTimeStep  )  const
 

Definition at line 1789 of file orsa_units.cc.

01789                                                                                             {
01790     return (!((*this) == ts_in));
01791   }

UniverseTypeAwareTimeStep operator+ const UniverseTypeAwareTime  )  const
 

Definition at line 1696 of file orsa_units.cc.

References UniverseTypeAwareTimeStep::dts, UniverseTypeAwareTimeStep::GetTimeStep(), Universe::GetUniverseType(), orsa::Real, orsa::Simulated, and orsa::universe.

01696                                                                                                         {
01697     UniverseTypeAwareTimeStep _ts(*this);
01698     switch (universe->GetUniverseType()) {
01699     case Real:
01700       _ts += t.GetDate().GetTimeStep();
01701       break;
01702     case Simulated:
01703       _ts.dts += t.GetTime();
01704       break;
01705     }
01706     return _ts;
01707   }

Here is the call graph for this function:

UniverseTypeAwareTimeStep operator+ const UniverseTypeAwareTimeStep  )  const
 

Definition at line 1682 of file orsa_units.cc.

References UniverseTypeAwareTimeStep::dts, and UniverseTypeAwareTimeStep::ts.

01682                                                                                                                 {
01683     UniverseTypeAwareTimeStep _ts(*this);
01684     _ts.ts  += ts_in.ts;
01685     _ts.dts += ts_in.dts;
01686     return _ts;
01687   }

UniverseTypeAwareTimeStep operator+  )  const
 

Definition at line 1671 of file orsa_units.cc.

01671                                                                          {
01672     return * this;
01673   }

UniverseTypeAwareTimeStep & operator+= const UniverseTypeAwareTimeStep  ) 
 

Definition at line 1600 of file orsa_units.cc.

References UniverseTypeAwareTimeStep::dts, and UniverseTypeAwareTimeStep::ts.

01600                                                                                                               {
01601     ts  += ts_in.ts;
01602     dts += ts_in.dts;
01603     return * this;
01604   }

UniverseTypeAwareTimeStep operator- const UniverseTypeAwareTime  )  const
 

Definition at line 1709 of file orsa_units.cc.

References UniverseTypeAwareTimeStep::dts, Universe::GetUniverseType(), orsa::Real, orsa::Simulated, UniverseTypeAwareTimeStep::ts, and orsa::universe.

01709                                                                                                         {
01710     UniverseTypeAwareTimeStep _ts(*this);
01711     switch (universe->GetUniverseType()) {
01712     case Real:
01713       _ts.ts -= t.GetDate().GetTimeStep();
01714       break;
01715     case Simulated:
01716       _ts.dts -= t.GetTime();
01717       break;
01718     }
01719     return _ts;
01720   }

Here is the call graph for this function:

UniverseTypeAwareTimeStep operator- const UniverseTypeAwareTimeStep  )  const
 

Definition at line 1689 of file orsa_units.cc.

References UniverseTypeAwareTimeStep::dts, and UniverseTypeAwareTimeStep::ts.

01689                                                                                                                 {
01690     UniverseTypeAwareTimeStep _ts(*this);
01691     _ts.ts  -= ts_in.ts;
01692     _ts.dts -= ts_in.dts;
01693     return _ts;
01694   }

UniverseTypeAwareTimeStep operator-  )  const
 

Definition at line 1675 of file orsa_units.cc.

References UniverseTypeAwareTimeStep::dts, and UniverseTypeAwareTimeStep::ts.

01675                                                                          {
01676     UniverseTypeAwareTimeStep _ts;
01677     _ts.ts  = - ts;
01678     _ts.dts = - dts;
01679     return _ts;
01680   }

UniverseTypeAwareTimeStep & operator-= const UniverseTypeAwareTimeStep  ) 
 

Definition at line 1606 of file orsa_units.cc.

References UniverseTypeAwareTimeStep::dts, and UniverseTypeAwareTimeStep::ts.

01606                                                                                                               {
01607     ts  -= ts_in.ts;
01608     dts -= ts_in.dts;
01609     return * this;
01610   }

bool operator< const   double  )  const
 

Definition at line 1637 of file orsa_units.cc.

References UniverseTypeAwareTimeStep::GetDouble().

01637                                                                   {
01638     return (GetDouble() < x);
01639   }

Here is the call graph for this function:

bool operator< const UniverseTypeAwareTime  )  const
 

Definition at line 1645 of file orsa_units.cc.

References UniverseTypeAwareTimeStep::dts, Universe::GetUniverseType(), orsa::Real, orsa::Simulated, UniverseTypeAwareTimeStep::ts, and orsa::universe.

01645                                                                                    {
01646     bool _z = false;
01647     switch (universe->GetUniverseType()) {
01648     case Real:
01649       if (ts < t.GetDate().GetTimeStep()) _z = true;
01650       break;
01651     case Simulated:
01652       if (dts < t.GetTime()) _z = true;
01653       break;
01654     }
01655     return _z;
01656   }

Here is the call graph for this function:

bool operator< const UniverseTypeAwareTimeStep  )  const
 

Definition at line 1748 of file orsa_units.cc.

References UniverseTypeAwareTimeStep::dts, Universe::GetUniverseType(), orsa::Real, orsa::Simulated, UniverseTypeAwareTimeStep::ts, and orsa::universe.

01748                                                                                            {
01749     if (*this == ts_in) return false;
01750     bool _z = false;
01751     switch (universe->GetUniverseType()) {
01752     case Real:
01753       if (ts < ts_in.ts) _z = true;
01754       break;
01755     case Simulated:
01756       if (dts < ts_in.dts) _z = true;
01757       break;
01758     }
01759     return _z;
01760   }

Here is the call graph for this function:

bool operator== const UniverseTypeAwareTimeStep  )  const
 

Definition at line 1776 of file orsa_units.cc.

References UniverseTypeAwareTimeStep::dts, Universe::GetUniverseType(), orsa::Real, orsa::Simulated, UniverseTypeAwareTimeStep::ts, and orsa::universe.

01776                                                                                             {
01777     bool _z = false;
01778     switch (universe->GetUniverseType()) {
01779     case Real:
01780       if (ts == ts_in.ts) _z = true;
01781       break;
01782     case Simulated:
01783       if (dts == ts_in.dts) _z = true;
01784       break;
01785     }
01786     return _z;
01787   }

Here is the call graph for this function:

bool operator> const   double  )  const
 

Definition at line 1641 of file orsa_units.cc.

References UniverseTypeAwareTimeStep::GetDouble().

01641                                                                   {
01642     return (GetDouble() > x);
01643   }

Here is the call graph for this function:

bool operator> const UniverseTypeAwareTime  )  const
 

Definition at line 1658 of file orsa_units.cc.

References UniverseTypeAwareTimeStep::dts, Universe::GetUniverseType(), orsa::Real, orsa::Simulated, UniverseTypeAwareTimeStep::ts, and orsa::universe.

01658                                                                                    {
01659     bool _z = false;
01660     switch (universe->GetUniverseType()) {
01661     case Real:
01662       if (ts > t.GetDate().GetTimeStep()) _z = true;
01663       break;
01664     case Simulated:
01665       if (dts > t.GetTime()) _z = true;
01666       break;
01667     }
01668     return _z;
01669   }

Here is the call graph for this function:

bool operator> const UniverseTypeAwareTimeStep  )  const
 

Definition at line 1762 of file orsa_units.cc.

References UniverseTypeAwareTimeStep::dts, Universe::GetUniverseType(), orsa::Real, orsa::Simulated, UniverseTypeAwareTimeStep::ts, and orsa::universe.

01762                                                                                            {
01763     if (*this == ts_in) return false;
01764     bool _z = false;
01765     switch (universe->GetUniverseType()) {
01766     case Real:
01767       if (ts > ts_in.ts) _z = true;
01768       break;
01769     case Simulated:
01770       if (dts > ts_in.dts) _z = true;
01771       break;
01772     }
01773     return _z; 
01774   }

Here is the call graph for this function:

void SetDouble const double  d  )  [inline]
 

Definition at line 527 of file orsa_units.h.

00527 { dts = d; }

void SetTimeStep const TimeStep ts_in  )  [inline]
 

Definition at line 525 of file orsa_units.h.

00525 { ts = ts_in; }

int sign  )  const [inline]
 

Definition at line 521 of file orsa_units.h.

00521 { return ts.sign();         }


Member Data Documentation

double dts [protected]
 

Definition at line 531 of file orsa_units.h.

Referenced by UniverseTypeAwareTimeStep::absolute(), UniverseTypeAwareTimeStep::GetDouble(), UniverseTypeAwareTimeStep::IsZero(), UniverseTypeAwareTimeStep::operator *=(), UniverseTypeAwareTimeStep::operator+(), UniverseTypeAwareTimeStep::operator+=(), UniverseTypeAwareTimeStep::operator-(), UniverseTypeAwareTimeStep::operator-=(), UniverseTypeAwareTimeStep::operator<(), UniverseTypeAwareTimeStep::operator==(), and UniverseTypeAwareTimeStep::operator>().

TimeStep ts [protected]
 

Definition at line 530 of file orsa_units.h.

Referenced by UniverseTypeAwareTimeStep::absolute(), UniverseTypeAwareTimeStep::GetDouble(), UniverseTypeAwareTimeStep::IsZero(), UniverseTypeAwareTimeStep::operator *=(), UniverseTypeAwareTimeStep::operator+(), UniverseTypeAwareTimeStep::operator+=(), UniverseTypeAwareTimeStep::operator-(), UniverseTypeAwareTimeStep::operator-=(), UniverseTypeAwareTimeStep::operator<(), UniverseTypeAwareTimeStep::operator==(), and UniverseTypeAwareTimeStep::operator>().


The documentation for this class was generated from the following files:
Generated on Tue Jan 11 15:29:56 2005 for liborsa by  doxygen 1.4.0