Skip to content

Commit d0117a7

Browse files
authored
Add Hcat indexing test (#210)
1 parent c8b15cb commit d0117a7

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Infinities = "0.1"
3838
IntervalSets = "0.7"
3939
LazyArrays = "2"
4040
Makie = "0.20, 0.21, 0.22, 0.24"
41-
QuasiArrays = "0.13"
41+
QuasiArrays = "0.13.1"
4242
Random = "1.0"
4343
RecipesBase = "1.0"
4444
StaticArrays = "1.0"

test/test_basisconcat.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using ContinuumArrays, BlockArrays, InfiniteArrays, Test
1+
using ContinuumArrays, BlockArrays, InfiniteArrays, StaticArrays, Test
22
import ContinuumArrays: PiecewiseBasis, VcatBasis, HvcatBasis, arguments, ApplyLayout, checkpoints, UnionDomain
33

44
@testset "ConcatBasis" begin
@@ -10,6 +10,14 @@ import ContinuumArrays: PiecewiseBasis, VcatBasis, HvcatBasis, arguments, ApplyL
1010
H∞ = [ones(x) Q]
1111
@test H∞[:,1:∞] isa SubQuasiArray
1212
@test (H∞')[1:∞,:] isa SubQuasiArray
13+
14+
𝐱 = Inclusion((-1.0..1)^2)
15+
@test 𝐱[SVector(0.1,0.2)] == SVector(0.1,0.2)
16+
H = [first.(𝐱) last.(𝐱)]
17+
@test H[SVector(0.1,0.2),1] == 0.1
18+
@test H[SVector(0.1,0.2),1:2] == H[SVector(0.1,0.2),:] == [0.1, 0.2]
19+
@test H[[SVector(0.1,0.2),SVector(0.3,0.4)],1] == [0.1,0.3]
20+
@test H[[SVector(0.1,0.2),SVector(0.3,0.4)],1:2] == H[[SVector(0.1,0.2),SVector(0.3,0.4)],:] == [0.1 0.2; 0.3 0.4]
1321
end
1422
@testset "PiecewiseBasis" begin
1523
S1 = LinearSpline(0:1)

0 commit comments

Comments
 (0)