Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

OpenCAL::PhaseSpace Class Reference

#include <PhaseSpace.h>

List of all members.

Public Member Functions

 PhaseSpace (unsigned int reserve=0)
 PhaseSpace (const float *values, unsigned int size)
void clear (unsigned int reserve=0)
void reset ()
void skip (unsigned int positions)
float getNext ()
float getValue (unsigned int i) const
vector< float > & getVector ()
unsigned int getSize () const
void setValue (unsigned int i, float value)
void setValues (const float *values, unsigned int size)
bool isEmpty () const
void concat (const PhaseSpace &p)
void concatZeros (unsigned int positions)
void concat (float value)
void concat (const Vector3 &v)
void concat (const Quaternion &q)
float operator[] (unsigned int i) const
float & operator[] (unsigned int i)
void operator+= (const PhaseSpace &p)
PhaseSpace operator+ (const PhaseSpace &p)
PhaseSpace operator * (float value)
void add (const PhaseSpace &p, float scale=1.0f)
 <

Protected Attributes

vector< float > m_values
unsigned int m_position

Friends

PhaseSpace operator * (float value, const PhaseSpace &p)


Detailed Description

This class represents a current state of the system, using the state in phase space.

Definition at line 32 of file PhaseSpace.h.


Constructor & Destructor Documentation

PhaseSpace::PhaseSpace unsigned int  reserve = 0  ) 
 

This constructor reserves space in the values vector, for faster operations.

Warning:
It doesn't adjust the values' size. That will still be 0!
Parameters:
reserve The amount of floats that will be reserved
Definition at line 33 of file PhaseSpace.cpp.


Member Function Documentation

void PhaseSpace::add const PhaseSpace p,
float  scale = 1.0f
 

<

Todo:
operator const float *() const { return m_values.begin(); }
Definition at line 170 of file PhaseSpace.cpp.

Referenced by OpenCAL::RungeKutta4Solver::solve(), OpenCAL::MidpointSolver::solve(), and OpenCAL::EulerSolver::solve().

void PhaseSpace::concat const Vector3 v  ) 
 

Warning:
If more memory is reserverd in front, will this reduce the reserved memory? -> NO (http://www.sgi.com/tech/stl) And is this faster than without the reserve (in this case)? -> Normally not
Definition at line 90 of file PhaseSpace.cpp.

References OpenCAL::Utils::Vector3::getX(), OpenCAL::Utils::Vector3::getY(), and OpenCAL::Utils::Vector3::getZ().

Here is the call graph for this function:

void PhaseSpace::concat const PhaseSpace p  ) 
 

Warning:
Rather expensive operation according the STL documentation
Definition at line 80 of file PhaseSpace.cpp.

References getSize(), and m_values.

Referenced by OpenCAL::RigidBody::addToDerivative().

Here is the call graph for this function:

float OpenCAL::PhaseSpace::getValue unsigned int  i  )  const [inline]
 

Todo:
float *getValues() const { return m_values.begin(); }
Definition at line 54 of file PhaseSpace.h.

PhaseSpace PhaseSpace::operator+ const PhaseSpace p  ) 
 

Definition at line 128 of file PhaseSpace.cpp.

void PhaseSpace::operator+= const PhaseSpace p  ) 
 

Definition at line 120 of file PhaseSpace.cpp.


The documentation for this class was generated from the following files:
Generated on Sun Aug 15 19:19:30 2004 for OpenCAL: Open Computer Animation Library by doxygen 1.3.8