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

OSCAR::MatrixRow Class Reference
[Math]

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

#include <Matrix.h>

Inheritance diagram for OSCAR::MatrixRow:

Inheritance graph
[legend]
List of all members.

Public Methods

 MatrixRow (unsigned int row, const Matrix &m, const String &name="")
 MatrixRow (const MatrixRow &rhs)
unsigned int nCol () 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
double operator * (const MatrixCol &rhs) const
MatrixRow & operator= (const MatrixRow &rhs)
double & operator[] (unsigned int j)
const double & operator[] (unsigned int j) const
virtual void printOn (std::ostream &out) const

Protected Attributes

const Matrixpm
unsigned int _row

Detailed Description

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


Constructor & Destructor Documentation

OSCAR::MatrixRow::MatrixRow unsigned int    row,
const Matrix   m,
const String   name = ""
 

Constructor.

This is the constructor for an object of type Application MatrixRow. Use this to create a pointer to a Matrix and store a row number.

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

OSCAR::MatrixRow::MatrixRow const MatrixRow &    rhs
 

Copy Constructor.

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

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


Member Function Documentation

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

Get an element of a MatrixRow object.

This method is used to access an element of a MatrixRow object.

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

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

Get/set an element of a MatrixRow object.

This method is used for read/write access of an element of a MatrixRow object.

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

unsigned int OSCAR::MatrixRow::nCol   const
 

Get the Number of columns.

This method is used to get the number of columns in a MatrixRow object.

Returns:
The number of columns.

double OSCAR::MatrixRow::operator * const MatrixCol   rhs const
 

Overloaded operator*.

This overloaded operator* is used to get the dot product of a MatrixCol object with the calling MatrixRow object. An error occurs if the number of columns in the MatrixRow object do not match the number of rows in the MatrixCol object.

Parameters:
rhs A MatrixCol object.
Returns:
The scalar dot product.
Exceptions:
MatrixSizeMismatch #MatrixSizeMismatch

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

Overloaded const operator().

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

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

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

Overloaded operator().

This overloaded operator is used for read/write access an element of a MatrixRow. Internally, it just calls the .at method.

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

MatrixRow& OSCAR::MatrixRow::operator= const MatrixRow &    rhs
 

Assignment operator.

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

Parameters:
rhs An MatrixRow 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:
matrixColumnSizeMismatch matrixColumnSizeMismatch

const double& OSCAR::MatrixRow::operator[] unsigned int    j const
 

Overloaded const operator[].

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

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

double& OSCAR::MatrixRow::operator[] unsigned int    j
 

Overloaded operator[].

This overloaded operator is used for read/write access an element of a MatrixRow by using matrix[i][j]. Internally, it just calls the .at method.

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

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

Output a MatrixRow object to an output stream.

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

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


Member Data Documentation

unsigned int OSCAR::MatrixRow::_row [protected]
 

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


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