JOLI reference

Module

JOLI.JOLIModule

Julia Operator LIbrary (JOLI) is a package for creating algebraic operators (currently linear only) and use them in a way that tries to mimic the mathematical formulas of basics algebra.

The package was created in SLIM group at the University of British Columbia for their work in seismic imaging and modelling.

JOLI has a collection of methods that allow creating and use of element-free operators, operators created from explicit Matrices, and composing all of those into complex formulas that are not explicitly executed until they act on the Vector or Matrix. '*', '+', '-' and etc... operations are supported in any mathematically valid combination of operators and vectors as long as vector is on the right side of the operator. Composite operators can be defined before they are used to act on vectors.

JOLI operators support operations like adjoint, transpose, and conjugate for element-free operators provided that enough functionality is provided when constructing JOLI operator.

JOLI operators support and enforce consistency of domain and range data types for operators with both vectors acted upon and created by operators. JOLI also has the functionality that allows easily to switch precision of computations using global type definitions.

Contrary to other linear-operators Julia packages, JOLI operators act on matrices as if those were column-wise collections of vectors. I.e. JOLI operator does not treat explicit matrix on left side of '*' as another operator, and will act on it immediately. Such behaviour is convenient for implementation of Kronecker product.

source

Types

JOLI.joCoreBlockMethod
julia> op = joCoreBlock(op1[,op2][,...];
    [moffsets=...,][noffsets=...,][weights=...,]
    [mextend=...,][nextend=...,][name=...])

Universal (Core) block operator composed from serial JOLI operators

Signature

joCoreBlock(ops::joAbstractLinearOperator...;
    moffsets::LocalVector{Integer},noffsets::LocalVector{Integer},
    weights::LocalVector,mextend::Integer,nextend::Integer,name::String)

Arguments

  • op#: JOLI operators (subtypes of joAbstractLinearOperator)
  • keywords
    • moffsets: vector of starting indecies in 1st dimansion
    • noffsets: vector of starting indecies in 2nd dimansion
    • weights: vector of waights for each operator
    • mextend: size of zero extension in 1st dimension
    • nextend: size of zero extension in 2nd dimension
    • name: custom name

Notes

  • all given operators must have same domain/range types
  • the domain/range types of joCoreBlock are equal to domain/range types of the given operators

Example

define operators

a=rand(ComplexF64,4,5);
A=joMatrix(a;DDT=ComplexF32,RDT=ComplexF64,name="A")

b=rand(ComplexF64,7,8);
B=joMatrix(b;DDT=ComplexF32,RDT=ComplexF64,name="B")

c=rand(ComplexF64,6,8);
C=joMatrix(c;DDT=ComplexF32,RDT=ComplexF64,name="C")

define supporting vectors for more complex blocks

moff=[0;5;13]
noff=[0;6;15]
w=rand(ComplexF64,3)

basic diagonal-corners adjacent blocks

BD=joCoreBlock(A,B,C)

sparse blocks

BD=joCoreBlock(A,B,C;moffsets=moff,noffsets=noff)

sparse blocks with zero extansion of (mextend,nextend) size

BD=joCoreBlock(A,B,C;moffsets=moff,noffsets=noff,mextend=5,nextend=5)

weighted basic diagonal-corners adjacent blocks

BD=joCoreBlock(A,B,C;weights=w)
source
JOLI.joDAdistributeType
joDAdistribute is DAarray toggle type & constructor

!!! Do not use it to create the operators
source
JOLI.joDAdistributeMethod
julia> joDAdistribute(m [,parts]; [DT])
julia> joDAdistribute(wpool, m [,parts]; [DT])
julia> joDAdistribute(m, nvc [,parts]; [DT])
julia> joDAdistribute(wpool, m, nvc [,parts]; [DT])
julia> joDAdistribute(dst)
julia> joDAdistribute(DA)

defines operator to distribute serial vector into DistributedArrays' vector

Signature

joDAdistribute(m::Integer,
    parts::Vector{INT}=joPAsetup_etc.balanced_partition(nworkers(),m);
    kwargs...) where INT<:Integer
joDAdistribute(wpool::WorkerPool,m::Integer,
    parts::Vector{INT}=joPAsetup_etc.balanced_partition(nworkers(wpool),m);
    DT::DataType=joFloat,gclean::Bool=false) where INT<:Integer
joDAdistribute(m::Integer,nvc::Integer,
    parts::Vector{INT}=joPAsetup_etc.balanced_partition(nworkers(),nvc);
    kwargs...) where INT<:Integer
joDAdistribute(wpool::WorkerPool,m::Integer,nvc::Integer,
    parts::Vector{INT}=joPAsetup_etc.balanced_partition(nworkers(wpool),nvc);
    DT::DataType=joFloat,gclean::Bool=false) where INT<:Integer
joDAdistribute(dst::joPAsetup;gclean::Bool=false)
joDAdistribute(A::joDAdistributedLinearOperator;gclean::Bool=false)

Arguments

  • m: length of the vector
  • nvc: # of columns in multi-vector - if given then multi-vector is distributed over 2nd dimension
  • parts: custom partitioning of distributed dimension
  • wpool: custom WorkerPool
  • DT: DataType for joPAsetup
  • dst: joPAsetup
  • DA: joDAdistributedLinearOperator
  • glcean: clean DArray after gathering

Notes

  • no type conversions are attempted at the moment (i.e. DT is used as for any other JOLI operator)
  • adjoint/transpose of the joDAdistribute will gather distributed vector into serial vector

Examples

  • joDAdistribute(5): distribute vector of lenght 5 into default WorkerPool
  • joDAdistribute(5,2): distribute multi-vector of lenght 5 with 2 columns into default WorkerPool
  • joDAdistribute(5)': gather vector of lenght 5
  • joDAdistribute(5,2)': gather multi-vector of lenght 5 with 2 columns
source
JOLI.joDAgatherType
joDAgather is DAarray toggle type & constructor

!!! Do not use it to create the operators
source
JOLI.joDAgatherMethod
julia> joDAgather(m [,parts]; [DT])
julia> joDAgather(wpool, m [,parts]; [DT])
julia> joDAgather(m, nvc [,parts]; [DT])
julia> joDAgather(wpool, m, nvc [,parts]; [DT])
julia> joDAgather(dst)
julia> joDAgather(DA)

defines operator to gather DistributedArrays' vector into serial vector

Signature

joDAgather(m::Integer,
    parts::Vector{INT}=joPAsetup_etc.balanced_partition(nworkers(),m);
    kwargs...) where INT<:Integer
joDAgather(wpool::WorkerPool,m::Integer,
    parts::Vector{INT}=joPAsetup_etc.balanced_partition(nworkers(wpool),m);
    DT::DataType=joFloat,gclean::Bool=false) where INT<:Integer
joDAgather(m::Integer,nvc::Integer,
    parts::Vector{INT}=joPAsetup_etc.balanced_partition(nworkers(),nvc);
    kwargs...) where INT<:Integer
joDAgather(wpool::WorkerPool,m::Integer,nvc::Integer,
    parts::Vector{INT}=joPAsetup_etc.balanced_partition(nworkers(wpool),nvc);
    DT::DataType=joFloat,gclean::Bool=false) where INT<:Integer
joDAgather(dst::joPAsetup;gclean::Bool=false)
joDAgather(A::joDAdistributedLinearOperator;gclean::Bool=false)

Arguments

  • m: length of the vector
  • nvc: # of columns in multi-vector - if given then multi-vector is distributed over 2nd dimension
  • parts: custom partitioning of distributed dimension
  • wpool: custom WorkerPool
  • DT: DataType for joPAsetup
  • dst: joPAsetup
  • DA: joDAdistributedLinearOperator
  • glcean: clean DArray after gathering

Notes

  • no type conversions are attempted at the moment (i.e. DT is used as for any other JOLI operator)
  • adjoint/transpose of the joDAgather will distribute serial vector into DistributedArrays' vector

Examples

  • joDAgather(5): gather vector of lenght 5
  • joDAgather(5,2): gather multi-vector of lenght 5 with 2 columns
  • joDAgather(5)': distribute vector of lenght 5 into default WorkerPool
  • joDAgather(5,2)': distribute multi-vector of lenght 5 with 2 columns into default WorkerPool
source
JOLI.joKronMethod
julia> op = joKron(op1[,op2][,...];[name=...])

Kronecker product of serial JOLI operators

Signature

joKron(ops::joAbstractLinearOperator...;name::String="joKron")

Arguments

  • op#: JOLI operators (subtypes of joAbstractLinearOperator)
  • keywords
    • name: custom name

Notes

  • the domain and range types of joKron are equal respectively to domain type of rightmost operator and range type of leftmost operator
  • all operators in the chain must have consistent passing domain/range types, i.e. domain type of operator on the left have to be the same as range type of operator on the right

Example

define operators

a=rand(ComplexF64,6,4);
A=joMatrix(a;name="A")

b=rand(ComplexF64,6,8);
B=joMatrix(b;DDT=ComplexF32,RDT=ComplexF64,name="B")

c=rand(ComplexF64,6,4);
C=joMatrix(c;DDT=ComplexF64,RDT=ComplexF32,name="C")

define Kronecker product

K=joKron(A,B,C)
source
JOLI.joLinearFunctionType

joLinearFunction type

TYPE PARAMETERS

  • DDT::DataType : domain DataType
  • RDT::DataType : range DataType

FIELDS

  • name::String : given name
  • m::Integer : # of rows
  • n::Integer : # of columns
  • fop::Function : forward function
  • fop_T::Nullable{Function} : transpose function
  • fop_A::Nullable{Function} : adjoint function
  • fop_C::Nullable{Function} : conj function
  • fMVok : whether fops are rady to handle mvec
  • iop::Nullable{Function} : inverse for fop
  • iopT::Nullable{Function} : inverse for fopT
  • iopA::Nullable{Function} : inverse for fopA
  • iopC::Nullable{Function} : inverse for fopC
  • iMVok::Bool : whether iops are rady to handle mvec
source
JOLI.joLinearFunctionInplaceType

joLinearFunctionInplace type

TYPE PARAMETERS

  • DDT::DataType : domain DataType
  • RDT::DataType : range DataType

FIELDS

  • name::String : given name
  • m::Integer : # of rows
  • n::Integer : # of columns
  • fop::Function : forward function
  • fop_T::Nullable{Function} : transpose function
  • fop_A::Nullable{Function} : adjoint function
  • iop::Nullable{Function} : inverse for fop
  • iopT::Nullable{Function} : inverse for fopT
  • iopA::Nullable{Function} : inverse for fopA
source
JOLI.joLooseLinearFunctionType

joLooseLinearFunction type

TYPE PARAMETERS

  • DDT::DataType : domain DataType
  • RDT::DataType : range DataType

FIELDS

  • name::String : given name
  • m::Integer : # of rows
  • n::Integer : # of columns
  • fop::Function : forward function
  • fop_T::Nullable{Function} : transpose function
  • fop_A::Nullable{Function} : adjoint function
  • fop_C::Nullable{Function} : conj function
  • fMVok : whether fops are rady to handle mvec
  • iop::Nullable{Function} : inverse for fop
  • iopT::Nullable{Function} : inverse for fopT
  • iopA::Nullable{Function} : inverse for fopA
  • iopC::Nullable{Function} : inverse for fopC
  • iMVok::Bool : whether iops are rady to handle mvec
source
JOLI.joLooseLinearFunctionInplaceType

joLooseLinearFunctionInplace type

TYPE PARAMETERS

  • DDT::DataType : domain DataType
  • RDT::DataType : range DataType

