Category : arpack

To find the 10 smallest eigenvalue of a sparse matrix ‘A’, the minimal code below works well: g++ -std=c++17 -o test_sparse.o -c test_sparse.cpp g++ -std=c++17 -o myapp test_sparse.o -larmadillo -larpack #include <armadillo> #include <iostream> int main(){ arma::SpMat<double> A = arma::sprandu(100,100,0.1) ; A = A.t()*A ; arma::dvec e = arma::eigs_sym(A,10,"sm") ; std::cout << e ; return ..

Read more