MDA
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups
Public Member Functions | List of all members
MDAT::CRS_Mat< DataType > Class Template Reference

A class to store the Pfam domain matches in a compact way. More...

#include <CRS_Mat.hpp>

Public Member Functions

 CRS_Mat ()
 Standard Constructor.
 
 CRS_Mat (const std::string &mat_f)
 Constructor which immediately reads the file. More...
 
 ~CRS_Mat ()
 Destructor.
 
std::string name ()
 Returns the identifier of the Matrix. More...
 
void read (const std::string &mat_f)
 Reads a CRS matrix from a binary file. More...
 
DataType value (int i, int j) const
 Returns the values stored in the matrix. More...
 

Detailed Description

template<typename DataType>
class MDAT::CRS_Mat< DataType >

A class to store the Pfam domain matches in a compact way.

The domain matrix is symmetric so that only half of the entries are actually stored. The matrix can be read from a binary file of the following format:

ID var name    length     type     variable_name
0  name        10         char     name
1  n_domains   1          int      n_domains
2  n_values    1          int      n_values
3  ids         n_domains  int      The domain identifier as int (eg PF00005 = 5)
4  row_ids     n_domains  int      The row ids
5  col_ids     n_values   int      The column ids
6  values      n_values   DataType The actual values stored in the matrix

Constructor & Destructor Documentation

template<typename DataType >
MDAT::CRS_Mat< DataType >::CRS_Mat ( const std::string &  mat_f)

Constructor which immediately reads the file.

Parameters
mat_f

Member Function Documentation

template<typename DataType >
std::string MDAT::CRS_Mat< DataType >::name ( )
inline

Returns the identifier of the Matrix.

Returns
template<typename DataType >
void MDAT::CRS_Mat< DataType >::read ( const std::string &  mat_f)

Reads a CRS matrix from a binary file.

Parameters
mat_fThe file to read.
template<typename DataType >
DataType MDAT::CRS_Mat< DataType >::value ( int  i,
int  j 
) const

Returns the values stored in the matrix.

Parameters
iThe row id
jThe column id
Returns
The value stored in the matrix.