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

Allow for non-default SparseMatrix template #17

Merged
merged 1 commit into from
Jan 18, 2017
Merged

Conversation

ryanlevy
Copy link
Contributor

Currently the only Eigen::SparseMatrix available to Spectra is the default SparseMatrix<Scalar>=SparseMatrix<Scalar,Eigen::ColMajor,int>, and when passed something else (ex: SparseMatrix<Scalar,ColMajor,long>), a runtime error occurs with a rather cryptic EXEC_BAD_ACCESS.
This commit allows for something like

Eigen::SparseMatrix<double,Eigen::ColMajor,long> m;
SparseGenMatProd<double,Eigen::ColMajor,long> op(m);
GenEigsSolver< double, LARGEST_MAGN, SparseGenMatProd<double,Eigen::ColMajor,long> > eigs(&op, 3, 6);

@yixuan
Copy link
Owner

yixuan commented Jan 18, 2017

Looks great! I'll take a look tomorrow and let me merge it first. Thank you!

@yixuan yixuan merged commit 38c195c into yixuan:master Jan 18, 2017
@yixuan
Copy link
Owner

yixuan commented Jan 18, 2017

One more thought: If we restrict to use Eigen 3.3, this issue can be solved nicely by the Map or Ref class, see #16 .

yixuan pushed a commit that referenced this pull request Jan 10, 2021
Some recent upstream changes
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

Successfully merging this pull request may close these issues.

2 participants