Skip to content

Commit

Permalink
increase cov
Browse files Browse the repository at this point in the history
  • Loading branch information
dlfivefifty committed Nov 30, 2024
1 parent dfe2bdb commit 4ff3eea
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "InfiniteArrays"
uuid = "4858937d-0d70-526a-a4dd-2d5cb5dd786c"
version = "0.15.0"
version = "0.15.0-dev"

[deps]
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
Expand Down
6 changes: 3 additions & 3 deletions src/InfiniteArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ end

using Base.Broadcast
import ArrayLayouts: AbstractBandedLayout, LayoutMatrix, LayoutVecOrMat, LayoutVecOrMats, LayoutVector, MemoryLayout,
RangeCumsum, UnknownLayout, reshapedlayout, sub_materialize, sublayout, MatLdivVec,
subdiagonaldata, diagonaldata, supdiagonaldata
RangeCumsum, UnknownLayout, reshapedlayout, sub_materialize, materialize!, sublayout, MatLdivVec,
subdiagonaldata, diagonaldata, supdiagonaldata, triangularlayout

import Base.Broadcast: BroadcastStyle, Broadcasted, DefaultArrayStyle, axistype, broadcasted

Expand All @@ -39,7 +39,7 @@ import Infinities: InfiniteCardinal, Infinity, ∞

import LazyArrays: AbstractLazyLayout, AbstractCachedVector, ApplyLayout, CachedArray, CachedVector, InvColumnLayout, AbstractLazyBandedLayout,
LazyArrayStyle, LazyLayout, LazyMatrix, PaddedColumns, _padded_sub_materialize, sub_paddeddata,
ApplyBandedLayout, BroadcastBandedLayout
ApplyBandedLayout, BroadcastBandedLayout, islazy_layout

import LinearAlgebra: AdjOrTrans, HermOrSym, diag, norm, norm1, norm2, normp

Expand Down
10 changes: 9 additions & 1 deletion test/test_infbanded.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ const InfBandCartesianIndices = InfiniteArraysBandedMatricesExt.InfBandCartesian
S = SymTridiagonal(Fill(1,∞), Fill(2,∞))
@test (S + 2I)[1:10,1:10] == (2I + S)[1:10,1:10] == S[1:10,1:10] + 2I
@test BandedMatrix(S, (2,3))[1:10,1:10] == S[1:10,1:10]

B = Bidiagonal(Fill(1,∞), Fill(2,∞), :U)
@test (B*B)[1:10,1:10] == B[1:10,1:11] * B[1:11,1:10]

@test (B \ [1:10; zeros(∞)])[1:10] == B[1:10,1:10] \ (1:10)
end

@testset "constant data" begin
Expand Down Expand Up @@ -202,14 +207,17 @@ const InfBandCartesianIndices = InfiniteArraysBandedMatricesExt.InfBandCartesian

@testset "SubArray broadcasting" begin
A = BandedMatrix(2 => 1:∞)
@test exp.(A[1:2:∞,1:2:∞])[1:10,1:10] exp.(A[1:2:20,1:2:20])
@test exp.(A[1:2:∞,1:2:∞])[1:10,1:10] exp.(A)[1:2:20,1:2:20] exp.(A[1:2:20,1:2:20])
@test A[band(2)][1:5] == 1:5
@test _BandedMatrix((1:∞)', ∞, -1,1)[band(1)][1:5] == 2:6
@test exp.(view(A,band(2)))[1:10] exp.(1:10)

@test BandedMatrices.banded_similar(Int, (∞,5), (1,1)) isa BandedMatrix
@test BandedMatrices.banded_similar(Int, (5,∞), (1,1)) isa Adjoint{<:Any,<:BandedMatrix}

@test (A+A)[2:∞,3:∞] isa SubArray
@test (A*A)[2:∞,3:∞] isa SubArray

A = BandedMatrix{Int}((2 => 1:∞,), (∞,∞), (0,2))
@test eltype(A) == Int
@test bandwidths(A) == (0,2)
Expand Down

0 comments on commit 4ff3eea

Please sign in to comment.