{"action":"opened","issue":{"url":"https://api.github.com/repos/yixuan/spectra/issues/27","repository_url":"https://api.github.com/repos/yixuan/spectra","labels_url":"https://api.github.com/repos/yixuan/spectra/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/yixuan/spectra/issues/27/comments","events_url":"https://api.github.com/repos/yixuan/spectra/issues/27/events","html_url":"https://github.com/yixuan/spectra/issues/27","id":236520644,"number":27,"title":"Is there any difference in eigenvalues between direct EIGEN implementation vs Spectra based EIGEN implementation.","user":{"login":"Maharshi-kintada","id":29476605,"avatar_url":"https://avatars3.githubusercontent.com/u/29476605?v=3","gravatar_id":"","url":"https://api.github.com/users/Maharshi-kintada","html_url":"https://github.com/Maharshi-kintada","followers_url":"https://api.github.com/users/Maharshi-kintada/followers","following_url":"https://api.github.com/users/Maharshi-kintada/following{/other_user}","gists_url":"https://api.github.com/users/Maharshi-kintada/gists{/gist_id}","starred_url":"https://api.github.com/users/Maharshi-kintada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Maharshi-kintada/subscriptions","organizations_url":"https://api.github.com/users/Maharshi-kintada/orgs","repos_url":"https://api.github.com/users/Maharshi-kintada/repos","events_url":"https://api.github.com/users/Maharshi-kintada/events{/privacy}","received_events_url":"https://api.github.com/users/Maharshi-kintada/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-16T15:42:40Z","updated_at":"2017-06-16T15:42:40Z","closed_at":null,"body":"Hi,\r\nThanks for the fastest tool for EIGEN implementation, it's so useful for very large matrices. I am working with a FE project which is related to solving eigenvalues of a system.\r\n\r\nI am getting different eigen values with Spectra vs direct EIGEN/MATLAB implementation. For the same matrices check.dat as A and Mcheck.dat as MM, I solved using Spectra and Eigen as follows,\r\nThe both matrices are symmetric and positive definite.\r\n\r\n//-----------------in -----Spectra ----------\r\nMatrixXd A(n,n);\r\n//some file reading code here and memcpy into A and M_lin matrices here.\r\nDenseSymMatProd<double> op(A);\r\nSparseMatrix<double> MM(n,n);\r\nMM.reserve(Eigen::VectorXi::Constant(n, 3));\r\n\r\nSparseCholesky<double> Bop(MM);\r\nint num_eigval_want = 1398;\r\nint converge_speed = 1400;\r\nSymGEigsSolver<double, WHICH_SM, DenseSymMatProd<double>, SparseCholesky<double>, GEIGS_CHOLESKY>geigs(&op, &Bop, num_eigval_want, converge_speed);\r\ngeigs.init();\r\nint nconv = geigs.compute();\r\nVectorXd evalues;\r\nMatrixXd evecs;\r\nif(geigs.info() == SUCCESSFUL){\r\nevalues = geigs.eigenvalues();\r\nevecs = geigs.eigenvectors();}\r\nstd::cout << \"Generalized eigenvalues found:\\n\" << evalues << std::endl;\r\n//std::cout << \"Generalized eigenvectors found:\\n\" << evecs.topRows(num_eigval_want) << std::endl;\r\n\r\n//-----------------in -----Spectra ----------\r\n//file copying code here\r\nGeneralizedEigenSolver<MatrixXd> ges;\r\nges.compute(A, MM);\r\ncout << \"The (complex) generalzied eigenvalues are (alphas./beta): \" << ges.eigenvalues().transpose() << endl;\r\n\r\nCan you please correct me, if I am doing something wrong here. The attached eig.dat is the values obtained by direct EIGEN/MATLAB implementation. Seig.dat is Spectra implementation, which is having different eigenvalues than direct EIGEN/MATLAB. \r\n\r\nThanks in advance."}}
{"actor":{"display_login":"Maharshi-kintada"}}