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

committed by
Vladimír Chalupecký

parent
25a8a664a4
commit
8928ea27e9
@@ -837,45 +837,3 @@ func residualLeftEV(a, e blas64.General, wr, wi []float64) float64 {
|
||||
}
|
||||
return math.Min(errnorm/anorm, 1)
|
||||
}
|
||||
|
||||
func dlange(norm lapack.MatrixNorm, m, n int, a []float64, lda int) float64 {
|
||||
if m == 0 || n == 0 {
|
||||
return 0
|
||||
}
|
||||
switch norm {
|
||||
case lapack.MaxAbs:
|
||||
var value float64
|
||||
for i := 0; i < m; i++ {
|
||||
for j := 0; j < n; j++ {
|
||||
value = math.Max(value, math.Abs(a[i*lda+j]))
|
||||
}
|
||||
}
|
||||
return value
|
||||
case lapack.MaxColumnSum:
|
||||
work := make([]float64, n)
|
||||
for i := 0; i < m; i++ {
|
||||
for j := 0; j < n; j++ {
|
||||
work[j] += math.Abs(a[i*lda+j])
|
||||
}
|
||||
}
|
||||
var value float64
|
||||
for i := 0; i < n; i++ {
|
||||
value = math.Max(value, work[i])
|
||||
}
|
||||
return value
|
||||
case lapack.MaxRowSum:
|
||||
var value float64
|
||||
for i := 0; i < m; i++ {
|
||||
var sum float64
|
||||
for j := 0; j < n; j++ {
|
||||
sum += math.Abs(a[i*lda+j])
|
||||
}
|
||||
value = math.Max(value, sum)
|
||||
}
|
||||
return value
|
||||
case lapack.Frobenius:
|
||||
panic("not implemented")
|
||||
default:
|
||||
panic("bad MatrixNorm")
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user