![]() |
RDKit
Open-source cheminformatics and machine learning.
|
A matrix class for general, non-square matrices. More...
#include <Matrix.h>
Public Types | |
typedef boost::shared_array< TYPE > | DATA_SPTR |
Public Member Functions | |
Matrix (unsigned int nRows, unsigned int nCols) | |
Initialize with a size. More... | |
Matrix (unsigned int nRows, unsigned int nCols, TYPE val) | |
Initialize with a size and default value. More... | |
Matrix (unsigned int nRows, unsigned int nCols, DATA_SPTR data) | |
Initialize from a pointer. More... | |
Matrix (const Matrix< TYPE > &other) | |
copy constructor More... | |
virtual | ~Matrix () |
unsigned int | numRows () const |
returns the number of rows More... | |
unsigned int | numCols () const |
returns the number of columns More... | |
unsigned int | getDataSize () const |
virtual TYPE | getVal (unsigned int i, unsigned int j) const |
returns a particular element of the matrix More... | |
virtual void | setVal (unsigned int i, unsigned int j, TYPE val) |
sets a particular element of the matrix More... | |
virtual void | getRow (unsigned int i, Vector< TYPE > &row) const |
returns a copy of a row of the matrix More... | |
virtual void | getCol (unsigned int i, Vector< TYPE > &col) const |
returns a copy of a column of the matrix More... | |
TYPE * | getData () |
returns a pointer to our data array More... | |
const TYPE * | getData () const |
returns a const pointer to our data array More... | |
Matrix< TYPE > & | assign (const Matrix< TYPE > &other) |
Copy operator. More... | |
virtual Matrix< TYPE > & | operator+= (const Matrix< TYPE > &other) |
Matrix addition. More... | |
virtual Matrix< TYPE > & | operator-= (const Matrix< TYPE > &other) |
Matrix subtraction. More... | |
virtual Matrix< TYPE > & | operator*= (TYPE scale) |
Multiplication by a scalar. More... | |
virtual Matrix< TYPE > & | operator/= (TYPE scale) |
division by a scalar More... | |
virtual Matrix< TYPE > & | transpose (Matrix< TYPE > &transpose) const |
copies the transpose of this Matrix into another, returns the result More... | |
Protected Member Functions | |
Matrix () | |
Protected Attributes | |
unsigned int | d_nRows |
unsigned int | d_nCols |
unsigned int | d_dataSize |
DATA_SPTR | d_data |
A matrix class for general, non-square matrices.
typedef boost::shared_array<TYPE> RDNumeric::Matrix< TYPE >::DATA_SPTR |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
|
inlineprotected |
|
inline |
|
inlinevirtual |
|
inline |
returns a pointer to our data array
Definition at line 128 of file Matrix.h.
Referenced by RDNumeric::Matrix< double >::assign(), RDNumeric::Matrix< double >::Matrix(), RDNumeric::multiply(), RDNumeric::SquareMatrix< double >::operator*=(), RDNumeric::Matrix< double >::operator+=(), and RDNumeric::Matrix< double >::operator-=().
|
inline |
|
inline |
|
inlinevirtual |
|
inlinevirtual |
returns a particular element of the matrix
Definition at line 87 of file Matrix.h.
Referenced by operator<<().
|
inline |
returns the number of columns
Definition at line 82 of file Matrix.h.
Referenced by RDNumeric::Matrix< double >::assign(), RDNumeric::multiply(), RDNumeric::Matrix< double >::operator+=(), RDNumeric::Matrix< double >::operator-=(), and operator<<().
|
inline |
returns the number of rows
Definition at line 79 of file Matrix.h.
Referenced by RDNumeric::Matrix< double >::assign(), RDNumeric::multiply(), RDNumeric::SquareMatrix< double >::operator*=(), RDNumeric::Matrix< double >::operator+=(), RDNumeric::Matrix< double >::operator-=(), and operator<<().
|
inlinevirtual |
Multiplication by a scalar.
Reimplemented in RDNumeric::SquareMatrix< TYPE >, and RDNumeric::SquareMatrix< double >.
Definition at line 184 of file Matrix.h.
Referenced by RDNumeric::SquareMatrix< double >::operator*=().
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
copies the transpose of this Matrix into another, returns the result
transpose | the Matrix to store the results |
Definition at line 211 of file Matrix.h.
Referenced by RDNumeric::Matrix< double >::transpose().
|
protected |
Definition at line 236 of file Matrix.h.
Referenced by RDNumeric::Matrix< double >::assign(), RDNumeric::Matrix< double >::getCol(), RDNumeric::Matrix< double >::getData(), RDNumeric::Matrix< double >::getRow(), RDNumeric::Matrix< double >::getVal(), RDNumeric::Matrix< double >::Matrix(), RDNumeric::SquareMatrix< double >::operator*=(), RDNumeric::Matrix< double >::operator*=(), RDNumeric::Matrix< double >::operator+=(), RDNumeric::Matrix< double >::operator-=(), RDNumeric::Matrix< double >::operator/=(), RDNumeric::Matrix< double >::setVal(), RDNumeric::Matrix< double >::transpose(), and RDNumeric::SquareMatrix< double >::transposeInplace().
|
protected |
Definition at line 235 of file Matrix.h.
Referenced by RDNumeric::Matrix< double >::assign(), RDNumeric::Matrix< double >::getDataSize(), RDNumeric::Matrix< double >::Matrix(), RDNumeric::SquareMatrix< double >::operator*=(), RDNumeric::Matrix< double >::operator*=(), RDNumeric::Matrix< double >::operator+=(), RDNumeric::Matrix< double >::operator-=(), and RDNumeric::Matrix< double >::operator/=().
|
protected |
Definition at line 234 of file Matrix.h.
Referenced by RDNumeric::Matrix< double >::assign(), RDNumeric::Matrix< double >::getCol(), RDNumeric::Matrix< double >::getRow(), RDNumeric::Matrix< double >::getVal(), RDNumeric::Matrix< double >::numCols(), RDNumeric::SquareMatrix< double >::operator*=(), RDNumeric::Matrix< double >::operator+=(), RDNumeric::Matrix< double >::operator-=(), RDNumeric::Matrix< double >::setVal(), RDNumeric::Matrix< double >::transpose(), and RDNumeric::SquareMatrix< double >::transposeInplace().
|
protected |
Definition at line 232 of file Matrix.h.
Referenced by RDNumeric::Matrix< double >::assign(), RDNumeric::Matrix< double >::getCol(), RDNumeric::Matrix< double >::getRow(), RDNumeric::Matrix< double >::getVal(), RDNumeric::Matrix< double >::numRows(), RDNumeric::SquareMatrix< double >::operator*=(), RDNumeric::Matrix< double >::operator+=(), RDNumeric::Matrix< double >::operator-=(), RDNumeric::Matrix< double >::setVal(), RDNumeric::Matrix< double >::transpose(), and RDNumeric::SquareMatrix< double >::transposeInplace().