Skip to content

Commit

Permalink
Prepare split of AbstractQ and AbstractMatrix
Browse files Browse the repository at this point in the history
  • Loading branch information
dkarrasch committed Feb 12, 2023
1 parent 9c2477f commit 2ab3cd7
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/JOLI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ import Base.getindex


# what's imported from LinearAlgebra
import LinearAlgebra.norm
import LinearAlgebra.norm, LinearAlgebra.AbstractQ
import LinearAlgebra.issymmetric, LinearAlgebra.ishermitian
import LinearAlgebra.mul!, LinearAlgebra.ldiv!

Expand Down
2 changes: 1 addition & 1 deletion src/joAbstractDAparallelLinearOperator/constructors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Create a linear operator working on 2D DArray in multi-vector (over 2nd dimensio
"""
function joDAdistributedLinOp(A::joAbstractLinearOperator{DDT,RDT},psin::joPAsetup,
fclean::Bool=false,rclean::Bool=false) where {DDT<:Number,RDT<:Number,INT<:Integer}
fclean::Bool=false,rclean::Bool=false) where {DDT<:Number,RDT<:Number}

psin.chunks[1]==1 || throw(joDAdistributedLinearOperatorException("joDAdistributedLinearOperator: invalid joPAsetup - must not be distributed in 1st dimension"))
A.n==psin.dims[1] || throw(joDAdistributedLinearOperatorException("joDAdistributedLinearOperator: invalid joPAsetup - 1st dimension off joPAsetup does not match size(A,2)"))
Expand Down
4 changes: 2 additions & 2 deletions src/joAbstractLinearOperator/constructors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""
joMatrix outer constructor
joMatrix(array::AbstractMatrix;
joMatrix(array::Union{AbstractMatrix,AbstractQ};
DDT::DataType=eltype(array),
RDT::DataType=promote_type(eltype(array),DDT),
name::String="joMatrix")
Expand All @@ -26,7 +26,7 @@ Look up argument names in help to joMatrix type.
- if RDT:<Real for complex matrix then imaginary part will be neglected for forward/conjugate operator
"""
function joMatrix(array::AbstractMatrix{EDT};
function joMatrix(array::Union{AbstractMatrix{EDT},AbstractQ{EDT}};
DDT::DataType=EDT,RDT::DataType=promote_type(EDT,DDT),name::String="joMatrix") where {EDT}

(typeof(array)<:DArray || typeof(array)<:SharedArray) && @warn "Creating joMatrix from non-local array like $(typeof(array)) is likely going to have adverse impact on JOLI's health. Please, avoid it."
Expand Down
2 changes: 1 addition & 1 deletion src/joAbstractSAparallelLinearOperator/constructors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Create a linear operator working on 2D SharedArray in multi-vector (over 2nd dim
"""
function joSAdistributedLinOp(A::joAbstractLinearOperator{DDT,RDT},psin::joPAsetup,
fclean::Bool=false,rclean::Bool=false) where {DDT<:Number,RDT<:Number,INT<:Integer}
fclean::Bool=false,rclean::Bool=false) where {DDT<:Number,RDT<:Number}

psin.chunks[1]==1 || throw(joSAdistributedLinearOperatorException("joSAdistributedLinearOperator: invalid joPAsetup - must not be distributed in 1st dimension"))
A.n==psin.dims[1] || throw(joSAdistributedLinearOperatorException("joSAdistributedLinearOperator: invalid joPAsetup - 1st dimension off joPAsetup does not match size(A,2)"))
Expand Down
3 changes: 1 addition & 2 deletions src/joMiscTypesMethods/joPAsetup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ Creates joPAsetup type - basic 1D distribution
"""
function joPAsetup(wpool::WorkerPool,n::Integer;
DT::DataType=joFloat,
name::String="joPAsetup",
) where INT<:Integer
name::String="joPAsetup")
n>0 || throw(joPAsetupException("joPAsetup: invalid lenght of the vector: $n"))
dims=(n,)
chunks=joPAsetup_etc.default_chunks(dims,sort(workers(wpool)))
Expand Down

0 comments on commit 2ab3cd7

Please sign in to comment.