Reference

Base.:*Method
:*(F, m)

Constructs F*m where F is a Jets linear (e.g. JopLn) or nonlinear (JopNl) operator.

source
Base.:+Method
:+(A₂, A₁)

Construct and return the linear combination of the two Jets operators A₁::Jop and A₂::Jop. Note that A₁ and A₂ must have consistent (same size and type) domains and ranges.

Example

A = 1.0*A₁ - 2.0*A₂ + 3.0*A₃
source
Base.:-Method
:-(A₂, A₁)

Construct and return the linear combination of the two Jets operators A₁::Jop and A₂::Jop. Note that A₁ and A₂ must have consistent (same size and type) domains and ranges.

Example

A = 1.0*A₁ - 2.0*A₂ + 3.0*A₃
source
Base.:∘Method
:∘(A₂, A₁)

Construct the composition of the two Jets operators. Note that when applying the composition operator, operators are applied in order from right to left: first A₁ and then A₂.

Example

using Jets
dg!(d,m;mₒ) = @. d = 2*m
A₁ = JopLn(Jet(;dom=JetSpace(Float64,2), rng=JetSpace(Float64,2), df! = dg!))
A₂ = JopLn(Jet(;dom=JetSpace(Float64,2), rng=JetSpace(Float64,2), df! = dg!))
C = A₂ ∘ A₁
m = rand(domain(C))
d = C * m
source
Base.convertMethod
convert(Array, A::JopLn)

Convert a linear Jets operator into its equivalent matrix.

source
Base.eltypeMethod
eltype(A::Union{Jet,Jop,JopAdjoint})

Return the element type of A.

source
Base.eltypeMethod
eltype(R)

Return the element type of the space R::JetAbstractSpace.

source
Base.iszeroMethod
iszero(A::Union{Jet, Jop})

Return true if A was constructed via JopZeroBlock.

source
Base.lengthMethod
length(R)

Return the dimension the space R::JetAbstractSpace

source
Base.onesFunction
ones(R)

Construct an array of the type and size defined by R::JetAbstractSpace{T} and filled with one(T).

source
Base.randFunction
rand(R)

Construct an array of the type and size defined by the R::JetAbstractSpace, and filled with random values from 0 - 1.

source
Base.randnFunction
randn(R)

Construct an array of the type and size defined by the R::JetAbstractSpace, and filled with random values from Gaussian distribution.

source
Base.rangeMethod
R = range(A)

Return R::JetAbstractSpace, which is the range of A::Union{Jet, Jop, AbstractMatrix}.

source
Base.reshapeMethod
reshape(x, R)

Returns an array that is consistent with the shape of the space R::JetAbstractSpace, and shares memory with x.

source
Base.sizeMethod
size(R[,i])

Return the shape of the array associated to the Jet space R::JetAbstractSpace. If i is specifid, then returns the length along the ith array dimension.

source
Base.sizeMethod
size(A[, i])

Return the size of the range and domain of A::Union{Jet,Jop}. With no arguments, return (length(range(A)), length(domain(A))). With i specified, return length(range(A)) for i = 1 and return length(domain(A)) otherwise.

source
Base.vecMethod
B = vec(A)

B is equivelent to A except that its domain and range are "vectorized". This is useful when calling algorithms that expect vectors in the domain and range of the operator. One example of this is the lsqr method in the IterativeSolvers package.

Example

using Jets, JetPack, IterativeSolvers

A = JopDiagonal(rand(10,11))
d = rand(range(A))
m = lsqr(vec(A), vec(d))
source
Base.zerosFunction
zeros(R)

Construct an array of the type and size defined by R::JetAbstractSpace{T} and filled with zero(T).

source
Jets.JopZeroBlockMethod
JopZeroBlock(dom, rng)

Construct a Jets operator that is equivalent to a matrix of zeros, and that maps from dom::JetAbstractSpace to rng::JetAbstractSpace. This can be useful when forming block operators that contain zero blocks.

source
Jets.domainMethod
R = domain(A)

Return R::JetAbstractSpace, which is the domain of A::Union{Jet, Jop, AbstractMatrix}.

