JOLI reference
Module
JOLI.JOLI
— ModuleJulia 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.
Types
JOLI.joCoreBlock
— Methodjulia> 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 dimansionnoffsets
: vector of starting indecies in 2nd dimansionweights
: vector of waights for each operatormextend
: size of zero extension in 1st dimensionnextend
: size of zero extension in 2nd dimensionname
: 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)
JOLI.joDALinearOperator
— TypejoDALinearOperator is glueing type & constructor
!!! Do not use it to create the operators
JOLI.joDAdistribute
— TypejoDAdistribute is DAarray toggle type & constructor
!!! Do not use it to create the operators
JOLI.joDAdistribute
— Methodjulia> 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 vectornvc
: # of columns in multi-vector - if given then multi-vector is distributed over 2nd dimensionparts
: custom partitioning of distributed dimensionwpool
: custom WorkerPoolDT
: DataType for joPAsetupdst
: joPAsetupDA
: joDAdistributedLinearOperatorglcean
: 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 WorkerPooljoDAdistribute(5,2)
: distribute multi-vector of lenght 5 with 2 columns into default WorkerPooljoDAdistribute(5)'
: gather vector of lenght 5joDAdistribute(5,2)'
: gather multi-vector of lenght 5 with 2 columns
JOLI.joDAdistributedLinearOperator
— TypejoDAdistributedLinearOperator is glueing type & constructor
!!! Do not use it to create the operators
JOLI.joDAdistributingLinearOperator
— TypejoDAdistributingLinearOperator is glueing type & constructor
!!! Do not use it to create the operators
JOLI.joDAgather
— TypejoDAgather is DAarray toggle type & constructor
!!! Do not use it to create the operators
JOLI.joDAgather
— Methodjulia> 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 vectornvc
: # of columns in multi-vector - if given then multi-vector is distributed over 2nd dimensionparts
: custom partitioning of distributed dimensionwpool
: custom WorkerPoolDT
: DataType for joPAsetupdst
: joPAsetupDA
: joDAdistributedLinearOperatorglcean
: 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 5joDAgather(5,2)
: gather multi-vector of lenght 5 with 2 columnsjoDAgather(5)'
: distribute vector of lenght 5 into default WorkerPooljoDAgather(5,2)'
: distribute multi-vector of lenght 5 with 2 columns into default WorkerPool
JOLI.joDAgatheringLinearOperator
— TypejoDAgatheringLinearOperator is glueing type & constructor
!!! Do not use it to create the operators
JOLI.joKron
— Methodjulia> 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)
JOLI.joLinearFunction
— TypejoLinearFunction 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
JOLI.joLinearFunctionInplace
— TypejoLinearFunctionInplace 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
JOLI.joLinearOperator
— TypejoLinearOperator is glueing type & constructor
!!! Do not use it to create the operators
JOLI.joLooseLinearFunction
— TypejoLooseLinearFunction 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
JOLI.joLooseLinearFunctionInplace
— TypejoLooseLinearFunctionInplace 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
JOLI.joLooseMatrix
— TypejoLooseMatrix 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
JOLI.joLooseMatrix
— MethodjoLooseMatrix 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
JOLI.joLooseMatrixInplace
— TypejoLooseMatrixInplace 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
JOLI.joLooseMatrixInplace
— MethodjoLooseMatrixInplace 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
JOLI.joMatrix
— TypejoMatrix 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
JOLI.joMatrix
— MethodjoMatrix 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
JOLI.joMatrixInplace
— TypejoMatrixInplace 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
JOLI.joMatrixInplace
— MethodjoMatrixInplace 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
JOLI.joNumber
— TypejoNumber 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
JOLI.joNumber
— MethodjoNumber outer constructor
joNumber(num)
Create joNumber with types matching given number
JOLI.joNumber
— MethodjoNumber outer constructor
joNumber(num,A::joAbstractLinearOperator{DDT,RDT})
Create joNumber with types matching the given operator.
JOLI.joPAsetup
— TypejoPAsetup 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.
JOLI.joPAsetup
— Methodjulia> joPAsetup(in::DArray)
Get joPAsetup represeanting a given DArray
JOLI.joPAsetup
— Methodjulia> 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 vectorDT
: DataType of vector's elementsname
: name of distributor
Examples
joPAsetup(128)
: basic distributor for joFloat vectorjoPAsetup(40;DT=Int8)
: basic distributor for Int8 vector
JOLI.joPAsetup
— Methodjulia> 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 dimensionsddim
: dimansion to distribute overDT
: DataType of array's elementsparts
: tuple/vector of the subarray's size on each worker in distributed dimensionname
: name of distributor
Examples
joPAsetup((3,40,5),2;DT=Int8)
: distribute 2nd dimension over 4 workersjoPAsetup((3,40,5),2;DT=Int8,parts=(11,11,11,7))
: distribute 2nd dimension over 4 workers and specify parts
JOLI.joPAsetup
— Methodjulia> 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 dimensionsDT
: DataType of array's elementschunks
: vector of number of parts in each dimensionname
: 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
JOLI.joPAsetup
— Methodjulia> 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 workerDT
: DataType of array's elementsname
: name of distributor
Examples
joPAsetup(((3,),(10,10,10,10),(5,));DT=Int8)
: distribute Int8 array (3,40,5) over 2nd dimension
JOLI.joSALinearOperator
— TypejoSALinearOperator is glueing type & constructor
!!! Do not use it to create the operators
JOLI.joSAdistribute
— TypejoSAdistribute is SharedArray toggle type & constructor
!!! Do not use it to create the operators
JOLI.joSAdistribute
— Methodjulia> 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 vectornvc
: # of columns in multi-vector - if given then multi-vector is distributed over 2nd dimensionparts
: custom partitioning of distributed dimensionwpool
: custom WorkerPoolDT
: DataType for joPAsetupdst
: joPAsetupSA
: joSAdistributedLinearOperatorglcean
: 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 WorkerPooljoSAdistribute(5,2)
: distribute multi-vector of lenght 5 with 2 columns into default WorkerPooljoSAdistribute(5)'
: gather vector of lenght 5joSAdistribute(5,2)'
: gather multi-vector of lenght 5 with 2 columns
JOLI.joSAdistributedLinearOperator
— TypejoSAdistributedLinearOperator is glueing type & constructor
!!! Do not use it to create the operators
JOLI.joSAdistributingLinearOperator
— TypejoSAdistributingLinearOperator is glueing type & constructor
!!! Do not use it to create the operators
JOLI.joSAgather
— TypejoSAgather is SharedArray toggle type & constructor
!!! Do not use it to create the operators
JOLI.joSAgather
— Methodjulia> 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 vectornvc
: # of columns in multi-vector - if given then multi-vector is distributed over 2nd dimensionparts
: custom partitioning of distributed dimensionwpool
: custom WorkerPoolDT
: DataType for joPAsetupglcean
: clean SArray after gatheringdst
: joPAsetupSA
: 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 5joSAgather(5,2)
: gather multi-vector of lenght 5 with 2 columnsjoSAgather(5)'
: distribute vector of lenght 5 into default WorkerPooljoSAgather(5,2)'
: distribute multi-vector of lenght 5 with 2 columns into default WorkerPool
JOLI.joSAgatheringLinearOperator
— TypejoSAgatheringLinearOperator is glueing type & constructor
!!! Do not use it to create the operators
Functions
DistributedArrays.SPMD.scatter
— Methodjulia> scatter(A,d)
Scatters SharedArray according to given joPAsetup.
Signature
scatter(a::AbstractArray,d::joPAsetup)
Arguments
A
: array to ditributed
: 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 distributorscatter(A,joPAsetup(size(A)...))
: scatter A using default distributor settings
DistributedArrays.dfill
— Methodjulia> 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 formI->f(...,map(length,I)))
d
: see help for joPAsetupDT
: 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
DistributedArrays.dfill
— Methodjulia> 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 joPAsetupDT
: 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.)
DistributedArrays.distribute
— Methodjulia> distribute(A,d)
Distributes DArray according to given joPAsetup.
Signature
distribute(a::AbstractArray,d::joPAsetup)
Arguments
A
: array to ditributed
: 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 distributordistribute(A,joPAsetup(size(A)...))
: distribute A using default distributor settings
DistributedArrays.dones
— Methodjulia> 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 joPAsetupDT
: keyword argument to overwrite the type in joPAsetup
Examples
dones(d)
: allocate an array of onesdones(d,DT=Float32)
: allocate array of Float32 ones
DistributedArrays.drand
— Methodjulia> 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 joPAsetupDT
: keyword argument to overwrite the type in joPAsetupRNG
: random-number generator function (see help for rand/randn)
Examples
drand(d)
: allocate an array with randdrand(d,DT=Float32)
: allocate array with rand of Float32drand(d,DT=Float32,RNG=MersenneTwister(1234))
: allocate array with rand of Float32 using MersenneTwister() random device
DistributedArrays.drandn
— Methodjulia> 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 joPAsetupDT
: keyword argument to overwrite the type in joPAsetupRNG
: 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 randndrandn(d,DT=Float32)
: allocate array with randn of Float32drandn(d,DT=Float32,RNG=MersenneTwister(1234))
: allocate array with randn of Float32 using MersenneTwister() random device
DistributedArrays.dzeros
— Methodjulia> 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 joPAsetupDT
: keyword argument to overwrite the type in joPAsetup
Examples
dzeros(d)
: allocate an array of zerosdzeros(d,DT=Float32)
: allocate array of Float32 zeros
JOLI.dalloc
— Methodjulia> 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
.
JOLI.dalloc
— Methodjulia> 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 joPAsetupDT
: keyword argument to overwrite the type in joPAsetup
Examples
dalloc(d)
: allocate an arraydalloc(d,DT=Float32)
: allocate array and overwite d.DT with Float32
JOLI.dcopy
— Methodjulia> 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
JOLI.dparts
— Methodjulia> 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)
JOLI.joAddSolverAll
— MethodjoAddSolver 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)
JOLI.joAddSolverAny
— MethodjoAddSolver 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))
JOLI.joBlock
— Methodjulia> 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' rowop#
: JOLI operators (subtypes of joAbstractLinearOperator)- keywords
weights
: vector of waights for each operatorname
: 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)
JOLI.joBlockDiag
— Methodjulia> 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 operatorname
: 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)
JOLI.joBlockDiag
— Methodjulia> 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 blocksop
: JOLI operators (subtypes of joAbstractLinearOperator)- keywords
weights
: vector of waights for each operatorname
: 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)
JOLI.joConj
— Methodjulia> 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 vectorname
: custom name
JOLI.joConstants
— Methodjulia> 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
: sizea
: element value, default DDT/RDT will have the same type asa
- optional
n
: 2nd dimension if not square
- keywords
DDT
: domain data typeRDT
: range data typename
: 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)
JOLI.joConvert
— Methodjulia> 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 sizeDDT
: domain data typeRDT
: range data type- keywords
name
: custom name
JOLI.joCurvelet2D
— Methodjulia> 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 inputzero_finest
: zero out finnest scales (defaults to false)DDT
: domain data typeRDT
: range data typename
: 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)
JOLI.joCurvelet2DnoFFT
— Methodjulia> 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 inputzero_finest
: zero out finnest scales (defaults to false)DDT
: domain data typeRDT
: range data typename
: 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)
JOLI.joDAdistributedLinOp
— Methodjulia> 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 typenvc
: number of columns in multi-vectorparts
: custom partitioning of 2nd diemnsionfclean
: close DArray after forward operationrclean
: 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
JOLI.joDAdistributedLinOp
— Methodjulia> 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 typepsin
: parallel setup from jpPAsetupfclean
: close DArray after forward operationrclean
: 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 columnsjoDAdistributedLinOp(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
JOLI.joDCT
— Methodjulia> 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 planDDT
: domain data typeRDT
: range data typename
: 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)
JOLI.joDFT
— Methodjulia> 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 plancentered
: produce centered coefficientsDDT
: domain data typeRDT
: range data typename
: 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)
JOLI.joDWT
— Functionjulia> 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 dimentionwt
: wavelet filter (Haar by default)
- keywords
L
: number of levelsDDT
: domain data typeRDT
: range data typename
: 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)
JOLI.joDiag
— Methodjulia> 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 typeRDT
: range data typename
: custom name
Examples
joDiag(rand(m))
examples with DDT/RDT
joDiag(rand(m); DDT=Float32)
joDiag(rand(m); DDT=Float32,RDT=Float64)
JOLI.joDict
— Methodjulia> 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 operatorname
: 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)
JOLI.joDict
— Methodjulia> 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 blocksop
: JOLI operators (subtypes of joAbstractLinearOperator)- keywords
weights
: vector of waights for each operatorname
: 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)
JOLI.joDirac
— MethodjoDirac(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 typeRDT
: range data typename
: custom name
Examples
A=joDirac(3)
examples with DDT/RDT
A=joDirac(3; DDT=Float32)
A=joDirac(3; DDT=Float32,RDT=Float64)
JOLI.joExtend
— Methodjulia> 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 vectorpad_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 endpad_upper
: number of points to pad on the upper index endDDT
: domain data typeRDT
: range data typename
: 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)
JOLI.joEye
— Methodjulia> 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 typeRDT
: range data typename
: custom name
Examples
joEye(m,n)
examples with DDT/RDT
joEye(m,n; DDT=Float32)
joEye(m,n; DDT=Float32,RDT=Float64)
JOLI.joEye
— Methodjulia> 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 typeRDT
: range data typename
: custom name
Examples
joEye(m)
examples with DDT/RDT
joEye(m; DDT=Float32)
joEye(m; DDT=Float32,RDT=Float64)
JOLI.joGaussian
— Functionjulia> 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 truenormalized
: keyword normalized (unit global-norm for explicit or unit-column norm for implicit) operator if trueorthonormal
: keyword explict orthonormal operator if true (above implicit/normalized is ignorred); requires M<=NRNG
: keyword random number generator function with explicit seedingDDT
: domain data typeRDT
: range data typename
: 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)
JOLI.joImag
— Methodjulia> 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 vectorname
: custom name
JOLI.joLinInterp1D
— Methodjulia> 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 gridxout
- output grid- keywords
DDT
: domain data typeRDT
: range data typename
: 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)
JOLI.joLinearFunctionAll
— FunctionjoLinearFunction 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
JOLI.joLinearFunctionFwd
— FunctionjoLinearFunction 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
JOLI.joLinearFunctionFwd_A
— FunctionjoLinearFunction 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
JOLI.joLinearFunctionFwd_T
— FunctionjoLinearFunction 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
JOLI.joLinearFunctionInplaceAll
— FunctionjoLinearFunctionInplace 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
JOLI.joLinearFunctionInplaceFwd
— FunctionjoLinearFunctionInplace 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
JOLI.joLinearFunctionInplaceFwd_A
— FunctionjoLinearFunctionInplace 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
JOLI.joLinearFunctionInplaceFwd_T
— FunctionjoLinearFunctionInplace 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
JOLI.joLinearFunctionInplace_A
— FunctionjoLinearFunctionInplace 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
JOLI.joLinearFunctionInplace_T
— FunctionjoLinearFunctionInplace 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
JOLI.joLinearFunction_A
— FunctionjoLinearFunction 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
JOLI.joLinearFunction_T
— FunctionjoLinearFunction 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
JOLI.joLooseLinearFunctionAll
— FunctionjoLooseLinearFunction 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
JOLI.joLooseLinearFunctionFwd
— FunctionjoLooseLinearFunction 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
JOLI.joLooseLinearFunctionFwd_A
— FunctionjoLooseLinearFunction 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
JOLI.joLooseLinearFunctionFwd_T
— FunctionjoLooseLinearFunction 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
JOLI.joLooseLinearFunctionInplaceAll
— FunctionjoLooseLinearFunctionInplace 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
JOLI.joLooseLinearFunctionInplaceFwd
— FunctionjoLooseLinearFunctionInplace 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
JOLI.joLooseLinearFunctionInplaceFwd_A
— FunctionjoLooseLinearFunctionInplace 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
JOLI.joLooseLinearFunctionInplaceFwd_T
— FunctionjoLooseLinearFunctionInplace 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
JOLI.joLooseLinearFunctionInplace_A
— FunctionjoLooseLinearFunctionInplace 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
JOLI.joLooseLinearFunctionInplace_T
— FunctionjoLooseLinearFunctionInplace 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
JOLI.joLooseLinearFunction_A
— FunctionjoLooseLinearFunction 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
JOLI.joLooseLinearFunction_T
— FunctionjoLooseLinearFunction 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
JOLI.joMask
— Methodjulia> 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 arrayDDT
: domain data typeRDT
: range data typename
: 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)
JOLI.joMask
— Methodjulia> 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 operatoridx
: vector of true indecies- keywords
DDT
: domain data typeRDT
: range data typename
: 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)
JOLI.joNFFT
— Functionjulia> 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
: sizenodes
: nodes' positions- optional
- see https://github.com/tknopp/NFFT.jl for info about optional parameters to NFFTplan:
m
,sigma
,window
, andK
- see https://github.com/tknopp/NFFT.jl for info about optional parameters to NFFTplan:
- keywords
centered
: return centered coefficientsDDT
: domain data typeRDT
: range data typename
: 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)
JOLI.joOnes
— Functionjulia> 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 typeRDT
: range data typename
: custom name
Examples
joOnes(m)
joOnes(m,n)
examples with DDT/RDT
joOnes(m; DDT=Float32)
joOnes(m; DDT=Float32,RDT=Float64)
JOLI.joOuterProd
— Methodjulia> 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 matrixV
: right vector or matrix- keywords
DDT
: domain data typeRDT
: range data typename
: 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)
JOLI.joPermutation
— Methodjulia> 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 typeRDT
: range data typename
: 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)
JOLI.joReal
— Methodjulia> 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 vectorname
: custom name
JOLI.joRestriction
— Methodjulia> 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 columnsidx
: vector of indecies- keywords
makecopy
: make private copy of indecies vectorDDT
: domain data typeRDT
: range data typename
: 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)
JOLI.joRomberg
— Methodjulia> 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 typeRDT
: range data typename
: 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)
JOLI.joSAdistributedLinOp
— Methodjulia> 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 typenvc
: number of columns in multi-vectorparts
: custom partitioning of 2nd diemnsionfclean
: close SharedArray after forward operationrclean
: 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
JOLI.joSAdistributedLinOp
— Methodjulia> 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 typepsin
: parallel setup from jpPAsetupfclean
: close SharedArray after forward operationrclean
: 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 columnsjoSAdistributedLinOp(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
JOLI.joSWT
— Functionjulia> 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:
- keywords
L
: number of levelsDDT
: domain data typeRDT
: range data typename
: 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)
JOLI.joSincInterp
— Methodjulia> 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 gridxout
- 1D output grid- keywords
r
: kaiser window parameter (default: 0, no windowing)DDT
: domain data typeRDT
: range data typename
: 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)
JOLI.joStack
— Methodjulia> 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 operatorname
: 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)
JOLI.joStack
— Methodjulia> 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 blocksop
: JOLI operators (subtypes of joAbstractLinearOperator)- keywords
weights
: vector of waights for each operatorname
: 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)
JOLI.joZeros
— Functionjulia> 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 typeRDT
: range data typename
: custom name
Examples
joZeros(m)
joZeros(m,n)
examples with DDT/RDT
joZeros(m; DDT=Float32)
joZeros(m; DDT=Float32,RDT=Float64)
JOLI.jo_PAmode
— Methodjo_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
JOLI.jo_balanced_partition
— Functionjulia> jo_balanced_partition(nlabs::Integer,dsize::Integer)
Get balanced partitioning of the dimension (dsize) on n workers (nlabs)
JOLI.jo_check_type_match
— MethodCheck 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")
JOLI.jo_complex_eltype
— MethodType of element of complex data type
jo_complex_eltype(DT::DataType)
Example
- jocomplexeltype(ComplexF32)
JOLI.jo_complex_eltype
— MethodType of element of complex scalar
jo_complex_eltype(a::Complex)
Example
- jocomplexeltype(1.+im*1.)
- jocomplexeltype(zero(ComplexF64))
JOLI.jo_convert
— MethodConvert 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())
JOLI.jo_convert
— MethodConvert 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))
JOLI.jo_convert_warn_set
— MethodSet warning mode for jo_convert
jo_convert_warn_set(flag::Bool)
Example
- joconvertwarn_set(false) turns of the warnings
JOLI.jo_eye
— Functionreturn identity array
jo_eye(m::Integer,n::Integer=m)
jo_eye(DT::DataType,m::Integer,n::Integer=m)
JOLI.jo_full
— Methodreturn full array
jo_full(A::AbstractArray)
JOLI.jo_iterative_solver4square_set
— MethodSet 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))
JOLI.jo_iterative_solver4tall_set
— MethodSet 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))
JOLI.jo_iterative_solver4wide_set
— MethodSet 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))
JOLI.jo_jo32bit_set
— Methodset default type joInt, joFloat, joComplex to 32 bit
function jo_jo32bit_set()
JOLI.jo_jo64bit_set
— Methodset default type joInt, joFloat, joComplex to 64 bit
function jo_jo64bit_set()
JOLI.jo_joComplex_set
— Functionset default complex type joComplex
function jo_joComplex_set(DT::DataType=joComplex)
JOLI.jo_joFloat_set
— Functionset default float type joFloat
function jo_joFloat_set(DT::DataType=joFloat)
JOLI.jo_joInt_set
— Functionset default integer type joInt
function jo_joInt_set(DT::DataType=joInt)
JOLI.jo_joTypes_get
— Methodget default types joInt, joFloat, joComplex
function jo_joTypes_get()
JOLI.jo_precision_type
— MethodType of the real number or element type of complex number.
Example
- joprecisiontype(1.)
- joprecisiontype(1+im*3.)
JOLI.jo_speye
— Functionreturn sparse identity array
jo_speye(m::Integer,n::Integer=m)
jo_speye(DT::DataType,m::Integer,n::Integer=m)
JOLI.jo_type_mismatch_error_set
— MethodToggle 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
JOLI.jo_type_tree
— FunctionShow type tree of JOLI operators, or any type with editional Type argument.
jo_type_tree()
jo_type_tree(Number)
JOLI.salloc
— Methodjulia> salloc(d; [DT])
Allocates a SharedArray according to given distributor
Signature
salloc(d::joPAsetup;DT::DataType=d.DT)
Arguments
d
: see help for joPAsetupDT
: keyword argument to overwrite the type in joPAsetup
Examples
salloc(d)
: allocate an arraysalloc(d,DT=Float32)
: allocate array and overwite d.DT with Float32
Constants
Macros
JOLI.@joNF
— MacroNullable{Function} macro for given function
@joNF ... | @joNF(...)
JOLI.@joNF
— MacroNullable{Function} macro for null function
@joNF
Index
JOLI.JOLI
JOLI.joCoreBlock
JOLI.joDALinearOperator
JOLI.joDAdistribute
JOLI.joDAdistribute
JOLI.joDAdistributedLinearOperator
JOLI.joDAdistributingLinearOperator
JOLI.joDAgather
JOLI.joDAgather
JOLI.joDAgatheringLinearOperator
JOLI.joKron
JOLI.joLinearFunction
JOLI.joLinearFunctionInplace
JOLI.joLinearOperator
JOLI.joLooseLinearFunction
JOLI.joLooseLinearFunctionInplace
JOLI.joLooseMatrix
JOLI.joLooseMatrix
JOLI.joLooseMatrixInplace
JOLI.joLooseMatrixInplace
JOLI.joMatrix
JOLI.joMatrix
JOLI.joMatrixInplace
JOLI.joMatrixInplace
JOLI.joNumber
JOLI.joNumber
JOLI.joNumber
JOLI.joPAsetup
JOLI.joPAsetup
JOLI.joPAsetup
JOLI.joPAsetup
JOLI.joPAsetup
JOLI.joPAsetup
JOLI.joSALinearOperator
JOLI.joSAdistribute
JOLI.joSAdistribute
JOLI.joSAdistributedLinearOperator
JOLI.joSAdistributingLinearOperator
JOLI.joSAgather
JOLI.joSAgather
JOLI.joSAgatheringLinearOperator
DistributedArrays.SPMD.scatter
DistributedArrays.dfill
DistributedArrays.dfill
DistributedArrays.distribute
DistributedArrays.dones
DistributedArrays.drand
DistributedArrays.drandn
DistributedArrays.dzeros
JOLI.dalloc
JOLI.dalloc
JOLI.dcopy
JOLI.dparts
JOLI.joAddSolverAll
JOLI.joAddSolverAny
JOLI.joBlock
JOLI.joBlockDiag
JOLI.joBlockDiag
JOLI.joConj
JOLI.joConstants
JOLI.joConvert
JOLI.joCurvelet2D
JOLI.joCurvelet2DnoFFT
JOLI.joDAdistributedLinOp
JOLI.joDAdistributedLinOp
JOLI.joDCT
JOLI.joDFT
JOLI.joDWT
JOLI.joDiag
JOLI.joDict
JOLI.joDict
JOLI.joDirac
JOLI.joExtend
JOLI.joEye
JOLI.joEye
JOLI.joGaussian
JOLI.joImag
JOLI.joLinInterp1D
JOLI.joLinearFunctionAll
JOLI.joLinearFunctionFwd
JOLI.joLinearFunctionFwd_A
JOLI.joLinearFunctionFwd_T
JOLI.joLinearFunctionInplaceAll
JOLI.joLinearFunctionInplaceFwd
JOLI.joLinearFunctionInplaceFwd_A
JOLI.joLinearFunctionInplaceFwd_T
JOLI.joLinearFunctionInplace_A
JOLI.joLinearFunctionInplace_T
JOLI.joLinearFunction_A
JOLI.joLinearFunction_T
JOLI.joLooseLinearFunctionAll
JOLI.joLooseLinearFunctionFwd
JOLI.joLooseLinearFunctionFwd_A
JOLI.joLooseLinearFunctionFwd_T
JOLI.joLooseLinearFunctionInplaceAll
JOLI.joLooseLinearFunctionInplaceFwd
JOLI.joLooseLinearFunctionInplaceFwd_A
JOLI.joLooseLinearFunctionInplaceFwd_T
JOLI.joLooseLinearFunctionInplace_A
JOLI.joLooseLinearFunctionInplace_T
JOLI.joLooseLinearFunction_A
JOLI.joLooseLinearFunction_T
JOLI.joMask
JOLI.joMask
JOLI.joNFFT
JOLI.joOnes
JOLI.joOuterProd
JOLI.joPermutation
JOLI.joReal
JOLI.joRestriction
JOLI.joRomberg
JOLI.joSAdistributedLinOp
JOLI.joSAdistributedLinOp
JOLI.joSWT
JOLI.joSincInterp
JOLI.joStack
JOLI.joStack
JOLI.joZeros
JOLI.jo_PAmode
JOLI.jo_balanced_partition
JOLI.jo_check_type_match
JOLI.jo_complex_eltype
JOLI.jo_complex_eltype
JOLI.jo_convert
JOLI.jo_convert
JOLI.jo_convert_warn_set
JOLI.jo_eye
JOLI.jo_full
JOLI.jo_iterative_solver4square_set
JOLI.jo_iterative_solver4tall_set
JOLI.jo_iterative_solver4wide_set
JOLI.jo_jo32bit_set
JOLI.jo_jo64bit_set
JOLI.jo_joComplex_set
JOLI.jo_joFloat_set
JOLI.jo_joInt_set
JOLI.jo_joTypes_get
JOLI.jo_precision_type
JOLI.jo_speye
JOLI.jo_type_mismatch_error_set
JOLI.jo_type_tree
JOLI.salloc
JOLI.@joNF
JOLI.@joNF