Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Caching/bandedblockbanded.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ end
#
function resizedata!(B::CachedOperator{T,<:BandedBlockBandedMatrix{T}}, ::Colon, col::Integer) where {T<:Number}
if col > size(B,2)
throw(ArgumentError("Cannot resize beyound size of operator"))
throw(ArgumentError("Cannot resize beyond size of operator"))
end

if col > B.datasize[2]
Expand Down
4 changes: 2 additions & 2 deletions src/Caching/blockbanded.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ end
# that is, trace an operator down the diagonal. What blocks correspond to the
# block diagonal?
# this is used to determine how many blocks to pad in the QR decomposition, as
# every lower block gets added to the upper daigonal
# every lower block gets added to the upper diagonal

diagblockshift(a,b) = error("Developer: Not implemented for blocklengths $a, $b")

Expand Down Expand Up @@ -88,7 +88,7 @@ end
#
function resizedata!(B::CachedOperator{T,BlockBandedMatrix{T}},::Colon,col::Integer) where {T<:Number}
if col > size(B,2)
throw(ArgumentError("Cannot resize beyound size of operator"))
throw(ArgumentError("Cannot resize beyond size of operator"))
end

if col > B.datasize[2]
Expand Down
2 changes: 1 addition & 1 deletion src/Caching/matrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CachedOperator(::Type{Matrix},op::Operator;padding::Bool=false) =

function resizedata!(B::CachedOperator{T,Matrix{T}},n::Integer,m::Integer) where T<:Number
if n > size(B,1) || m > size(B,2)
throw(ArgumentError("Cannot resize beyound size of operator"))
throw(ArgumentError("Cannot resize beyond size of operator"))
end

# this does nothing if already in dimensions
Expand Down
2 changes: 1 addition & 1 deletion src/Caching/ragged.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function resizedata!(B::CachedOperator{T,RaggedMatrix{T}},::Colon,n::Integer) wh
resize!(B.data.cols,n+1)

if B.padding
# K is largest colstop. We get previous largest by looking at precalulated
# K is largest colstop. We get previous largest by looking at precalculated
# cols
K = B.datasize[2]==0 ? 0 : B.data.cols[B.datasize[2]+1]-B.data.cols[B.datasize[2]]

Expand Down
10 changes: 5 additions & 5 deletions src/Domain.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ domainscompatible(a,b) = domainscompatible(domain(a),domain(b))
_isapprox(a, b) = isapprox(a,b)
function _isapprox(a::Interval, b::Interval)
# hacky compat for DomainSets v0.6,
# where comparing open and closed intevals throws an error
# where comparing open and closed intervals throws an error
# However, we don't need to compare at all if the endpoints differ
# this introduces a duplicate check, but that's probably ok
isapprox(leftendpoint(a), leftendpoint(b), atol=100eps(prectype(a))) &&
Expand All @@ -90,7 +90,7 @@ function indomain(x,d::SegmentDomain)
y=tocanonical(d,x)
ry=real(y)
iy=imag(y)
sc=norm(fromcanonicalD(d,ry<-1 ? -one(ry) : (ry>1 ? one(ry) : ry))) # scale based on stretch of map on projection to interal
sc=norm(fromcanonicalD(d,ry<-1 ? -one(ry) : (ry>1 ? one(ry) : ry))) # scale based on stretch of map on projection to interval
dy=fromcanonical(d,y)
# TODO: use isapprox once keywords are fast
((isinf(norm(dy)) && isinf(norm(x))) || norm(dy-x) ≤ 1000eps(T)*max(norm(x),1)) &&
Expand All @@ -101,7 +101,7 @@ end
issubcomponent(a::Domain,b::Domain) = a in components(b)


