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

OSCAR::MatrixCol Class Reference
[Math]

This class creates a pointer to a column in a Matrix. More...

#include <Matrix.h>

Inheritance diagram for OSCAR::MatrixCol:

Inheritance graph
[legend]
List of all members.

Public Methods

 MatrixCol (unsigned int col, const Matrix &m, const String &name="")
 MatrixCol (const MatrixCol &rhs)
unsigned int nRow () const
double & at (unsigned int i)
const double & at (unsigned int i) const
double & operator() (unsigned int i)
const double & operator() (unsigned int i) const
Matrix Cross (const MatrixCol &b)
MatrixCol & operator= (const MatrixCol &rhs)
void operator+= (const MatrixCol &rhs)
virtual void printOn (std::ostream &out) const

Protected Attributes

const Matrixpm
unsigned int _col

Detailed Description

Author:
Chetan Kapoor and S. M. Orlow (NIH), Murat Cetin (MATLAB)
This class basically creates a pointer to a column in an Matrix, providing an easier way to access an entire column of an Matrix


Constructor & Destructor Documentation

OSCAR::MatrixCol::MatrixCol unsigned int    col,
const Matrix   m,
const String   name = ""
 

Constructor.

This is the constructor for an object of type MatrixCol. Use this to create a pointer to a const Matrix and store a column number.

Parameters:
col The column of the Matrix to be stored.
m The Matrix where the column is.
name The name you want to give to this object. By default it is "".

OSCAR::MatrixCol::MatrixCol const MatrixCol &    rhs
 

Copy Constructor.

This is the copy constructor for an object of type MatrixCol. Use this to construct an MatrixCol object from an existing MatrixCol object.

Parameters:
rhs An Matrix object that is used to create the new object.


Member Function Documentation

const double& OSCAR::MatrixCol::at unsigned int    i const
 

Get an element of a const MatrixCol object.

This method is used for read access of an element of a const MatrixCol object.

Parameters:
i The index of the row to be accessed.
Returns:
Const reference to value of the element in the specified row.
Exceptions:
outOfRange outOfRange (An out of range error is generated only in in debug mode)

double& OSCAR::MatrixCol::at unsigned int    i
 

Get or Set an element of a const MatrixCol object.

This method is used for read/write access of an element of a non-const MatrixCol object.

Parameters:
i The index of the row to be accessed.
Returns:
Reference to value of the element in the specified row.
Exceptions:
outOfRange outOfRange (An out of range error is generated only in in debug mode)

Matrix OSCAR::MatrixCol::Cross const MatrixCol &    b
 

Get the Cross Product.

This method is used to get the cross product of a MatrixCol object with the calling MatrixCol object. This method only works on MatrixCols objects of size 3.

Parameters:
b A MatrixCol object with which the cross product is computed.
Returns:
A Matrix holding the cross product.
Exceptions:
matrixRowSizeMismatch matrixRowSizeMismatch

unsigned int OSCAR::MatrixCol::nRow   const
 

Get the Number of rows.

This method is used to get the number of rows in a MatrixCol object.

Returns:
The number of rows.

const double& OSCAR::MatrixCol::operator() unsigned int    i const
 

Overloaded const operator().

This overloaded operator is used for read access an element of a const MatrixCol object. Internally, it just calls the .at method.

Parameters:
i The index of the row to be accessed.
Returns:
Const reference to the element in the specified row.
Exceptions:
outOfRange outOfRange (An out of range error is generated only in in debug mode)

double& OSCAR::MatrixCol::operator() unsigned int    i
 

Overloaded non-const operator().

This overloaded operator is used for read/write access an element of a non-const MatrixCol object. Internally, it just calls the .at method.

Parameters:
i The index of the row to be accessed.
Returns:
Reference to the element in the specified row.
Exceptions:
outOfRange outOfRange (An out of range error is generated only in in debug mode)

void OSCAR::MatrixCol::operator+= const MatrixCol &    rhs
 

Overloaded operator+=.

This overloaded operator+= is used to add a MatrixCol object to the calling MatrixCol object and assign the result to the calling MatrixCol object. Both the MatrixCol objects must have the same number of rows.

Parameters:
rhs The MatrixCol to be added.
Exceptions:
matrixRowSizeMismatch matrixRowSizeMismatch

MatrixCol& OSCAR::MatrixCol::operator= const MatrixCol &    rhs
 

Assignment operator.

This is the Assignment operator for an object of type MatrixCol. Use this to copy a specified MatrixCol object into another MatrixCol object. An error occurs if both objects have a different number of elements.

Parameters:
rhs An MatrixCol 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.
Exceptions:
matrixRowSizeMismatch matrixRowSizeMismatch

virtual void OSCAR::MatrixCol::printOn std::ostream &    out const [virtual]
 

Output a MatrixCol object to an output stream.

This method is used to output a MatrixCol object to an output stream.

Parameters:
out An output stream to which the object is outputted.


Member Data Documentation

unsigned int OSCAR::MatrixCol::_col [protected]
 

const Matrix* OSCAR::MatrixCol::pm [protected]
 


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