RDKit: RDNumeric::SymmMatrix< TYPE > Class Template Reference

| RDKit Open-source cheminformatics and machine learning.

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
RDNumeric::SymmMatrix< TYPE > Class Template Reference

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 ()
unsigned int | numRows () const
| returns the number of rows More...
unsigned int | numCols () const
| returns the number of columns More...
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 More...
const TYPE * | getData () const
| returns a const pointer to our data array More...
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 More...
SymmMatrix< TYPE > & | transpose (SymmMatrix< TYPE > &transpose) const
SymmMatrix< TYPE > & | transposeInplace ()

## Protected Member Functions
| SymmMatrix ()

## Protected Attributes
unsigned int | d_size
unsigned int | d_dataSize
DATA_SPTR | d_data

## Detailed Description

### template<class TYPE>
class RDNumeric::SymmMatrix< TYPE >

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 29 of file SymmMatrix.h.

## Member Typedef Documentation

template<class TYPE>

typedef boost::shared_array<TYPE> RDNumeric::SymmMatrix< TYPE >::DATA_SPTR

Definition at line 31 of file SymmMatrix.h.

## Constructor & Destructor Documentation

template<class TYPE>

RDNumeric::SymmMatrix< TYPE >::SymmMatrix | ( | unsigned int | N | ) |
| inlineexplicit

Definition at line 33 of file SymmMatrix.h.

References RDNumeric::SymmMatrix< TYPE >::d_data, and RDNumeric::SymmMatrix< TYPE >::d_dataSize.

template<class TYPE>

RDNumeric::SymmMatrix< TYPE >::SymmMatrix | ( | unsigned int | N,
|  | TYPE | val
| ) |  |
| inline

Definition at line 39 of file SymmMatrix.h.

References RDNumeric::SymmMatrix< TYPE >::d_data, and RDNumeric::SymmMatrix< TYPE >::d_dataSize.

template<class TYPE>

RDNumeric::SymmMatrix< TYPE >::SymmMatrix | ( | unsigned int | N,
|  | DATA_SPTR | data
| ) |  |
| inline

Definition at line 49 of file SymmMatrix.h.

References RDNumeric::SymmMatrix< TYPE >::d_data.

template<class TYPE>

RDNumeric::SymmMatrix< TYPE >::SymmMatrix | ( | const SymmMatrix< TYPE > & | other | ) |
| inline

Definition at line 54 of file SymmMatrix.h.

References RDNumeric::SymmMatrix< TYPE >::d_data, RDNumeric::SymmMatrix< TYPE >::d_dataSize, and RDNumeric::SymmMatrix< TYPE >::getData().

template<class TYPE>

RDNumeric::SymmMatrix< TYPE >::~SymmMatrix | ( |  | ) |
| inline

Definition at line 64 of file SymmMatrix.h.

template<class TYPE>

RDNumeric::SymmMatrix< TYPE >::SymmMatrix | ( |  | ) |
| inlineprotected

Definition at line 235 of file SymmMatrix.h.

References RDNumeric::SymmMatrix< TYPE >::d_size.

## Member Function Documentation

template<class TYPE>

void RDNumeric::SymmMatrix< TYPE >::getCol | ( | unsigned int | i,
|  | Vector< TYPE > & | col
| ) |  |
| inline

Definition at line 121 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().

template<class TYPE>

TYPE* RDNumeric::SymmMatrix< TYPE >::getData | ( |  | ) |
| inline

returns a pointer to our data array

Definition at line 137 of file SymmMatrix.h.

References RDNumeric::SymmMatrix< TYPE >::d_data.

Referenced by RDNumeric::multiply(), RDNumeric::SymmMatrix< TYPE >::operator*=(), RDNumeric::SymmMatrix< TYPE >::operator+=(), RDNumeric::SymmMatrix< TYPE >::operator-=(), RDNumeric::SymmMatrix< TYPE >::SymmMatrix(), and RDNumeric::SymmMatrix< TYPE >::transpose().

template<class TYPE>

const TYPE* RDNumeric::SymmMatrix< TYPE >::getData | ( |  | ) | const
| inline

returns a const pointer to our data array

Definition at line 140 of file SymmMatrix.h.

References RDNumeric::SymmMatrix< TYPE >::d_data.

template<class TYPE>

unsigned int RDNumeric::SymmMatrix< TYPE >::getDataSize | ( |  | ) | const
| inline

Definition at line 72 of file SymmMatrix.h.

References RDNumeric::SymmMatrix< TYPE >::d_dataSize.

template<class TYPE>

void RDNumeric::SymmMatrix< TYPE >::getRow | ( | unsigned int | i,
|  | Vector< TYPE > & | row
| ) |  |
| inline

Definition at line 106 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().

template<class TYPE>

TYPE RDNumeric::SymmMatrix< TYPE >::getVal | ( | unsigned int | i,
|  | unsigned int | j
| ) |  | const
| inline

Definition at line 82 of file SymmMatrix.h.

