diff --git a/mat/eigen_test.go b/mat/eigen_test.go index dd62b868..93e8a5c7 100644 --- a/mat/eigen_test.go +++ b/mat/eigen_test.go @@ -5,6 +5,7 @@ package mat import ( + "sort" "testing" "golang.org/x/exp/rand" @@ -160,6 +161,11 @@ func TestSymEigen(t *testing.T) { t.Errorf("Eigenvalue does not match") } } + + // Check that the eigenvalues are in ascending order. + if !sort.Float64sAreSorted(es.values) { + t.Errorf("Eigenvalues not ascending") + } } } }