Go to the documentation of this file.
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;}
53 A = temp.selfadjointView<
Lower>();
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;
Namespace containing all symbols from the Eigen library.
A versatible sparse matrix representation.
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
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index rows, Index cols)
BiCGSTAB< SparseMatrix< double > > solver
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
bool loadMarketVector(VectorType &vec, const std::string &filename)
double value(int TIMER=CPU_TIMER) const
mxArray * scalar(mxClassID classid)
Matrix< Scalar, Dynamic, Dynamic > DenseMatrix
bool getMarketHeader(const std::string &filename, int &sym, bool &iscomplex, bool &isvector)
int main(int argc, char **args)
The matrix class, also used for vectors and row-vectors.
Sparse supernodal LU factorization for general matrices.
bool loadMarket(SparseMatrixType &mat, const std::string &filename)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:39:31