##### canoncial
##### canonical
"""
tocanonical(d, x)

Expand All @@ -120,7 +120,7 @@ function tocanonical end

const 𝑪 = tocanonical

## conveninece routines
## convenience routines

ones(d::Domain) = ones(prectype(d),Space(d))
zeros(d::Domain) = zeros(prectype(d),Space(d))
Expand Down Expand Up @@ -179,7 +179,7 @@ invfromcanonicalD(d::Domain,x...) = 1/fromcanonicalD(d,x...)


## sorting
# we sort spaces lexigraphically by default
# we sort spaces lexicographically by default

for OP in (:<,:(<=),:(isless))
@eval $OP(a::Domain,b::Domain)=$OP(string(a),string(b))
Expand Down
2 changes: 1 addition & 1 deletion src/Domains/Domains.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ end



# multivariate domainxs
# multivariate domains

include("multivariate.jl")

Expand Down
6 changes: 3 additions & 3 deletions src/Fun.jl
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ iszero(f::Fun) = all(iszero, coefficients(f)) || all(iszero, values(f))
# Deliberately not named isconst or isconstant to avoid conflicts with Base or DomainSets
isconstantfun(f::Fun) = iszero(f - first(f))

# sum, integrate, and idfferentiate are in CalculusOperator
# sum, integrate, and differentiate are in CalculusOperator

"""
reverseorientation(f::Fun)
Expand Down Expand Up @@ -826,11 +826,11 @@ end
# exp.( [x,x]) is equivalent to [exp(x),exp(x)]
#
# does not throw the same error. When array values are mixed with arrays, the Array
# takes presidence:
# takes precedence:
#
# exp.([x;x] .+ [x,x]) is equivalent to exp.(Array([x;x]) .+ [x,x])
#
# This presidence is picked by the `promote_containertype` overrides.
# This precedence is picked by the `promote_containertype` overrides.

struct FunStyle <: BroadcastStyle end

Expand Down
2 changes: 1 addition & 1 deletion src/LinearAlgebra/RaggedMatrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct RaggedMatrix{T} <: AbstractMatrix{T}
cols::Vector{Int} # a Vector specifying the first index of each column
m::Int #Number of rows
function RaggedMatrix{T}(data::Vector{T}, cols::Vector{Int}, m::Int) where T
# make sure the cols are monitonically increasing
# make sure the cols are monotonically increasing
@assert 1==cols[1]
for j=1:length(cols)-1
@assert cols[j] ≤ cols[j+1]
Expand Down
2 changes: 1 addition & 1 deletion src/LinearAlgebra/rowvector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ to_vec(x) = x
# expects to operate within the transposed domain, so to_vec transposes the elements
@inline map(f, rowvecs::RowVector...) = RowVector(map(f, to_vecs(rowvecs...)...))

# broacast (other combinations default to higher-dimensional array)
# broadcast (other combinations default to higher-dimensional array)
@inline broadcast(f, rowvecs::Union{Number,RowVector}...) =
RowVector(broadcast(f, to_vecs(rowvecs...)...))

