Create a block-native linear operator.
Arguments
- dim
Integer vector of length two giving row and column dimensions.
- apply
Function implementing block multiplication by the operator.
- apply_adjoint
Optional function implementing block multiplication by the adjoint operator.
- dtype
Scalar character type label, currently
"double"or"complex".- structure
Eigencore structure descriptor such as
general()orhermitian().- name
Optional operator label used in plans and diagnostics.
- metadata
Optional list of implementation metadata. Certificates read two optional entries, trusted as given:
two_norm, the exact spectral norm||A||_2(makes the certificate scale exact), andfrobenius_norm, whose||A||_F / sqrt(min(dim))gives a structural lower bound on||A||_2. Without them certificates use lower bounds from the computed vectors.- operator_id
Optional non-empty character identity for a logical callback-operator lineage. Supply together with
revision.- revision
Optional non-empty character revision for the values and behavior implemented by the callback. Supply together with
operator_id.- portable
Whether an explicitly identified callback operator may be restored and validated in another R session. Built-in matrix-backed operators derive portable deterministic identity automatically.
Value
An eigencore_operator list containing dimensions, apply callbacks,
scalar type, structure metadata, a display name, and implementation
metadata.
Examples
A <- diag(c(3, 2, 1))
op <- linear_operator(
dim = dim(A),
apply = function(X, alpha = 1, beta = 0, Y = NULL) {
Z <- alpha * (A %*% X)
if (is.null(Y) || beta == 0) Z else Z + beta * Y
},
structure = hermitian(),
metadata = list(frobenius_norm = sqrt(sum(A^2)))
)
fit <- eig_partial(op, k = 1, target = largest())
values(fit)
#> [1] 3