Main Page   Namespace List   Class Hierarchy   Compound List   File List   Header Files   Sources   Namespace Members   Compound Members   File Members  

matrix2x2 Class Reference

A 2x2 matrix. More...

#include <matrix2x2.h>

List of all members.


Public Members

 matrix2x2 (void)
 matrix2x2 ( const double k )
 matrix2x2 ( const vector2 &r0, const vector2 &r1 )
 matrix2x2 ( const double m00, const double m01, const double m10, const double m11 )
 matrix2x2 ( const matrix2x2 &m )
vector2operator[] ( const unsigned i )
Get one row of the matrix. More...

const vector2operator[] ( const unsigned i ) const
Get one row of the matrix. More...

vector2 row0
The top row of the matrix.

vector2 row1
The bottom row of the matrix.


Static Public Members

vector2 solve ( const matrix2x2 &M, const vector2 &y )
Solve a pair of simultaneous linear equations. More...


Detailed Description

A 2x2 matrix.

Using this class for a 2x2 matrix is more efficient and safer than using a generic vector<vector<double>>.

Definition at line 43 of file matrix2x2.h.


Member Function Documentation

matrix2x2::matrix2x2 (void) [inline]

Definition at line 229 of file matrix2x2.h.

matrix2x2::matrix2x2 (const double k) [inline]

Definition at line 234 of file matrix2x2.h.

matrix2x2::matrix2x2 (const vector2 & r0, const vector2 & r1) [inline]

Definition at line 257 of file matrix2x2.h.

matrix2x2::matrix2x2 (const double m00, const double m01, const double m10, const double m11) [inline]

Definition at line 244 of file matrix2x2.h.

matrix2x2::matrix2x2 (const matrix2x2 & m) [inline]

Definition at line 268 of file matrix2x2.h.

vector2 & matrix2x2::operator[] (const unsigned i) [inline]

Get one row of the matrix.

Parameters:
i   which row to get; 0 indicates the top row, 1 the bottom row
Returns:
the requested row

Preconditions:
 assert( i == 0 || i== 1 );

Definition at line 277 of file matrix2x2.h.

const vector2 & matrix2x2::operator[] (const unsigned i) const [inline]

Get one row of the matrix.

Parameters:
i   which row to get 0 indicates the top row, 1 the bottom row;
Returns:
the requested row

Preconditions:
 assert( i == 0 || i== 1 );

Definition at line 288 of file matrix2x2.h.

vector2 matrix2x2::solve (const matrix2x2 & M, const vector2 & y) [static]

Solve a pair of simultaneous linear equations.

The equations are represented by the matrix equation M*x==y.

Parameters:
M   the matrix holding the equation coefficients
y   the vector holding the equation right-hand-sides
Returns:
the x, such that (M*x)==y;

Definition at line 46 of file matrix2x2.cpp.


Member Data Documentation

vector2 matrix2x2::row0

The top row of the matrix.

Definition at line 120 of file matrix2x2.h.

vector2 matrix2x2::row1

The bottom row of the matrix.

Definition at line 125 of file matrix2x2.h.


The documentation for this class was generated from the following files:
Generated at Sun Jul 14 20:38:20 2002 for Mapper by doxygen 1.0.0 written by Dimitri van Heesch, © 1997-1999