Skip to content
Snippets Groups Projects
Commit 8a0fba38 authored by Marco Agnese's avatar Marco Agnese Committed by Christoph Grüninger
Browse files

[suitesparse] Activate SPQR test

parent 94acdc9c
No related branches found
No related tags found
1 merge request!8Feature/fs1519 suitesparse ldl spqr
#include "config.h"
#define HAVE_SPQR 1
#include <complex>
#include<iostream>
......@@ -16,7 +13,6 @@
#include "laplacian.hh"
int main(int argc, char** argv)
{
try
......@@ -53,23 +49,26 @@ int main(int argc, char** argv)
Dune::InverseOperatorResult res;
//Dune::SPQR<BCRSMat> solver1;
Dune::SPQR<BCRSMat> solver1;
//std::set<std::size_t> mrs;
//for(std::size_t s=0; s < N/2; ++s)
//mrs.insert(s);
std::set<std::size_t> mrs;
for(std::size_t s=0; s < N/2; ++s)
mrs.insert(s);
//solver1.setSubMatrix(mat,mrs);
//solver1.setVerbosity(true);
solver1.setSubMatrix(mat,mrs);
solver1.setVerbosity(true);
solver.apply(x,b, res);
solver.apply(x,b,res);
solver.free();
//solver1.apply(x,b, res);
//solver1.apply(reinterpret_cast<FIELD_TYPE*>(&x[0]), reinterpret_cast<FIELD_TYPE*>(&b[0]));
Vector residuum(N*N);
residuum=0;
fop.apply(x,residuum);
residuum-=b;
std::cout<<"Residuum : "<<residuum.two_norm()<<std::endl;
solver1.apply(x,b,res);
//Dune::UMFPack<BCRSMat> save_solver(mat,"umfpack_decomp",0);
//Dune::UMFPack<BCRSMat> load_solver(mat,"umfpack_decomp",0);
return 0;
}
catch(Dune::Exception &e)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment