mirror of
https://github.com/gonum/gonum.git
synced 2025-10-06 07:37:03 +08:00
mat: panic with the advertised value for invalid norm order
This commit is contained in:
@@ -768,7 +768,7 @@ func Norm(a Matrix, norm float64) float64 {
|
|||||||
rv := rma.RawVector()
|
rv := rma.RawVector()
|
||||||
switch norm {
|
switch norm {
|
||||||
default:
|
default:
|
||||||
panic("unreachable")
|
panic(ErrNormOrder)
|
||||||
case 1:
|
case 1:
|
||||||
if aTrans {
|
if aTrans {
|
||||||
imax := blas64.Iamax(rv)
|
imax := blas64.Iamax(rv)
|
||||||
@@ -787,7 +787,7 @@ func Norm(a Matrix, norm float64) float64 {
|
|||||||
}
|
}
|
||||||
switch norm {
|
switch norm {
|
||||||
default:
|
default:
|
||||||
panic("unreachable")
|
panic(ErrNormOrder)
|
||||||
case 1:
|
case 1:
|
||||||
var max float64
|
var max float64
|
||||||
for j := 0; j < c; j++ {
|
for j := 0; j < c; j++ {
|
||||||
|
Reference in New Issue
Block a user