mirror of
https://github.com/gonum/gonum.git
synced 2025-10-25 08:10:28 +08:00
testlapack: return index from containsComplex and update tests
This commit is contained in:
@@ -972,14 +972,14 @@ func schurBlockSize(t blas64.General, i int) (size int, first bool) {
|
||||
}
|
||||
|
||||
// containsComplex returns whether z is approximately equal to one of the complex
|
||||
// numbers in v.
|
||||
func containsComplex(v []complex128, z complex128, tol float64) bool {
|
||||
// numbers in v. If z is found, its index in v will be also returned.
|
||||
func containsComplex(v []complex128, z complex128, tol float64) (found bool, index int) {
|
||||
for i := range v {
|
||||
if cmplx.Abs(v[i]-z) < tol {
|
||||
return true
|
||||
return true, i
|
||||
}
|
||||
}
|
||||
return false
|
||||
return false, -1
|
||||
}
|
||||
|
||||
// isAllNaN returns whether x contains only NaN values.
|
||||
|
||||
Reference in New Issue
Block a user