FIELDS

  • name::String : given name
  • m::Integer : # of rows
  • n::Integer : # of columns
  • fop::Function : forward function
  • fop_T::Nullable{Function} : transpose function
  • fop_A::Nullable{Function} : adjoint function
  • iop::Nullable{Function} : inverse for fop
  • iopT::Nullable{Function} : inverse for fopT
  • iopA::Nullable{Function} : inverse for fopA
source
JOLI.joLooseMatrixType

joLooseMatrix type

TYPE PARAMETERS

  • DDT::DataType : domain DataType
  • RDT::DataType : range DataType

FIELDS

  • name::String : given name
  • m::Integer : # of rows
  • n::Integer : # of columns
  • fop::Function : forward matrix
  • fop_T::Function : transpose matrix
  • fop_A::Function : adjoint matrix
  • fop_C::Function : conj matrix
  • iop::Nullable{Function} : inverse for fop
  • iopT::Nullable{Function} : inverse for fopT
  • iopA::Nullable{Function} : inverse for fopA
  • iopC::Nullable{Function} : inverse for fopC
source
JOLI.joLooseMatrixMethod

joLooseMatrix outer constructor

joLooseMatrix(array::AbstractMatrix;
         DDT::DataType=eltype(array),
         RDT::DataType=promote_type(eltype(array),DDT),
         name::String="joLooseMatrix")

Look up argument names in help to joLooseMatrix type.

Example

  • joLooseMatrix(rand(4,3)) # implicit domain and range
  • joLooseMatrix(rand(4,3);DDT=Float32) # implicit range
  • joLooseMatrix(rand(4,3);DDT=Float32,RDT=Float64)
  • joLooseMatrix(rand(4,3);name="my matrix") # adding name

Notes

  • if DDT:<Real for complex matrix then imaginary part will be neglected for transpose/adjoint operator
  • if RDT:<Real for complex matrix then imaginary part will be neglected for forward/conjugate operator
source
JOLI.joLooseMatrixInplaceType

joLooseMatrixInplace type

TYPE PARAMETERS

  • DDT::DataType : domain DataType
  • RDT::DataType : range DataType

FIELDS

  • name::String : given name
  • m::Integer : # of rows
  • n::Integer : # of columns
  • fop::Function : forward matrix
  • fop_T::Function : transpose matrix
  • fop_A::Function : adjoint matrix
  • iop::Nullable{Function} : inverse for fop
  • iopT::Nullable{Function} : inverse for fopT
  • iopA::Nullable{Function} : inverse for fopA
source
JOLI.joLooseMatrixInplaceMethod

joLooseMatrixInplace outer constructor

joLooseMatrixInplace(array::AbstractMatrix;
         DDT::DataType=eltype(array),
         RDT::DataType=promote_type(eltype(array),DDT),
         name::String="joLooseMatrixInplace")

Look up argument names in help to joLooseMatrixInplace type.

Example

  • joLooseMatrixInplace(rand(4,3)) # implicit domain and range
  • joLooseMatrixInplace(rand(4,3);DDT=Float32) # implicit range
  • joLooseMatrixInplace(rand(4,3);DDT=Float32,RDT=Float64)
  • joLooseMatrixInplace(rand(4,3);name="my matrix") # adding name

Notes

  • if DDT:<Real for complex matrix then imaginary part will be neglected for transpose/adjoint operator
  • if RDT:<Real for complex matrix then imaginary part will be neglected for forward/conjugate operator
source
JOLI.joMatrixType

joMatrix type

TYPE PARAMETERS

  • DDT::DataType : domain DataType
  • RDT::DataType : range DataType

FIELDS

  • name::String : given name
  • m::Integer : # of rows
  • n::Integer : # of columns
  • fop::Function : forward matrix
  • fop_T::Function : transpose matrix
  • fop_A::Function : adjoint matrix
  • fop_C::Function : conj matrix
  • iop::Nullable{Function} : inverse for fop
  • iopT::Nullable{Function} : inverse for fopT
  • iopA::Nullable{Function} : inverse for fopA
  • iopC::Nullable{Function} : inverse for fopC
source
JOLI.joMatrixMethod

joMatrix outer constructor

joMatrix(array::AbstractMatrix;
         DDT::DataType=eltype(array),
         RDT::DataType=promote_type(eltype(array),DDT),
         name::String="joMatrix")

Look up argument names in help to joMatrix type.

Example

  • joMatrix(rand(4,3)) # implicit domain and range
  • joMatrix(rand(4,3);DDT=Float32) # implicit range
  • joMatrix(rand(4,3);DDT=Float32,RDT=Float64)
  • joMatrix(rand(4,3);name="my matrix") # adding name

Notes

  • if DDT:<Real for complex matrix then imaginary part will be neglected for transpose/adjoint operator
  • if RDT:<Real for complex matrix then imaginary part will be neglected for forward/conjugate operator
source
JOLI.joMatrixInplaceType

joMatrixInplace type

TYPE PARAMETERS

  • DDT::DataType : domain DataType
  • RDT::DataType : range DataType

FIELDS

  • name::String : given name
  • m::Integer : # of rows
  • n::Integer : # of columns
  • fop::Function : forward matrix
  • fop_T::Function : transpose matrix
  • fop_A::Function : adjoint matrix
  • fop_C::Function : conj matrix
  • iop::Nullable{Function} : inverse for fop
  • iopT::Nullable{Function} : inverse for fopT
  • iopA::Nullable{Function} : inverse for fopA
  • iopC::Nullable{Function} : inverse for fopC
source
JOLI.joMatrixInplaceMethod

joMatrixInplace outer constructor

joMatrixInplace(array::AbstractMatrix;
         DDT::DataType=eltype(array),
         RDT::DataType=promote_type(eltype(array),DDT),
         name::String="joMatrixInplace")

Look up argument names in help to joMatrixInplace type.

Example

  • joMatrixInplace(rand(4,3)) # implicit domain and range
  • joMatrixInplace(rand(4,3);DDT=Float32) # implicit range
  • joMatrixInplace(rand(4,3);DDT=Float32,RDT=Float64)
  • joMatrixInplace(rand(4,3);name="my matrix") # adding name

Notes

  • if DDT:<Real for complex matrix then imaginary part will be neglected for transpose/adjoint operator
  • if RDT:<Real for complex matrix then imaginary part will be neglected for forward/conjugate operator
source
JOLI.joNumberType

joNumber type

A number type to use for jo operations with number

TYPE PARAMETERS

  • DDT::DataType : domain DataType
  • RDT::DataType : range DataType

FIELDS

  • ddt::DDT : number to use when acting on vector to return domain vector
  • rdt::RDT : number to use when acting on vector to return range vector
source
JOLI.joNumberMethod

joNumber outer constructor

joNumber(num)

Create joNumber with types matching given number

source
JOLI.joNumberMethod

joNumber outer constructor

joNumber(num,A::joAbstractLinearOperator{DDT,RDT})

Create joNumber with types matching the given operator.

source
JOLI.joPAsetupType

joPAsetup type

Atributes

  • name::String # name for identification
  • dims::Dims # dimensions of the array
  • procs::Vector{Int} # ids of workers to use
  • chunks::Vector{Int} # number of chunks in each dimension
  • idxs::Array{Tuple{Vararg{UnitRange{<:Integer}}}}
  • cuts::Vector{Vector{<:Integer}}
  • DT::DataType

See help for outer constructors for joPAsetup.

source
JOLI.joPAsetupMethod
julia> joPAsetup(in::DArray)

Get joPAsetup represeanting a given DArray

source
JOLI.joPAsetupMethod
julia> joPAsetup(wpool,n;[DT,][name])
julia> joPAsetup(n;[DT,][name])

Creates joPAsetup type - basic 1D distribution

Signatures

