Skip to content

Commit 0029aa7

Browse files
authored
clean up whitespace (#80)
1 parent 101a92b commit 0029aa7

13 files changed

+43
-43
lines changed

src/ApproxFunOrthogonalPolynomials.jl

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module ApproxFunOrthogonalPolynomials
2-
using Base, LinearAlgebra, Reexport, BandedMatrices, BlockBandedMatrices, AbstractFFTs, FFTW, BlockArrays, FillArrays, FastTransforms, IntervalSets,
2+
using Base, LinearAlgebra, Reexport, BandedMatrices, BlockBandedMatrices, AbstractFFTs, FFTW, BlockArrays, FillArrays, FastTransforms, IntervalSets,
33
DomainSets, Statistics, SpecialFunctions, FastGaussQuadrature
4-
4+
55
@reexport using ApproxFunBase
66

77
import AbstractFFTs: Plan, fft, ifft
@@ -12,31 +12,31 @@ import ApproxFunBase: normalize!, flipsign, FiniteRange, Fun, MatrixFun, UnsetSp
1212
UnivariateSpace, AmbiguousSpace, SumSpace, SubSpace, WeightSpace, NoSpace, Space,
1313
HeavisideSpace, PointSpace,
1414
IntervalOrSegment, RaggedMatrix, AlmostBandedMatrix,
15-
AnyDomain, ZeroSpace, ArraySpace, TrivialInterlacer, BlockInterlacer,
15+
AnyDomain, ZeroSpace, ArraySpace, TrivialInterlacer, BlockInterlacer,
1616
AbstractTransformPlan, TransformPlan, ITransformPlan,
1717
ConcreteConversion, ConcreteMultiplication, ConcreteDerivative, ConcreteIntegral,
1818
ConcreteVolterra, Volterra, VolterraWrapper,
1919
MultiplicationWrapper, ConversionWrapper, DerivativeWrapper, Evaluation, EvaluationWrapper,
20-
Conversion, defaultConversion, defaultcoefficients, default_Fun, Multiplication, Derivative, Integral, bandwidths,
20+
Conversion, defaultConversion, defaultcoefficients, default_Fun, Multiplication, Derivative, Integral, bandwidths,
2121
ConcreteEvaluation, ConcreteDefiniteLineIntegral, ConcreteDefiniteIntegral, ConcreteIntegral,
2222
DefiniteLineIntegral, DefiniteIntegral, ConcreteDefiniteIntegral, ConcreteDefiniteLineIntegral, IntegralWrapper,
2323
ReverseOrientation, ReverseOrientationWrapper, ReverseWrapper, Reverse, NegateEven, Dirichlet, ConcreteDirichlet,
2424
TridiagonalOperator, SubOperator, Space, @containsconstants, spacescompatible,
25-
hasfasttransform, canonicalspace, domain, setdomain, prectype, domainscompatible,
26-
plan_transform, plan_itransform, plan_transform!, plan_itransform!, transform, itransform, hasfasttransform,
25+
hasfasttransform, canonicalspace, domain, setdomain, prectype, domainscompatible,
26+
plan_transform, plan_itransform, plan_transform!, plan_itransform!, transform, itransform, hasfasttransform,
2727
CanonicalTransformPlan, ICanonicalTransformPlan,
28-
Integral,
29-
domainspace, rangespace, boundary,
30-
union_rule, conversion_rule, maxspace_rule, conversion_type, maxspace, hasconversion, points,
31-
rdirichlet, ldirichlet, lneumann, rneumann, ivp, bvp,
32-
linesum, differentiate, integrate, linebilinearform, bilinearform,
28+
Integral,
29+
domainspace, rangespace, boundary,
30+
union_rule, conversion_rule, maxspace_rule, conversion_type, maxspace, hasconversion, points,
31+
rdirichlet, ldirichlet, lneumann, rneumann, ivp, bvp,
32+
linesum, differentiate, integrate, linebilinearform, bilinearform,
3333
UnsetNumber, coefficienttimes, subspace_coefficients, sumspacecoefficients, specialfunctionnormalizationpoint,
3434
Segment, IntervalOrSegmentDomain, PiecewiseSegment, isambiguous, Vec, eps, isperiodic,
3535
arclength, complexlength,
3636
invfromcanonicalD, fromcanonical, tocanonical, fromcanonicalD, tocanonicalD, canonicaldomain, setcanonicaldomain, mappoint,
3737
reverseorientation, checkpoints, evaluate, extrapolate, mul_coefficients, coefficients, isconvertible,
3838
clenshaw, ClenshawPlan, sineshaw,
39-
toeplitz_getindex, toeplitz_axpy!, sym_toeplitz_axpy!, hankel_axpy!, ToeplitzOperator, SymToeplitzOperator, hankel_getindex,
39+
toeplitz_getindex, toeplitz_axpy!, sym_toeplitz_axpy!, hankel_axpy!, ToeplitzOperator, SymToeplitzOperator, hankel_getindex,
4040
SpaceOperator, ZeroOperator, InterlaceOperator,
4141
interlace!, reverseeven!, negateeven!, cfstype, pad!, alternatesign!, mobius,
4242
extremal_args, hesseneigvals, chebyshev_clenshaw, recA, recB, recC, roots,splitatroots,
@@ -49,11 +49,11 @@ import ApproxFunBase: normalize!, flipsign, FiniteRange, Fun, MatrixFun, UnsetSp
4949
import DomainSets: Domain, indomain, UnionDomain, ProductDomain, FullSpace, Point, elements, DifferenceDomain,
5050
Interval, ChebyshevInterval, boundary, ∂, rightendpoint, leftendpoint,
5151
dimension, WrappedDomain
52-
52+
5353
import BandedMatrices: bandrange, bandshift,
5454
inbands_getindex, inbands_setindex!, bandwidth, AbstractBandedMatrix,
5555
colstart, colstop, colrange, rowstart, rowstop, rowrange,
56-
bandwidths, _BandedMatrix, BandedMatrix
56+
bandwidths, _BandedMatrix, BandedMatrix
5757

5858
import Base: values, convert, getindex, setindex!, *, +, -, ==, <, <=, >, |, !, !=, eltype, iterate,
5959
>=, /, ^, \, , transpose, size, tail, broadcast, broadcast!, copyto!, copy, to_index, (:),
@@ -70,7 +70,7 @@ import Base: values, convert, getindex, setindex!, *, +, -, ==, <, <=, >, |, !,
7070
import LinearAlgebra: BlasInt, BlasFloat, norm, ldiv!, mul!, det, eigvals, dot, cross,
7171
qr, qr!, rank, isdiag, istril, istriu, issymmetric, ishermitian,
7272
Tridiagonal, diagm, diagm_container, factorize, nullspace,
73-
Hermitian, Symmetric, adjoint, transpose, char_uplo
73+
Hermitian, Symmetric, adjoint, transpose, char_uplo
7474

7575
import FastTransforms: ChebyshevTransformPlan, IChebyshevTransformPlan, plan_chebyshevtransform,
7676
plan_chebyshevtransform!, plan_ichebyshevtransform, plan_ichebyshevtransform!,
@@ -96,7 +96,7 @@ import SpecialFunctions: sinpi, cospi, airy, besselh,
9696
points(d::IntervalOrSegmentDomain{T},n::Integer) where {T} =
9797
fromcanonical.(Ref(d), chebyshevpoints(float(real(eltype(T))), n)) # eltype to handle point
9898
bary(v::AbstractVector{Float64},d::IntervalOrSegmentDomain,x::Float64) = bary(v,tocanonical(d,x))
99-
99+
100100
include("bary.jl")
101101

102102

src/Domains/IntervalCurve.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fromcanonicalD(c::IntervalCurve,x)=differentiate(c.curve)(x)
3232

3333
function indomain(x,c::IntervalCurve)
3434
rts=roots(c.curve-x)
35-
if length(rts)  1
35+
if length(rts) 1
3636
false
3737
else
3838
in(first(rts),canonicaldomain(c))
@@ -44,4 +44,4 @@ isambiguous(d::IntervalCurve) = ncoefficients(d.curve)==0 && isambiguous(domain(
4444
reverseorientation(d::IntervalCurve) = IntervalCurve(reverseorientation(d.curve))
4545
convert(::Type{IntervalCurve{S,T}},::AnyDomain) where {S,T}=Fun(S(AnyDomain()),[NaN])
4646

47-
arclength(d::IntervalCurve) = linesum(ones(d))
47+
arclength(d::IntervalCurve) = linesum(ones(d))

src/Domains/Line.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,4 +223,4 @@ function setdiff(b::Line,a::Segment)
223223
else
224224
Ray([leftendpoint(b),leftendpoint(a)]) Ray([rightendpoint(a),rightendpoint(b)])
225225
end
226-
end
226+
end

src/Spaces/Jacobi/JacobiOperators.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function getindex(op::ConcreteEvaluation{<:Jacobi,typeof(leftendpoint)},kr::Abst
4848
@assert isa(d,IntervalOrSegment)
4949
if kr[1]==1 && kr[end] 2
5050
tocanonicalD(d,leftendpoint(d)).*(a .+ b .+ kr).*T[zero(T);jacobip(T,0:kr[end]-2,1+a,1+b,-one(T))]/2
51-
elseif kr[1]==1 # kr[end] ≤ 1
51+
elseif kr[1]==1 # kr[end] ≤ 1
5252
zeros(T,length(kr))
5353
else
5454
tocanonicalD(d,leftendpoint(d)) .* (a.+b.+kr).*jacobip(T,kr.-1,1+a,1+b,-one(T))/2
@@ -77,7 +77,7 @@ function getindex(op::ConcreteEvaluation{<:Jacobi,typeof(rightendpoint)},kr::Abs
7777
@assert isa(d,IntervalOrSegment)
7878
if kr[1]==1 && kr[end] 2
7979
tocanonicalD(d,leftendpoint(d))*((a+b).+kr).*T[zero(T);jacobip(T,0:kr[end]-2,1+a,1+b,one(T))]/2
80-
elseif kr[1]==1 # kr[end] ≤ 1
80+
elseif kr[1]==1 # kr[end] ≤ 1
8181
zeros(T,length(kr))
8282
else
8383
tocanonicalD(d,leftendpoint(d))*((a+b).+kr).*jacobip(T,kr.-1,1+a,1+b,one(T))/2
@@ -178,7 +178,7 @@ for (Func,Len,Sum) in ((:DefiniteIntegral,:complexlength,:sum),(:DefiniteLineInt
178178
dsp = domainspace(Σ)
179179

180180
if dsp.b == dsp.a == 0
181-
# TODO: copy and paste
181+
# TODO: copy and paste
182182
k == 1 ? convert(T,$Sum(Fun(dsp,[one(T)]))) : zero(T)
183183
else
184184
convert(T,$Sum(Fun(dsp,[zeros(T,k-1);1])))

src/Spaces/PolynomialSpace.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ function jac_gbmm!(α, J, B, β, C, b)
148148
Cn, Cm = size(C)
149149

150150
@views for k=-1:b-1
151-
if 1-Cn  b-k  Cm-1 # if inbands
151+
if 1-Cn b-k Cm-1 # if inbands
152152
C[band(b-k)] .+= α.*B[band(b-k-1)][2:n-b+k+1].*Jp[1:n-b+k]
153153
if k 0
154154
C[band(b-k)] .+= α.*B[band(b-k)].*J0[1:n-b+k]
@@ -160,7 +160,7 @@ function jac_gbmm!(α, J, B, β, C, b)
160160
end
161161

162162
@views for k=-1:b-1
163-
if 1-Cn  k-b  Cm-1 # if inbands
163+
if 1-Cn k-b Cm-1 # if inbands
164164
C[band(k-b)] .+= α.*B[band(k-b+1)][1:n-b+k].*Jm[b-k:n-1]
165165
if k 0
166166
C[band(k-b)] .+= α.*B[band(k-b)].*J0[b-k+1:n]

src/Spaces/Spaces.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ bandwidths(::ConcreteConversion{HS,PiecewiseSpace{NTuple{kk,CC},DD,RR}}) where {
4040
0,0
4141

4242
getindex(C::ConcreteConversion{HS,PiecewiseSpace{NTuple{kk,CC},DD,RR}},k::Integer,j::Integer) where {HS<:HeavisideSpace,CC<:PolynomialSpace,DD<:Domain{<:Number},RR<:Real,kk} =
43-
k dimension(domainspace(C)) && j==k ? one(eltype(C)) : zero(eltype(C))
43+
k dimension(domainspace(C)) && j==k ? one(eltype(C)) : zero(eltype(C))

src/Spaces/Ultraspherical/ContinuousSpace.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ function getindex(B::ConcreteDirichlet{<:TensorChebyshevDirichlet}, k::Integer,j
253253
one(T)
254254
elseif j == 2 && k 2
255255
-one(T)
256-
elseif j == 2 && k  4
256+
elseif j == 2 && k 4
257257
one(T)
258258
elseif j == 3 && (k == 1 || k == 4)
259259
-one(T)
@@ -263,7 +263,7 @@ function getindex(B::ConcreteDirichlet{<:TensorChebyshevDirichlet}, k::Integer,j
263263
-one(T)
264264
elseif j == 5 && (k == 1 || k == 3)
265265
one(T)
266-
elseif j == 5 || j  3
266+
elseif j == 5 || j 3
267267
zero(T)
268268
else
269269
K = Int(block(rs,k))
@@ -341,7 +341,7 @@ function BlockBandedMatrix(S::SubOperator{T,<:ConcreteDirichlet{<:TensorChebyshe
341341
J = K+1 # super-diagonal block
342342
N = ret.rows[K.n[1]]
343343
M = ret.cols[J.n[1]]
344-
if N  0 && M  0
344+
if N 0 && M 0
345345
# calculate shift
346346
k_sh = K == K1 ? kr[1]-Kr1 : 0
347347
j_sh = J == J1 ? jr[1]-Jr1 : 0
@@ -357,7 +357,7 @@ function BlockBandedMatrix(S::SubOperator{T,<:ConcreteDirichlet{<:TensorChebyshe
357357
J = K+1 # super-diagonal block
358358
N = ret.rows[K.n[1]]
359359
M = ret.cols[J.n[1]]
360-
if N  0 && M  0
360+
if N 0 && M 0
361361
# calculate shift
362362
k_sh = K == K1 ? kr[1]-Kr1 : 0
363363
j_sh = J == J1 ? jr[1]-Jr1 : 0
@@ -374,7 +374,7 @@ function BlockBandedMatrix(S::SubOperator{T,<:ConcreteDirichlet{<:TensorChebyshe
374374
N = ret.rows[K.n[1]]
375375
M = ret.cols[J.n[1]]
376376

377-
if N  0 && M  0
377+
if N 0 && M 0
378378
B=view(ret,K,J)
379379
# calculate shift
380380
k_sh = K == K1 ? kr[1]-Kr1 : 0
@@ -393,7 +393,7 @@ function BlockBandedMatrix(S::SubOperator{T,<:ConcreteDirichlet{<:TensorChebyshe
393393
N = ret.rows[K.n[1]]
394394
M = ret.cols[J.n[1]]
395395

396-
if N  0 && M  0
396+
if N 0 && M 0
397397
B=view(ret,K,J)
398398
# calculate shift
399399
k_sh = K == K1 ? kr[1]-Kr1 : 0

src/Spaces/Ultraspherical/Ultraspherical.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ struct Ultraspherical{T,D<:Domain,R} <: PolynomialSpace{D,R}
1818
order::T
1919
domain::D
2020
Ultraspherical{T,D,R}(m::T,d::D) where {T,D,R} = (@assert m 0; new(m,d))
21-
Ultraspherical{T,D,R}(m::Number,d::Domain) where {T,D,R} = (@assert m  0; new(convert(T,m),convert(D,d)))
21+
Ultraspherical{T,D,R}(m::Number,d::Domain) where {T,D,R} = (@assert m 0; new(convert(T,m),convert(D,d)))
2222
Ultraspherical{T,D,R}(d::Domain) where {T,D,R} = new(one(T),convert(D,d))
23-
Ultraspherical{T,D,R}(m::Number) where {T,D,R} = (@assert m  0; new(convert(T,m),D()))
23+
Ultraspherical{T,D,R}(m::Number) where {T,D,R} = (@assert m 0; new(convert(T,m),D()))
2424
end
2525

2626
Ultraspherical(m::Number,d::Domain) = Ultraspherical{typeof(m),typeof(d),real(prectype(d))}(m,d)

src/Spaces/Ultraspherical/UltrasphericalOperators.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Derivative(sp::Ultraspherical{LT,DD},m::Integer) where {LT,DD<:IntervalOrSegment
5555
ConcreteDerivative(sp,m)
5656
function Integral(sp::Ultraspherical{LT,DD},m::Integer) where {LT,DD<:IntervalOrSegment}
5757
λ = order(sp)
58-
if m  λ
58+
if m λ
5959
ConcreteIntegral(sp,m)
6060
else # Convert up
6161
nsp = Ultraspherical+1,domain(sp))
@@ -315,7 +315,7 @@ function getindex(M::ConcreteConversion{Ultraspherical{LT,DD,RR},C,T},
315315
elseif λ == 0.5
316316
if k==1 && isodd(j)
317317
convert(T,FastTransforms.Λ((j-1)/2)^2/π)
318-
elseif k  j && iseven(k-j)
318+
elseif k j && iseven(k-j)
319319
convert(T,FastTransforms.Λ((j-k)/2)*FastTransforms.Λ((k+j-2)/2)*2/π)
320320
else
321321
zero(T)

src/fastops.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function BandedMatrix(S::SubOperator{T,ConcreteConversion{Chebyshev{DD,RR},Ultra
1717
kr,jr = parentindices(S)
1818
dg = diagindshift(S)
1919

20-
@assert -bandwidth(ret,1) dg  bandwidth(ret,2)-2
20+
@assert -bandwidth(ret,1) dg bandwidth(ret,2)-2
2121

2222
ret[band(dg)] .= 0.5
2323
ret[band(dg+1)] .= 0.0
@@ -51,9 +51,9 @@ function BandedMatrix(V::SubOperator{T,ConcreteConversion{Ultraspherical{LT,DD,R
5151

5252

5353

54-
1-n  dg  m-1 && (ret[band(dg)] .= c./(jr[max(0,dg)+1:min(n+dg,m)] .- 2 .+ λ))
55-
1-n  dg+1  m-1 && (ret[band(dg+1)] .= 0)
56-
1-n  dg+2  m-1 && (ret[band(dg+2)] .= c./(2 .- λ .- jr[max(0,dg+2)+1:min(n+dg+2,m)]))
54+
1-n dg m-1 && (ret[band(dg)] .= c./(jr[max(0,dg)+1:min(n+dg,m)] .- 2 .+ λ))
55+
1-n dg+1 m-1 && (ret[band(dg+1)] .= 0)
56+
1-n dg+2 m-1 && (ret[band(dg+2)] .= c./(2 .- λ .- jr[max(0,dg+2)+1:min(n+dg+2,m)]))
5757

5858
ret
5959
end

test/ChebyshevTest.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ import ApproxFunOrthogonalPolynomials: forwardrecurrence
202202
f = 1/(1 + 25*(x^2))
203203
@test norm(f, Inf) 1.0
204204
end
205-
205+
206206
@testset "Jacobi" begin
207207
S=Chebyshev()
208208
@test S.a==-0.5

test/PDETest.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ import ApproxFunBase: testbandedblockbandedoperator, testblockbandedoperator, te
169169
u=\(A,F;tolerance=1E-10)
170170

171171
@test u(0.1,0.2) exp(0.1)*cos(0.2)
172-
end
172+
end
173173

174174

175175
@testset "Check resizing" begin
@@ -289,5 +289,5 @@ import ApproxFunBase: testbandedblockbandedoperator, testblockbandedoperator, te
289289
[Fun(x->exp(-20(x+0.5)^2),s),[[0],[0,0]],0.0];tolerance=1E-2)
290290

291291
@test u(-0.4,0.1) u(-0.5,0.0) atol = 0.0001
292-
end
292+
end
293293
end

test/VectorTest.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ using ApproxFunOrthogonalPolynomials, ApproxFunBase, LazyArrays, FillArrays, Lin
170170
@test norm(((Derivative(space(f))*f)-Fun(t->[2t,cos(t)])).coefficients)<100eps()
171171
@test norm((([1 2;3 4]*f)-Fun(t->[t^2+2sin(t),3t^2+4sin(t)])).coefficients)<100eps()
172172
end
173-
173+
174174
@testset "Interlace" begin
175175
S1 = Chebyshev()^2
176176
S2 = Chebyshev()

0 commit comments

Comments
 (0)