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

OSCAR::VectorArray Class Reference
[Math]

Stores arrays of vectors. More...

#include <VectorArray.h>

Inheritance diagram for OSCAR::VectorArray:

Inheritance graph
[legend]
List of all members.

Public Methods

 VectorArray (unsigned int arraySize, unsigned int vectorSize)
 VectorArray (VectorArray &rhs)
 VectorArray (Matrix &rhs)
virtual ~VectorArray ()
VectorArray & operator= (VectorArray &rhs)
VectorArray & operator= (Matrix &rhs)
unsigned int GetSize (void) const
unsigned int GetVectorSize (void) const
double & at (unsigned int vectorNo, unsigned int elementNo)
const double & at (unsigned int vectorNo, unsigned int elementNo) const
Vectorat (unsigned int vectorNo)
const Vectorat (unsigned int vectorNo) const
double & operator() (unsigned int vectorNo, unsigned int elementNo)
const double & operator() (unsigned int vectorNo, unsigned int elementNo) const
Vectoroperator[] (unsigned int vectorNo)
const Vectoroperator[] (unsigned int vectorNo) const
int operator== (const VectorArray &rhs) const

Protected Methods

void init (unsigned int arraySize, unsigned int vectorSize)

Protected Attributes

unsigned int _noOfVectors
VectorP_array

Friends

std::ostream & operator<< (std::ostream &output, const VectorArray &x)

Detailed Description

Author:
Chetan Kapoor.
This class is used anywhere an array of vectors is needed. For example, a list of possible joint solutions, etc.


Constructor & Destructor Documentation

OSCAR::VectorArray::VectorArray unsigned int    arraySize,
unsigned int    vectorSize
 

Constructor.

This is the constructor for an object of type VectorArray. Use this to construct an empty (all elements 0) VectorArray object.

Parameters:
arraySize number of vectors to store in the array.
vectorSize number of elements in each vector (all vectors will be the same size).

OSCAR::VectorArray::VectorArray VectorArray &    rhs
 

Copy Constructor.

This is the Copy Constructor for an object of type VectorArray. Use this to construct an VectorArray object from an existing VectorArray object. If both VectorArray objects are of different sizes, then an error will occur and the function will abort.

Parameters:
rhs An VectorArray object that will be used to initialize this new object.
Exceptions:
arraySizeMismatch arraySizeMismatch
vectorSizeMismatch vectorSizeMismatch

OSCAR::VectorArray::VectorArray Matrix   rhs
 

Copy Constructor.

This is the Copy Constructor for an object of type VectorArray. Use this to construct an VectorArray object from an existing Matrix object. If the VectorArray and Matrix objects are of different sizes, then an error will occur and the function will abort.

Parameters:
rhs An Matrix object that will be used to initialize this new object.
Exceptions:
arraySizeMismatch arraySizeMismatch
vectorSizeMismatch vectorSizeMismatch

virtual OSCAR::VectorArray::~VectorArray   [virtual]
 

Virtual Destructor.

This is the Destructor for an object of type VectorArray.


Member Function Documentation

const Vector& OSCAR::VectorArray::at unsigned int    vectorNo const
 

Get the the vector stored at a particular index in a const VectorArray object.

This method is used to get the (const) vector stored at a particular index in a const VectorArray object. An error is displayed if the index is out of range.

Parameters:
vectorNo The vector to access.
Returns:
A reference to the Vector.
Exceptions:
outOfRange outOfRange Call GetError() for more information.

Vector& OSCAR::VectorArray::at unsigned int    vectorNo
 

Get or Set the the vector stored at a particular index in a non-const VectorArray object.

This method is used to get the vector stored at a particular index in a non-const VectorArray object. An error is displayed if the index is out of range.

Parameters:
vectorNo The vector to access.
Returns:
A reference to the Vector.
Exceptions:
outOfRange outOfRange Call GetError() for more information.

const double& OSCAR::VectorArray::at unsigned int    vectorNo,
unsigned int    elementNo
const
 

Get the value of an element at a particular index in a vector in a const VectorArray object.

This method is used to get the value of an element at a particular index in a vector in an VectorArray object. An error is displayed if the vector or element index is out of range.

Parameters:
vectorNo The vector to access.
elementNo The element of that vector to access.
Returns:
A reference to the value of the element.
Exceptions:
outOfRange outOfRange Call GetError() for more information.

