lapack/gonum: simplify logic for transposed case in Dlatbs
MODIFY
lapack/gonum/dlatbs.go
lapack/gonum/dlatbs.go
@@ -398,8 +398,11 @@ skipComputeGrow:
// if 1/A[j,j] was not used to scale the dot product.
x[j] -= sumj
xj = math.Abs(x[j])
- if diag == blas.NonUnit {
// Compute x[j] = x[j] / A[j,j], scaling if necessary.
+ // Note: the reference implementation skips this step for blas.Unit matrices
+ // when tscal is equal to 1 but it complicates the logic and only saves
+ // the comparison and division in the first switch-case. Not skipping it
+ // is also consistent with the NoTrans case above.
switch {
case tjj > smlnum:
// smlnum < abs(A[j,j]):
@@ -431,7 +434,6 @@ skipComputeGrow:
scale = 0
xMax = 0
}
- }
} else {
// Compute x[j] := x[j] / A[j,j] - sumj
// if the dot product has already been divided by 1/A[j,j].

lapack/gonum: simplify logic for transposed case in Dlatbs