7 #include <unsupported/Eigen/SparseExtra> 8 #include <Eigen/SparseLU> 10 #ifdef EIGEN_METIS_SUPPORT 11 #include <Eigen/MetisSupport> 15 using namespace Eigen;
32 std::cout<<
"ORDERING : COLAMD\n";
42 if (argc < 2) assert(
false &&
"please, give the matrix market file ");
44 cout <<
"End charging matrix " << endl;
45 bool iscomplex=
false, isvector=
false;
49 if (isvector) { cout <<
"The provided file is not a matrix file\n";
return -1;}
65 for (
int i = 0;
i <
n;
i++) tmp(
i) =
i;
75 cout <<
"Time to analyze " << timer.
value() << std::endl;
80 cout <<
"Factorize Time " << timer.
value() << std::endl;
85 cout <<
"solve time " << timer.
value() << std::endl;
88 scalar tempNorm = tmp2.norm()/b.norm();
89 cout <<
"Relative norm of the computed solution : " << tempNorm <<
"\n";
90 cout <<
"Number of nonzeros in the factor : " << solver.
nnzL() + solver.
nnzU() << std::endl;
Matrix< Scalar, Dynamic, Dynamic > DenseMatrix
bool loadMarketVector(VectorType &vec, const std::string &filename)
A versatible sparse matrix representation.
const Solve< SparseLU< _MatrixType, _OrderingType >, Rhs > solve(const MatrixBase< Rhs > &b) const
double value(int TIMER=CPU_TIMER) const
Namespace containing all symbols from the Eigen library.
BiCGSTAB< SparseMatrix< double > > solver
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
void factorize(const MatrixType &matrix)
Sparse supernodal LU factorization for general matrices.
bool getMarketHeader(const std::string &filename, int &sym, bool &iscomplex, bool &isvector)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index rows, Index cols)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
ConstSelfAdjointViewReturnType< UpLo >::Type selfadjointView() const
int main(int argc, char **args)
bool loadMarket(SparseMatrixType &mat, const std::string &filename)
void analyzePattern(const MatrixType &matrix)
The matrix class, also used for vectors and row-vectors.
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
mxArray * scalar(mxClassID classid)