References RDNumeric::SymmMatrix< TYPE >::d_data, RDNumeric::SymmMatrix< TYPE >::d_size, and URANGE_CHECK.

Referenced by operator<<().

template<class TYPE>

unsigned int RDNumeric::SymmMatrix< TYPE >::numCols | ( |  | ) | const
| inline

returns the number of columns

Definition at line 70 of file SymmMatrix.h.

References RDNumeric::SymmMatrix< TYPE >::d_size.

Referenced by operator<<().

template<class TYPE>

unsigned int RDNumeric::SymmMatrix< TYPE >::numRows | ( |  | ) | const
| inline

returns the number of rows

Definition at line 67 of file SymmMatrix.h.

References RDNumeric::SymmMatrix< TYPE >::d_size.

Referenced by RDNumeric::multiply(), RDNumeric::SymmMatrix< TYPE >::operator*=(), RDNumeric::SymmMatrix< TYPE >::operator+=(), RDNumeric::SymmMatrix< TYPE >::operator-=(), operator<<(), and RDNumeric::SymmMatrix< TYPE >::transpose().

template<class TYPE>

SymmMatrix<TYPE>& RDNumeric::SymmMatrix< TYPE >::operator*= | ( | TYPE | scale | ) |
| inline

Definition at line 142 of file SymmMatrix.h.

References RDNumeric::SymmMatrix< TYPE >::d_data, and RDNumeric::SymmMatrix< TYPE >::d_dataSize.

template<class TYPE>

SymmMatrix<TYPE>& RDNumeric::SymmMatrix< TYPE >::operator*= | ( | const SymmMatrix< TYPE > & | B | ) |
| inline

in-place matrix multiplication

Definition at line 181 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().

template<class TYPE>

SymmMatrix<TYPE>& RDNumeric::SymmMatrix< TYPE >::operator+= | ( | const SymmMatrix< TYPE > & | other | ) |
| inline

Definition at line 158 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().

template<class TYPE>

SymmMatrix<TYPE>& RDNumeric::SymmMatrix< TYPE >::operator-= | ( | const SymmMatrix< TYPE > & | other | ) |
| inline

Definition at line 169 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().

template<class TYPE>

SymmMatrix<TYPE>& RDNumeric::SymmMatrix< TYPE >::operator/= | ( | TYPE | scale | ) |
| inline

Definition at line 150 of file SymmMatrix.h.

References RDNumeric::SymmMatrix< TYPE >::d_data, and RDNumeric::SymmMatrix< TYPE >::d_dataSize.

template<class TYPE>

void RDNumeric::SymmMatrix< TYPE >::setToIdentity | ( |  | ) |
| inline

Definition at line 74 of file SymmMatrix.h.

References RDNumeric::SymmMatrix< TYPE >::d_data, RDNumeric::SymmMatrix< TYPE >::d_dataSize, and RDNumeric::SymmMatrix< TYPE >::d_size.

template<class TYPE>

void RDNumeric::SymmMatrix< TYPE >::setVal | ( | unsigned int | i,
|  | unsigned int | j,
|  | TYPE | val
| ) |  |
| inline

Definition at line 94 of file SymmMatrix.h.

References RDNumeric::SymmMatrix< TYPE >::d_data, RDNumeric::SymmMatrix< TYPE >::d_size, and URANGE_CHECK.

template<class TYPE>

SymmMatrix<TYPE>& RDNumeric::SymmMatrix< TYPE >::transpose | ( | SymmMatrix< TYPE > & | transpose | ) | const
| inline

Definition at line 218 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().

template<class TYPE>

SymmMatrix<TYPE>& RDNumeric::SymmMatrix< TYPE >::transposeInplace | ( |  | ) |
| inline

Definition at line 229 of file SymmMatrix.h.

## Member Data Documentation

template<class TYPE>

DATA_SPTR RDNumeric::SymmMatrix< TYPE >::d_data
| protected

Definition at line 238 of file SymmMatrix.h.

Referenced by RDNumeric::SymmMatrix< TYPE >::getCol(), 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 >::setToIdentity(), RDNumeric::SymmMatrix< TYPE >::setVal(), RDNumeric::SymmMatrix< TYPE >::SymmMatrix(), and RDNumeric::SymmMatrix< TYPE >::transpose().

template<class TYPE>

unsigned int RDNumeric::SymmMatrix< TYPE >::d_dataSize
| protected

Definition at line 237 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 >::setToIdentity(), RDNumeric::SymmMatrix< TYPE >::SymmMatrix(), and RDNumeric::SymmMatrix< TYPE >::transpose().

template<class TYPE>

unsigned int RDNumeric::SymmMatrix< TYPE >::d_size
| protected

Definition at line 235 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(), RDNumeric::SymmMatrix< TYPE >::SymmMatrix(), and RDNumeric::SymmMatrix< TYPE >::transpose().

The documentation for this class was generated from the following file:

- SymmMatrix.h