RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
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 ()=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
 

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

Member Typedef Documentation

◆ DATA_SPTR

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

Definition at line 32 of file SymmMatrix.h.

Constructor & Destructor Documentation

◆ SymmMatrix() [1/5]

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

Definition at line 34 of file SymmMatrix.h.

◆ SymmMatrix() [2/5]

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

Definition at line 40 of file SymmMatrix.h.

◆ SymmMatrix() [3/5]

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

Definition at line 50 of file SymmMatrix.h.

◆ SymmMatrix() [4/5]

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

Definition at line 55 of file SymmMatrix.h.

◆ ~SymmMatrix()

template<class TYPE>
RDNumeric::SymmMatrix< TYPE >::~SymmMatrix ( )
default

◆ SymmMatrix() [5/5]

template<class TYPE>
RDNumeric::SymmMatrix< TYPE >::SymmMatrix ( )
inlineprotected

Definition at line 236 of file SymmMatrix.h.

Member Function Documentation

◆ getCol()

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

Definition at line 122 of file SymmMatrix.h.

◆ getData() [1/2]

◆ getData() [2/2]

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

returns a const pointer to our data array

Definition at line 141 of file SymmMatrix.h.

◆ getDataSize()

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

Definition at line 73 of file SymmMatrix.h.

◆ getRow()

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

Definition at line 107 of file SymmMatrix.h.

◆ getVal()

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

Definition at line 83 of file SymmMatrix.h.

Referenced by operator<<().

◆ numCols()

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

returns the number of columns

Definition at line 71 of file SymmMatrix.h.

Referenced by operator<<().

◆ numRows()

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

◆ operator*=() [1/2]

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

in-place matrix multiplication

Definition at line 182 of file SymmMatrix.h.

◆ operator*=() [2/2]

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

Definition at line 143 of file SymmMatrix.h.

◆ operator+=()

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

Definition at line 159 of file SymmMatrix.h.

◆ operator-=()

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

Definition at line 170 of file SymmMatrix.h.

◆ operator/=()

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

Definition at line 151 of file SymmMatrix.h.

◆ setToIdentity()

template<class TYPE>
void RDNumeric::SymmMatrix< TYPE >::setToIdentity ( )
inline

Definition at line 75 of file SymmMatrix.h.

◆ setVal()

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

Definition at line 95 of file SymmMatrix.h.

◆ transpose()

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

Definition at line 219 of file SymmMatrix.h.

◆ transposeInplace()

template<class TYPE>
SymmMatrix< TYPE > & RDNumeric::SymmMatrix< TYPE >::transposeInplace ( )
inline

Definition at line 230 of file SymmMatrix.h.

Member Data Documentation

◆ d_data

template<class TYPE>
DATA_SPTR RDNumeric::SymmMatrix< TYPE >::d_data
protected

Definition at line 239 of file SymmMatrix.h.

◆ d_dataSize

template<class TYPE>
unsigned int RDNumeric::SymmMatrix< TYPE >::d_dataSize {0}
protected

Definition at line 238 of file SymmMatrix.h.

◆ d_size

template<class TYPE>
unsigned int RDNumeric::SymmMatrix< TYPE >::d_size {0}
protected

Definition at line 237 of file SymmMatrix.h.


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