JuliaSmoothOptimizers / JuliaSmoothOptimizers/JSOSolvers.jl
Replace `V(undef, nvar)` by `similar(nlp.meta.x0)` in `TrunkSolver`?
- Dominant language
- Julia
- Stars
- 78
- Forks
- 18
- Avg merge
- 1h 30m
- Merged PRs (30d)
- 1
Description
Hey guys (@dpo @tmigot), I was wondering why the `AbstractVector` required by `TrunkSolver` are defined with `V(undef, nvar)` and not with `similar(nlp.meta.x0)`?
https://github.com/JuliaSmoothOptimizers/JSOSolvers.jl/blob/15550bdd2282c7fb1d7a5fcd78078ac271385b57/src/trunk.jl#L84
I'm currently working on PartitionedStructures.jl and PartiallySeparableNLPModels.jl to make solvers (starting with trunk) exploit fully the partially separable structure.
I'm defining `PartitionedVector<:AbstractVector` in PartitionedStructure.jl, and my plan is to set `nlp.meta.x0` as a partitioned vector.
This way, any object similar to `x0` keeps the same partitioned structure.
In addition, I will overload all operations required by `trunk()` (and `cg()`) on `PartitionedVector`s.
Defining vectors with `V(undef, nvar)` prevents any use of the partitioned structure.
Contributor guide
Assessment
This issue has not been assessed yet.