double& OSCAR::VectorArray::at unsigned int    vectorNo,
unsigned int    elementNo
 

Get or Set the value of an element at a particular index in a vector in a non-const VectorArray object.

This method is used to get/set the value of an element at a particular index in a vector in an VectorArray object. An error is displayed if the vector or element index is out of range.

Parameters:
vectorNo The vector to access.
elementNo The element of that vector to access.
Returns:
A reference to the value of the element.
Exceptions:
outOfRange outOfRange Call GetError() for more information.

unsigned int OSCAR::VectorArray::GetSize void    const
 

Get the number of Vectors stored in the VectorArray object.

This method is used to get the number of Vectors stored in the VectorArray object.

Returns:
The number of Vectors in the VectorArray object.

unsigned int OSCAR::VectorArray::GetVectorSize void    const
 

Get the size of each Vector element stored in the VectorArray object.

This method is used to get the size of each Vector element stored in the VectorArray object.

Returns:
The size of each Vector element stored in the VectorArray object.

void OSCAR::VectorArray::init unsigned int    arraySize,
unsigned int    vectorSize
[protected]
 

Initialize the VectorArray object.

This method is used to initialize the VectorArray object.

Parameters:
arraySize Size of the VectorArray.
vectorSize Size of each vector.

const double& OSCAR::VectorArray::operator() unsigned int    vectorNo,
unsigned int    elementNo
const
 

Overloaded, const () operator.

The overloaded () operator is used to get the (const) value of an element at a particular index in a vector in an VectorArray object. An error is displayed if the vector or element index is out of range.

Parameters:
vectorNo The vector to access.
elementNo The element of that vector to access.
Returns:
A reference to the value of the element.
Exceptions:
outOfRange outOfRange Call GetError() for more information.

double& OSCAR::VectorArray::operator() unsigned int    vectorNo,
unsigned int    elementNo
 

Overloaded, non-const () operator.

The overloaded () operator is used to get/set the value of an element at a particular index in a vector in a non-const VectorArray object. An error is displayed if the vector or element index is out of range.

Parameters:
vectorNo The vector to access.
elementNo The element of that vector to access.
Returns:
A reference to the value of the element.
Exceptions:
outOfRange outOfRange Call GetError() for more information.

VectorArray& OSCAR::VectorArray::operator= Matrix   rhs
 

Assignment Operator.

This is the Assignment Operator for an object of type VectorArray.

Parameters:
rhs A Matrix object that goes on the right hand side of the = operator
Returns:
A reference to the object on the left hand side of the = operator

VectorArray& OSCAR::VectorArray::operator= VectorArray &    rhs
 

Assignment Operator.

This is the Assignment Operator for an object of type VectorArray.

Parameters:
rhs A VectorArray object that goes on the right hand side of the = operator
Returns:
A reference to the object on the left hand side of the = operator

int OSCAR::VectorArray::operator== const VectorArray &    rhs const
 

Overloaded == operator.

The Overloaded == operator checks if two VectorArray objects are equal or not.

Parameters:
rhs A VectorArray object
Returns:
1 if both VectorArray objects are equal. Otherwise, 0 is returned.

const Vector& OSCAR::VectorArray::operator[] unsigned int    vectorNo const
 

Index operator for VectorArray objects.

The Overloaded operator[] allows the read-only access of individual vectors in const VectorArray objects. An error is displayed if the index is out of range.

Parameters:
vectorNo The vector to access.
Returns:
A reference to the Vector.
Exceptions:
outOfRange outOfRange Call GetError() for more information.

Vector& OSCAR::VectorArray::operator[] unsigned int    vectorNo
 

Index operator for VectorArray objects.

The Overloaded operator[] allows the read/write access of individual vectors in non-const VectorArray objects. An error is displayed if the index is out of range.

Parameters:
vectorNo The vector to access.
Returns:
A reference to the Vector.
Exceptions:
outOfRange outOfRange Call GetError() for more information.


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &    output,
const VectorArray &    x
[friend]
 


Member Data Documentation

VectorP* OSCAR::VectorArray::_array [protected]
 

unsigned int OSCAR::VectorArray::_noOfVectors [protected]
 


The documentation for this class was generated from the following file:
RRG Homepage OSCAR Overview OSCAR Tutorials Simulations