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

convert function for solvers #585

Closed
geoffroyleconte opened this issue May 27, 2022 · 2 comments
Closed

convert function for solvers #585

geoffroyleconte opened this issue May 27, 2022 · 2 comments

Comments

@geoffroyleconte
Copy link
Member

It could be practical to have something like:

convert(::Type{KrylovSolver{T, FC}}, solver::MinresSolver) where {T, FC} = MinresSolver(...)

to convert a solver from Float32 to Float64 for example. However I'm not sure what should be the way to implement this. Should the user provide FC or could it be inferred from T ?

@amontoison
Copy link
Member

amontoison commented May 29, 2022

The user should provide S (Vector{ComplexF32}, CuVector{Float64}, ...)
T and FC are determined from S.

Is it not easier to just build a new solver with the constructor XyzSolver(n, m, S) ?
I can also add n and m attributes in the solver such that

convert(::Type{MinresSolver{T, FC, S}}, solver::MinresSolver) where {T, FC, S} = MinresSolver(solver.n, solver.m, S)

but It's a more complex way to do the same thing.

@geoffroyleconte
Copy link
Member Author

Yes, but that was in case we would want to keep the current solution for using warm start later for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants