Operators

LinearOperators.LinearOperatorType

Base type to represent a linear operator. The usual arithmetic operations may be applied to operators to combine or otherwise alter them. They can be combined with other operators, with matrices and with scalars. Operators may be transposed and conjugate-transposed using the usual Julia syntax.

LinearOperators.PreallocatedLinearOperatorType

Type to represent a linear operator with preallocation. Implicit modifications may happen if used without care:

op = PreallocatedLinearOperator(rand(5, 5))
v  = rand(5)
x = op * v        # Uses internal storage and passes pointer to x
y = op * ones(5)  # Overwrites the same memory as x.
y === x           # true. op * v is lost

x = op * v        # Uses internal storage and passes pointer to x
y = op * x        # Silently overwrite x to zeros! Equivalent to mul!(x, A, x).
y == zeros(5)     # true. op * v and op * x are lost
LinearOperators.opOnesFunction
opOnes(T, nrow, ncol)
opOnes(nrow, ncol)

Operator of all ones of size nrow-by-ncol and of data type T (defaults to Float64).

LinearOperators.opZerosFunction
opZeros(T, nrow, ncol)
opZeros(nrow, ncol)

Zero operator of size nrow-by-ncol and of data type T (defaults to Float64).

LinearOperators.opDiagonalFunction
opDiagonal(d)

Diagonal operator with the vector d on its main diagonal.

opDiagonal(nrow, ncol, d)

Rectangular diagonal operator of size nrow-by-ncol with the vector d on its main diagonal.

LinearOperators.opInverseFunction
opInverse(M; symmetric=false, hermitian=false)

Inverse of a matrix as a linear operator using \. Useful for triangular matrices. Note that each application of this operator applies \.

LinearOperators.opCholeskyFunction
opCholesky(M, [check=false])

Inverse of a Hermitian and positive definite matrix as a linear operator using its Cholesky factorization. The factorization is computed only once. The optional check argument will perform cheap hermicity and definiteness checks.

LinearOperators.opLDLFunction
opLDL(M, [check=false])

Inverse of a symmetric matrix as a linear operator using its LDL' factorization if it exists. The factorization is computed only once. The optional check argument will perform a cheap hermicity check.

LinearOperators.opHouseholderFunction
opHouseholder(h)

Apply a Householder transformation defined by the vector h. The result is x -> (I - 2 h h') x.

LinearOperators.opHermitianFunction
opHermitian(d, A)

A symmetric/hermitian operator based on the diagonal d and lower triangle of A.

opHermitian(A)

A symmetric/hermitian operator based on a matrix.

LinearOperators.opRestrictionFunction
Z = opRestriction(I, ncol)
Z = opRestriction(:, ncol)

Creates a LinearOperator restricting a ncol-sized vector to indices I. The operation Z * v is equivalent to v[I]. I can be :.

Z = opRestriction(k, ncol)

Alias for opRestriction([k], ncol).

LinearOperators.opExtensionFunction
Z = opExtension(I, ncol)
Z = opExtension(:, ncol)

Creates a LinearOperator extending a vector of size length(I) to size ncol, where the position of the elements on the new vector are given by the indices I. The operation w = Z * v is equivalent to w = zeros(ncol); w[I] = v.

Z = opExtension(k, ncol)

Alias for opExtension([k], ncol).

LinearOperators.InverseLBFGSOperatorFunction
InverseLBFGSOperator(T, n, [mem=5; scaling=true])
InverseLBFGSOperator(n, [mem=5; scaling=true])

Construct a limited-memory BFGS approximation in inverse form. If the type T is omitted, then Float64 is used.

Base.kronFunction

kron(A, B)

Kronecker tensor product of A and B in linear operator form, if either or both are linear operators. If both A and B are matrices, then Base.kron is used.

Utility functions

LinearAlgebra.diagFunction
diag(op)

Extract the diagonal of a L-BFGS operator in forward mode.

diag(op)

Extract the diagonal of a L-SR1 operator in forward mode.

Base.MatrixType
A = Matrix(op)

Materialize an operator as a dense array using op.ncol products.

Base.push!Function
push!(op, s, y)
push!(op, s, y, α, g)

Push a new {s,y} pair into a L-BFGS operator. The second calling sequence is used in inverse LBFGS updating in conjunction with damping, where α is the most recent steplength and g the gradient used when solving d=-Hg. In forward updating with damping, it is not necessary to supply α and g.

push!(op, s, y)

Push a new {s,y} pair into a L-SR1 operator.

LinearOperators.reset!Function

reset!(op)

Reset the product counters of a linear operator.

reset!(data)

Resets the given LBFGS data.

reset!(op)

Resets the LBFGS data of the given operator.

reset!(data)

Reset the given LSR1 data.

reset!(op)

Resets the LSR1 data of the given operator.

Base.showFunction
show(io, op)

Display basic information about a linear operator.

show(io, op)

Display basic information about a linear operator.

Base.sizeFunction
m, n = size(op)

Return the size of a linear operator as a tuple.

m = size(op, d)

Return the size of a linear operator along dimension d.

Internal