Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | 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 SparseMatrix< Scalar, ColMajorMatrixType
 
typedef Matrix< Scalar, Dynamic, 1 > VectorType
 

Public Member Functions

bool hasrefX ()
 
bool hasRhs ()
 
bool isFolderValid ()
 
std::string & matname ()
 
MatrixTypematrix ()
 
 MatrixMarketIterator (const std::string &folder)
 
 operator bool () const
 
MatrixMarketIteratoroperator++ ()
 
VectorTyperefX ()
 
VectorTyperhs ()
 
int sym ()
 
 ~MatrixMarketIterator ()
 

Protected Member Functions

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

Protected Attributes

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

Private Types

typedef NumTraits< Scalar >::Real RealScalar
 

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

Definition at line 42 of file MatrixMarketIterator.h.

Member Typedef Documentation

◆ MatrixType

template<typename Scalar >
typedef SparseMatrix<Scalar,ColMajor> Eigen::MatrixMarketIterator< Scalar >::MatrixType

Definition at line 47 of file MatrixMarketIterator.h.

◆ RealScalar

template<typename Scalar >
typedef NumTraits<Scalar>::Real Eigen::MatrixMarketIterator< Scalar >::RealScalar
private

Definition at line 44 of file MatrixMarketIterator.h.

◆ VectorType

template<typename Scalar >
typedef Matrix<Scalar,Dynamic,1> Eigen::MatrixMarketIterator< Scalar >::VectorType

Definition at line 46 of file MatrixMarketIterator.h.

Constructor & Destructor Documentation

◆ MatrixMarketIterator()

template<typename Scalar >
Eigen::MatrixMarketIterator< Scalar >::MatrixMarketIterator ( const std::string &  folder)
inline

Definition at line 50 of file MatrixMarketIterator.h.

◆ ~MatrixMarketIterator()

template<typename Scalar >
Eigen::MatrixMarketIterator< Scalar >::~MatrixMarketIterator ( )
inline

Definition at line 58 of file MatrixMarketIterator.h.

Member Function Documentation

◆ Fileexists()

template<typename Scalar >
bool Eigen::MatrixMarketIterator< Scalar >::Fileexists ( std::string  file)
inlineprotected

Definition at line 173 of file MatrixMarketIterator.h.

◆ Getnextvalidmatrix()

template<typename Scalar >
void Eigen::MatrixMarketIterator< Scalar >::Getnextvalidmatrix ( )
inlineprotected

Definition at line 187 of file MatrixMarketIterator.h.

◆ hasrefX()

template<typename Scalar >
bool Eigen::MatrixMarketIterator< Scalar >::hasrefX ( )
inline

Definition at line 168 of file MatrixMarketIterator.h.

◆ hasRhs()

template<typename Scalar >
bool Eigen::MatrixMarketIterator< Scalar >::hasRhs ( )
inline

Definition at line 167 of file MatrixMarketIterator.h.

◆ isFolderValid()

template<typename Scalar >
bool Eigen::MatrixMarketIterator< Scalar >::isFolderValid ( )
inline

Definition at line 169 of file MatrixMarketIterator.h.

◆ matname()

template<typename Scalar >
std::string& Eigen::MatrixMarketIterator< Scalar >::matname ( )
inline

Definition at line 163 of file MatrixMarketIterator.h.

◆ matrix()

template<typename Scalar >
MatrixType& Eigen::MatrixMarketIterator< Scalar >::matrix ( )
inline

Return the sparse matrix corresponding to the current file

Definition at line 74 of file MatrixMarketIterator.h.

◆ operator bool()

template<typename Scalar >
Eigen::MatrixMarketIterator< Scalar >::operator bool ( ) const
inline

Definition at line 71 of file MatrixMarketIterator.h.

◆ operator++()

template<typename Scalar >
MatrixMarketIterator& Eigen::MatrixMarketIterator< Scalar >::operator++ ( )
inline

Definition at line 63 of file MatrixMarketIterator.h.

◆ 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

Definition at line 145 of file MatrixMarketIterator.h.

◆ 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

Definition at line 113 of file MatrixMarketIterator.h.

◆ sym()

template<typename Scalar >
int Eigen::MatrixMarketIterator< Scalar >::sym ( )
inline

Definition at line 165 of file MatrixMarketIterator.h.

Member Data Documentation

◆ m_curs_id

template<typename Scalar >
struct dirent* Eigen::MatrixMarketIterator< Scalar >::m_curs_id
protected

Definition at line 241 of file MatrixMarketIterator.h.

◆ m_folder

template<typename Scalar >
std::string Eigen::MatrixMarketIterator< Scalar >::m_folder
protected

Definition at line 239 of file MatrixMarketIterator.h.

◆ m_folder_id

template<typename Scalar >
DIR* Eigen::MatrixMarketIterator< Scalar >::m_folder_id
protected

Definition at line 240 of file MatrixMarketIterator.h.

◆ m_hasrefX

template<typename Scalar >
bool Eigen::MatrixMarketIterator< Scalar >::m_hasrefX
protected

Definition at line 238 of file MatrixMarketIterator.h.

◆ m_hasRhs

template<typename Scalar >
bool Eigen::MatrixMarketIterator< Scalar >::m_hasRhs
protected

Definition at line 237 of file MatrixMarketIterator.h.

◆ m_isvalid

template<typename Scalar >
bool Eigen::MatrixMarketIterator< Scalar >::m_isvalid
protected

Definition at line 235 of file MatrixMarketIterator.h.

◆ m_mat

template<typename Scalar >
MatrixType Eigen::MatrixMarketIterator< Scalar >::m_mat
protected

Definition at line 231 of file MatrixMarketIterator.h.

◆ m_matIsLoaded

template<typename Scalar >
bool Eigen::MatrixMarketIterator< Scalar >::m_matIsLoaded
protected

Definition at line 236 of file MatrixMarketIterator.h.

◆ m_matname

template<typename Scalar >
std::string Eigen::MatrixMarketIterator< Scalar >::m_matname
protected

Definition at line 234 of file MatrixMarketIterator.h.

◆ m_refX

template<typename Scalar >
VectorType Eigen::MatrixMarketIterator< Scalar >::m_refX
protected

Definition at line 233 of file MatrixMarketIterator.h.

◆ m_rhs

template<typename Scalar >
VectorType Eigen::MatrixMarketIterator< Scalar >::m_rhs
protected

Definition at line 232 of file MatrixMarketIterator.h.

◆ m_sym

template<typename Scalar >
int Eigen::MatrixMarketIterator< Scalar >::m_sym
protected

Definition at line 230 of file MatrixMarketIterator.h.


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


gtsam
Author(s):
autogenerated on Thu Dec 19 2024 04:10:05