mirror of
https://github.com/gonum/gonum.git
synced 2025-10-05 23:26:52 +08:00
lapack/testlapack: add some helpers
This commit is contained in:

committed by
Vladimír Chalupecký

parent
459f250b3d
commit
90f4be8768
@@ -61,6 +61,43 @@ func (wl worklen) String() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func normToString(norm lapack.MatrixNorm) string {
|
||||||
|
switch norm {
|
||||||
|
case lapack.MaxAbs:
|
||||||
|
return "MaxAbs"
|
||||||
|
case lapack.MaxRowSum:
|
||||||
|
return "MaxRowSum"
|
||||||
|
case lapack.MaxColumnSum:
|
||||||
|
return "MaxColSum"
|
||||||
|
case lapack.Frobenius:
|
||||||
|
return "Frobenius"
|
||||||
|
default:
|
||||||
|
panic("invalid norm")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func uploToString(uplo blas.Uplo) string {
|
||||||
|
switch uplo {
|
||||||
|
case blas.Lower:
|
||||||
|
return "Lower"
|
||||||
|
case blas.Upper:
|
||||||
|
return "Upper"
|
||||||
|
default:
|
||||||
|
panic("invalid uplo")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func diagToString(diag blas.Diag) string {
|
||||||
|
switch diag {
|
||||||
|
case blas.NonUnit:
|
||||||
|
return "NonUnit"
|
||||||
|
case blas.Unit:
|
||||||
|
return "Unit"
|
||||||
|
default:
|
||||||
|
panic("invalid diag")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// nanSlice allocates a new slice of length n filled with NaN.
|
// nanSlice allocates a new slice of length n filled with NaN.
|
||||||
func nanSlice(n int) []float64 {
|
func nanSlice(n int) []float64 {
|
||||||
s := make([]float64, n)
|
s := make([]float64, n)
|
||||||
|
Reference in New Issue
Block a user