Skip to content

Commit 36f646a

Browse files
committed
Preserve types in triangular constructors
1 parent 950e29f commit 36f646a

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ToeplitzMatrices"
22
uuid = "c751599d-da0a-543b-9d20-d0a503d91d24"
3-
version = "0.8.3"
3+
version = "0.9.0"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
@@ -25,7 +25,7 @@ LinearAlgebra = "<0.0.1, 1"
2525
Random = "<0.0.1, 1"
2626
StatsBase = "0.32, 0.33, 0.34"
2727
Test = "<0.0.1, 1"
28-
julia = "1.0"
28+
julia = "1.6"
2929

3030
[extras]
3131
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"

src/special.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,9 @@ function LowerTriangularToeplitz{T}(A::AbstractMatrix) where T
192192
checksquare(A)
193193
LowerTriangularToeplitz{T}(_vc(A))
194194
end
195-
_toeplitztype(s::Symbol) = Symbol(s,"Toeplitz")
195+
_toeplitztype(s::Symbol) = Symbol(s, :Toeplitz)
196196
for TYPE in (:UpperTriangular, :LowerTriangular)
197197
@eval begin
198-
$TYPE{T}(A::AbstractToeplitz) where T = $(_toeplitztype(TYPE)){T}(A)
199-
$TYPE(A::AbstractToeplitz) = $TYPE{eltype(A)}(A)
200198
convert(::Type{TriangularToeplitz{T}},A::$(_toeplitztype(TYPE))) where T<:Number = convert($(_toeplitztype(TYPE)){T},A)
201199
end
202200
end

test/runtests.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -614,19 +614,19 @@ end
614614
A = randn(ComplexF64, 3, 3)
615615
T = Toeplitz(A)
616616
TU = UpperTriangular(T)
617-
@test TU isa TriangularToeplitz
617+
@test TU isa UpperTriangular
618618
@test istriu(TU)
619619
@test TU == Toeplitz(triu(A)) == triu(T)
620620
@test TU'ones(3) == Matrix(TU)'ones(3)
621621
@test transpose(TU)*ones(3) == transpose(Matrix(TU))*ones(3)
622-
@test triu(TU, 1)::TriangularToeplitz == triu(Matrix(T), 1) == triu(T,1)
622+
@test triu(TU, 1) == triu(Matrix(T), 1) == triu(T,1)
623623
TL = LowerTriangular(T)
624-
@test TL isa TriangularToeplitz
624+
@test TL isa LowerTriangular
625625
@test istril(TL)
626626
@test TL == Toeplitz(tril(A)) == tril(T)
627627
@test TL'ones(3) == Matrix(TL)'ones(3)
628628
@test transpose(TL)*ones(3) == transpose(Matrix(TL))*ones(3)
629-
@test tril(TL, -1)::TriangularToeplitz == tril(Matrix(T), -1) == tril(T,-1)
629+
@test tril(TL, -1) == tril(Matrix(T), -1) == tril(T,-1)
630630
for n in (65, 128)
631631
A = randn(n, n)
632632
TU = TriangularToeplitz(A, :U)

0 commit comments

Comments
 (0)