RDKit
Open-source cheminformatics and machine learning.
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
template<class TYPE>
RDNumeric::SymmMatrix< TYPE >::SymmMatrix ( unsigned int  N,
TYPE  val 
)
inline
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
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
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
template<class TYPE>
TYPE RDNumeric::SymmMatrix< TYPE >::getVal ( unsigned int  i,
unsigned int  j 
) const
inline
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>
SymmMatrix<TYPE>& RDNumeric::SymmMatrix< TYPE >::operator*= ( TYPE  scale)
inline
template<class TYPE>
SymmMatrix<TYPE>& RDNumeric::SymmMatrix< TYPE >::operator/= ( TYPE  scale)
inline
template<class TYPE>
void RDNumeric::SymmMatrix< TYPE >::setToIdentity ( )
inline
template<class TYPE>
void RDNumeric::SymmMatrix< TYPE >::setVal ( unsigned int  i,
unsigned int  j,
TYPE  val 
)
inline
template<class TYPE>
SymmMatrix<TYPE>& RDNumeric::SymmMatrix< TYPE >::transposeInplace ( )
inline

Definition at line 229 of file SymmMatrix.h.

Member Data Documentation


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