Skip to content

Commit fbd2b0f

Browse files
authored
Fix whitespace (#118)
Co-authored-by: Jishnu Bhattacharya <[email protected]>
1 parent 3feb5e9 commit fbd2b0f

27 files changed

+154
-155
lines changed

examples/blocktridiagonal.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
using InfiniteLinearAlgebra, BlockBandedMatrices, BandedMatrices, BlockArrays, InfiniteArrays, FillArrays, LazyArrays, Test
22

3-
A = BlockTridiagonal(Vcat([fill(1.0,2,1),Matrix(1.0I,2,2),Matrix(1.0I,2,2),Matrix(1.0I,2,2)],Fill(Matrix(1.0I,2,2), ∞)),
4-
Vcat([zeros(1,1)], Fill(zeros(2,2), ∞)),
3+
A = BlockTridiagonal(Vcat([fill(1.0,2,1),Matrix(1.0I,2,2),Matrix(1.0I,2,2),Matrix(1.0I,2,2)],Fill(Matrix(1.0I,2,2), ∞)),
4+
Vcat([zeros(1,1)], Fill(zeros(2,2), ∞)),
55
Vcat([fill(1.0,1,2),Matrix(1.0I,2,2)], Fill(Matrix(1.0I,2,2), ∞)))
66

77

8-

examples/intervalarithmetic.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
using InfiniteLinearAlgebra
2-
import IntervalArithmetic
2+
import IntervalArithmetic

examples/jacobi.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ql(Δ - λ*I).L[1,1]
1717
end
1818

1919
λ2 = Interval(m,λ.hi)
20-
ql- λ1.hi*I).L[1,1]
20+
ql- λ1.hi*I).L[1,1]
2121

2222

2323
ql- Interval(4.2)I).L[1,1]
@@ -41,7 +41,7 @@ Z,A,B = 0.5,-4.0,0.5
4141

4242
A = 4
4343
rig_qltail(-2,10,B)
44-
44+
4545
d,e = d2,e2
4646

4747
rig_qltail(Z,A,B,d,e)
@@ -106,4 +106,4 @@ X[2,:] .= (zero(T), X[1,1], X[1,2]);
106106
X[1,:] .= (Z,A,B);
107107
QL = _qlfactUnblocked!(X)
108108

109-
X, QL.τ[end]
109+
X, QL.τ[end]

examples/periodicschrodinger.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ using InfiniteLinearAlgebra, Plots
33
# Consider a rank-1 perturbation of periodic semi-infinite Schrödinger (Jacobi) operator.
44
# We can construct it as a block matrix as follows:
55

