PPL Logo

Matrix Class Reference

Matrix class with some fundmental operations. More...

#include <matrix.h>

Collaboration diagram for Matrix:

Collaboration graph
[legend]

Public Member Functions

 Matrix (int dim)
 Perform basic initialization.
void setElement (int i, int j, double value)
 Sets element i,j of matrix.
const doubleelem (int i, int j) const
 Accesses matrix and returns mtx[i][j] (value).
double determinant (void) const
 Calculate and return the matrix' determinant.
Matrix cofactor (int aI, int aJ) const
 Helper to determinant but may eventually be generally useful.

Protected Attributes

double ** mtx
 this mtx can be of any size
int order
 dimension of matrix (when using square matrices)

Detailed Description

Matrix class with some fundmental operations.

This is probably a bad thing to do, but given my luck with STL of late, I don't want to have to deal with anyone else's ill- or un-documented code. Matrices are here to get Delaunay flippable tests done.

Definition at line 5 of file matrix.h.


Constructor & Destructor Documentation

Matrix::Matrix ( int  dim  )  [inline]

Perform basic initialization.

Allocate arrays for a square matrix of size dim X dim, and initialize order to dim.

Definition at line 16 of file matrix.h.

References malloc(), mtx, and order.


Member Function Documentation

void Matrix::setElement ( int  i,
int  j,
double  value 
) [inline]

Sets element i,j of matrix.

Definition at line 24 of file matrix.h.

References mtx, and order.

Referenced by element::calculateVolume(), and cofactor().

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

Accesses matrix and returns mtx[i][j] (value).

Definition at line 30 of file matrix.h.

References mtx, and order.

Referenced by cofactor(), and determinant().

double Matrix::determinant ( void   )  const [inline]

Calculate and return the matrix' determinant.

Definition at line 36 of file matrix.h.

References cofactor(), determinant(), elem(), and order.

Referenced by element::calculateVolume(), and determinant().

Matrix Matrix::cofactor ( int  aI,
int  aJ 
) const [inline]

Helper to determinant but may eventually be generally useful.

Returns a new matrix with dim one smaller than current, with row aI and column aJ removed.

Definition at line 49 of file matrix.h.

References elem(), order, and setElement().

Referenced by determinant().


Field Documentation

double** Matrix::mtx [protected]

this mtx can be of any size

Definition at line 8 of file matrix.h.

Referenced by elem(), Matrix(), and setElement().

int Matrix::order [protected]

dimension of matrix (when using square matrices)

Definition at line 10 of file matrix.h.

Referenced by cofactor(), determinant(), elem(), Matrix(), and setElement().


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

Generated on Fri May 25 08:04:12 2012 for Charm++ by  doxygen 1.5.5