1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- #ifndef EigenproblemINCLUDE
- #define EigenproblemINCLUDE
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- #include <vector>
- #include <string.h>
- 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<element> 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<element> mat, int mat_size, std::vector<double> &evals,
- std::vector< std::vector<double> > &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
|