Adds unit tests

Former-commit-id: 33e9d9a8a370afc3d6318c6972de02a957fa3098
This commit is contained in:
2023-08-27 16:23:09 +02:00
parent 5b7d88ccc6
commit bfe6fa630a
3 changed files with 282 additions and 0 deletions

View File

@ -94,6 +94,8 @@ func (matrix *Matrix[T]) Rows(i ...int) Matrix[T] {
// It returns two integers: the number of rows and the number of columns.
func (matrix *Matrix[T]) Dim() (int, int) {
switch {
case matrix == nil:
return 0, 0
case *matrix == nil:
return 0, 0
case len(*matrix) == 0: