#ifndef EigenproblemINCLUDE #define EigenproblemINCLUDE #include #include #include #include #include typedef struct{ uint x; uint y; double val; } element; namespace OBJREC { /** depreceated version: Real Symmetric Eigenproblem - no parallel mode the eigenpairs returned by the method solve are ordered increasingly */ class Eigenproblem{ private: public: ///performs matrix-vector multiplication with sparse matrix this->mat void sparseMult(double* xin, double* yout, int ldy); std::vector mat; Eigenproblem(){}; ~Eigenproblem(){}; /** Solves the user defined eigenproblem with the following parameters: mat - Sparse matrix mat_size - matrix size, i.e. dim(mat)=mat_size x mat_size evals - std::vector of eigenvalues evecs - std::vector of k eigenvectors k - number of eigenvalues/eigenvectors to compute magnitude - Specifies the nature of the eigenproblem: find eigenpair with respect to the k largest (magnitude>0) or smallest (magnitude<0) eigenvalues restarting_... - restarting scheme of TRLAN max_mult - maximum number of matrix-vector multiplications to perform tolerance - stop criterion (abs. resudual |A*x-lambda*x|?) mult_flops - number of flops per matrix multiplication (used for statistics calculation) */ void solve( std::vector mat, int mat_size, std::vector &evals, std::vector< std::vector > &evecs, int k=1, int magnitude=1, int restarting_scheme=1,double tolerance=1e-8, int max_mult=-1, int mult_flops=-1); }; } // namespace #endif