compbio
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Eigen::MatrixMarketIterator< Scalar > Class Template Reference

Iterator to browse matrices from a specified folder. More...

#include <MatrixMarketIterator.h>

Public Types

typedef Matrix< Scalar, Dynamic, 1 > VectorType
 
typedef SparseMatrix< Scalar, ColMajorMatrixType
 

Public Member Functions

 MatrixMarketIterator (const std::string &folder)
 
MatrixMarketIteratoroperator++ ()
 
 operator bool () const
 
MatrixTypematrix ()
 Return the sparse matrix corresponding to the current file.
 
VectorTyperhs ()
 Return the right hand side corresponding to the current matrix. More...
 
VectorTyperefX ()
 Return a reference solution If it is not provided and if the right hand side is not available then refX is randomly generated such that A*refX = b where A and b are the matrix and the rhs. More...
 
std::string & matname ()
 
int sym ()
 
bool hasRhs ()
 
bool hasrefX ()
 
bool isFolderValid ()
 

Protected Member Functions

bool Fileexists (std::string file)
 
void Getnextvalidmatrix ()
 

Protected Attributes

int m_sym
 
MatrixType m_mat
 
VectorType m_rhs
 
VectorType m_refX
 
std::string m_matname
 
bool m_isvalid
 
bool m_matIsLoaded
 
bool m_hasRhs
 
bool m_hasrefX
 
std::string m_folder
 
DIR * m_folder_id
 
struct dirent * m_curs_id
 

Detailed Description

template<typename Scalar>
class Eigen::MatrixMarketIterator< Scalar >

Iterator to browse matrices from a specified folder.

This is used to load all the matrices from a folder. The matrices should be in Matrix Market format It is assumed that the matrices are named as matname.mtx and matname_SPD.mtx if the matrix is Symmetric and positive definite (or Hermitian) The right hand side vectors are loaded as well, if they exist. They should be named as matname_b.mtx. Note that the right hand side for a SPD matrix is named as matname_SPD_b.mtx

Sometimes a reference solution is available. In this case, it should be named as matname_x.mtx

Sample code

Template Parameters
ScalarThe scalar type

Member Function Documentation

§ refX()

template<typename Scalar>
VectorType& Eigen::MatrixMarketIterator< Scalar >::refX ( )
inline

Return a reference solution If it is not provided and if the right hand side is not available then refX is randomly generated such that A*refX = b where A and b are the matrix and the rhs.

Note that when a rhs is provided, refX is not available

§ rhs()

template<typename Scalar>
VectorType& Eigen::MatrixMarketIterator< Scalar >::rhs ( )
inline

Return the right hand side corresponding to the current matrix.

If the rhs file is not provided, a random rhs is generated


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