mirror of
https://github.com/gonum/gonum.git
synced 2025-10-05 15:16:59 +08:00
testlapack: simplify isSchurCanonical
This commit is contained in:

committed by
Vladimír Chalupecký

parent
3dada2a439
commit
ec45d4d55c
@@ -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
|
||||||
|
Reference in New Issue
Block a user