testlapack: return index from containsComplex and update tests

This commit is contained in:
Vladimir Chalupecky
2016-09-06 14:50:29 +09:00
parent 64a340e2db
commit cc184eac50
4 changed files with 14 additions and 13 deletions

View File

@@ -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.