You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to write a custom KKT backend and solver for Tulip that could exploit the known structure of a certain class of problems. The problem details etc. are not particularly relevant, but I would like to write a module like:
module MyKKT
using Tulip
struct Backend <:AbstractKKTBackend# custom backend class to pass to Tulip parametersendmutable struct Solver{Tv<:Number,Ti<:Integer} <:AbstractKKTSolver{Tv}# custom solver class that knows the problem structure# problem specific dataendbackend(::Solver) ="CustomBackend"linear_system(::Solver) ="Normal equations (K1)"functionsetup(A::AbstractSparseMatrix{Tv,Ti}, ::K1, ::Backend) where {Tv<:Number,Ti<:Integer}
# setup workendfunctionupdate!(kkt::Solver{Tv,Ti}, θ::AbstractVector{Tv}, regP::AbstractVector{Tv}, regD::AbstractVector{Tv}) where {Tv<:Number,Ti<:Integer}
# update workendfunctionsolve!(dx::AbstractVector{Tv}, dy::AbstractVector{Tv}, kkt::Solver{Tv,Ti}, ξp::AbstractVector{Tv}, ξd::AbstractVector{Tv}) where {Tv<:Number,Ti<:Integer}
# solve workendend
The problem is that the rest of the Tulip framework heavily relies on the KKT module and its specific functions, e.g. this setup call.
I don't understand if it's possible to define a setup() function (as shown above) completely outside Tulip, and still be able to reuse the rest of the Tulip (i.e. I don't have to work on a fork). I couldn't find any example if that's possible to do so. If not right now, how difficult it could be to make the KKT module extendable (I'm happy to make an attempt if the maintainers are open to it)?
The text was updated successfully, but these errors were encountered:
function Tulip.KKT.setup(A::AbstractSparseMatrix{Tv,Ti}, ::K1, ::Backend) where {Tv<:Number,Ti<:Integer}
# setup workend
and so on, and that would be enough to extend those functions from KKT module. Didn't know I could do that in Julia before. Closing the issue, since it's a non-issue after all.
Hi,
I am trying to write a custom KKT backend and solver for Tulip that could exploit the known structure of a certain class of problems. The problem details etc. are not particularly relevant, but I would like to write a module like:
The problem is that the rest of the Tulip framework heavily relies on the
KKT
module and its specific functions, e.g. this setup call.I don't understand if it's possible to define a
setup()
function (as shown above) completely outside Tulip, and still be able to reuse the rest of the Tulip (i.e. I don't have to work on a fork). I couldn't find any example if that's possible to do so. If not right now, how difficult it could be to make the KKT module extendable (I'm happy to make an attempt if the maintainers are open to it)?The text was updated successfully, but these errors were encountered: