int main(int argc, char **args)
{
SparseMatrix<double, ColMajor> A; typedef SparseMatrix<double, ColMajor>::Index Index; typedef Matrix<double, Dynamic, Dynamic> DenseMatrix; typedef Matrix<double, Dynamic, 1> DenseRhs;
VectorXd b, x, tmp;
BenchTimer timer,totaltime; //SparseLU<SparseMatrix<double, ColMajor> > solver; // SuperLU<SparseMatrix<double, ColMajor> > solver;
ConjugateGradient<SparseMatrix<double, ColMajor>, Lower,IncompleteCholesky<double,Lower> > solver;
ifstream matrix_file;
string line; int n; // Set parameters // solver.iparm(IPARM_THREAD_NBR) = 4; /* Fill the matrix with sparse matrix stored in Matrix-Market coordinate column-oriented format */ if (argc < 2) assert(false && "please, give the matrix market file ");
timer.start();
totaltime.start();
loadMarket(A, args[1]);
cout << "End charging matrix " << endl; bool iscomplex=false, isvector=false; int sym;
getMarketHeader(args[1], sym, iscomplex, isvector); if (iscomplex) { cout<< " Not for complex matrices \n"; return -1; } if (isvector) { cout << "The provided file is not a matrix file\n"; return -1;} if (sym != 0) { // symmetric matrices, only the lower part is stored
SparseMatrix<double, ColMajor> temp;
temp = A;
A = temp.selfadjointView<Lower>();
}
timer.stop();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.