Public Member Functions | |
Matrix (const code::Image< float > &inData) | |
Note that this makes a shallow copy of the input data, replacing the data whenever possible. | |
Matrix () | |
For STL use. | |
void | set_val (int i, int j, double v) |
const code::Image< float > & | getResult () const |
Matrix | clone () const |
bool | hasSameDimensionsAs (const Matrix &another) const |
bool | isSquare () const |
bool | isScalar () const |
Matrix & | add (const Matrix &another) |
Matrix & | subtract (const Matrix &another) |
Matrix & | transpose () |
Matrix & | multiply (const Matrix &another) |
double | getScalar () const |
The behavior of this method is undefined if the given matrix is not really a scalar, i.e. | |
Matrix & | invert () throw (SingularException) |
inverts this matrix using Gauss-Jordan elimination, admittedly not the most efficient method. | |
Matrix & | multiply (double factor) |
double | determinant () const |
returns the determinant of this matrix. | |
Static Public Member Functions | |
static code::Image< float > | multiply (const code::Image< float > &a, const code::Image< float > &b) |
Helper function used by the Matrix multiplication. | |
static code::Image< float > | transpose (const code::Image< float > &a) |
Helper function used by the Matrix transpose. | |
static Matrix | Zero (int rows, int cols) |
return a zero matrix with these dimensions. | |
static Matrix | Identity (int rows, int cols) |
return an identity matrix with these dimensions. | |
Friends | |
bool | operator== (const Matrix &a, const Matrix &b) |
Classes | |
struct | SingularException |
An exception thrown by Matrix operations such as invert when they encounter a singular matrix. More... |
w2img::Matrix::Matrix | ( | const code::Image< float > & | inData | ) | [inline] |
Note that this makes a shallow copy of the input data, replacing the data whenever possible.
You may be interested in passing a twin() of the actual image so your copy is not affected.
w2img::Matrix::Matrix | ( | ) | [inline] |
For STL use.
Matrix w2img::Matrix::clone | ( | ) | const [inline] |
double w2img::Matrix::determinant | ( | ) | const |
returns the determinant of this matrix.
A very expensive ( O(N^3) operation ).
const code::Image<float>& w2img::Matrix::getResult | ( | ) | const [inline] |
double w2img::Matrix::getScalar | ( | ) | const |
The behavior of this method is undefined if the given matrix is not really a scalar, i.e.
has only one row and one column.
static Matrix w2img::Matrix::Identity | ( | int | rows, | |
int | cols | |||
) | [static] |
return an identity matrix with these dimensions.
Matrix& w2img::Matrix::invert | ( | ) | throw (SingularException) |
inverts this matrix using Gauss-Jordan elimination, admittedly not the most efficient method.
A very expensive ( O(N^3) operation ).
If the exception is thrown, the matrix held is in an unusable state. Further operations are undefined.
bool w2img::Matrix::isScalar | ( | ) | const |
bool w2img::Matrix::isSquare | ( | ) | const |
static code::Image<float> w2img::Matrix::multiply | ( | const code::Image< float > & | a, | |
const code::Image< float > & | b | |||
) | [static] |
Helper function used by the Matrix multiplication.
Matrix& w2img::Matrix::multiply | ( | double | factor | ) |
void w2img::Matrix::set_val | ( | int | i, | |
int | j, | |||
double | v | |||
) | [inline] |
static code::Image<float> w2img::Matrix::transpose | ( | const code::Image< float > & | a | ) | [static] |
Helper function used by the Matrix transpose.
Matrix& w2img::Matrix::transpose | ( | ) |
static Matrix w2img::Matrix::Zero | ( | int | rows, | |
int | cols | |||
) | [static] |
return a zero matrix with these dimensions.