RDKit
Open-source cheminformatics and machine learning.
|
A symmetric matrix class. More...
#include <SymmMatrix.h>
Public Types | |
typedef boost::shared_array< TYPE > | DATA_SPTR |
Public Member Functions | |
SymmMatrix (unsigned int N) | |
SymmMatrix (unsigned int N, TYPE val) | |
SymmMatrix (unsigned int N, DATA_SPTR data) | |
SymmMatrix (const SymmMatrix< TYPE > &other) | |
~SymmMatrix ()=default | |
unsigned int | numRows () const |
returns the number of rows | |
unsigned int | numCols () const |
returns the number of columns | |
unsigned int | getDataSize () const |
void | setToIdentity () |
TYPE | getVal (unsigned int i, unsigned int j) const |
void | setVal (unsigned int i, unsigned int j, TYPE val) |
void | getRow (unsigned int i, Vector< TYPE > &row) |
void | getCol (unsigned int i, Vector< TYPE > &col) |
TYPE * | getData () |
returns a pointer to our data array | |
const TYPE * | getData () const |
returns a const pointer to our data array | |
SymmMatrix< TYPE > & | operator*= (TYPE scale) |
SymmMatrix< TYPE > & | operator/= (TYPE scale) |
SymmMatrix< TYPE > & | operator+= (const SymmMatrix< TYPE > &other) |
SymmMatrix< TYPE > & | operator-= (const SymmMatrix< TYPE > &other) |
SymmMatrix< TYPE > & | operator*= (const SymmMatrix< TYPE > &B) |
in-place matrix multiplication | |
SymmMatrix< TYPE > & | transpose (SymmMatrix< TYPE > &transpose) const |
SymmMatrix< TYPE > & | transposeInplace () |
Protected Member Functions | |
SymmMatrix () | |
Protected Attributes | |
unsigned int | d_size {0} |
unsigned int | d_dataSize {0} |
DATA_SPTR | d_data |
A symmetric matrix class.
The data is stored as the lower triangle, so A[i,j] = data[i*(i+1) + j] when i >= j and A[i,j] = data[j*(j+1) + i] when i < j
Definition at line 30 of file SymmMatrix.h.
typedef boost::shared_array<TYPE> RDNumeric::SymmMatrix< TYPE >::DATA_SPTR |
Definition at line 32 of file SymmMatrix.h.
|
inlineexplicit |
Definition at line 34 of file SymmMatrix.h.
References RDNumeric::SymmMatrix< TYPE >::d_data, and RDNumeric::SymmMatrix< TYPE >::d_dataSize.
|
inline |
Definition at line 40 of file SymmMatrix.h.
References RDNumeric::SymmMatrix< TYPE >::d_data, and RDNumeric::SymmMatrix< TYPE >::d_dataSize.
|
inline |
Definition at line 50 of file SymmMatrix.h.
References RDNumeric::SymmMatrix< TYPE >::d_data.
|
inline |
Definition at line 55 of file SymmMatrix.h.
References RDNumeric::SymmMatrix< TYPE >::d_data, RDNumeric::SymmMatrix< TYPE >::d_dataSize, and RDNumeric::SymmMatrix< TYPE >::getData().
|
default |
|
inlineprotected |
Definition at line 236 of file SymmMatrix.h.
|
inline |
Definition at line 122 of file SymmMatrix.h.
References CHECK_INVARIANT, RDNumeric::SymmMatrix< TYPE >::d_data, RDNumeric::SymmMatrix< TYPE >::d_size, RDNumeric::Vector< TYPE >::getData(), and RDNumeric::Vector< TYPE >::size().
|
inline |
returns a pointer to our data array
Definition at line 138 of file SymmMatrix.h.
References RDNumeric::SymmMatrix< TYPE >::d_data.
Referenced by RDNumeric::multiply(), RDNumeric::multiply(), RDNumeric::SymmMatrix< TYPE >::operator*=(), RDNumeric::SymmMatrix< TYPE >::operator+=(), RDNumeric::SymmMatrix< TYPE >::operator-=(), and RDNumeric::SymmMatrix< TYPE >::SymmMatrix().
|
inline |
returns a const pointer to our data array
Definition at line 141 of file SymmMatrix.h.
References RDNumeric::SymmMatrix< TYPE >::d_data.
|
inline |
Definition at line 73 of file SymmMatrix.h.
References RDNumeric::SymmMatrix< TYPE >::d_dataSize.
|
inline |
Definition at line 107 of file SymmMatrix.h.
References CHECK_INVARIANT, RDNumeric::SymmMatrix< TYPE >::d_data, RDNumeric::SymmMatrix< TYPE >::d_size, RDNumeric::Vector< TYPE >::getData(), and RDNumeric::Vector< TYPE >::size().
|
inline |
Definition at line 83 of file SymmMatrix.h.
References RDNumeric::SymmMatrix< TYPE >::d_data, RDNumeric::SymmMatrix< TYPE >::d_size, and URANGE_CHECK.
Referenced by operator<<().
|
inline |
returns the number of columns
Definition at line 71 of file SymmMatrix.h.
References RDNumeric::SymmMatrix< TYPE >::d_size.
Referenced by operator<<().
|
inline |
returns the number of rows
Definition at line 68 of file SymmMatrix.h.
References RDNumeric::SymmMatrix< TYPE >::d_size.
Referenced by RDNumeric::multiply(), RDNumeric::multiply(), RDNumeric::SymmMatrix< TYPE >::operator*=(), RDNumeric::SymmMatrix< TYPE >::operator+=(), RDNumeric::SymmMatrix< TYPE >::operator-=(), and operator<<().
|
inline |
in-place matrix multiplication
Definition at line 182 of file SymmMatrix.h.
References CHECK_INVARIANT, RDNumeric::SymmMatrix< TYPE >::d_data, RDNumeric::SymmMatrix< TYPE >::d_dataSize, RDNumeric::SymmMatrix< TYPE >::d_size, RDNumeric::SymmMatrix< TYPE >::getData(), and RDNumeric::SymmMatrix< TYPE >::numRows().
|
inline |
Definition at line 143 of file SymmMatrix.h.
References RDNumeric::SymmMatrix< TYPE >::d_data, and RDNumeric::SymmMatrix< TYPE >::d_dataSize.
|
inline |
|
inline |
|
inline |
Definition at line 151 of file SymmMatrix.h.
References RDNumeric::SymmMatrix< TYPE >::d_data, and RDNumeric::SymmMatrix< TYPE >::d_dataSize.
|
inline |
Definition at line 75 of file SymmMatrix.h.
References RDNumeric::SymmMatrix< TYPE >::d_data, RDNumeric::SymmMatrix< TYPE >::d_dataSize, and RDNumeric::SymmMatrix< TYPE >::d_size.
|
inline |
Definition at line 95 of file SymmMatrix.h.
References RDNumeric::SymmMatrix< TYPE >::d_data, RDNumeric::SymmMatrix< TYPE >::d_size, and URANGE_CHECK.
|
inline |
Definition at line 219 of file SymmMatrix.h.
References CHECK_INVARIANT, RDNumeric::SymmMatrix< TYPE >::d_data, RDNumeric::SymmMatrix< TYPE >::d_dataSize, RDNumeric::SymmMatrix< TYPE >::d_size, and RDNumeric::SymmMatrix< TYPE >::transpose().
Referenced by RDNumeric::SymmMatrix< TYPE >::transpose().
|
inline |
Definition at line 230 of file SymmMatrix.h.
|
protected |
Definition at line 239 of file SymmMatrix.h.
Referenced by RDNumeric::SymmMatrix< TYPE >::getCol(), RDNumeric::SymmMatrix< TYPE >::getData(), RDNumeric::SymmMatrix< TYPE >::getData(), RDNumeric::SymmMatrix< TYPE >::getRow(), RDNumeric::SymmMatrix< TYPE >::getVal(), RDNumeric::SymmMatrix< TYPE >::operator*=(), RDNumeric::SymmMatrix< TYPE >::operator*=(), RDNumeric::SymmMatrix< TYPE >::operator+=(), RDNumeric::SymmMatrix< TYPE >::operator-=(), RDNumeric::SymmMatrix< TYPE >::operator/=(), RDNumeric::SymmMatrix< TYPE >::setToIdentity(), RDNumeric::SymmMatrix< TYPE >::setVal(), RDNumeric::SymmMatrix< TYPE >::SymmMatrix(), RDNumeric::SymmMatrix< TYPE >::SymmMatrix(), RDNumeric::SymmMatrix< TYPE >::SymmMatrix(), RDNumeric::SymmMatrix< TYPE >::SymmMatrix(), and RDNumeric::SymmMatrix< TYPE >::transpose().
|
protected |
Definition at line 238 of file SymmMatrix.h.
Referenced by RDNumeric::SymmMatrix< TYPE >::getDataSize(), RDNumeric::SymmMatrix< TYPE >::operator*=(), RDNumeric::SymmMatrix< TYPE >::operator*=(), RDNumeric::SymmMatrix< TYPE >::operator+=(), RDNumeric::SymmMatrix< TYPE >::operator-=(), RDNumeric::SymmMatrix< TYPE >::operator/=(), RDNumeric::SymmMatrix< TYPE >::setToIdentity(), RDNumeric::SymmMatrix< TYPE >::SymmMatrix(), RDNumeric::SymmMatrix< TYPE >::SymmMatrix(), RDNumeric::SymmMatrix< TYPE >::SymmMatrix(), and RDNumeric::SymmMatrix< TYPE >::transpose().
|
protected |
Definition at line 237 of file SymmMatrix.h.
Referenced by RDNumeric::SymmMatrix< TYPE >::getCol(), RDNumeric::SymmMatrix< TYPE >::getRow(), RDNumeric::SymmMatrix< TYPE >::getVal(), RDNumeric::SymmMatrix< TYPE >::numCols(), RDNumeric::SymmMatrix< TYPE >::numRows(), RDNumeric::SymmMatrix< TYPE >::operator*=(), RDNumeric::SymmMatrix< TYPE >::operator+=(), RDNumeric::SymmMatrix< TYPE >::operator-=(), RDNumeric::SymmMatrix< TYPE >::setToIdentity(), RDNumeric::SymmMatrix< TYPE >::setVal(), and RDNumeric::SymmMatrix< TYPE >::transpose().