joPAsetup(wpool::WorkerPool,n::Integer;
    DT::DataType=joFloat,
    name::String="joPAsetup";
joPAsetup(n::Integer;kwargs...)

Arguments

  • wpool: WorkerPool instance - defaults to WorkerPool(workers())
  • n: length of the vector
  • DT: DataType of vector's elements
  • name: name of distributor

Examples

  • joPAsetup(128): basic distributor for joFloat vector
  • joPAsetup(40;DT=Int8): basic distributor for Int8 vector
source
JOLI.joPAsetupMethod
julia> joPAsetup(wpool,dims,ddim;[DT,][parts,][name])
julia> joPAsetup(dims,ddim;[DT,][parts,][name])

Creates joPAsetup type

Signature

joPAsetup(wpool::WorkerPool,dims::Dims,ddim::Integer;
    DT::DataType=joFloat,
    parts::Union{Vector{Integer},Dims}=joPAsetup_etc.balanced_partition(nworkers(wpool),dims[ddim]),
    name::String="joPAsetup",)
joPAsetup(dims::Dims,ddim::Integer;kwargs...)

Arguments

  • wpool: WorkerPool instance - defaults to WorkerPool(workers())
  • dims: tuple with array's dimensions
  • ddim: dimansion to distribute over
  • DT: DataType of array's elements
  • parts: tuple/vector of the subarray's size on each worker in distributed dimension
  • name: name of distributor

Examples

  • joPAsetup((3,40,5),2;DT=Int8): distribute 2nd dimension over 4 workers
  • joPAsetup((3,40,5),2;DT=Int8,parts=(11,11,11,7)): distribute 2nd dimension over 4 workers and specify parts
source
JOLI.joPAsetupMethod
julia> joPAsetup(wpool,dims;[DT,][chunks,][name])
julia> joPAsetup(dims;[DT,][chunks,][name])

Creates joPAsetup type - basic distribution

Signatures

joPAsetup(wpool::WorkerPool,dims::Dims;
    DT::DataType=joFloat,
    chunks::Vector{Integer}=joPAsetup_etc.default_chunks(dims,sorted(workers(wpool))),
    name::String="joPAsetup";
joPAsetup(dims::Dims;kwargs...)

Arguments

  • wpool: WorkerPool instance - defaults to WorkerPool(workers())
  • dims: tuple with array's dimensions
  • DT: DataType of array's elements
  • chunks: vector of number of parts in each dimension
  • name: name of distributor

Examples

  • joPAsetup((3,40,5);DT=Int8): basic distributor for Int8 array (3,40,5)
  • joPAsetup((3,40,5);DT=Int8, chunks=[1,nworkers(),1]): basic distributor for Int8 array (3,40,5) forcing distribution in 2nd dimension
source
JOLI.joPAsetupMethod
julia> joPAsetup(wpool,parts;[name],[DT])
julia> joPAsetup(parts;[name],[DT])

Creates joPAsetup type with ultimate distribution topology control

Signature

joPAsetup(wpool::WorkerPool,parts::Tuple{Vararg{Tuple{Vararg{Integer}}}};
    DT::DataType=joFloat,
    procs::Vector{Integer}=workers(),
    name::String="joPAsetup")
joPAsetup(parts::Tuple{Vararg{Tuple{Vararg{INT}}}};kwargs...)

Arguments

  • wpool: WorkerPool instance - defaults to WorkerPool(workers())
  • parts: tuple of tuples with subarray's size on each worker
  • DT: DataType of array's elements
  • name: name of distributor

Examples

  • joPAsetup(((3,),(10,10,10,10),(5,));DT=Int8): distribute Int8 array (3,40,5) over 2nd dimension
source
JOLI.joSAdistributeType
joSAdistribute is SharedArray toggle type & constructor

!!! Do not use it to create the operators
source
JOLI.joSAdistributeMethod
julia> joSAdistribute(m [,parts]; [DT])
julia> joSAdistribute(wpool, m [,parts]; [DT])
julia> joSAdistribute(m, nvc [,parts]; [DT])
julia> joSAdistribute(wpool, m, nvc [,parts]; [DT])
julia> joSAdistribute(dst)
julia> joSAdistribute(SA)

defines operator to distribute serial vector into DistributedArrays' vector

Signature

joSAdistribute(m::Integer,
    parts::Vector{INT}=joPAsetup_etc.balanced_partition(nworkers(),m);
    kwargs...) where INT<:Integer
joSAdistribute(wpool::WorkerPool,m::Integer,
    parts::Vector{INT}=joPAsetup_etc.balanced_partition(nworkers(wpool),m);
    DT::DataType=joFloat,gclean::Bool=false) where INT<:Integer
joSAdistribute(m::Integer,nvc::Integer,
    parts::Vector{INT}=joPAsetup_etc.balanced_partition(nworkers(),nvc);
    kwargs...) where INT<:Integer
joSAdistribute(wpool::WorkerPool,m::Integer,nvc::Integer,
    parts::Vector{INT}=joPAsetup_etc.balanced_partition(nworkers(wpool),nvc);
    DT::DataType=joFloat,gclean::Bool=false) where INT<:Integer
joSAdistribute(dst::joPAsetup;gclean::Bool=false)
joSAdistribute(A::joSAdistributedLinearOperator;gclean::Bool=false)

Arguments

  • m: length of the vector
  • nvc: # of columns in multi-vector - if given then multi-vector is distributed over 2nd dimension
  • parts: custom partitioning of distributed dimension
  • wpool: custom WorkerPool
  • DT: DataType for joPAsetup
  • dst: joPAsetup
  • SA: joSAdistributedLinearOperator
  • glcean: clean SArray after gathering

Notes

  • no type conversions are attempted at the moment (i.e. DT is used as for any other JOLI operator)
  • adjoint/transpose of the joSAdistribute will gather distributed vector into serial vector

Examples

  • joSAdistribute(5): distribute vector of lenght 5 into default WorkerPool
  • joSAdistribute(5,2): distribute multi-vector of lenght 5 with 2 columns into default WorkerPool
  • joSAdistribute(5)': gather vector of lenght 5
  • joSAdistribute(5,2)': gather multi-vector of lenght 5 with 2 columns
source
JOLI.joSAgatherType
joSAgather is SharedArray toggle type & constructor

!!! Do not use it to create the operators
source
JOLI.joSAgatherMethod
julia> joSAgather(m [,parts]; [DT])
julia> joSAgather(wpool, m [,parts]; [DT])
julia> joSAgather(m, nvc [,parts]; [DT])
julia> joSAgather(wpool, m, nvc [,parts]; [DT])
julia> joSAgather(dst)
julia> joSAgather(SA)

defines operator to gather DistributedArrays' vector into serial vector

Signature

joSAgather(m::Integer,
    parts::Vector{INT}=joPAsetup_etc.balanced_partition(nworkers(),m);
    kwargs...) where INT<:Integer
joSAgather(wpool::WorkerPool,m::Integer,
    parts::Vector{INT}=joPAsetup_etc.balanced_partition(nworkers(wpool),m);
    DT::DataType=joFloat,gclean::Bool=false) where INT<:Integer
joSAgather(m::Integer,nvc::Integer,
    parts::Vector{INT}=joPAsetup_etc.balanced_partition(nworkers(),nvc);
    kwargs...) where INT<:Integer
joSAgather(wpool::WorkerPool,m::Integer,nvc::Integer,
    parts::Vector{INT}=joPAsetup_etc.balanced_partition(nworkers(wpool),nvc);
    DT::DataType=joFloat,gclean::Bool=false) where INT<:Integer
joSAgather(dst::joPAsetup;gclean::Bool=false)
joSAgather(A::joSAdistributedLinearOperator;gclean::Bool=false)

Arguments

  • m: length of the vector
  • nvc: # of columns in multi-vector - if given then multi-vector is distributed over 2nd dimension
  • parts: custom partitioning of distributed dimension
  • wpool: custom WorkerPool
  • DT: DataType for joPAsetup
  • glcean: clean SArray after gathering
  • dst: joPAsetup
  • SA: joSAdistributedLinearOperator

Notes

  • no type conversions are attempted at the moment (i.e. DT is used as for any other JOLI operator)
  • adjoint/transpose of the joSAgather will distribute serial vector into DistributedArrays' vector

Examples

  • joSAgather(5): gather vector of lenght 5
  • joSAgather(5,2): gather multi-vector of lenght 5 with 2 columns
  • joSAgather(5)': distribute vector of lenght 5 into default WorkerPool
  • joSAgather(5,2)': distribute multi-vector of lenght 5 with 2 columns into default WorkerPool
source

Functions

DistributedArrays.SPMD.scatterMethod
julia> scatter(A,d)

Scatters SharedArray according to given joPAsetup.

Signature

scatter(a::AbstractArray,d::joPAsetup)

Arguments

  • A: array to ditribute
  • d: see help for joPAsetup

Notes

  • the type in joPAsetup is ignored here
  • one of the dimensions must be large enough to hold at least one element on each worker

Examples

  • scatter(A,d): scatter A using given distributor
  • scatter(A,joPAsetup(size(A)...)): scatter A using default distributor settings
source
DistributedArrays.dfillMethod
julia> dfill(F, d; [DT])

Constructs a DistributedArrays.DArray, according to given distributor, filled with elements provided by anonymous function F.

Signature

dfill(F::Function,d::joPAsetup;DT::DataType=d.DT)

Arguments

  • F: anonymous function of the form I->f(...,map(length,I)))
  • d: see help for joPAsetup
  • DT: keyword argument to overwrite the type in joPAsetup

Notes

  • function F will be passed via map(length,I) the tuple with dimensions of local part
  • one has to pass array type manualy to F

Examples

  • dfill(I->ones(d.DT,map(length,I)),d): fill a distributed array with ones of type d.DT
source
DistributedArrays.dfillMethod
julia> dfill(x, d; [DT])

Constructs a DistributedArrays.DArray, according to given distributor, filled with x.

Signature

dfill(x::Number,d::joPAsetup;DT::DataType=d.DT)

Arguments

  • d: see help for joPAsetup
  • DT: keyword argument to overwrite the type in joPAsetup

Examples

  • dfill(3.,d): fill a distributed array with d.DT(3.)
  • dfill(3.,d;DT=Float32): fill a distributed array with Float32(3.)
source
DistributedArrays.distributeMethod
julia> distribute(A,d)

Distributes DArray according to given joPAsetup.

Signature

distribute(a::AbstractArray,d::joPAsetup)

Arguments

  • A: array to ditribute
  • d: see help for joPAsetup

Notes

  • the type in joPAsetup is ignored here
  • distributes over last non-singleton (worker-wise) dimension
  • one of the dimensions must be large enough to hold at least one element on each worker

Examples

  • distribute(A,d): distribute A using given distributor
  • distribute(A,joPAsetup(size(A)...)): distribute A using default distributor settings
source
DistributedArrays.donesMethod
julia> dones(d; [DT])

Constructs a DistributedArrays.DArray, according to given distributor, filled with ones.

Signature

dones(d::joPAsetup;DT::DataType=d.DT)

Arguments

  • d: see help for joPAsetup
  • DT: keyword argument to overwrite the type in joPAsetup

Examples

  • dones(d): allocate an array of ones
  • dones(d,DT=Float32): allocate array of Float32 ones
source
DistributedArrays.drandMethod
julia> drand(d; [DT], [RNG])

Constructs a DistributedArrays.DArray, according to given distributor, filled using built-in rand.

Signature

drand(d::joPAsetup;DT::DataType=d.DT,RNG::AbstractRNG=RandomDevice())

Arguments

  • d: see help for joPAsetup
  • DT: keyword argument to overwrite the type in joPAsetup
  • RNG: random-number generator function (see help for rand/randn)

Examples

  • drand(d): allocate an array with rand
  • drand(d,DT=Float32): allocate array with rand of Float32
  • drand(d,DT=Float32,RNG=MersenneTwister(1234)): allocate array with rand of Float32 using MersenneTwister() random device
source
DistributedArrays.drandnMethod
julia> drandn(d; [DT], [RNG])

Constructs a DistributedArrays.DArray, according to given distributor, filled using built-in randn.

Signature

drandn(d::joPAsetup;DT::DataType=d.DT,RNG::AbstractRNG=RandomDevice())

Arguments

  • d: see help for joPAsetup
  • DT: keyword argument to overwrite the type in joPAsetup
  • RNG: random-number generator function (see help for rand/randn)

Notes

  • only float type are supported by randn (see help for randn)

Examples

  • drandn(d): allocate an array with randn
  • drandn(d,DT=Float32): allocate array with randn of Float32
  • drandn(d,DT=Float32,RNG=MersenneTwister(1234)): allocate array with randn of Float32 using MersenneTwister() random device
source
DistributedArrays.dzerosMethod
julia> dzeros(d; [DT])

Constructs a DistributedArrays.DArray, according to given distributor, filled with zeros.

Signature

dzeros(d::joPAsetup;DT::DataType=d.DT)

Arguments

  • d: see help for joPAsetup
  • DT: keyword argument to overwrite the type in joPAsetup

Examples

  • dzeros(d): allocate an array of zeros
  • dzeros(d,DT=Float32): allocate array of Float32 zeros
source
JOLI.dallocMethod
julia> dalloc(dims, [...])

Allocates a DistributedArrays.DArray without value assigment.

Use it to allocate quicker the array that will have all elements overwritten.

Signature

dalloc(dims::Dims, [...])

Arguments

  • optional trailing arguments are the same as those accepted by DArray.
source
JOLI.dallocMethod
julia> dalloc(d; [DT])

Allocates a DistributedArrays.DArray, according to given distributor, without value assigment.

Use it to allocate quicker the array that will have all elements overwritten.

Signature

dalloc(d::joPAsetup;DT::DataType=d.DT)

Arguments

  • d: see help for joPAsetup
  • DT: keyword argument to overwrite the type in joPAsetup

Examples

  • dalloc(d): allocate an array
  • dalloc(d,DT=Float32): allocate array and overwite d.DT with Float32
source
JOLI.dcopyMethod
julia> dcopy(dtr,[dst])

copy transpose(DArray) into a new DArray using predefined joPAsetup

Signature

dcopy(Dtr::Transpose{T,<:DArray{T,2}},dst::joPAsetup)
dcopy(Dtr::Transpose{T,<:DArray{T,2}})

Arguments

  • dtr: transpose(DArray)
  • dst: target joPAsetup
source
JOLI.dpartsMethod
julia> dparts(da)

return partitioning vector of DArray if partioned in single dimension

Signature

dparts(da::DArray{T,N})

Arguments

  • da: DArray

Notes

  • if DArray is quasi-distributed (over single worker), dparts returns size(da,N)
source
JOLI.joAddSolverAllMethod

joAddSolver outer constructor

joAddSolverAll(A::joAbstractLinearOperator{DDT,RDT},
    solver::Function,solver_T::Function,solver_A::Function,solver_C::Function)

Create joLinearOperator with added specific solver(s) for (jo,[m]vec), distinct for each form of the operator.

Examples

O=joAddSolverAll(O,
    (s,x)->my_solver(s,x),
    (s,x)->my_solver_T(s,x),
    (s,x)->my_solver_A(s,x),
    (s,x)->my_solver_C(s,x))

O=joAddSolverAll(O,
    (s,x)->my_solver(s,x),
    @joNF,
    (s,x)->my_solver_A(s,x),
    @joNF)

O=joAddSolverAll(O,
    (s,x)->my_solver(s,x),
    @joNF,
    @joNF,
    @joNF)
source
JOLI.joAddSolverAnyMethod

joAddSolver outer constructor

joAddSolverAny(A::joAbstractLinearOperator{DDT,RDT},solver::Function)

Create joLinearOperator with added solver for (jo,[m]vec), same for each form of the operator

Example (for all forms of O)

O=joAddSolverAny(O,(s,x)->my_solver(s,x))
source
JOLI.joBlockMethod
julia> op = joBlock(rows,op1[,op2][,...];[weights=...,][name=...])

Block operator composed from different square JOLI operators

Signature

joBlock(rows::Vector{RVDT},ops::joAbstractLinearOperator...;
    weights::LocalVector{WDT}=zeros(0),name::String="joBlock")
        where {RVDT<:Integer,WDT<:Number}

Arguments

  • rows: # number of operator in a blocks' row
  • op#: JOLI operators (subtypes of joAbstractLinearOperator)
  • keywords
    • weights: vector of waights for each operator
    • name: custom name

Notes

  • operators are to be given in row-major order
  • all operators in a blocs' row must have the same # of rows (M)
  • sum of Ns for operators in each row must be the same
  • all given operators must have same domain/range types
  • the domain/range types of joBlock are equal to domain/range types of the given operators

Example

define operators

a=rand(ComplexF64,4,4);
A=joMatrix(a;DDT=ComplexF32,RDT=ComplexF64,name="A")
b=rand(ComplexF64,4,8);
B=joMatrix(b;DDT=ComplexF32,RDT=ComplexF64,name="B")
c=rand(ComplexF64,6,6);
C=joMatrix(c;DDT=ComplexF32,RDT=ComplexF64,name="C")
d=rand(ComplexF64,6,6);
D=joMatrix(d;DDT=ComplexF32,RDT=ComplexF64,name="D")

define weights if needed

w=rand(ComplexF64,4)

basic blocks in function syntax

S=joBlock([2,2],A,B,C,D)

basic blocks in [] syntax

S=[A B; C D]

weighted blocks

S=joBlock([2,2],A,B,C,D;weights=w)
source
JOLI.joBlockDiagMethod
julia> op = joBlockDiag(op1[,op2][,...];[weights=...,][name=...])

Block-diagonal operator composed from different square JOLI operators

Signature

joBlockDiag(ops::joAbstractLinearOperator...;
    weights::LocalVector{WDT}=zeros(0),name::String="joBlockDiag")
        where {WDT<:Number}

Arguments

  • op#: JOLI operators (subtypes of joAbstractLinearOperator)
  • keywords
    • weights: vector of waights for each operator
    • name: custom name

Notes

  • all operators must be square (M(i)==N(i))
  • all given operators must have same domain/range types
  • the domain/range types of joBlockDiag are equal to domain/range types of the given operators

Example

define operators

a=rand(ComplexF64,4,4);
A=joMatrix(a;DDT=ComplexF32,RDT=ComplexF64,name="A")
b=rand(ComplexF64,8,8);
B=joMatrix(b;DDT=ComplexF32,RDT=ComplexF64,name="B")
c=rand(ComplexF64,6,6);
C=joMatrix(c;DDT=ComplexF32,RDT=ComplexF64,name="C")

define weights if needed

w=rand(ComplexF64,3)

basic block diagonal

BD=joBlockDiag(A,B,C)

weighted block diagonal

BD=joBlockDiag(A,B,C;weights=w)
source
JOLI.joBlockDiagMethod
julia> op = joBlockDiag(l,op;[weights=...,][name=...])

Block-diagonal operator composed from l-times replicated square JOLI operator

Signature

joBlockDiag(l::Integer,op::joAbstractLinearOperator;
    weights::LocalVector{WDT}=zeros(0),name::String="joBlockDiag")
        where {WDT<:Number}

Arguments

  • l: # of replcated blocks
  • op: JOLI operators (subtypes of joAbstractLinearOperator)
  • keywords
    • weights: vector of waights for each operator
    • name: custom name

Notes

  • all given operators must have same domain/range types
  • the domain/range types of joBlockDiag are equal to domain/range types of the given operators

Example

define operator

a=rand(ComplexF64,4,4);
A=joMatrix(a;DDT=ComplexF32,RDT=ComplexF64,name="A")

define weights if needed

w=rand(ComplexF64,3)

basic block diagonal

BD=joBlockDiag(3,A)

weighted block diagonal

BD=joBlockDiag(3,A;weights=w)
source
JOLI.joConjMethod
julia> op = joConj(m;[VDP=...,][name=...])

Takes conjugate of vector (experimantal).

Signature

joConj(m::Integer;VDP::DataType=joFloat,name::String="joConj")

Arguments

  • m: vector size
  • keywords
    • VDP: float element type of Complex number in vector
    • name: custom name
source
JOLI.joConstantsMethod
julia> op = joConstants(m,a;[DDT=...,][RDT=...,][name=...])
julia> op = joConstants(m,n,a;[DDT=...,][RDT=...,][name=...])

Operator equivalent to matrix of same elements

Signature

joConstants(m::Integer,a::EDT;
    DDT::DataType=EDT,RDT::DataType=promote_type(EDT,DDT),
    name::String="joConstants") where {EDT<:Number}
joConstants(m::Integer,n::Integer,a::EDT;
    DDT::DataType=EDT,RDT::DataType=promote_type(EDT,DDT),
    name::String="joConstants") where {EDT<:Number}

Arguments

  • m: size
  • a: element value, default DDT/RDT will have the same type as a
  • optional
    • n: 2nd dimension if not square
  • keywords
    • DDT: domain data type
    • RDT: range data type
    • name: custom name

Examples

joConstants(m,a)
joConstants(m,n,a)

examples with DDT/RDT

joConstants(m,a; DDT=Float32)
joConstants(m,a; DDT=Float32,RDT=Float64)
source
JOLI.joConvertMethod
julia> op = joConvert(m,DDT,RDT;[name=...])

Converts vector between different types (experimental)

Signature

joConvert(m::Integer,DDT::DataType,RDT::DataType;name::String="joConvert")

Arguments

  • m: vector size
  • DDT: domain data type
  • RDT: range data type
  • keywords
    • name: custom name
source
JOLI.joCurvelet2DMethod
julia> op = joCurvelet2D(n1,n2;[DDT=joFloat,][RDT=DDT,]
                [nbscales=...,][nbangles_coarse=...,][all_crvlts=...,]
                [real_crvlts=...,][zero_finest=...,][name=...])

2D Curvelet transform (wrapping) over fast dimensions

Signature

function joCurvelet2D(n1::Integer,n2::Integer;DDT::DataType=joFloat,RDT::DataType=DDT,
        nbscales::Integer=0,
        nbangles_coarse::Integer=16,
        all_crvlts::Bool=false,
        real_crvlts::Bool=true,
        zero_finest::Bool=false,
        name::String="joCurvelt2D")

Arguments

  • n1,n2: image sizes
  • keywords
    • nbscales: # of scales (requires #>=default; defaults to max(1,ceil(log2(min(n1,n2))-3)))
    • nbangles_coarse: # of angles at coarse scale (requires #%4==0, #>=8; defaults to 16)
    • all_crvlts: curvelets at finnest scales (defaults to false)
    • real_crvlts: real transform (defaults to true) and requires real input
    • zero_finest: zero out finnest scales (defaults to false)
    • DDT: domain data type
    • RDT: range data type
    • name: custom name

Notes

  • if DDT:<Real for complex transform then imaginary part will be neglected for transpose/adjoint
  • isadjoint test at larger sizes (above 128) might require reseting tollerance to bigger number.

Examples

real transform (64-bit)

joCurvelet2D(32,32)

complex transform (64-bit)

joCurvelet2D(32,32;real_crvlts=false)

real transform with curevelts at the finnest scales (64-bit)

joCurvelet2D(32,32;all_crvlts=true)

real transform with zeros at the finnest scales (64-bit)

joCurvelet2D(32,32;zero_finest=true)

complex transform with real 64-bit input for forward

joCurvelet2D(32,32;DDT=Float64,real_crvlts=false)

complex transform with just precision specification for curvelets

joCurvelet2D(32,32;DDT=Float32,RDT=Float64,real_crvlts=false)

complex transform with full type specification for curvelets (same as above)

joCurvelet2D(32,32;DDT=Float32,RDT=ComplexF64,real_crvlts=false)
source
JOLI.joCurvelet2DnoFFTMethod
julia> op = joCurvelet2DnoFFT(n1,n2;[DDT=joComplex,][RDT=DDT,]
                [nbscales=...,][nbangles_coarse=...,][all_crvlts=...,]
                [real_crvlts=...,][zero_finest=...,][name=...])

2D Curvelet transform (wrapping) over fast dimensions without FFT

Signature

function joCurvelet2DnoFFT(n1::Integer,n2::Integer;DDT::DataType=joFloat,RDT::DataType=DDT,
        nbscales::Integer=0,
        nbangles_coarse::Integer=16,
        all_crvlts::Bool=false,
        real_crvlts::Bool=true,
        zero_finest::Bool=false,
        name::String="joCurvelt2DnoFFT")

Arguments

  • n1,n2: image sizes
  • keywords
    • nbscales: # of scales (requires #>=default; defaults to max(1,ceil(log2(min(n1,n2))-3)))
    • nbangles_coarse: # of angles at coarse scale (requires #%4==0, #>=8; defaults to 16)
    • all_crvlts: curvelets at finnest scales (defaults to false)
    • real_crvlts: real transform (defaults to true) and requires real input
    • zero_finest: zero out finnest scales (defaults to false)
    • DDT: domain data type
    • RDT: range data type
    • name: custom name

Notes

  • real joCurvelet2DnoFFT passed adjoint test while either combined with joDFT, or with isadjont flag userange=true
  • isadjoint test at larger sizes (above 128) might require reseting tollerance to bigger number.

Examples

real transform (64-bit)

joCurvelet2DnoFFT(32,32)

complex transform (64-bit)

joCurvelet2DnoFFT(32,32;real_crvlts=false)

real transform with curevelts at the finnest scales (64-bit)

joCurvelet2DnoFFT(32,32;all_crvlts=true)

real transform with zeros at the finnest scales (64-bit)

joCurvelet2DnoFFT(32,32;zero_finest=true)

complex transform with complex 64-bit input for forward

joCurvelet2DnoFFT(32,32;DDT=Float64,real_crvlts=false)

complex transform with just precision specification for curvelets

joCurvelet2DnoFFT(32,32;DDT=Float32,RDT=Float64,real_crvlts=false)

complex transform with full type specification for curvelets (same as above)

joCurvelet2DnoFFT(32,32;DDT=Float32,RDT=ComplexF64,real_crvlts=false)
source
JOLI.joDAdistributedLinOpMethod
julia> joDAdistributedLinOp(A,nvc; [parts] [,fclean] [,rclean])

Create a linear operator working on 2D DArray in multi-vector (over 2nd dimension) mode.

Signature

function joDAdistributedLinOp(wpool::WorkerPool,A::joAbstractLinearOperator{DDT,RDT},nvc::Integer,
    parts::Vector{INT}=joPAsetup_etc.balanced_partition(nworkers(wpool),nvc);
    fclean::Bool=false,rclean::Bool=false) where {DDT<:Number,RDT<:Number,INT<:Integer}
joDAdistributedLinOp(A::joAbstractLinearOperator{ADDT,ARDT},nvc::Integer,
    parts::Vector{INT}=joPAsetup_etc.balanced_partition(nworkers(),nvc);
    fclean::Bool=false,rclean::Bool=false) where {ADDT<:Number,ARDT<:Number,INT<:Integer}

Arguments

  • A: joAbstractLinearOperator type
  • nvc: number of columns in multi-vector
  • parts: custom partitioning of 2nd diemnsion
  • fclean: close DArray after forward operation
  • rclean: close DArray after forward operation in transpose/adjoint mode

Examples

  • joDAdistributedLinOp(A,30): operator that will apply A to distributed multivector with 30 columns

Notes

  • nvc must be >= then # of workers in the WorkerPool
source
JOLI.joDAdistributedLinOpMethod
julia> joDAdistributedLinOp(A,psin; [,fclean] [,rclean])

Create a linear operator working on 2D DArray in multi-vector (over 2nd dimension) mode.

Signature

function joDAdistributedLinOp(A::joAbstractLinearOperator{DDT,RDT},psin::joPAsetup,
    fclean::Bool=false,rclean::Bool=false) where {DDT<:Number,RDT<:Number,INT<:Integer}

Arguments

  • A: joAbstractLinearOperator type
  • psin: parallel setup from jpPAsetup
  • fclean: close DArray after forward operation
  • rclean: close DArray after forward operation in transpose/adjoint mode

Examples

  • ps=joPAsetup((12,30)): define parallel setup for operator with 12 columns and multi-vector with 30 columns
  • joDAdistributedLinOp(A,ps): operator that will apply A to distributed multi-vector with 30 columns

Notes

  • nvc of joPAsetup must be >= then # of workers in the WorkerPool
  • DT in joPAsetup will be overwritten by DDT of the operator
source
JOLI.joDCTMethod
julia> op = joDCT(m[,n[,...]];[planned::Bool=true][,DDT=joFloat][,RDT=DDT])

Multi-dimensional DCT transform over fast dimension(s)

Signature

function joDCT(ms::Integer...;
    planned::Bool=true,
    DDT::DataType=joFloat,RDT::DataType=DDT,
    name::String="joDCT")

Arguments

  • m: dimension
  • optional
    • n,...: more dimensions
  • keywords
    • planned: use DCT plan
    • DDT: domain data type
    • RDT: range data type
    • name: custom name

Notes

  • multidimensional image must be vectorized
  • if you intend to use joDCT in remote* calls, you have to either set planned=false or create the operator on the worker
  • joDCT is always planned if applied to multi-vector

Examples

1D DCT

joDCT(m)

1D DCT without the precomputed plan

joDCT(m; planned=false)

2D DCT

joDCT(m,n)

examples with DDT/RDT

joDCT(m; DDT=Float32)
joDCT(m; DDT=Float32,RDT=Float64)
source
JOLI.joDFTMethod
julia> op = joDFT(m[,n[,...]];[plannned=...,][centered=...,][DDT=...,][RDT=...,][name=...])

Multi-dimensional FFT transform over fast dimension(s)

Signature

function joDFT(ms::Integer...;
    planned::Bool=true, centered::Bool=false,
    DDT::DataType=joFloat, RDT::DataType=(DDT<:Real ? Complex{DDT} : DDT),
    name::String="joDFT")

Arguments

  • m: dimension
  • optional
    • n,...: more dimensions
  • keywords
    • planned: use FFTW plan
    • centered: produce centered coefficients
    • DDT: domain data type
    • RDT: range data type
    • name: custom name

Notes

  • multidimensional image must be vectorized
  • if DDT:<Real then imaginary part will be neglected for transpose/adjoint
  • if you intend to use joDFT in remote* calls, you have to either set planned=false or create the operator on the worker
  • joDFT is always planned if applied to multi-vector

Examples

1D FFT

joDFT(m)

1D FFT with centered coefficients

joDFT(m; centered=true)

1D FFT without the precomputed plan

joDFT(m; planned=false)

2D FFT

joDFT(m,n)

examples with DDT/RDT

joDFT(m; DDT=Float32)
joDFT(m; DDT=Float32,RDT=ComplexF64)
source
JOLI.joDWTFunction
julia> op = joDWT(m,[n,][wt];[L=...,][DDT=...,][RDT=...])

1/2-dimensional DWT transform over fast dimension(s) - based on Wavelets.jl. See Wavelets.jl package form more information, especially current filter list.

Signature

function joDWT(m::Integer,n::Integer,wt::OrthoFilter=wavelet(WT.haar);
    L::Integer=maxtransformlevels(min(m,n)),
    DDT::DataType=joFloat,RDT::DataType=DDT,
    name::String="joDWT")

Arguments

  • m: dimention
  • optional
    • n: 2nd dimention
    • wt: wavelet filter (Haar by default)
  • keywords
    • L: number of levels
    • DDT: domain data type
    • RDT: range data type
    • name: custom name

Notes

  • only square 2D arrays are supported for now due to limitations of Wavelets.jl package

Examples

1D DWT with default wavelet (Haar wavelet)

joDWT(m)

define wavelet

wt=wavelet(WT.haar)

1D DWT

joDWT(m,wt)

2D DWT

joDWT(m,n,wt)

examples with DDT/RDT

joDWT(m,wt; DDT=Float32)
joDWT(m,wt; DDT=Float32,RDT=Float64)
source
JOLI.joDiagMethod
julia> op = joDiag(v;[makecopy=...,][DDT=...,][RDT=...,][name=...])

Diagonal matrix with elements from given vector

Signature

function joDiag(v::LocalVector{EDT};makecopy::Bool=true,
    DDT::DataType=EDT,RDT::DataType=promote_type(EDT,DDT),name::String="joDiag") where {EDT}

Arguments

  • v: vector of diagonal elements
  • keywords
    • DDT: domain data type
    • RDT: range data type
    • name: custom name

Examples

joDiag(rand(m))

examples with DDT/RDT

joDiag(rand(m); DDT=Float32)
joDiag(rand(m); DDT=Float32,RDT=Float64)
source
JOLI.joDictMethod
julia> op = joDict(op1[,op2][,...];[weights=...,][name=...])

Dictionary (single block row) operator composed from different JOLI operators

Signature

joDict(ops::joAbstractLinearOperator...;
    weights::LocalVector{WDT}=zeros(0),name::String="joDict")
        where {WDT<:Number}

Arguments

  • op#: JOLI operators (subtypes of joAbstractLinearOperator)
  • keywords
    • weights: vector of waights for each operator
    • name: custom name

Notes

  • all operators must have the same # of rows (M)
  • all given operators must have same domain/range types
  • the domain/range types of joDict are equal to domain/range types of the given operators

Example

define operators

a=rand(ComplexF64,4,4);
A=joMatrix(a;DDT=ComplexF32,RDT=ComplexF64,name="A")
b=rand(ComplexF64,4,8);
B=joMatrix(b;DDT=ComplexF32,RDT=ComplexF64,name="B")
c=rand(ComplexF64,4,6);
C=joMatrix(c;DDT=ComplexF32,RDT=ComplexF64,name="C")

define weights if needed

w=rand(ComplexF64,3)

basic dictionary in function syntax

D=joDict(A,B,C)

basic dictionary in [] syntax

D=[A B C]

weighted dictionary

D=joDict(A,B,C;weights=w)
source
JOLI.joDictMethod
julia> op = joDict(l,op;[weights=...,][name=...])

Dictionary operator composed from l-times replicated square JOLI operator

Signature

joDict(l::Integer,op::joAbstractLinearOperator;
    weights::LocalVector{WDT}=zeros(0),name::String="joDict")
        where {WDT<:Number}

Arguments

  • l: # of replcated blocks
  • op: JOLI operators (subtypes of joAbstractLinearOperator)
  • keywords
    • weights: vector of waights for each operator
    • name: custom name

Notes

  • all operators must have the same # of rows (M)
  • all given operators must have same domain/range types
  • the domain/range types of joDict are equal to domain/range types of the given operators

Example

a=rand(ComplexF64,4,4);
A=joMatrix(a;DDT=ComplexF32,RDT=ComplexF64,name="A")

define weights if needed

w=rand(ComplexF64,3)

basic dictionary

D=joDict(3,A)

weighted dictionary

D=joDict(3,A;weights=w)
source
JOLI.joDiracMethod
joDirac(m;[DDT=...,][RDT=...,][name=...])

Dirac operator

Signature

joDirac(m::Integer;DDT::DataType=joFloat,RDT::DataType=DDT,name::String="joDirac")

Arguments

Arguments

  • m: size
  • keywords
    • DDT: domain data type
    • RDT: range data type
    • name: custom name

Examples

A=joDirac(3)

examples with DDT/RDT

A=joDirac(3; DDT=Float32)
A=joDirac(3; DDT=Float32,RDT=Float64)
source
JOLI.joExtendMethod
julia> op = joExtend(n,pad_type;[pad_lower=...,][pad_upper=...,][DDT=...,][RDT=...,][name=...])

1D extension operator

Signature

function joExtend(n::Integer,pad_type::Symbol;
    pad_upper::Integer=0,pad_lower::Integer=0,
    DDT::DataType=joFloat,RDT::DataType=DDT,
    name="joExtend")

Arguments

  • n : size of input vector
  • pad_type : one of the symbols
    • :zeros : pad signal with zeros
    • :border : pad signal with values at the edge of the domain
    • :mirror : mirror extension of the signal
    • :periodic : periodic extension of the signal
  • keywords
    • pad_lower : number of points to pad on the lower index end
    • pad_upper : number of points to pad on the upper index end
    • DDT: domain data type
    • RDT: range data type
    • name: custom name

Examples

extend a n-length vector with 10 zeros on either side

joExtend(n,:zeros; pad_lower=10,pad_upper=10)

append, to a n-length vector, so that x[n+1:n+10] = x[n]

joExtend(n,:border; pad_upper=10)

prepend, to n-length vector, its mirror extension: y=[reverse(x[1:10]);x]

joExtend(n,:mirror; pad_lower=10)

append, to n-length vector, its periodic extension: y=[x;x[1:10]]

joExtend(n,:periodic; pad_upper=10)

examples with DDT/RDT

joExtend(n,:mirror; pad_lower=10,DDT=Float32)
joExtend(n,:periodic; pad_upper=10,DDT=Float32,RDT=Float64)
source
JOLI.joEyeMethod
julia> op = joEye(m,n;[DDT=...,][RDT=...,][name=...])

Identity matrix - rectangular

Signature

joEye(m::Integer,n::Integer;DDT::DataType=joFloat,RDT::DataType=DDT,name::String="joEye")

Arguments

  • m,n: sizes
  • keywords
    • DDT: domain data type
    • RDT: range data type
    • name: custom name

Examples

joEye(m,n)

examples with DDT/RDT

joEye(m,n; DDT=Float32)
joEye(m,n; DDT=Float32,RDT=Float64)
source
JOLI.joEyeMethod
julia> op = joEye(m;[DDT=...,][RDT=...,][name=...])

Identity matrix - square

Signature

joEye(m::Integer;DDT::DataType=joFloat,RDT::DataType=DDT,name::String="joEye")

Arguments

  • m: sizes
  • keywords
    • DDT: domain data type
    • RDT: range data type
    • name: custom name

Examples

joEye(m)

examples with DDT/RDT

joEye(m; DDT=Float32)
joEye(m; DDT=Float32,RDT=Float64)
source
JOLI.joGaussianFunction
julia> op = joGaussian(M,[N];
            [implicit=...,][normalized=...,][orthonormal=...,][RNG=...,]
            [DDT=...,][RDT=...,][name=...])

Gausian matrix

Signature

joGaussian(M::Integer,N::Integer=M;
    implicit::Bool=false,normalized::Bool=false,orthonormal::Bool=false,
    RNG::AbstractRNG=Random.seed!(),
    DDT::DataType=joFloat,RDT::DataType=DDT,
    name::String="joGaussian")

Arguments

  • M[,N]: sizes
  • keywords
    • implicit: keyword element-free operator if true
    • normalized: keyword normalized (unit global-norm for explicit or unit-column norm for implicit) operator if true
    • orthonormal: keyword explict orthonormal operator if true (above implicit/normalized is ignorred); requires M<=N
    • RNG: keyword random number generator function with explicit seeding
    • DDT: domain data type
    • RDT: range data type
    • name: custom name

Notes

  • AbstractRNG has to support seeding (RNG.seed atribute to type); e.g. RandomDevice() will not work

Examples

not-normalized and explict dense matrix

A=joGaussian(M,N)

explicit orthonormal dense matrix

A=joGaussian(M,orthonormal=true)

not-normalized and element-free operator

A=joGaussian(M,implicit=true)

normalized and explict dense matrix

A=joGaussian(M,normalized=true)

normalized and element-free operator

A=joGaussian(M,implicit=true,normalized=true)

examples with DDT/RDT

A=joGaussian(M,N; DDT=Float32)
A=joGaussian(M,N; DDT=Float32,RDT=Float64)
source
JOLI.joImagMethod
julia> op = joImag(m;[VDP=...,][name=...])

Takes imag part of vector (experimantal).

transpose/adjont puts the real vector into imag part of the complex vector with zero real part

Signature

joReal(m::Integer;VDP::DataType=joFloat,name::String="joImag")

Arguments

  • m: vector size
  • keywords
    • VDP: float element type of Complex number in vector
    • name: custom name
source
JOLI.joLinInterp1DMethod
julia> joLinInterp1D(xin,xout;[DDT=...,][RDT=...,][name=...])

1D Linear interpolation operator

Signature

function joLinInterp1D(xin::AbstractArray{T,1},xout::AbstractArray{T,1};
    DDT::DataType=T,RDT::DataType=DDT,name::String="joLinInterp1D") where {T<:AbstractFloat}

Arguments

  • xin - input grid
  • xout - output grid
  • keywords
    • DDT: domain data type
    • RDT: range data type
    • name: custom name

Notes

  • The interval [minimum(xout),maximum(xout)] must be contained in the interval [minimum(xin),maximum(xin)]

Examples

% description

joLinInterp1D(xin,xout)

examples with DDT/RDT

joLinInterp1D(xin,xout; DDT=Float32)
joLinInterp1D(xin,xout; DDT=Float32,RDT=Float64)
source
JOLI.joLinearFunctionAllFunction

joLinearFunction outer constructor

joLinearFunctionAll(m::Integer,n::Integer,
    fop::Function,fop_T::Function,fop_A::Function,fop_C::Function,
    iop::Function,iop_T::Function,iop_A::Function,iop_C::Function,
    DDT::DataType,RDT::DataType=DDT;
    fMVok::Bool=false,iMVok::Bool=false,
    name::String="joLinearFunctionAll")

Look up argument names in help to joLinearFunction type.

Notes

  • the developer is responsible for ensuring that used functions take/return correct DDT/RDT
source
JOLI.joLinearFunctionFwdFunction

joLinearFunction outer constructor

joLinearFunctionFwd(m::Integer,n::Integer,
    fop::Function,fop_T::Function,fop_A::Function,fop_C::Function,
    DDT::DataType,RDT::DataType=DDT;
    fMVok::Bool=false,
    name::String="joLinearFunctionFwd")

Look up argument names in help to joLinearFunction type.

Notes

  • the developer is responsible for ensuring that used functions take/return correct DDT/RDT
source
JOLI.joLinearFunctionFwd_AFunction

joLinearFunction outer constructor

joLinearFunctionFwd_A(m::Integer,n::Integer,
    fop::Function,fop_A::Function,
    DDT::DataType,RDT::DataType=DDT;
    fMVok::Bool=false,
    name::String="joLinearFunctionFwd_A")

Look up argument names in help to joLinearFunction type.

Notes

  • the developer is responsible for ensuring that used functions take/return correct DDT/RDT
source
JOLI.joLinearFunctionFwd_TFunction

joLinearFunction outer constructor

joLinearFunctionFwd_T(m::Integer,n::Integer,
    fop::Function,fop_T::Function,
    DDT::DataType,RDT::DataType=DDT;
    fMVok::Bool=false,
    name::String="joLinearFunctionFwd_T")

Look up argument names in help to joLinearFunction type.

Notes

  • the developer is responsible for ensuring that used functions take/return correct DDT/RDT
source
JOLI.joLinearFunctionInplaceAllFunction

joLinearFunctionInplace outer constructor

joLinearFunctionInplaceAll(m::Integer,n::Integer,
    fop::Function,fop_T::Function,fop_A::Function,fop_C::Function,
    iop::Function,iop_T::Function,iop_A::Function,iop_C::Function,
    DDT::DataType,RDT::DataType=DDT;
    name::String="joLinearFunctionInplaceAll")

Look up argument names in help to joLinearFunctionInplace type.

Notes

  • the developer is responsible for ensuring that used functions provide correct DDT & RDT
source
JOLI.joLinearFunctionInplaceFwdFunction

joLinearFunctionInplace outer constructor

joLinearFunctionInplaceFwd(m::Integer,n::Integer,
    fop::Function,fop_T::Function,fop_A::Function,fop_C::Function,
    DDT::DataType,RDT::DataType=DDT;
    name::String="joLinearFunctionInplaceAll")

Look up argument names in help to joLinearFunctionInplace type.

Notes

  • the developer is responsible for ensuring that used functions provide correct DDT & RDT
source
JOLI.joLinearFunctionInplaceFwd_AFunction

joLinearFunctionInplace outer constructor

joLinearFunctionInplaceFwd_A(m::Integer,n::Integer,
    fop::Function,fop_A::Function,
    DDT::DataType,RDT::DataType=DDT;
    name::String="joLinearFunctionInplaceFwd_A")

Look up argument names in help to joLinearFunctionInplace type.

Notes

  • the developer is responsible for ensuring that used functions provide correct DDT & RDT
source
JOLI.joLinearFunctionInplaceFwd_TFunction

joLinearFunctionInplace outer constructor

joLinearFunctionInplaceFwd_T(m::Integer,n::Integer,
    fop::Function,fop_T::Function,
    DDT::DataType,RDT::DataType=DDT;
    name::String="joLinearFunctionInplaceFwd_T")

Look up argument names in help to joLinearFunctionInplace type.

Notes

  • the developer is responsible for ensuring that used functions provide correct DDT & RDT
source
JOLI.joLinearFunctionInplace_AFunction

joLinearFunctionInplace outer constructor

joLinearFunctionInplace_A(m::Integer,n::Integer,
    fop::Function,fop_A::Function, iop::Function,iop_A::Function,
    DDT::DataType,RDT::DataType=DDT;
    name::String="joLinearFunctionInplace_A")

Look up argument names in help to joLinearFunctionInplace type.

Notes

  • the developer is responsible for ensuring that used functions provide correct DDT & RDT
source
JOLI.joLinearFunctionInplace_TFunction

joLinearFunctionInplace outer constructor

joLinearFunctionInplace_T(m::Integer,n::Integer,
    fop::Function,fop_T::Function, iop::Function,iop_T::Function,
    DDT::DataType,RDT::DataType=DDT;
    name::String="joLinearFunctionInplace_T")

Look up argument names in help to joLinearFunctionInplace type.

Notes

  • the developer is responsible for ensuring that used functions provide correct DDT & RDT
source
JOLI.joLinearFunction_AFunction

joLinearFunction outer constructor

joLinearFunction_A(m::Integer,n::Integer,
    fop::Function,fop_A::Function, iop::Function,iop_A::Function,
    DDT::DataType,RDT::DataType=DDT;
    fMVok::Bool=false,iMVok::Bool=false,
    name::String="joLinearFunction_A")

Look up argument names in help to joLinearFunction type.

Notes

  • the developer is responsible for ensuring that used functions take/return correct DDT/RDT
source
JOLI.joLinearFunction_TFunction

joLinearFunction outer constructor

joLinearFunction_T(m::Integer,n::Integer,
    fop::Function,fop_T::Function, iop::Function,iop_T::Function,
    DDT::DataType,RDT::DataType=DDT;
    fMVok::Bool=false,iMVok::Bool=false,
    name::String="joLinearFunction_T")

Look up argument names in help to joLinearFunction type.

Notes

  • the developer is responsible for ensuring that used functions take/return correct DDT/RDT
source
JOLI.joLooseLinearFunctionAllFunction

joLooseLinearFunction outer constructor

joLooseLinearFunctionAll(m::Integer,n::Integer,
    fop::Function,fop_T::Function,fop_A::Function,fop_C::Function,
    iop::Function,iop_T::Function,iop_A::Function,iop_C::Function,
    DDT::DataType,RDT::DataType=DDT;
    fMVok::Bool=false,iMVok::Bool=false,
    name::String="joLooseLinearFunctionAll")

Look up argument names in help to joLooseLinearFunction type.

Notes

  • the developer is responsible for ensuring that used functions take/return correct DDT/RDT
source
JOLI.joLooseLinearFunctionFwdFunction

joLooseLinearFunction outer constructor

joLooseLinearFunctionFwd(m::Integer,n::Integer,
    fop::Function,fop_T::Function,fop_A::Function,fop_C::Function,
    DDT::DataType,RDT::DataType=DDT;
    fMVok::Bool=false,
    name::String="joLooseLinearFunctionAll")

Look up argument names in help to joLooseLinearFunction type.

Notes

  • the developer is responsible for ensuring that used functions take/return correct DDT/RDT
source
JOLI.joLooseLinearFunctionFwd_AFunction

joLooseLinearFunction outer constructor

joLooseLinearFunctionFwd_A(m::Integer,n::Integer,
    fop::Function,fop_A::Function,
    DDT::DataType,RDT::DataType=DDT;
    fMVok::Bool=false,
    name::String="joLooseLinearFunctionFwd_A")

Look up argument names in help to joLooseLinearFunction type.

Notes

  • the developer is responsible for ensuring that used functions take/return correct DDT/RDT
source
JOLI.joLooseLinearFunctionFwd_TFunction

joLooseLinearFunction outer constructor

joLooseLinearFunctionFwd_T(m::Integer,n::Integer,
    fop::Function,fop_T::Function,
    DDT::DataType,RDT::DataType=DDT;
    fMVok::Bool=false,
    name::String="joLooseLinearFunctionFwd_T")

Look up argument names in help to joLooseLinearFunction type.

Notes

  • the developer is responsible for ensuring that used functions take/return correct DDT/RDT
source
JOLI.joLooseLinearFunctionInplaceAllFunction

joLooseLinearFunctionInplace outer constructor

joLooseLinearFunctionInplaceAll(m::Integer,n::Integer,
    fop::Function,fop_T::Function,fop_A::Function,fop_C::Function,
    iop::Function,iop_T::Function,iop_A::Function,iop_C::Function,
    DDT::DataType,RDT::DataType=DDT;
    name::String="joLooseLinearFunctionInplaceAll")

Look up argument names in help to joLooseLinearFunctionInplace type.

Notes

  • the developer is responsible for ensuring that used functions provide correct DDT & RDT
source
JOLI.joLooseLinearFunctionInplaceFwdFunction

joLooseLinearFunctionInplace outer constructor

joLooseLinearFunctionInplaceFwd(m::Integer,n::Integer,
    fop::Function,fop_T::Function,fop_A::Function,fop_C::Function,
    DDT::DataType,RDT::DataType=DDT;
    name::String="joLooseLinearFunctionInplaceAll")

Look up argument names in help to joLooseLinearFunctionInplace type.

Notes

  • the developer is responsible for ensuring that used functions provide correct DDT & RDT
source
JOLI.joLooseLinearFunctionInplaceFwd_AFunction

joLooseLinearFunctionInplace outer constructor

joLooseLinearFunctionInplaceFwd_A(m::Integer,n::Integer,
    fop::Function,fop_A::Function,
    DDT::DataType,RDT::DataType=DDT;
    name::String="joLooseLinearFunctionInplaceFwd_A")

Look up argument names in help to joLooseLinearFunctionInplace type.

Notes

  • the developer is responsible for ensuring that used functions provide correct DDT & RDT
source
JOLI.joLooseLinearFunctionInplaceFwd_TFunction

joLooseLinearFunctionInplace outer constructor

joLooseLinearFunctionInplaceFwd_T(m::Integer,n::Integer,
    fop::Function,fop_T::Function,
    DDT::DataType,RDT::DataType=DDT;
    name::String="joLooseLinearFunctionInplaceFwd_T")

Look up argument names in help to joLooseLinearFunctionInplace type.

Notes

  • the developer is responsible for ensuring that used functions provide correct DDT & RDT
source
JOLI.joLooseLinearFunctionInplace_AFunction

joLooseLinearFunctionInplace outer constructor

joLooseLinearFunctionInplace_A(m::Integer,n::Integer,
    fop::Function,fop_A::Function, iop::Function,iop_A::Function,
    DDT::DataType,RDT::DataType=DDT;
    name::String="joLooseLinearFunctionInplace_A")

Look up argument names in help to joLooseLinearFunctionInplace type.

Notes

  • the developer is responsible for ensuring that used functions provide correct DDT & RDT
source
JOLI.joLooseLinearFunctionInplace_TFunction

joLooseLinearFunctionInplace outer constructor

joLooseLinearFunctionInplace_T(m::Integer,n::Integer,
    fop::Function,fop_T::Function, iop::Function,iop_T::Function,
    DDT::DataType,RDT::DataType=DDT;
    name::String="joLooseLinearFunctionInplace_T")

Look up argument names in help to joLooseLinearFunctionInplace type.

Notes

  • the developer is responsible for ensuring that used functions provide correct DDT & RDT
source
JOLI.joLooseLinearFunction_AFunction

joLooseLinearFunction outer constructor

joLooseLinearFunction_A(m::Integer,n::Integer,
    fop::Function,fop_A::Function, iop::Function,iop_A::Function,
    DDT::DataType,RDT::DataType=DDT;
    fMVok::Bool=false,iMVok::Bool=false,
    name::String="joLooseLinearFunction_A")

Look up argument names in help to joLooseLinearFunction type.

Notes

  • the developer is responsible for ensuring that used functions take/return correct DDT/RDT
source
JOLI.joLooseLinearFunction_TFunction

joLooseLinearFunction outer constructor

joLooseLinearFunction_T(m::Integer,n::Integer,
    fop::Function,fop_T::Function, iop::Function,iop_T::Function,
    DDT::DataType,RDT::DataType=DDT;
    fMVok::Bool=false,iMVok::Bool=false,
    name::String="joLooseLinearFunction_T")

Look up argument names in help to joLooseLinearFunction type.

Notes

  • the developer is responsible for ensuring that used functions take/return correct DDT/RDT
source
JOLI.joMaskMethod
julia> op = joMask(mask;[makecopy=...,][DDT=...,][RDT=...,][name=...])

Mask operator with BitArray mask

Signature

function joMask(mask::BitArray{1};
    makecopy::Bool=true,DDT::DataType=joFloat,RDT::DataType=DDT,name::String="joMask")

Arguments

  • mask: BitArray mask of true indecies
  • keywords
    • makecopy: copy mask array
    • DDT: domain data type
    • RDT: range data type
    • name: custom name

Examples

define BitArray mask and operator

mask=falses(3)
mask[[1,3]]=true

A=joMask(mask)

examples with RDT/DDT

A=joMask(mask; DDT=Float32)
A=joMask(mask; DDT=Float32,RDT=Float64)
source
JOLI.joMaskMethod
julia> op = joMask(n,idx;[DDT=...,][RDT=...,][name=...])

Mask operator with index array

Signature

function joMask(n::Integer,idx::Vector{VDT};
    DDT::DataType=joFloat,RDT::DataType=DDT,name::String="joMask") where {VDT<:Integer}

Arguments

  • n: size of square operator
  • idx: vector of true indecies
  • keywords
    • DDT: domain data type
    • RDT: range data type
    • name: custom name

Examples

A=joMask(3,[1,3])

examples with DDT/RDT

A=joMask(3,[1,3]; DDT=Float32)
A=joMask(3,[1,3]; DDT=Float32,RDT=Float64)
source
JOLI.joNFFTFunction
julia> op = joNFFT(N,nodes[,m=...][,sigma=...][,window=...][,K=...];
            [centered=...,][DDT=...,][RDT=...,][name=...])

1D NFFT transform over fast dimension (wrapper to https://github.com/tknopp/NFFT.jl)

Signature

function joNFFT(N::Integer,pos::Vector{joFloat},
    m=4,sigma=2.0,window=:kaiser_bessel,K=2000; centered::Bool=false,
    DDT::DataType=joComplex,RDT::DataType=DDT,name::String="joNFFT")

Arguments

  • N: size
  • nodes: nodes' positions
  • optional
    • see https://github.com/tknopp/NFFT.jl for info about optional parameters to NFFTplan: m, sigma, window, and K
  • keywords
    • centered: return centered coefficients
    • DDT: domain data type
    • RDT: range data type
    • name: custom name

Notes

  • NFFT always uses ComplexF64 vectors internally

Examples

1D NFFT

joNFFT(N,nodes)

centered coefficients

joNFFT(N,nodes; centered=true)

examples with DDT/RDT

% joNFFT(N,nodes; DDT=ComplexF32)
% joNFFT(N,nodes; DDT=ComplexF32,RDT=ComplexF64)
source
JOLI.joOnesFunction
julia> op = joOnes(m[,n];[DDT=...,][RDT=...,][name=...])

Operator equivalent to matrix of zerso

Signature

joOnes(m::Integer,n::Integer=m;
    DDT::DataType=joFloat,RDT::DataType=DDT,name::String="joOnes")

Arguments

  • m: size
  • optional
    • n: 2nd dimension if not square
  • keywords
    • DDT: domain data type
    • RDT: range data type
    • name: custom name

Examples

joOnes(m)
joOnes(m,n)

examples with DDT/RDT

joOnes(m; DDT=Float32)
joOnes(m; DDT=Float32,RDT=Float64)
source
JOLI.joOuterProdMethod
julia> op = joOuterProd(U,V;[DDT=...,][RDT=...,][name=...])

Memory efficient implementation of operator A = U*V'

Signature

joOuterProd(U::LocalVecOrMat{UDT},V::LocalVecOrMat{VDT};
    DDT::DataType=joFloat,RDT::DataType=promote_type(UDT,VDT,DDT),name::String="joOuterProd")
        where {UDT<:Number,VDT<:Number}

Arguments

  • U: left vector or matrix
  • V: right vector or matrix
  • keywords
    • DDT: domain data type
    • RDT: range data type
    • name: custom name

Notes

  • 2nd dimension of U and V must match

Examples

A=joOuterProd(rand(4),rand(5))
A=joOuterProd(rand(4,2),rand(5,2))

examples with DDT/RDT

A=joOuterProd(rand(4),rand(5); DDT=Float32)
A=joOuterProd(rand(4),rand(5); DDT=Float32,RDT=Float64)
source
JOLI.joPermutationMethod
julia> op = joPermutation(perm;[DDT=...,][RDT=...,][name=...])

Permiutation operator

Signature

function joPermutation(perm::LocalVector{T};
    DDT::DataType=joFloat,RDT::DataType=DDT,name::String="joPermutation") where {T<:Integer}

Arguments

  • perm: permiutation vector
  • keywords
    • DDT: domain data type
    • RDT: range data type
    • name: custom name

Examples

joPermutation([3, 1, 2])

examples with DDT/RDT

joPermutation([3, 1, 2]; DDT=Float32)
joPermutation([3, 1, 2]; DDT=Float32,RDT=Float64)
source
JOLI.joRealMethod
julia> op = joReal(m;[VDP=...,][name=...])

Takes real part of vector (experimantal).

transpose/adjont puts the real vector into real part of the complex vector with zero imag part

Signature

joReal(m::Integer;VDP::DataType=joFloat,name::String="joReal")

Arguments

  • m: vector size
  • keywords
    • VDP: float element type of Complex number in vector
    • name: custom name
source
JOLI.joRestrictionMethod
julia> op = joRestriction(n,idx;[makecopy=...,][DDT=...,][RDT=...,][name=...])

Restriction operator

Signature

function joRestriction(n::Integer,idx::LocalVector{idxdt};
    makecopy::Bool=true,DDT::DataType=joFloat,RDT::DataType=DDT,name::String="joRestriction")
        where {idxdt<:Integer}

Arguments

  • n: number of columns
  • idx: vector of indecies
  • keywords
    • makecopy: make private copy of indecies vector
    • DDT: domain data type
    • RDT: range data type
    • name: custom name

Examples

A=joRestriction(3,[1,3])

examples with DDT/RDT

A=joRestriction(3,[1,3];DDT=Float32)
A=joRestriction(3,[1,3];DDT=Float32,RDT=Float64)
source
JOLI.joRombergMethod
julia> op = joRomberg(n1[,n2[,...]];[DDT=...,][RDT=...,][name=...])

A random comvolution based on Romberg 08

Signature

joRomberg(dims::Integer...;
    DDT::DataType=joFloat,RDT::DataType=DDT,name::String="joRomberg")

Arguments

  • n1[,n2[...]]: dimensions of the image; M=N=prod(ni)
  • keywords
    • DDT: domain data type
    • RDT: range data type
    • name: custom name

Examples

A=joRomberg(9)
A=joRomberg(9,11)

examples with DDT/RDT

A=joRomberg(9,11; DDT=Float32)
A=joRomberg(9,11; DDT=Float32,RDT=Float64)
source
JOLI.joSAdistributedLinOpMethod
julia> joSAdistributedLinOp(A,nvc; [parts] [,fclean] [,rclean])

Create a linear operator working on 2D SharedArray in multi-vector (over 2nd dimension) mode.

Signature

function joSAdistributedLinOp(wpool::WorkerPool,A::joAbstractLinearOperator{DDT,RDT},nvc::Integer,
    parts::Vector{INT}=joPAsetup_etc.balanced_partition(nworkers(wpool),nvc);
    fclean::Bool=false,rclean::Bool=false) where {DDT<:Number,RDT<:Number,INT<:Integer}
joSAdistributedLinOp(A::joAbstractLinearOperator{ADDT,ARDT},nvc::Integer,
    parts::Vector{INT}=joPAsetup_etc.balanced_partition(nworkers(),nvc);
    fclean::Bool=false,rclean::Bool=false) where {ADDT<:Number,ARDT<:Number,INT<:Integer}

Arguments

  • A: joAbstractLinearOperator type
  • nvc: number of columns in multi-vector
  • parts: custom partitioning of 2nd diemnsion
  • fclean: close SharedArray after forward operation
  • rclean: close SharedArray after forward operation in transpose/adjoint mode

Examples

  • joSAdistributedLinOp(A,30): operator that will apply A to distributed multivector with 30 columns

Notes

  • nvc must be >= then # of workers in the WorkerPool
source
JOLI.joSAdistributedLinOpMethod
julia> joSAdistributedLinOp(A,psin; [,fclean] [,rclean])

Create a linear operator working on 2D SharedArray in multi-vector (over 2nd dimension) mode.

Signature

function joSAdistributedLinOp(A::joAbstractLinearOperator{DDT,RDT},psin::joPAsetup,
    fclean::Bool=false,rclean::Bool=false) where {DDT<:Number,RDT<:Number,INT<:Integer}

Arguments

  • A: joAbstractLinearOperator type
  • psin: parallel setup from jpPAsetup
  • fclean: close SharedArray after forward operation
  • rclean: close SharedArray after forward operation in transpose/adjoint mode

Examples

  • ps=joPAsetup((12,30)): define parallel setup for operator with 12 columns and multi-vector with 30 columns
  • joSAdistributedLinOp(A,ps): operator that will apply A to distributed multi-vector with 30 columns

Notes

  • nvc of joPAsetup must be >= then # of workers in the WorkerPool
  • DT in joPAsetup will be overwritten by DDT of the operator
source
JOLI.joSWTFunction
julia> op = joSWT(m,[wt,];[L=...,][DDT=...,][RDT=...])

1-dimensional SWT transform based on PyWavelets. Only 1D is supported currently in JOLI but n-dimensional supported in PyWavelets. Choice of wavelet is fixed to "db20"

Signature

function joSWT(m::Integer, wt::String="db20";
    L::Integer=maxtransformlevels(min(m,n)),
    DDT::DataType=joFloat,RDT::DataType=DDT,
    name::String="joDWT")

Arguments

  • m: dimention
  • optional
    • wt: wavelet filter ("db20" by default) see for options:
    https://github.com/PyWavelets/pywt/blob/master/pywt/extensions/waveletslist.pxi
  • keywords
    • L: number of levels
    • DDT: domain data type
    • RDT: range data type
    • name: custom name

Notes

  • only 1D arrays are supported for now due to limitations of author time.
  • only orthogonal wavelets should be used from ["haar", "db", "sym", "coif"] to have access to adjoint via inverse.

Examples

1D DWT with default wavelet (Daubechie20 wavelet)

joSWT(m)

examples with DDT/RDT

joDWT(m,"db20"; DDT=Float32)
joDWT(m,"sym5"; DDT=Float32,RDT=Float64)
source
JOLI.joSincInterpMethod
julia> joSincInterp(xin,xout;[r=...,][DDT=...,][RDT=...,][name=...])

sinc interpolation matrix for interpolating functions f defined on grid xin to functions defined on grid xout

Signature

function joSincInterp(xin::AbstractArray{T,1},xout::AbstractArray{T,1};
    r::I=0,DDT::DataType=T,RDT::DataType=DDT,name::String="joSincInterp")
    where {T<:AbstractFloat,I<:Integer}

Arguments

  • xin - 1D input grid
  • xout - 1D output grid
  • keywords
    • r: kaiser window parameter (default: 0, no windowing)
    • DDT: domain data type
    • RDT: range data type
    • name: custom name

Notes

  • If xout has more than one point, the spacings of xin and xout are normalized to the spacing of xout.

Examples

% description

joSincInterp(xin,xout)

examples with DDT/RDT

% joSincInterp(xin,xout; DDT=Float32)
% joSincInterp(xin,xout; DDT=Float32,RDT=Float64)
source
JOLI.joStackMethod
julia> op = joStack(op1[,op2][,...];[weights=...,][name=...])

Stack operator (single block column) composed from different JOLI operators

Signature

joStack(ops::joAbstractLinearOperator...;
    weights::LocalVector{WDT}=zeros(0),name::String="joStack")
        where {WDT<:Number}

Arguments

  • op#: JOLI operators (subtypes of joAbstractLinearOperator)
  • keywords
    • weights: vector of waights for each operator
    • name: custom name

Notes

  • all operators must have the same # of columns (N)
  • all given operators must have same domain/range types
  • the domain/range types of joStack are equal to domain/range types of the given operators

Example

define operators

a=rand(ComplexF64,4,4);
A=joMatrix(a;DDT=ComplexF32,RDT=ComplexF64,name="A")
b=rand(ComplexF64,8,4);
B=joMatrix(b;DDT=ComplexF32,RDT=ComplexF64,name="B")
c=rand(ComplexF64,6,4);
C=joMatrix(c;DDT=ComplexF32,RDT=ComplexF64,name="C")

define weights if needed

w=rand(ComplexF64,3)

basic stack in function syntax

S=joStack(A,B,C)

basic stack in [] syntax

S=[A; B; C]

weighted stack

S=joStack(A,B,C;weights=w)
source
JOLI.joStackMethod
julia> op = joStack(l,op;[weights=...,][name=...])

Stack operator composed from l-times replicated square JOLI operator

Signature

joStack(l::Integer,op::joAbstractLinearOperator;
    weights::LocalVector{WDT}=zeros(0),name::String="joStack")
        where {WDT<:Number}

Arguments

  • l: # of replcated blocks
  • op: JOLI operators (subtypes of joAbstractLinearOperator)
  • keywords
    • weights: vector of waights for each operator
    • name: custom name

Notes

  • all operators must have the same # of columns (N)
  • all given operators must have same domain/range types
  • the domain/range types of joStack are equal to domain/range types of the given operators

Example

define operator

a=rand(ComplexF64,4,4);
A=joMatrix(a;DDT=ComplexF32,RDT=ComplexF64,name="A")

define weights if needed

w=rand(ComplexF64,3)

basic stack

S=joStack(3,A)

weighted stack

S=joStack(3,A;weights=w)
source
JOLI.joZerosFunction
julia> op = joZeros(m[,n];[DDT=...,][RDT=...,][name=...])

Operator equivalent to matrix of ones

Signature

joZeros(m::Integer,n::Integer=m;
    DDT::DataType=joFloat,RDT::DataType=DDT,name::String="joZeros")

Arguments

  • m: size
  • optional
    • n: 2nd dimension if not square
  • keywords
    • DDT: domain data type
    • RDT: range data type
    • name: custom name

Examples

joZeros(m)
joZeros(m,n)

examples with DDT/RDT

joZeros(m; DDT=Float32)
joZeros(m; DDT=Float32,RDT=Float64)
source
JOLI.jo_PAmodeMethod

jo_PAmode - set and query parallel mode

jo_PAmode(verbose=false) - query parallel mode

jo_PAmode([ :SA | :DA ]; verbose=false) - set parallel mode to respectively shared or distributed arrays

source
JOLI.jo_balanced_partitionFunction
julia> jo_balanced_partition(nlabs::Integer,dsize::Integer)

Get balanced partitioning of the dimension (dsize) on n workers (nlabs)

source
JOLI.jo_check_type_matchMethod

Check type match

jo_check_type_match(DT1::DataType,DT2::DataType,where::String)

The bahaviour of the function while types do not match depends on values of jotypemismatchwarn and jotypemismatcherror flags. Use jotypemismatcherrorset to toggle those flags from warning mode to error mode.

EXAMPLE

  • jochecktype_match(Float32,Float64,"my session")
source
JOLI.jo_complex_eltypeMethod

Type of element of complex data type

jo_complex_eltype(DT::DataType)

Example

  • jocomplexeltype(ComplexF32)
source
JOLI.jo_complex_eltypeMethod

Type of element of complex scalar

jo_complex_eltype(a::Complex)

Example

  • jocomplexeltype(1.+im*1.)
  • jocomplexeltype(zero(ComplexF64))
source
JOLI.jo_convertMethod

Convert number to new type

jo_convert(DT::DataType,n::Number,warning::Bool=true)

Limitations

  • converting integer number to shorter representation will throw an error
  • converting float/complex number to integer will throw an error
  • converting from complex to float drops immaginary part and issues warning; use joconvertwarn_set(false) to turn off the warning

Example

  • jo_convert(ComplexF32,rand())
source
JOLI.jo_convertMethod

Convert vector to new type

jo_convert(DT::DataType,v::AbstractArray,warning::Bool=true)

Limitations

  • converting integer array to shorter representation will throw an error
  • converting float/complex array to integer will throw an error
  • converting from complex to float drops immaginary part and issues warning; use joconvertwarn_set(false) to turn off the warning

Example

  • jo_convert(ComplexF32,rand(3))
source
JOLI.jo_convert_warn_setMethod

Set warning mode for jo_convert

jo_convert_warn_set(flag::Bool)

Example

  • joconvertwarn_set(false) turns of the warnings
source
JOLI.jo_eyeFunction

return identity array

jo_eye(m::Integer,n::Integer=m)
jo_eye(DT::DataType,m::Integer,n::Integer=m)
source
JOLI.jo_iterative_solver4square_setMethod

Set default iterative solver for (jo,vec) and square jo

jo_iterative_solver4square_set(f::Function)

Where f must take two arguments (jo,vec) and return vec.

Example (using IterativeSolvers)

  • joiterativesolver4square_set((A,v)->gmres(A,v))
source
JOLI.jo_iterative_solver4tall_setMethod

Set default iterative solver for (jo,vec) and tall jo

jo_iterative_solver4tall_set(f::Function)

Where f must take two arguments (jo,vec) and return vec.

Example

  • joiterativesolver4tallset((A,v)->tallsolve(A,v))
source
JOLI.jo_iterative_solver4wide_setMethod

Set default iterative solver for (jo,vec) and wide jo

jo_iterative_solver4wide_set(f::Function)

Where f must take two arguments (jo,vec) and return vec.

Example

  • joiterativesolver4wideset((A,v)->widesolve(A,v))
source
JOLI.jo_precision_typeMethod

Type of the real number or element type of complex number.

Example

  • joprecisiontype(1.)
  • joprecisiontype(1+im*3.)
source
JOLI.jo_speyeFunction

return sparse identity array

jo_speye(m::Integer,n::Integer=m)
jo_speye(DT::DataType,m::Integer,n::Integer=m)
source
JOLI.jo_type_mismatch_error_setMethod

Toggle between warning and error for type mismatch

jo_type_mismatch_error_set(flag::Bool)

Examples

  • jotypemismatcherrorset(false) turns on warnings instead of errors
  • jotypemismatcherrorset(true) reverts to errors
source
JOLI.jo_type_treeFunction

Show type tree of JOLI operators, or any type with editional Type argument.

jo_type_tree()
jo_type_tree(Number)
source
JOLI.sallocMethod
julia> salloc(d; [DT])

Allocates a SharedArray according to given distributor

Signature

salloc(d::joPAsetup;DT::DataType=d.DT)

Arguments

  • d: see help for joPAsetup
  • DT: keyword argument to overwrite the type in joPAsetup

Examples

  • salloc(d): allocate an array
  • salloc(d,DT=Float32): allocate array and overwite d.DT with Float32
source

Constants

Macros

JOLI.@joNFMacro

Nullable{Function} macro for given function

@joNF ... | @joNF(...)
source

Index