source
Jets.dot_product_testMethod
lhs,rhs = dot_product_test(A, m, d; mmask, dmask)

Compute and return the left and right hand sides of the dot product test:

<d,Am> ≈ <Aᴴd,m>

Here Aᴴ is the conjugate transpose or adjoint of A, and <x, y> denotes the inner product of vectors x and y. The left and right hand sides of the dot product test are expected to be equivalent close to machine precision for operator A. If the equality does not hold this can indicate a problem with the implementation of the operator A.

This function provides the optional named arguments mmask and dmask which are vectors in the domain and range of A that are applied via elementwise multiplication to mask the vectors m and d before applying of the operator, as shown below. Here we use to represent the Hadamard product (elementwise multiplication) of two vectors.

<dmask ∘ d, A (mmask ∘ m)> ≈ <Aᵀ (dmask ∘ d), mmask ∘ m>

You can test the relative accuracy of the operator with this relation for the left hand side lhs and right hand side rhs returned by this function:

|lhs - rhs| / |lhs + rhs| < ϵ

source
Jets.getblockMethod
getblock(A, i, j)

Return the block of the Jets block operator A that corresponds to row block i and column block j.

source
Jets.indicesMethod
indices(R, iblock)

Return the linear indices associated with block iblock in the Jets block space R::JetBSpace.

Example

Consider a block operator with 2 row-blocks and 3 column-blocks. We can use indices to determine the elements of the vector that are associatd with the first block of its domain:

using Pkg
pkg"add Jets JetPack"
using Jets, JetPack
A = @blockop [JopDiagonal(rand(10)) for irow=1:2, icol=1:3]
indices(domain(A), 1) # returns indices 1:10
source
Jets.jacobian!Method
jacobian!(F, mₒ)

Return the jacobian of F::Union{Jet, Jop, AbstractMatrix} at the linearization point m₀. The jacobian shares the underlying Jet with F. This means that if the jacobian may mutate F.

source
Jets.jacobianMethod
jacobian(F, mₒ)

Return the jacobian of F::Union{Jet, Jop, AbstractMatrix} at the point m₀. The linearization constructs a new underlying Jet.

source
Jets.jetMethod
jet(A)

Return the Jet associated with A::Union{Jop, JopAdjoint}.

source
Jets.linearity_testFunction
lhs,rhs = linearity_test(A::Jop)

test the the linear Jet operator A satisfies the following test for linearity:

A(m_1+m_2)=Am_1 + A_m2

source
Jets.linearization_testMethod
μobs, μexp = linearization_test(F, mₒ; μ)

Thest that the jacobian, J, of F satisfies the Taylor expansion:

F(m) = F(m_o) + F'(m_o)δm + O(δm^2)

source
Jets.nblocksMethod
nblocks(R)

Return the number of blocks in the Jets block space R::JetBSpace.

source
Jets.nblocksMethod
nblocks(A[, i])

Return the number of blocks in the range and domain of the Jets block operator A::Union{Jet, Jop}. With i specified, return nblocks(range(jet)) for i = 1 and return nblocks(domain(jet)) otherwise.

source
Jets.perfstatMethod
perfstat(A)

Return a Dictionary with performance information for A::Union{Jet,Jop,JopAdjoint}. the perfstat(jet::Jet) method that can be implemented by the author of an operator to track performance metrics.

source
Jets.point!Method
point!(F, mₒ)

Update the linearization point (model vector) for F::Union{Jet, JopLn, JopAdjoint} to model vector mₒ.

source
Jets.pointMethod
point(F)

Return the linearization point (model vector) mₒ associated with F::Union{Jet, JopLn, JopAdjoint}.

source
Jets.shapeMethod
shape(A[, i])

Return the shape of the range and domain of A::Union{Jet, Jop, AbstractMatrix}. With no arguments, return (size(range(A)), size(domain(A))). With i specified, return size(range(A)) for i = 1 and return size(domain(A)) otherwise.

source
Jets.spaceMethod
space(R, iblock)

Return the Jets sub-space associated with block iblock in the Jets block space R::JetBSpace.

Example

