mat: test that SymEigen eigenvalues are in ascending order

This commit is contained in:
Vladimir Chalupecky
2018-05-21 08:24:49 +02:00
committed by Vladimír Chalupecký
parent 3f7b30d06c
commit e77e79f8cc

View File

@@ -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")
}
}
}
}