#include <matrix.h>
Public Member Functions | |
| CMatrix (const size_t &nrow=0, const size_t &ncol=0) | |
| CMatrix (const CMatrix &m) | |
| CMatrix (const CVector &v) | |
| ~CMatrix () | |
| CVector | col (const size_t &) const |
| CMatrix | crop (const size_t &nr, const size_t &nc, const size_t &nrz=0, const size_t &ncz=0) const |
| real | det (void) const |
| CMatrix | dev (const size_t &, const size_t &) const |
| CMatrix | diag () const |
| size_t | columns () const |
| size_t | rows () const |
| CMatrix | img (void) const |
| CMatrix | inv (void) const |
| bool | empty () const |
| CMatrix | kern (const size_t &vsize) const |
| CVector | row (size_t) const |
| CSubSpace | solve (const CVector &) const |
| void | swap_row (const size_t &, const size_t &) |
| void | swap_col (const size_t &, const size_t &) |
| CMatrix | transp (void) const |
| real & | operator() (const size_t &row, const size_t &col) |
| real | operator() (const size_t &row, const size_t &col) const |
| CMatrix & | operator= (const CMatrix &) |
| bool | operator== (const CMatrix &) const |
| bool | operator!= (const CMatrix &) const |
| CMatrix | operator- () const |
| CMatrix | operator* (const CMatrix &) const |
| CVector | operator* (const CVector &) const |
Static Public Member Functions | |
| static CMatrix | id (const size_t &) |
| static CMatrix | rnd (const size_t &, const size_t &) |
| static CMatrix | rot3d (const size_t &, const real &) |
Protected Member Functions | |
| CMatrix | gaussjordan (bool *is_inv=NULL, CMatrix *inv=NULL, soltype_t *soltype=NULL, CVector *bb=NULL, CMatrix *tkern=NULL) const |
Protected Attributes | |
| real * | m_data |
| size_t | m_nrow |
| size_t | m_ncol |
Definition at line 35 of file matrix.h.
| CMatrix::CMatrix | ( | const size_t & | nrow = 0, |
|
| const size_t & | ncol = 0 | |||
| ) | [inline] |
| CMatrix::CMatrix | ( | const CMatrix & | m | ) | [inline] |
| CMatrix::CMatrix | ( | const CVector & | v | ) | [inline] |
| CMatrix::~CMatrix | ( | ) | [inline] |
| CMatrix CMatrix::id | ( | const size_t & | n | ) | [static] |
Returns the (square) identity matrix for a given dimension.
| n | the dimension of the identity matrix. |
Definition at line 36 of file matrix.cpp.
References CMatrix().
Referenced by CSailDisp::CSailDisp(), gaussjordan(), kern(), and solve().
| CMatrix CMatrix::rnd | ( | const size_t & | nrow, | |
| const size_t & | ncol | |||
| ) | [static] |
Returns a random matrix of specified dimension.
| nrow | number of rows for the matrix | |
| ncol | number of columns for the matrix |
Definition at line 50 of file matrix.cpp.
| CMatrix CMatrix::rot3d | ( | const size_t & | axis, | |
| const real & | angle | |||
| ) | [static] |
Return a rotation matrix about specified axis.
| axis | the index (0,1,..) of the axis | |
| angle | rotation angle in radians |
Definition at line 69 of file matrix.cpp.
Referenced by CPanel::add6Hems(), CSailWorker::CSailWorker(), CPanel::develop(), CSailPainter::drawArrowLabel(), CSailWorker::EdgeIntersect(), CSailWorker::Layout0(), CSailWorker::LayoutMitre(), CSailWorker::LayoutMitre2(), CSailWorker::LayoutTwist(), CSailWorker::LayoutVertical(), CSailWorker::LayoutWing(), CRigWorker::makeRig(), CRigWorker::mastCenter(), and CSailDisp::setAngle().
| CVector CMatrix::col | ( | const size_t & | index | ) | const |
Extracts the vector for the specified column.
| index | the index of the column to return |
Definition at line 94 of file matrix.cpp.
References m_data, m_ncol, and m_nrow.
Referenced by gaussjordan().
| CMatrix CMatrix::crop | ( | const size_t & | nr, | |
| const size_t & | nc, | |||
| const size_t & | nrz = 0, |
|||
| const size_t & | ncz = 0 | |||
| ) | const |
Extracts part of a CMatrix.
| nr | row to start at | |
| nc | column to start at | |
| nrz | number of rows to extract | |
| ncz | number of columns to extract |
Definition at line 113 of file matrix.cpp.
References m_ncol, and m_nrow.
Referenced by gaussjordan().
| real CMatrix::det | ( | void | ) | const |
| CMatrix CMatrix::dev | ( | const size_t & | i, | |
| const size_t & | j | |||
| ) | const |
| CMatrix CMatrix::diag | ( | ) | const [inline] |
Diagonalises matrix. Currently this is implemented as a full pivot Gauss-Jordan diagonalisation.
Definition at line 119 of file matrix.h.
References gaussjordan().
Referenced by img().
| size_t CMatrix::columns | ( | ) | const [inline] |
Accessor for the number of columns.
Definition at line 124 of file matrix.h.
References m_ncol.
Referenced by CSubSpace::CSubSpace().
| size_t CMatrix::rows | ( | ) | const [inline] |
Accessor for the number of rows.
Definition at line 129 of file matrix.h.
References m_nrow.
Referenced by CSubSpace::CSubSpace(), CSubSpace::getdim(), and CSubSpace::intersect().
| CMatrix CMatrix::img | ( | void | ) | const |
Returns the image space of the linear application associated with the matrix.
Definition at line 390 of file matrix.cpp.
| CMatrix CMatrix::inv | ( | void | ) | const |
Inverts matrix by Gauss-Jordan method with full pivoting.
Definition at line 398 of file matrix.cpp.
References CMatrix(), empty(), gaussjordan(), m_ncol, and m_nrow.
| bool CMatrix::empty | ( | ) | const [inline] |
| CMatrix CMatrix::kern | ( | const size_t & | vsize | ) | const |
Returns the kernel of the linear application. associated with the matrix.
Definition at line 420 of file matrix.cpp.
References empty(), gaussjordan(), and id().
Referenced by CSubSpace::CSubSpace().
| CVector CMatrix::row | ( | size_t | index | ) | const |
Retrieves a row of the matrix in vector form.
Definition at line 436 of file matrix.cpp.
Solves the linear equations system formed by the current matrix and a given right-hand side vector.
| b | the right-hand side values in the equation |
Definition at line 453 of file matrix.cpp.
References CMatrix(), gaussjordan(), id(), and m_nrow.
| void CMatrix::swap_row | ( | const size_t & | i1, | |
| const size_t & | i2 | |||
| ) |
Swaps two rows of a matrix.
Definition at line 488 of file matrix.cpp.
References m_data, m_ncol, and m_nrow.
Referenced by gaussjordan().
| void CMatrix::swap_col | ( | const size_t & | j1, | |
| const size_t & | j2 | |||
| ) |
Swap two columns of a matrix.
Definition at line 510 of file matrix.cpp.
References m_data, m_ncol, and m_nrow.
Referenced by gaussjordan().
| CMatrix CMatrix::transp | ( | void | ) | const |
Transposes ('tilts') matrix
Definition at line 532 of file matrix.cpp.
References m_data, m_ncol, and m_nrow.
Referenced by CSubSpace::CSubSpace(), and img().
| real & CMatrix::operator() | ( | const size_t & | row, | |
| const size_t & | col | |||
| ) | [inline] |
| real CMatrix::operator() | ( | const size_t & | row, | |
| const size_t & | col | |||
| ) | const [inline] |
Performs an assignment.
Definition at line 552 of file matrix.cpp.
| bool CMatrix::operator== | ( | const CMatrix & | m | ) | const |
Tests two matrices for equality.
Definition at line 580 of file matrix.cpp.
| bool CMatrix::operator!= | ( | const CMatrix & | m | ) | const |
Tests two matrices for non-equality.
Definition at line 596 of file matrix.cpp.
| CMatrix CMatrix::operator- | ( | ) | const |
Return the opposite of a matrix.
Definition at line 604 of file matrix.cpp.
Multiplies a matrix by a vector.
Definition at line 637 of file matrix.cpp.
| CMatrix CMatrix::gaussjordan | ( | bool * | is_inv = NULL, |
|
| CMatrix * | inv = NULL, |
|||
| soltype_t * | soltype = NULL, |
|||
| CVector * | bb = NULL, |
|||
| CMatrix * | tkern = NULL | |||
| ) | const [protected] |
Diagonalises matrix by Gauss-Jordan method with full pivoting optionally returns the inverse matrix.
Definition at line 204 of file matrix.cpp.
References CMatrix(), col(), crop(), id(), m_ncol, m_nrow, swap_col(), and swap_row().
real* CMatrix::m_data [protected] |
the matrix's data
Definition at line 39 of file matrix.h.
Referenced by CMatrix(), col(), operator()(), operator*(), operator-(), operator=(), row(), swap_col(), swap_row(), transp(), and ~CMatrix().
size_t CMatrix::m_nrow [protected] |
number of rows
Definition at line 41 of file matrix.h.
Referenced by CMatrix(), col(), crop(), det(), dev(), empty(), gaussjordan(), inv(), operator()(), operator*(), operator-(), operator=(), operator==(), row(), rows(), solve(), swap_col(), swap_row(), and transp().
size_t CMatrix::m_ncol [protected] |
number of columns
Definition at line 43 of file matrix.h.
Referenced by CMatrix(), col(), columns(), crop(), det(), dev(), empty(), gaussjordan(), inv(), operator()(), operator*(), operator-(), operator=(), operator==(), row(), swap_col(), swap_row(), and transp().
1.5.6