mirror of
https://github.com/gonum/gonum.git
synced 2025-10-23 07:09:27 +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
|
package mat
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"golang.org/x/exp/rand"
|
"golang.org/x/exp/rand"
|
||||||
@@ -160,6 +161,11 @@ func TestSymEigen(t *testing.T) {
|
|||||||
t.Errorf("Eigenvalue does not match")
|
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