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

generic solve interface #38

Closed
3 tasks done
lucaferranti opened this issue Jun 30, 2021 · 1 comment
Closed
3 tasks done

generic solve interface #38

lucaferranti opened this issue Jun 30, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@lucaferranti
Copy link
Member

lucaferranti commented Jun 30, 2021

Now that we have different preconditioning mechanisms and solvers, it's time to polish the generic solve interface

  • Extend CommonSolve.jl #42
  • At the moment the solution using Oettli-Präger has its stand alone solver oettli I guess that should also be a solver like the others #41
  • implement generic interface with different methods that decide the preconditioning based on the matrix type and the algorithms, e.g. #42
function _default_precondition(A, method::AbstractSolver)
    # ....
end

# specific default preconditioning methods
function _default_precondition(A, method::GaussElimination)
    if is_sdd_matrix || is_M_matrix 
        return NoPrecondition()
    else
        return InverseMidpoint()
    end
end

function _default_solver()
    GaussEliminiation()
end

function solve(A, b,
               solver::AbstractSolver=_default_solver(),
               precondition::AbstractPrecondition=_default_precondition(A, method))
   
    # precondition
    Ap, bp = precondition(A, b)

    # compute solution
    return solver(Ap, bp)
end
@lucaferranti lucaferranti added the enhancement New feature or request label Jun 30, 2021
@lucaferranti
Copy link
Member Author

fixed in the above linked PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant