testlapack: simplify isSchurCanonical

This commit is contained in:
Vladimir Chalupecky
2020-02-13 09:01:46 +01:00
committed by Vladimír Chalupecký
parent 3dada2a439
commit ec45d4d55c

View File

@@ -1158,13 +1158,7 @@ func extract2x2Block(t []float64, ldt int) (a, b, c, d float64) {
// isSchurCanonical returns whether the 2×2 matrix [a b; c d] is in Schur // isSchurCanonical returns whether the 2×2 matrix [a b; c d] is in Schur
// canonical form. // canonical form.
func isSchurCanonical(a, b, c, d float64) bool { func isSchurCanonical(a, b, c, d float64) bool {
if c == 0 { return c == 0 || (b != 0 && a == d && math.Signbit(b) != math.Signbit(c))
return true
}
if b == 0 || a != d || math.Signbit(b) == math.Signbit(c) {
return false
}
return true
} }
// isSchurCanonicalGeneral returns whether T is block upper triangular with 1×1 // isSchurCanonicalGeneral returns whether T is block upper triangular with 1×1