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
-
template<typename Scalar >
Return the sparse matrix corresponding to the current file
76 std::cerr <<
"Warning loadMarket failed when loading \"" << matrix_file <<
"\"" << std::endl;
87 if (lower_norm > diag_norm && upper_norm == diag_norm) {
90 m_mat =
tmp.template selfadjointView<Lower>();
91 }
else if (upper_norm > diag_norm && lower_norm == diag_norm) {
94 m_mat =
tmp.template selfadjointView<Upper>();
NumTraits< Scalar >::Real RealScalar
Definition: bench_gemm.cpp:46
MatrixXf MatrixType
Definition: benchmark-blocking-sizes.cpp:52
MatrixType m_mat
Definition: MatrixMarketIterator.h:205
RealScalar norm() const
Definition: SparseDot.h:88
const ConstDiagonalReturnType diagonal() const
Definition: SparseMatrix.h:757
Eigen::Matrix< Scalar, Dynamic, Dynamic, ColMajor > tmp
Definition: level3_impl.h:365
bool loadMarket(SparseMatrixType &mat, const std::string &filename)
Loads a sparse matrix from a matrixmarket format file.
Definition: MarketIO.h:156
References Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::diagonal(), Eigen::loadMarket(), Eigen::MatrixMarketIterator< Scalar >::m_folder, Eigen::MatrixMarketIterator< Scalar >::m_mat, Eigen::MatrixMarketIterator< Scalar >::m_matIsLoaded, Eigen::MatrixMarketIterator< Scalar >::m_matname, Eigen::MatrixMarketIterator< Scalar >::m_sym, Eigen::NonSymmetric, Eigen::SparseMatrixBase< Derived >::norm(), oomph::Global_string_for_annotation::string(), and tmp.
Referenced by Browse_Matrices(), check_sparse_spd_solving(), check_sparse_square_solving(), and Eigen::MatrixMarketIterator< Scalar >::rhs().
template<typename Scalar >
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
VectorType m_refX
Definition: MatrixMarketIterator.h:207
bool Fileexists(std::string file)
Definition: MatrixMarketIterator.h:156
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void resize(Index rows, Index cols)
Definition: PlainObjectBase.h:294
Index cols() const
Definition: SparseMatrix.h:161
bool loadMarketVector(VectorType &vec, const std::string &filename)
Same functionality as loadMarketDense, deprecated.
Definition: MarketIO.h:284
References Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::cols(), Eigen::MatrixMarketIterator< Scalar >::Fileexists(), Eigen::loadMarketVector(), Eigen::MatrixMarketIterator< Scalar >::m_folder, Eigen::MatrixMarketIterator< Scalar >::m_hasrefX, Eigen::MatrixMarketIterator< Scalar >::m_mat, Eigen::MatrixMarketIterator< Scalar >::m_matname, Eigen::MatrixMarketIterator< Scalar >::m_refX, Eigen::PlainObjectBase< Derived >::resize(), and oomph::Global_string_for_annotation::string().
Referenced by Browse_Matrices(), check_sparse_spd_solving(), and check_sparse_square_solving().