File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
NDTensors/src/lib/GradedAxes Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 6868# == is just a range comparison that ignores labels. Need dedicated function to check equality.
6969struct NoLabel end
7070blocklabels (r:: AbstractUnitRange ) = Fill (NoLabel (), blocklength (r))
71- blocklabels (la:: LabelledUnitRange ) = label (la)
71+ blocklabels (la:: LabelledUnitRange ) = [ label (la)]
7272
7373function LabelledNumbers. labelled_isequal (a1:: AbstractUnitRange , a2:: AbstractUnitRange )
7474 return blockisequal (a1, a2) && (blocklabels (a1) == blocklabels (a2))
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ nondual(a::LabelledUnitRangeDual) = a.nondual_unitrange
1212dual (a:: LabelledUnitRangeDual ) = nondual (a)
1313flip (a:: LabelledUnitRangeDual ) = dual (flip (nondual (a)))
1414isdual (:: LabelledUnitRangeDual ) = true
15- blocklabels (la:: LabelledUnitRangeDual ) = label (la)
15+ blocklabels (la:: LabelledUnitRangeDual ) = [ label (la)]
1616
1717LabelledNumbers. label (a:: LabelledUnitRangeDual ) = dual (label (nondual (a)))
1818LabelledNumbers. unlabel (a:: LabelledUnitRangeDual ) = unlabel (nondual (a))
Original file line number Diff line number Diff line change 6464 la = labelled (1 : 2 , U1 (1 ))
6565 @test la isa LabelledUnitRange
6666 @test label (la) == U1 (1 )
67- @test blocklabels (la) == U1 (1 )
67+ @test blocklabels (la) == [ U1 (1 )]
6868 @test unlabel (la) == 1 : 2
6969 @test la == 1 : 2
7070 @test ! isdual (la)
7474 lad = dual (la)
7575 @test lad isa LabelledUnitRangeDual
7676 @test label (lad) == U1 (- 1 )
77- @test blocklabels (lad) == U1 (- 1 )
77+ @test blocklabels (lad) == [ U1 (- 1 )]
7878 @test unlabel (lad) == 1 : 2
7979 @test lad == 1 : 2
8080 @test labelled_isequal (lad, lad)
9090 lad = dual (la)
9191 @test lad isa LabelledUnitRangeDual
9292 @test label (lad) == ' x'
93- @test blocklabels (la ) == ' x'
93+ @test blocklabels (lad ) == [ ' x' ]
9494 @test unlabel (lad) == 1 : 2
9595 @test lad == 1 : 2
9696 @test labelled_isequal (lad, lad)
You can’t perform that action at this time.
0 commit comments