JuliaSmoothOptimizers / JuliaSmoothOptimizers/LinearOperators.jl

Clarification of required fields for custom operators

Open
#412 1 comment 1 reaction 1 assignee Claimed by @amontoison View on GitHub
Dominant language
Julia
Stars
209
Forks
46
Avg merge
6h 50m
Merged PRs (30d)
1

Description

Hello, we have a few packages with custom operators based on LinearOperators.jl and with the recent 2.13 update and the included internal LinearOperator field changes from #406 our operators became incompatible (see [here](https://github.com/MagneticResonanceImaging/MRIReco.jl/issues/272) and related issues).

Such custom operators might be outside the scope of the package, but if not, I think it would be helpful to document the property or methods a custom operator needs to implement in order to be compatible with the package and to consider those part of the public interface.

As an example, [if we consider this function](https://github.com/JuliaSmoothOptimizers/LinearOperators.jl/blob/5ecfcc6ff08473b878c4bae423fdeccc173bbd7e/src/operations.jl#L6):

```julia
function allocate_vectors_args3!(op::AbstractLinearOperator)
S = storage_type(op)
op.Mv = S(undef, op.nrow)
op.Mtu = (op.nrow == op.ncol) ? op.Mv : S(undef, op.ncol)
return op
end
```
LinearOperators.jl dispatches on `AbstractLinearOperator` and if we inherit from that we need to have ncol, Mv and so on. And in particular, previous versions had Mv5.

If custom operators are within the package's intended scope, maybe we could add a small section to either the readme or the docs which describes the necessary fields and methods a custom operator needs to implement

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.