Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

rdStateVector Class Reference

A class which stores a vector of states or data at a specified time. More...

#include <rdStateVector.h>

List of all members.

Public Member Functions

 rdStateVector (double aT=0.0, int aN=0, double *aData=NULL)
 Default constructor.

 rdStateVector (rdStateVector &aVector)
 Copy constructor.

virtual ~rdStateVector ()
 Destructor.

void setStates (double aT, int aN, double aY[])
int getSize ()
 Get the size of the data vector.

void setTime (double aT)
 Set the time stamp of this vector.

double getTime ()
 Get the time stamp of this vector.

int getDataValue (int aIndex, double &rValue)
 Get the data value at a specified index.

double * getData ()
 Get the data values of this vector.

void shiftTime (double aValue)
 Shift the time of this state vector.

void scaleTime (double aValue)
 Scale the time of this state vector.

void add (double aValue)
 Add a value to each state.

void add (int aN, double aY[])
 Add the values held in an array to the corresponding states.

void add (rdStateVector *aStateVector)
 Add the values held in a state vector to the corresponding states.

void subtract (double aValue)
 Subtract a value from each state.

void subtract (int aN, double aY[])
 Subtract the values held in an array from the corresponding states.

void subtract (rdStateVector *aStateVector)
 Subtract the values held in a state vector from the corresponding states.

void multiply (double aValue)
 Multiply the states by a value.

void multiply (int aN, double aY[])
 Multiply the states by the corresponding values in an array.

void multiply (rdStateVector *aStateVector)
 Multiply the states by the corresponding values in a state vector.

void divide (double aValue)
 Divide the states by a value.

void divide (int aN, double aY[])
 Divide the states by the corresponding values in an array.

void divide (rdStateVector *aStateVector)
 Divide the states by the corresponding values in a state vector.

void print ()
 Print the contents of this rdStateVector to standard out.

int print (FILE *fp)
 Print the contents of this rdStateVector to file.


Private Member Functions

void setNull ()
 Set the null or default values of the states.


Private Attributes

double _t
 Time stamp of the statevector.

int _n
 Number of elements in the statevector.

double * _data
 The statevector.


Detailed Description

A class which stores a vector of states or data at a specified time.

Generally, it is used to store the time histories of the states during an integration.

The format of the numerical output for this class is specified by the settings in rdIO.

Author:
Frank C. Anderson
Version:
1.0
See also:
rdIO


Member Function Documentation

void rdStateVector::add rdStateVector *  aStateVector  ) 
 

Add the values held in a state vector to the corresponding states.

Parameters:
aStateVector State vector to add to the states.

void rdStateVector::add int  aN,
double  aY[]
 

Add the values held in an array to the corresponding states.

Only the first aN states are altered.

Parameters:
aN Length of aY.
aY Array of values to add to the states.

void rdStateVector::add double  aValue  ) 
 

Add a value to each state.

Parameters:
aValue Value to add to each state.

void rdStateVector::divide rdStateVector *  aStateVector  ) 
 

Divide the states by the corresponding values in a state vector.

Parameters:
aStateVector State vector by which to divide the states.

void rdStateVector::divide int  aN,
double  aY[]
 

Divide the states by the corresponding values in an array.

Only the first aN states are altered.

Parameters:
aN Length of aY.
aY Array of values the states are divided by.

void rdStateVector::divide double  aValue  ) 
 

Divide the states by a value.

Parameters:
aValue Value each state is to be divided by.

int rdStateVector::getDataValue int  aIndex,
double &  rValue
 

Get the data value at a specified index.

Parameters:
aIndex Index of the desired value: 0 < aIndex < getSize().
rValue Value of the data point if it is defined.
Returns:
1 on success, 0 on failure.

void rdStateVector::multiply rdStateVector *  aStateVector  ) 
 

Multiply the states by the corresponding values in a state vector.

Parameters:
aStateVector State vector by which to multiply the states.

void rdStateVector::multiply int  aN,
double  aY[]
 

Multiply the states by the corresponding values in an array.

Only the first aN states are altered.

Parameters:
aN Length of aY.
aY Array of values the states are multiplied by.

void rdStateVector::multiply double  aValue  ) 
 

Multiply the states by a value.

Parameters:
aValue Value each state is to be multiplied by.

int rdStateVector::print FILE *  fp  ) 
 

Print the contents of this rdStateVector to file.

The number of characters written to file is returned. If an error occurs, a negative value is returned.

void rdStateVector::scaleTime double  aValue  ) 
 

Scale the time of this state vector.

Parameters:
aValue Value by which to scale time.

void rdStateVector::shiftTime double  aValue  ) 
 

Shift the time of this state vector.

Parameters:
aValue Value by which to shift time.

void rdStateVector::subtract rdStateVector *  aStateVector  ) 
 

Subtract the values held in a state vector from the corresponding states.

Parameters:
aStateVector State vector to subtract from the states.

void rdStateVector::subtract int  aN,
double  aY[]
 

Subtract the values held in an array from the corresponding states.

Only the first aN states are altered.

Parameters:
aN Length of aY.
aY Array of values to subtracted from the states.

void rdStateVector::subtract double  aValue  ) 
 

Subtract a value from each state.

Parameters:
aValue Value to subtract from each state.


The documentation for this class was generated from the following files:
Generated on Wed Aug 20 02:17:13 2003 for Simulation Software by doxygen1.3