6-
A = BlockTridiagonal(Vcat([[0. 1.; 0. 0.]],Fill([0. 1.; 0. 0.], ∞)),
7-
Vcat([[-1. 1.; 1. 1.]], Fill([-1. 1.; 1. 1.], ∞)),
6+
A = BlockTridiagonal(Vcat([[0. 1.; 0. 0.]],Fill([0. 1.; 0. 0.], ∞)),
7+
Vcat([[-1. 1.; 1. 1.]], Fill([-1. 1.; 1. 1.], ∞)),
88
Vcat([[0. 0.; 1. 0.]], Fill([0. 0.; 1. 0.], ∞)))
99

1010
A[1,1] = 2 # perturbation
@@ -16,7 +16,7 @@ n = 100; scatter(eigvals(A[1:n,1:n]), zeros(n); label="finite-section")
1616
# In any case, we can also calculate the spectrum using ∞-QL:
1717
xx = [-0.95:0.05:0.95; 2.25:0.125/4:4.0]
1818
plot!(xx, (x -> ql(A-x*I).L[1,1]).(xx); label="L[1,1]")
19-
xx =
19+
xx =
2020
plot!(xx, (x -> ql(A-x*I).L[1,1]).(xx))
2121

2222

examples/perttoeplitz.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ A = BandedMatrix(-2 => Vcat([1], Fill(1,∞)), 0 => Vcat(a, Fill(0,∞)), 1 =>
2323
x,y = range(-2,2; length=200),range(-2,2;length=200)
2424
z = abs.(.(x' .+ y.*im))
2525
contour(x,y,z; nlevels=50, title="z^2 + 1/(4z)")
26-
scatter!(eigvals(Matrix(A[1:100,1:100]')); label="A' finite section")
26+
scatter!(eigvals(Matrix(A[1:100,1:100]')); label="A' finite section")
2727
scatter!(eigvals(Matrix(A[1:100,1:100])); label="A finite section")
2828

2929
x = range(-2,2,length=1_000)
30-
plot(x, abs.(.(x.+eps()im)); label="abs(L[1,1])")
30+
plot(x, abs.(.(x.+eps()im)); label="abs(L[1,1])")
3131

3232
a = [-0.1,0.2,0.3]
3333
A = BandedMatrix(-2 => Vcat([1], Fill(1,∞)), 0 => Vcat(a, Fill(0,∞)), 1 => Vcat([1/4], Fill(1/4,∞)))

examples/toeplitz.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ using InfiniteLinearAlgebra, BandedMatrices, PyPlot
1212
###
1313

1414
function ℓ11(A,λ; kwds...)
15-
try
16-
abs(ql(A-λ*I; kwds...).L[1,1])
17-
catch DomainError
15+
try
16+
abs(ql(A-λ*I; kwds...).L[1,1])
17+
catch DomainError
1818
-1.0
1919
end
2020
end
@@ -64,7 +64,7 @@ clf(); qlplot(A; branch=findsecond, x=range(-2,3; length=100), y=range(-2.5,2.5;
6464
clf(); qlplot(transpose(A); x=range(-2,3; length=100), y=range(-2.5,2.5;length=100)); symbolplot(A; color=:black); title("Limacon, transpose")
6565

6666

67-
###
67+
###
6868
# bull-head
6969
###
7070

@@ -95,7 +95,7 @@ clf(); qlplot(transpose(A); branch=branch(2), x=range(-2,2; length=100), y=range
9595
# Whale
9696
###
9797

98-
A = BandedMatrix(-4 => Fill(im,∞), -3 => Fill(4,∞), -2 => Fill(3+im,∞), -1 => Fill(10,∞),
98+
A = BandedMatrix(-4 => Fill(im,∞), -3 => Fill(4,∞), -2 => Fill(3+im,∞), -1 => Fill(10,∞),
9999
1 => Fill(1,∞), 2 => Fill(im,∞), 3 => Fill(-(3+2im),∞), 4=>Fill(-1,∞))
100100

101101
clf(); qlplot(A; x=range(-15,20; length=100), y=range(-20,20;length=100)); symbolplot(A; color=:black); title("Whale")

src/InfiniteLinearAlgebra.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Base: +, -, *, /, \, ^, OneTo, getindex, promote_op, _unsafe_getindex, si
88
show, getproperty, copy, copyto!, map, require_one_based_indexing, similar, inv
99
import Base.Broadcast: BroadcastStyle, Broadcasted, broadcasted
1010

11-
import ArrayLayouts: colsupport, rowsupport, triangularlayout, MatLdivVec, triangulardata, TriangularLayout, TridiagonalLayout,
11+
import ArrayLayouts: colsupport, rowsupport, triangularlayout, MatLdivVec, triangulardata, TriangularLayout, TridiagonalLayout,
1212
sublayout, _qr, __qr, MatLmulVec, MatLmulMat, AbstractQLayout, materialize!, diagonaldata, subdiagonaldata, supdiagonaldata,
1313
_bidiag_forwardsub!, mulreduce, RangeCumsum, _factorize, transposelayout, ldiv!, lmul!, mul, CNoPivot
1414
import BandedMatrices: BandedMatrix, _BandedMatrix, AbstractBandedMatrix, bandeddata, bandwidths, BandedColumns, bandedcolumns,
@@ -46,7 +46,7 @@ else
4646
import Base: oneto, unitrange
4747
end
4848

49-
if VERSION  v"1.7-"
49+
if VERSION v"1.7-"
5050
LinearAlgebra._cut_B(x::AbstractVector, r::InfUnitRange) = x
5151
LinearAlgebra._cut_B(X::AbstractMatrix, r::InfUnitRange) = X
5252
end

src/banded/hessenbergq.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function show(io::IO, mime::MIME{Symbol("text/plain")}, F::QLHessenberg)
4343
show(io, mime, F.L)
4444
end
4545

46-
@inline function getL(F::QLHessenberg, _)
46+
@inline function getL(F::QLHessenberg, _)
4747
m, n = size(F)
4848
tril!(getfield(F, :factors)[end-min(m,n)+1:end, 1:n], max(n-m,0))
4949
end
@@ -78,7 +78,7 @@ for Typ in (:UpperHessenbergQ, :LowerHessenbergQ)
7878
end
7979
end
8080

81-
$Typ(q::AbstractVector{<:AbstractMatrix{T}}) where T =
81+
$Typ(q::AbstractVector{<:AbstractMatrix{T}}) where T =
8282
$Typ{T,typeof(q)}(q)
8383
end
8484
end
@@ -111,7 +111,7 @@ function materialize!(L::MatLmulVec{<:HessenbergQLayout{'L'}})
111111
v = view(x, n:n+1)
112112
mul!(t, Q.q[n], v)
113113
v .= t
114-
n > nz && norm(t)  10floatmin(real(T)) && return x
114+
n > nz && norm(t) 10floatmin(real(T)) && return x
115115
end
116116
x
117117
end

src/banded/infbanded.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function _inf_banded_sub_materialize(::BandedColumns, V)
2323
b = parentindices(V)[1].b
2424
data = bandeddata(A)
2525
l,u = bandwidths(A)
26-
if -l  b  u
26+
if -l b u
2727
data[u+1-b, max(1,b+1):end]
2828
else
2929
Zeros{eltype(V)}(∞) # Not type stable
@@ -86,7 +86,7 @@ function BandedMatrix{T}(kv::Tuple{Vararg{Pair{<:Integer,<:Vcat{<:Any,1,<:Tuple{
8686
m,n = mn
8787
@assert isinf(n)
8888
l,u = lu
89-
M = mapreduce(x -> length(x.second.args[1]) + max(0,x.first), max, kv) # number of data rows
89+
M = mapreduce(x -> length(x.second.args[1]) + max(0,x.first), max, kv) # number of data rows
9090
data = zeros(T, u+l+1, M)
9191
t = zeros(T, u+l+1)
9292
for (k,v) in kv
@@ -110,30 +110,30 @@ function BandedMatrix(Ac::Adjoint{T,<:InfToeplitz}) where T
110110
A = parent(Ac)
111111
l,u = bandwidths(A)
112112
a = A.data.args[1]
113-
_BandedMatrix(reverse(conj(a)) * Ones{T}(1,∞), ℵ₀, u, l)
113+
_BandedMatrix(reverse(conj(a)) * Ones{T}(1,∞), ℵ₀, u, l)
114114
end
115115

116116
function BandedMatrix(Ac::Transpose{T,<:InfToeplitz}) where T
117117
A = parent(Ac)
118118
l,u = bandwidths(A)
119119
a = A.data.args[1]
120-
_BandedMatrix(reverse(a) * Ones{T}(1,∞), ℵ₀, u, l)
120+
_BandedMatrix(reverse(a) * Ones{T}(1,∞), ℵ₀, u, l)
121121
end
122122

123123
function BandedMatrix(Ac::Adjoint{T,<:PertToeplitz}) where T
124124
A = parent(Ac)
125125
l,u = bandwidths(A)
126126
a,b = A.data.args
127127
Ac_fd = BandedMatrix(_BandedMatrix(Hcat(a, b[:,1:l+1]), size(a,2)+l, l, u)')
128-
_BandedMatrix(Hcat(Ac_fd.data, reverse(conj(b.args[1])) * Ones{T}(1,∞)), ℵ₀, u, l)
128+
_BandedMatrix(Hcat(Ac_fd.data, reverse(conj(b.args[1])) * Ones{T}(1,∞)), ℵ₀, u, l)
129129
end
130130

131131
function BandedMatrix(Ac::Transpose{T,<:PertToeplitz}) where T
132132
A = parent(Ac)
133133
l,u = bandwidths(A)
134134
a,b = A.data.args
135135
Ac_fd = BandedMatrix(transpose(_BandedMatrix(Hcat(a, b[:,1:l+1]), size(a,2)+l, l, u)))
136-
_BandedMatrix(Hcat(Ac_fd.data, reverse(b.args[1]) * Ones{T}(1,∞)), ℵ₀, u, l)
136+
_BandedMatrix(Hcat(Ac_fd.data, reverse(b.args[1]) * Ones{T}(1,∞)), ℵ₀, u, l)
137137
end
138138

139139

@@ -231,7 +231,7 @@ end
231231
function BandedMatrix(A::PertToeplitz{T}, (l,u)::Tuple{Int,Int}) where T
232232
@assert A.u == u # Not implemented
233233
a, b = A.data.args
234-
t = b.args[1] # topelitz part
234+
t = b.args[1] # topelitz part
235235
t_pad = vcat(t,Zeros(l-A.l))
236236
data = Hcat([vcat(a,Zeros{T}(l-A.l,size(a,2))) repeat(t_pad,1,l)], t_pad * Ones{T}(1,∞))
237237
_BandedMatrix(data, ℵ₀, l, u)
@@ -509,7 +509,7 @@ copyto!(dest::AbstractArray, L::Ldiv{BidiagonalToeplitzLayout,Lay}) where Lay =
509509

510510
# copy for AdjOrTrans
511511
copy(A::Adjoint{T,<:BandedMatrix{T,<:Any,OneToInf{Int}}}) where T = copy(parent(A))'
512-
copy(A::Transpose{T,<:BandedMatrix{T,<:Any,OneToInf{Int}}}) where T = transpose(copy(parent(A)))
512+
copy(A::Transpose{T,<:BandedMatrix{T,<:Any,OneToInf{Int}}}) where T = transpose(copy(parent(A)))
513513

514514

515515
##

src/banded/infqltoeplitz.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,4 +191,4 @@ ql(A::InfToeplitz; kwds...) = _inf_ql(A; kwds...)
191191
ql(A::PertToeplitz; kwds...) = _inf_ql(A; kwds...)
192192

193193
ql(A::Adjoint{<:Any,<:InfToeplitz}) = ql(BandedMatrix(A))
194-
ql(A::Adjoint{<:Any,<:PertToeplitz}) = ql(BandedMatrix(A))
194+
ql(A::Adjoint{<:Any,<:PertToeplitz}) = ql(BandedMatrix(A))

0 commit comments

Comments
 (0)