File tree 2 files changed +14
-3
lines changed
2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 623
623
copytrito! (dest, U, U isa UpperOrUnitUpperTriangular ? ' L' : ' U' )
624
624
return dest
625
625
end
626
- @propagate_inbounds function _copy! (dest:: StridedMatrix , U:: UpperOrLowerTriangular{<:Any, <:StridedMatrix} )
626
+ @propagate_inbounds function _copy! (dest:: StridedMatrix ,
627
+ U:: Union{UnitUpperOrUnitLowerTriangular, UpperOrLowerTriangularStrided} )
627
628
U2 = Base. unalias (dest, U)
628
629
copy_unaliased! (dest, U2)
629
630
return dest
656
657
end
657
658
dest
658
659
end
659
- @inline function copy_unaliased! (dest:: StridedMatrix , U:: UpperOrUnitUpperTriangular{<:Any, <:StridedMatrix} )
660
+ @inline function copy_unaliased! (dest:: StridedMatrix , U:: UpperOrUnitUpperTriangular )
660
661
@boundscheck checkbounds (dest, axes (U)... )
661
662
for col in axes (dest,2 )
662
663
@inbounds copy_unaliased_stored! (dest, U, col)
666
667
end
667
668
return dest
668
669
end
669
- @inline function copy_unaliased! (dest:: StridedMatrix , L:: LowerOrUnitLowerTriangular{<:Any, <:StridedMatrix} )
670
+ @inline function copy_unaliased! (dest:: StridedMatrix , L:: LowerOrUnitLowerTriangular )
670
671
@boundscheck checkbounds (dest, axes (L)... )
671
672
for col in axes (dest,2 )
672
673
for row in firstindex (dest,1 ): col- 1
Original file line number Diff line number Diff line change 650
650
@test_throws " cannot set index in the upper triangular part" copyto! (A, B)
651
651
end
652
652
end
653
+
654
+ @testset " partly initialized unit triangular" begin
655
+ for T in (UnitUpperTriangular, UnitLowerTriangular)
656
+ isupper = T == UnitUpperTriangular
657
+ M = Matrix {BigFloat} (undef, 2 , 2 )
658
+ M[1 + isupper,1 + ! isupper] = 3
659
+ U = T (M' )
660
+ @test copyto! (similar (M), U) == U
661
+ end
662
+ end
653
663
end
654
664
655
665
@testset " getindex with Integers" begin
You can’t perform that action at this time.
0 commit comments