-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix IsUpperTriangularMat for non-square matrices; add tests
- Loading branch information
1 parent
608c6b8
commit 410a347
Showing
2 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# | ||
gap> IsDiagonalMat(NullMat(3, 3)); | ||
true | ||
gap> IsDiagonalMat(NullMat(1, 3)); | ||
true | ||
gap> IsDiagonalMat(NullMat(3, 1)); | ||
true | ||
gap> IsDiagonalMat(IdentityMat(3)); | ||
true | ||
gap> IsDiagonalMat([[1,1],[1,1]]); | ||
false | ||
gap> IsDiagonalMat([[1,0],[1,1]]); | ||
false | ||
gap> IsDiagonalMat([[1,1],[0,1]]); | ||
false | ||
|
||
# | ||
gap> IsUpperTriangularMat(NullMat(3, 3)); | ||
true | ||
gap> IsUpperTriangularMat(NullMat(1, 3)); | ||
true | ||
gap> IsUpperTriangularMat(NullMat(3, 1)); | ||
true | ||
gap> IsUpperTriangularMat(IdentityMat(3)); | ||
true | ||
gap> IsUpperTriangularMat([[1,1],[1,1]]); | ||
false | ||
gap> IsUpperTriangularMat([[1,0],[1,1]]); | ||
false | ||
gap> IsUpperTriangularMat([[1,1],[0,1]]); | ||
true | ||
|
||
# | ||
gap> IsLowerTriangularMat(NullMat(3, 3)); | ||
true | ||
gap> IsLowerTriangularMat(NullMat(1, 3)); | ||
true | ||
gap> IsLowerTriangularMat(NullMat(3, 1)); | ||
true | ||
gap> IsLowerTriangularMat(IdentityMat(3)); | ||
true | ||
gap> IsLowerTriangularMat([[1,1],[1,1]]); | ||
false | ||
gap> IsLowerTriangularMat([[1,0],[1,1]]); | ||
true | ||
gap> IsLowerTriangularMat([[1,1],[0,1]]); | ||
false |