11 #ifndef EIGEN_BROWSE_MATRICES_H 12 #define EIGEN_BROWSE_MATRICES_H 41 template <
typename Scalar>
82 std::cerr <<
"Warning loadMarket failed when loading \"" << matrix_file <<
"\"" << std::endl;
92 RealScalar lower_norm =
m_mat.template triangularView<Lower>().norm();
93 RealScalar upper_norm =
m_mat.template triangularView<Upper>().norm();
94 if(lower_norm>diag_norm && upper_norm==diag_norm)
97 MatrixType tmp(
m_mat);
98 m_mat = tmp.template selfadjointView<Lower>();
100 else if(upper_norm>diag_norm && lower_norm==diag_norm)
103 MatrixType tmp(
m_mat);
104 m_mat = tmp.template selfadjointView<Upper>();
118 std::string rhs_file;
150 std::string lhs_file;
175 std::ifstream file_id(file.c_str());
176 if (!file_id.good() )
196 if (
m_curs_id->d_type == DT_DIR)
continue;
202 bool isvector,iscomplex=
false;
204 if(isvector)
continue;
219 m_matname = filename.substr(0, filename.length()-4);
bool loadMarketVector(VectorType &vec, const std::string &filename)
struct dirent * m_curs_id
Matrix< Scalar, Dynamic, 1 > VectorType
bool Fileexists(std::string file)
SparseMatrix< Scalar, ColMajor > MatrixType
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
MatrixMarketIterator & operator++()
bool getMarketHeader(const std::string &filename, int &sym, bool &iscomplex, bool &isvector)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index rows, Index cols)
void Getnextvalidmatrix()
Iterator to browse matrices from a specified folder.
NumTraits< Scalar >::Real RealScalar
MatrixMarketIterator(const std::string &folder)
bool loadMarket(SparseMatrixType &mat, const std::string &filename)
const ConstDiagonalReturnType diagonal() const
Derived & setRandom(Index size)