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
Copy file name to clipboardExpand all lines: src/func.jl
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -111,6 +111,7 @@ uniform across `op`, `op_adjoint`, `op_inverse`, `op_adjoint_inverse`.
111
111
* `has_mul5` - `true` if the operator provides a five-argument `mul!` via the signature `op(v, u, p, t, α, β; <accepted_kwargs>)`. This trait is inferred if no value is provided.
112
112
* `isconstant` - `true` if the operator is constant, and doesn't need to be updated via `update_coefficients[!]` during operator evaluation.
113
113
* `islinear` - `true` if the operator is linear. Defaults to `false`.
114
+
* `isconvertible` - `true` a cheap `convert(AbstractMatrix, L.op)` method is available. Defaults to `false`.
114
115
* `batch` - Boolean indicating if the input/output arrays comprise of batched column-vectors stacked in a matrix. If `true`, the input/output arrays must be `AbstractVecOrMat`s, and the length of the second dimension (the batch dimension) must be the same. The batch dimension is not involved in size computation. For example, with `batch = true`, and `size(output), size(input) = (M, K), (N, K)`, the `FunctionOperator` size is set to `(M, N)`. If `batch = false`, which is the default, the `input`/`output` arrays may of any size so long as `ndims(input) == ndims(output)`, and the `size` of `FunctionOperator` is set to `(length(input), length(output))`.
115
116
* `ifcache` - Allocate cache arrays in constructor. Defaults to `true`. Cache can be generated afterwards by calling `cache_operator(L, input, output)`
116
117
* `cache` - Pregenerated cache arrays for in-place evaluations. Expected to be of type and shape `(similar(input), similar(output),)`. The constructor generates cache if no values are provided. Cache generation by the constructor can be disabled by setting the kwarg `ifcache = false`.
@@ -138,6 +139,7 @@ function FunctionOperator(op,
138
139
has_mul5::Union{Nothing,Bool}=nothing,
139
140
isconstant::Bool=false,
140
141
islinear::Bool=false,
142
+
isconvertible::Bool=false,
141
143
142
144
batch::Bool=false,
143
145
ifcache::Bool=true,
@@ -248,6 +250,7 @@ function FunctionOperator(op,
248
250
249
251
traits = (;
250
252
islinear = islinear,
253
+
isconvertible = isconvertible,
251
254
isconstant = isconstant,
252
255
253
256
opnorm = opnorm,
@@ -480,6 +483,8 @@ function Base.inv(L::FunctionOperator)
0 commit comments