Consider a block operator with 2 row-blocks and 3 column-blocks. We can use space to determine the sub-space associated with the first block of its domain:

using Pkg
pkg"add Jets JetPack"
using Jets, JetPack
A = @blockop [JopDiagonal(rand(10)) for irow=1:2, icol=1:3]
space(domain(A), 1) # JetSpace(Float64,10)
source
Jets.state!Method
state!(A::Union{Jet,Jop,JopAdjoint}, s)

Updates and merges the state of the A with s.

source
Jets.stateMethod
state(A::Union{Jet,Jop,JopAdjoint}[, key])

If key::Symbol is specified, then return the state corresponding to key. Otherwise, return the state of A as a NamedTuple.

source
LinearAlgebra.mul!Method
mul!(d, F, m)

In place version of d=F*m where F is a Jets linear (e.g. JopLn) or nonlinear (JopNl) operator.

source
Random.randpermMethod
randperm(R)

Construct a list of random linear indices over the dimensions of R::JetAbstractSpace. The list is useful for selecting a random subset of a multi-dimensional image.

Example

using Jets
R = JetSpace(Float64, 10, 2)
x = rand(R)
y = x[randperm(R)[1:10]] # get 10 elements at random from x
source
Core.ArrayType
Array(R)

Construct an uninitialized array of the type and size defined by R::JetsAbstractSpace.

source
Jets.JetMethod
Jet(;dom, rng, f!, df!, df′!, upstate!, s)

Return a Jet with domain dom::JetAbstractSpace, range rng::JetSAbstractpace, with forward mapping f!::Function, linearized forward mapping df!::Function, linearized adjoint mapping df′!::Function, Jacobian state modification function upstate!::Function, and state s::NamedTuple.

A jet describes a function f! and its linearization (forward df!, and adjointdf′!``) about a point.

If one of f! or df! is specified, and df′! is not, then we assume that f!=df!=df′!. This means that the operator is linear and self-adjoint.

If f! and df! are sepecified, bug df′! is not, then we assume that df′!=df!. This means that the operator is nonlinear and self-adjoint.

Example

Consider a nonlinear mapping with a self-adjoint linearization $f(x)=x^2$

using Jets
g!(m) = m.^2
dg!(δm; mₒ) = @. 2*mₒ*δm
jet = Jet(;dom=JetSpace(Float64,2), rng=JetSpace(Float64,2), f! = g!, df! = dg!)
source
Jets.JetSSpaceMethod
JetSSpace(_T, n, M, map::F)

Construct and return a symmetric space JetSSpace.

parameters

  • _T is the type, usually Complex{Float32} or Complex{Float64}.
  • n is a tuple that defines the dimensionality of the space.
  • M is a tuple that defines which dimensions are symmetric. Note that currently only a single symmetric dimension is supported by the API.
  • F is a function that maps indices for the symmetric dimension, described below.

An example requiring a JetSSpace is the Fourier transform: the Fourier transform of a real vector is in a complex space with Hermittian symmetry. Only the positive frequencies are needed, and the spectrum at negative frequencies is the Hermittian conjugate of the spectrum at the corresponding positive frequencies: S(-f) = conj(S(f). For this example the map F is a function that returns the multi-dimensional index of f when given the multi-dimensional index of -f.

See also: JopFft in the JetPackTransforms package.

source
Jets.JetSpaceMethod
JetSpace(T, n)

Construct and return a JetSpace of type T and size n

Examples

Create a 100 dimension space with array elelment type Float64 and array size (100,)

R1 = JetSpace(Float64, 100)

Create a 100 dimension space with array element type Float32 and array size (5, 20)

R2 = JetSpace(Float32, 5, 20)
source
Jets.JopLnMethod
JopLn(; kwargs ...)

Construct a JopLn with Jet constructed from keyword arguments kwargs. This is equivalent to JopLn(Jet(;kwargs...)). Please see Jet for more information.

source
Jets.JopNlMethod
JopNl(; kwargs ...)

Construct a JopNl with Jet constructed from keyword arguments kwargs. This is equivalent to JopNl(Jet(;kwargs...)). Please see Jet for more information.

source

Index