mirror of
https://github.com/gonum/gonum.git
synced 2025-10-21 22:29:30 +08:00
mat: test that SymEigen eigenvalues are in ascending order
This commit is contained in:

committed by
Vladimír Chalupecký

parent
3f7b30d06c
commit
e77e79f8cc
@@ -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")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user