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

SelectionRule template parameter #61

Closed
wo80 opened this issue Feb 27, 2019 · 2 comments
Closed

SelectionRule template parameter #61

wo80 opened this issue Feb 27, 2019 · 2 comments

Comments

@wo80
Copy link

wo80 commented Feb 27, 2019

I was wondering why the selection rule was chosen to be a template parameter instead of a constructor argument (or function argument to init() or compute())?

I'm trying to write a C API around Spectra and this makes it hard to create the eigensolver. The solution (or hack) used in RSpectra (i.e. generating all code in a switch statement using macros) is rather inflexible and could be avoided if only SelectionRule wasn't a template parameter.

@yixuan
Copy link
Owner

yixuan commented Feb 28, 2019

Yeah, viewed from today, the original design may be questionable.

I recall that when I wrote this library, I was standing at the user's point of view. Typically when you want to compute eigenvalues, you already have a well-defined problem. You know you need the largest, or the smallest ones.

But I agree that writing a wrapper is an issue. I believe moving the selection rule to compute() is doable, but that will break existing code. Probably I can create a dynamic version parallel to the current one, after the whole library is stable enough.

@yixuan
Copy link
Owner

yixuan commented Jun 4, 2020

This has been fixed in the 1.y.z branch, which is meant to be the next major version.

@yixuan yixuan closed this as completed Jun 4, 2020
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

2 participants