Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eigen value and generalized eigen value of a Super Big Size Real Matrix(160000*160000) , Help! #163

Open
Shelton-hub opened this issue Aug 16, 2023 · 0 comments

Comments

@Shelton-hub
Copy link

Hello, I need to get the most 1 smallest algrebraic eigen value of a big size symmetric matrix G with a level about 160000*160000 to see if G is positive definite . I try the solver SymEigsSolver but the result shows me failed. Here is the code fragment.

SparseGenMatProd<double> op(G);
// Construct eigen solver object, requesting the largest three eigenvalues
SymEigsSolver<SparseGenMatProd<double>> eigs(op, 4, 6);
// Initialize and compute
eigs.init();
int nconv = eigs.compute(SortRule::SmallestAlge);

And If G is positve definete , I have another symmetric matrix C (but may be singular ) with the same size as G, I need to solve the largest k algebraic generalized eigen value $\lambda$ for the problem $Cx = \lambda Gx$. Without validtation the property of G , I have try to use SymGEigsSolver (Cholesky mode and RegularInverse), SymGEigsShiftSolver, but all failed or too long to be waited. Here are the code fragments, I wanna if there are something wrong. Since the size of the matrix is too large, I really want to konw how to improve the calculation speed, thanks for answering!

string path = "../data/matrix1/CSC_C.txt";
Eigen::SparseMatrix<double> C = readfrom_csc(path);
path = "../data/matrix1/CSC_G.txt";
Eigen::SparseMatrix<double> G = readfrom_csc(path);

//Cholesky mode
SparseSymMatProd<double> op(C);
SparseCholesky<double>  Bop(G);
SymGEigsSolver<SparseSymMatProd<double>, SparseCholesky<double>, GEigsMode::Cholesky> geigs(op, Bop, 3, 6);
geigs.init();
int nconv = geigs.compute(SortRule::LargestAlge); 

//RegularInverse mode
SparseSymMatProd<double> op(C);
SparseRegularInverse<double> Bop(G);
SymGEigsSolver<SparseSymMatProd<double>, SparseRegularInverse<double>, GEigsMode::RegularInverse> geigs(op, Bop, 3, 6);
geigs.init();
int nconv = geigs.compute(SortRule::LargestAlge);


//SymGEigsShiftSolver
using OpType = SymShiftInvert<double, Eigen::Sparse, Eigen::Sparse>;
using BOpType = SparseSymMatProd<double>;
OpType op(C, G);
BOpType Bop(G);
SymGEigsShiftSolver<OpType, BOpType, GEigsMode::ShiftInvert> geigs(op, Bop, 3, 6, 1.0);
geigs.init();
int nconv = geigs.compute(SortRule::LargestMagn);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant