mat: test that SymEigen eigenvalues are in ascending order
MODIFY
mat/eigen_test.go
mat/eigen_test.go
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")
+ }
}
}
}

mat: test that SymEigen eigenvalues are in ascending order