Skip to content

Commit

Permalink
testlapack: simplify isSchurCanonical
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimir-ch committed Feb 13, 2020
1 parent 3dada2a commit ec45d4d
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lapack/testlapack/general.go
Expand Up @@ -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
// canonical form.
func isSchurCanonical(a, b, c, d float64) bool {
if c == 0 {
return true
}
if b == 0 || a != d || math.Signbit(b) == math.Signbit(c) {
return false
}
return true
return c == 0 || (b != 0 && a == d && math.Signbit(b) != math.Signbit(c))
}

// isSchurCanonicalGeneral returns whether T is block upper triangular with 1×1
Expand Down

0 comments on commit ec45d4d

Please sign in to comment.