|
Open PaperOpt
|
#include <Matrix.h>
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 |
| Matrix & | operator= (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 |
A simple matrix implementation.
#include "matrix.h"
| Matrix::Matrix | ( | void | ) |
Constructor.
| Matrix::Matrix | ( | int | rows, |
| int | columns | ||
| ) |
Constructor.
Creates an empty matrix of the specified dimension.
| rows | Number of rows to allocate. |
| columns | Number of columns to allocate. |
| Matrix::~Matrix | ( | void | ) |
Destructor.
| int Matrix::get_c_size | ( | ) | const [inline] |
| int Matrix::get_r_size | ( | ) | const [inline] |
| void Matrix::identity | ( | void | ) |
Set to identity matrix.

| double& Matrix::operator() | ( | int | i, |
| int | j | ||
| ) | const [inline] |
Subscript operator.
Can be used to set values as well.
| i | |
| j |
Vector multiplication.
| v | Vector. |

| const V3< double > Matrix::row | ( | int | i | ) | const |
Get row as a vector.
Only works with matrices with 3 columns.
| i | Row to return. |
| void Matrix::set_row | ( | int | i, |
| const V3< double > & | v | ||
| ) |
Fill row with a vector.
Only works with matrices with 3 columns.
| i | Row to set. |


| const Matrix Matrix::transpose | ( | ) | const |