@@ -482,14 +482,25 @@ end
482
482
@test ldiv! (tempmat, lu (cmat + I), cmat) isa ComponentMatrix
483
483
@test ldiv! (getdata (tempmat), lu (cmat + I), cmat) isa AbstractMatrix
484
484
485
- vca2 = vcat (ca2' , ca2' )
486
- hca2 = hcat (ca2, ca2)
485
+ for n in 1 : 3 # Issue 168 cats (on more than one) ComponentArrays
486
+ vca2 = vcat (repeat ([ca2' ], n)... )
487
+ hca2 = hcat (repeat ([ca2], n)... )
488
+ hca2_reduced = reduce (hcat, repeat ([ca2], n)) # Issue 113: reduce cats should match non-reduced ones
489
+ vca2_reduced = reduce (vcat, repeat ([ca2' ], n))
490
+ @test hca2 == hca2_reduced
491
+ @test typeof (hca2) == typeof (hca2_reduced)
492
+ @test vca2 == vca2_reduced
493
+ @test typeof (vca2) == typeof (vca2_reduced)
494
+ @test hca2 isa ComponentMatrix
495
+ @test vca2 isa ComponentMatrix
496
+ @test all (vca2[1 , :] .== ca2)
497
+ @test all (hca2[:, 1 ] .== ca2)
498
+ @test all (vca2' .== hca2)
499
+ @test hca2[:a , :] == vca2[:, :a ]
500
+ end
501
+
487
502
temp = ComponentVector (q = 100 , r = rand (3 , 3 , 3 ))
488
503
vtempca = [temp; ca]
489
- @test all (vca2[1 , :] .== ca2)
490
- @test all (hca2[:, 1 ] .== ca2)
491
- @test all (vca2' .== hca2)
492
- @test hca2[:a , :] == vca2[:, :a ]
493
504
@test vtempca isa ComponentVector
494
505
@test vtempca. r == temp. r
495
506
@test vtempca. c == ca. c
0 commit comments