From d626fad0a6b1c9ea9a74aade4f5755a33198e9ea Mon Sep 17 00:00:00 2001 From: Sheehan Olver Date: Fri, 29 Nov 2024 16:37:14 +0000 Subject: [PATCH] Make sure container type is maintained in constructor --- Project.toml | 2 +- src/banded/BandedMatrix.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index f4e64c80..5b42a18e 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "BandedMatrices" uuid = "aae01518-5342-5314-be14-df237901396f" -version = "1.7.5" +version = "1.7.6" [deps] ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a" diff --git a/src/banded/BandedMatrix.jl b/src/banded/BandedMatrix.jl index 1ccccb45..26f2ffc8 100644 --- a/src/banded/BandedMatrix.jl +++ b/src/banded/BandedMatrix.jl @@ -59,7 +59,7 @@ BandedMatrix{T, C}(::UndefInitializer, (n,m)::NTuple{2,Integer}, (a,b)::NTuple{2 BandedMatrix{T, C}(::UndefInitializer, (n,m)::NTuple{2,Integer}, (a,b)::NTuple{2,Integer}) where {T, C<:AbstractMatrix{T}} = _BandedMatrix(C(undef,max(0,b+a+1),m),n,a,b) BandedMatrix{T, C}(::UndefInitializer, (n,m)::NTuple{2,Integer}, (a,b)::NTuple{2,Integer}) where {T<:Number, C<:AbstractMatrix{T}} = - _BandedMatrix(fill!(similar(C, max(0,b+a+1),m), zero(T)),n,a,b) + _BandedMatrix(fill!(convert(C, similar(C, max(0,b+a+1),m)), zero(T)),n,a,b) BandedMatrix{T}(::UndefInitializer, nm::NTuple{2,Integer}, ab::NTuple{2,Integer}) where T = BandedMatrix{T, Matrix{T}}(undef,nm,ab)