Expand Down
2 changes: 1 addition & 1 deletion src/Multivariate/ProductFun.jl
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ function canonicalevaluate(f::ProductFun{S,V,SS,T},x::Number,::Colon) where {S,V
end
canonicalevaluate(f::ProductFun,x::Number,y::Number) = canonicalevaluate(f,x,:)(y)
canonicalevaluate(f::ProductFun{S,V,SS},x::Colon,y::Number) where {S,V,SS<:TensorSpace} =
evaluate(transpose(f),y,:) # doesn't make sense For general product fon without specifying space
evaluate(transpose(f),y,:) # doesn't make sense For general product fun without specifying space

canonicalevaluate(f::ProductFun,xx::AbstractVector,yy::AbstractVector) =
transpose(hcat([evaluate(f,x,:)(yy) for x in xx]...))
Expand Down
6 changes: 3 additions & 3 deletions src/Multivariate/TensorSpace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ factor(d::AbstractProductSpace,k) = factors(d)[k]
##### Tensorizer
# This gives the map from coefficients to the
# tensor entry of a tensor product of d spaces
# findfirst is overriden to get efficient inverse
# findfirst is overridden to get efficient inverse
# blocklengths is a tuple of block lengths, e.g., Chebyshev()^2
# would be Tensorizer((Ones{Int}(∞), Ones{Int}(∞)))
# ConstantSpace() ⊗ Chebyshev()
Expand Down Expand Up @@ -43,7 +43,7 @@ Base.IteratorSize(::Type{Tensorizer{T}}) where {T<:Tuple} = _IteratorSize(T)
Base.keys(a::Tensorizer) = oneto(length(a))

function start(a::TrivialTensorizer{d}) where {d}
# ((block_dim_1, block_dim_2,...), (itaration_number, iterator, iterator_state)), (itemssofar, length)
# ((block_dim_1, block_dim_2,...), (iteration_number, iterator, iterator_state)), (itemssofar, length)
block = ntuple(one, d)
return (block, (0, nothing, nothing)), (0,length(a))
end
Expand Down Expand Up @@ -273,7 +273,7 @@ tensorblocklengths(a,b,c,d...) = tensorblocklengths(tensorblocklengths(a,b),c,d.
TensorSpace(a::Space,b::Space)

represents a tensor product of two 1D spaces `a` and `b`.
The coefficients are interlaced in lexigraphical order.
The coefficients are interlaced in lexicographical order.

For example, consider
```julia
Expand Down
2 changes: 1 addition & 1 deletion src/Operators/Operator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ const WrapperOperator = Union{SpaceOperator,MultiplicationWrapper,DerivativeWrap
# The following support converting an Operator to a Matrix or BandedMatrix

## BLAS and matrix routines
# We assume that copy may be overriden
# We assume that copy may be overridden

function axpy!(a, X::Operator, Y::AbstractMatrix)
Y .+= a .* AbstractMatrix(X)
Expand Down
2 changes: 1 addition & 1 deletion src/Operators/SubOperator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ blockcolstop(S::SubOperator{<:Any,<:Any,Tuple{AbstractRange{Int},AbstractRange{I

israggedbelow(S::SubOperator) = israggedbelow(parent(S))

# since blocks don't change with indexex, neither do blockbandwidths
# since blocks don't change with indices, neither do blockbandwidths
blockbandwidths(S::SubOperator{<:Any,<:Any,NTuple{2,AbstractRange{Int}}}) =
blockbandwidths(parent(S))
function blockbandwidths(S::SubOperator{<:Any,<:Any,NTuple{2,BlockRange1}})
Expand Down
2 changes: 1 addition & 1 deletion src/Operators/almostbanded/LowRankOperator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ rank(L::LowRankOperator) = length(L.U)


*(A::LowRankOperator,B::LowRankOperator) = LowRankOperator(transpose(A.V*B.transpose(U))*A.U,B.V)
# avoid ambiguituy
# avoid ambiguity
for TYP in (:TimesOperator,:PlusOperator,:Conversion,:Operator)
@eval *(L::LowRankOperator,B::$TYP) = LowRankOperator(L.U,map(v->v*B,L.V))
@eval *(B::$TYP,L::LowRankOperator) = LowRankOperator(map(u->B*u,L.U),L.V)
Expand Down
2 changes: 1 addition & 1 deletion src/Operators/banded/CalculusOperator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ Spaces will be inferred when applying or manipulating the operator.
Integral(k::Int)

"""
Intergral()
Integral()

Return the first integral operator on an unset space.
Spaces will be inferred when applying or manipulating the operator.
Expand Down
2 changes: 1 addition & 1 deletion src/Operators/banded/Multiplication.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ function default_mult_compatible(f::Fun, g::Fun)
coefficienttimes(g,f)
end
end
# This should be overriden whenever the multiplication space is different
# This should be overridden whenever the multiplication space is different
function default_mult(f::Fun,g::Fun)
# When the spaces differ we promote and multiply
if domainscompatible(space(f),space(g))
Expand Down
2 changes: 1 addition & 1 deletion src/Operators/banded/TridiagonalOperator.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## This makes implementing operators simpler
# but overrided BandedMatrix directly is likely to be faster
# but overriding BandedMatrix directly is likely to be faster


abstract type TridiagonalOperator{T} <: Operator{T} end
Expand Down
2 changes: 1 addition & 1 deletion src/Operators/banded/banded.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ include("ConstantOperator.jl")
include("TridiagonalOperator.jl")
include("PermutationOperator.jl")

## Operators overrided for spaces
## Operators overridden for spaces

include("Conversion.jl")
include("Multiplication.jl")
Expand Down
2 changes: 1 addition & 1 deletion src/Operators/functionals/Evaluation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ DirichletWrapper(B::Operator,λ=0) = DirichletWrapper{typeof(B),eltype(B)}(B,λ)
convert(::Type{Operator{T}},B::DirichletWrapper) where {T} =
DirichletWrapper(Operator{T}(B.op),B.order)::Operator{T}

# Default is to use diffbca
# Default is to use diffbcs
default_Dirichlet(sp::Space,λ) =
DirichletWrapper(InterlaceOperator((ldiffbc(sp,λ), rdiffbc(sp,λ)), false), λ)
Dirichlet(sp::Space,λ) = default_Dirichlet(sp,λ)
Expand Down
4 changes: 2 additions & 2 deletions src/Operators/general/InterlaceOperator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ Operator(M::AbstractArray{<:Operator}) = InterlaceOperator(M)


function interlace_choosedomainspace(ops,sp::UnsetSpace)
# this ensures correct dispatch for unino
# this ensures correct dispatch for union
sps = Vector{Space}(
filter(x->!isambiguous(x),map(choosedomainspace,ops)))
if isempty(sps)
Expand All @@ -546,7 +546,7 @@ end


function interlace_choosedomainspace(ops,rs::Space)
# this ensures correct dispatch for unino
# this ensures correct dispatch for union
sps = Vector{Space}(
filter(x->!isambiguous(x),map((op)->choosedomainspace(op,rs),ops)))
if isempty(sps)
Expand Down
2 changes: 1 addition & 1 deletion src/Operators/general/PartialInverseOperator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ rangespace(P::PartialInverseOperator)=domainspace(P.cache)
domain(P::PartialInverseOperator)=domain(domainspace(P))
bandwidths(P::PartialInverseOperator) = P.bandwidths

# Compute the value at the (k,j)th index of inv(C), assumming that C is upper triangular
# Compute the value at the (k,j)th index of inv(C), assuming that C is upper triangular
function _getindexinv(C, k::Integer, j::Integer, ::Type{UpperTriangular})
j >= k || return zero(inv(one(eltype(C))))
j == k && return inv(C[k,k])
Expand Down
2 changes: 1 addition & 1 deletion src/Operators/general/algebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ function choosedomainspace(P::PlusOperator, sp::Space)
ret = UnsetSpace()
for op in P.ops
sp2 = choosedomainspace(op, sp)
if !isa(sp2, AmbiguousSpace) # we will ignore this result in hopes another opand
if !isa(sp2, AmbiguousSpace) # we will ignore this result in hopes another operand
# tells us a good space
ret = union(ret, sp2)
end
Expand Down
2 changes: 1 addition & 1 deletion src/Operators/systems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ end
blockdiag(a::Operator,b::Operator) = blockdiag(Operator{promote_type(eltype(a),eltype(b))}[a],
Operator{promote_type(eltype(a),eltype(b))}[b])

## broadcase
## broadcast

broadcast(::typeof(*),A::AbstractArray{N},D::Operator) where {N<:Number} =
Operator{promote_type(N,eltype(D))}[A[k,j]*D for k=1:size(A,1),j=1:size(A,2)]
Expand Down
6 changes: 3 additions & 3 deletions src/PDE/KroneckerOperator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function subblockbandwidths(K::KroneckerOperator)
sb = subblock_blockbandwidths(K)
# divide by the size of each block
sb_sz = mapreduce(getindex_value,*,dt.blocks)
# spread by sub block szie
# spread by sub block size
(sb[1]+1)*sb_sz-1,(sb[2]+1)*sb_sz-1
end
end
Expand Down Expand Up @@ -182,7 +182,7 @@ domaintensorizer(K::KroneckerOperator) = K.domaintensorizer
rangetensorizer(K::KroneckerOperator) = K.rangetensorizer


# we suport 4-indexing with KroneckerOperator
# we support 4-indexing with KroneckerOperator
# If A is K x J and B is N x M, then w
# index to match KO=reshape(kron(B,A),N,K,M,J)
# that is
Expand Down Expand Up @@ -388,7 +388,7 @@ convert(::Type{BandedBlockBandedMatrix}, S::SubOperator{T,KroneckerOperator{SS,V


## Conversion
# TODO: we explicetly state type to avoid type inference bug in 0.4
# TODO: we explicitly state type to avoid type inference bug in 0.4

ConcreteConversion(a::BivariateSpace,b::BivariateSpace) =
ConcreteConversion(promote_type(prectype(a),prectype(b)), a,b)
Expand Down
8 changes: 4 additions & 4 deletions src/Space.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ end
# S=typeof(sp)
# @assert length(fieldnames(S))==1
# # the domain is not compatible, but maybe we c
# # can drop the space depence. For example,
# # can drop the space dependence. For example,
# # CosSpace{Circle{Float64}} -> CosSpace
# eval(Meta.parse(string(S.name.module)*"."*string(S.name)))(d)
# end
Expand Down Expand Up @@ -218,7 +218,7 @@ function conversion_type(a, b)
if spacescompatible(a,b)
a
elseif !domainscompatible(a,b)
NoSpace() # this avoids having to check eachtime
NoSpace() # this avoids having to check each time
else
cr=conversion_rule(a,b)
cr==NoSpace() ? conversion_rule(b,a) : cr
Expand Down Expand Up @@ -246,7 +246,7 @@ function maxspace(a::Space, b::Space)
if spacescompatible(a,b)
return a
elseif !domainscompatible(a,b)
return NoSpace() # this avoids having to check eachtime
return NoSpace() # this avoids having to check each time
end


Expand Down Expand Up @@ -600,7 +600,7 @@ for OP in (:plan_transform,:plan_itransform,:plan_transform!,:plan_itransform!)
end

## sorting
# we sort spaces lexigraphically by default
# we sort spaces lexicographically by default

for OP in (:<,:(<=),:(isless))
@eval $OP(a::Space,b::Space)=$OP(string(a),string(b))
Expand Down
2 changes: 1 addition & 1 deletion src/Spaces/ArraySpace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ end
const VectorSpace{S,DD,RR,A<:AbstractVector{S}} = ArraySpace{S,1,DD,RR,A}
const MatrixSpace{S,DD,RR,A<:AbstractMatrix{S}} = ArraySpace{S,2,DD,RR,A}

#TODO: Think through domain/domaindominsion
#TODO: Think through domain/domaindimension
ArraySpace(sp::AbstractArray{SS,N}) where {D,R,SS<:Space{D,R},N} =
ArraySpace{SS,N,D,R,typeof(sp)}(sp)
ArraySpace(sp::AbstractArray{SS,N}, f = first(sp)) where {SS<:Space,N} =
Expand Down
6 changes: 3 additions & 3 deletions src/Spaces/ConstantSpace.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Sequence space defintions
## Sequence space definitions

# A Fun for SequenceSpace can be an iterator
iterate(::Fun{SequenceSpace}) = 1
Expand Down Expand Up @@ -29,7 +29,7 @@ coefficients(cfs::AbstractVector,::SequenceSpace) = cfs # all vectors are conve



## Constant space defintions
## Constant space definitions

containsconstant(A::Space) = containsconstant(typeof(A))
containsconstant(@nospecialize(_)) = Val(false)
Expand Down Expand Up @@ -266,7 +266,7 @@ promoterangespace(M::ConcreteMultiplication{CS,UnsetSpace},
ps::Space) where {CS<:ConstantSpace} =
promoterangespace(Multiplication(M.f,space(M.f)),ps)

# Possible hack: we try uing constant space for [1 Operator()] \ z.
# Possible hack: we try using constant space for [1 Operator()] \ z.
choosedomainspace(M::ConcreteMultiplication{D,UnsetSpace},sp::UnsetSpace) where {D<:ConstantSpace} = space(M.f)
choosedomainspace(M::ConcreteMultiplication{D,UnsetSpace},sp::Space) where {D<:ConstantSpace} = space(M.f)

Expand Down
2 changes: 1 addition & 1 deletion src/Spaces/HeavisideSpace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function Base.sum(f::Fun{SplineSpace{1,T,R}}) where {T,R}
ret
end

#diffentiate HeavisideSpace
#differentiate HeavisideSpace
function differentiate(f::Fun{<:HeavisideSpace})
dp=domain(f).points
cfs=f.coefficients
Expand Down
Loading
Loading