From 0f90369b9c069bcc89400fa26a80354f10f2dff6 Mon Sep 17 00:00:00 2001 From: Sheehan Olver Date: Sun, 30 Jul 2023 15:17:40 +0100 Subject: [PATCH] Increase codecov --- test/test_banded.jl | 2 ++ test/test_interface.jl | 6 ++++++ test/test_linalg.jl | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/test/test_banded.jl b/test/test_banded.jl index 5fe02dea..6d9f4e9e 100644 --- a/test/test_banded.jl +++ b/test/test_banded.jl @@ -515,6 +515,8 @@ Base.similar(::MyMatrix, ::Type{T}, m::Int, n::Int) where T = MyMatrix{T}(undef, @test LinearAlgebra.copymutable_oftype(B', Float64) isa Adjoint{Float64,<:BandedMatrix{Float64}} @test LinearAlgebra.copymutable_oftype(transpose(B), Float64) == transpose(B) @test LinearAlgebra.copymutable_oftype(transpose(B), Float64) isa Transpose{Float64,<:BandedMatrix{Float64}} + + @test LinearAlgebra.copymutable_oftype(UpperTriangular(B), Float64) == B end end end diff --git a/test/test_interface.jl b/test/test_interface.jl index f9d25cde..a43ecc36 100644 --- a/test/test_interface.jl +++ b/test/test_interface.jl @@ -205,6 +205,12 @@ LinearAlgebra.fill!(A::PseudoBandedMatrix, v) = fill!(A.data,v) bandwidths(convert(BandedMatrix{Float64}, A)) == bandwidths(convert(BandedMatrix{Float64,Matrix{Float64}},A)) == bandwidths(A) + + @testset "copymutable_oftype" begin + A = PseudoBandedMatrix(rand(5, 4), 1, 2) + @test ArrayLayouts.copymutable_oftype_layout(MemoryLayout(A), A, BigFloat) == A + @test ArrayLayouts.copymutable_oftype_layout(MemoryLayout(A), A, BigFloat) isa BandedMatrix + end end @testset "Bi/Tri/Diagonal" begin diff --git a/test/test_linalg.jl b/test/test_linalg.jl index 1fcc218c..1470024c 100644 --- a/test/test_linalg.jl +++ b/test/test_linalg.jl @@ -426,5 +426,12 @@ import BandedMatrices: BandedColumns, _BandedMatrix end end end + + @testset "mul with α = 0" begin + A = randn(5,5) + B = brand(5,5,1,2) + @test muladd!(0.0, A, B, 2.0, copy(A)) == 2A + @test muladd!(0.0, B, A, 2.0, copy(A)) == 2A + end end