Open PaperOpt
Matrix Class Reference

#include <Matrix.h>

List of all members.

Public Member Functions

 Matrix (void)
 Matrix (int rows, int columns)
 Matrix (const Matrix &m)
 ~Matrix (void)
const Matrix transpose () const
void identity (void)
const Matrix operator* (const Matrix &m) const
const V3< double > operator* (const V3< double > &v) const
Matrixoperator= (const Matrix &m)
double & operator() (int i, int j) const
const V3< double > row (int i) const
void set_row (int i, const V3< double > &v)
int get_r_size () const
int get_c_size () const

Detailed Description

A simple matrix implementation.

#include "matrix.h"


Constructor & Destructor Documentation

Matrix::Matrix ( void  )

Constructor.

Matrix::Matrix ( int  rows,
int  columns 
)

Constructor.

Creates an empty matrix of the specified dimension.

Parameters:
rowsNumber of rows to allocate.
columnsNumber of columns to allocate.
Matrix::Matrix ( const Matrix m)

Copy constructor.

Parameters:
mMatrix to copy.
Matrix::~Matrix ( void  )

Destructor.


Member Function Documentation

int Matrix::get_c_size ( ) const [inline]
int Matrix::get_r_size ( ) const [inline]
void Matrix::identity ( void  )

Set to identity matrix.

Returns:
void

Here is the caller graph for this function:

double& Matrix::operator() ( int  i,
int  j 
) const [inline]

Subscript operator.

Can be used to set values as well.

Parameters:
i
j
Returns:
double&
const Matrix Matrix::operator* ( const Matrix m) const

Matrix multiplicator.

Parameters:
mSecond matrix in multiplication.
Returns:
Matrix Product.
const V3< double > Matrix::operator* ( const V3< double > &  v) const

Vector multiplication.

Parameters:
vVector.
Returns:
V3 Resulting vector.

Here is the call graph for this function:

Matrix & Matrix::operator= ( const Matrix m)
const V3< double > Matrix::row ( int  i) const

Get row as a vector.

Only works with matrices with 3 columns.

Parameters:
iRow to return.
Returns:
V3 Row number i as a vector.
void Matrix::set_row ( int  i,
const V3< double > &  v 
)

Fill row with a vector.

Only works with matrices with 3 columns.

Parameters:
iRow to set.
Returns:
void

Here is the call graph for this function:

Here is the caller graph for this function:

const Matrix Matrix::transpose ( ) const

Transpose.

Returns:
Matrix Transpose.

Here is the caller graph for this function:


The documentation for this class was generated from the following files: