lapack/gonum: rewrite Dlartg to use safe scaling from https://doi.org/10.1145/3061665

This commit is contained in:
Vladimir Chalupecky
2021-03-16 21:54:37 +01:00
committed by Vladimír Chalupecký
parent 13102a112c
commit 7a88995ca8
7 changed files with 102 additions and 118 deletions

View File

@@ -52,10 +52,10 @@ tests:
4.9, 3.1, 1.5, 0.1,
}),
wantVecs: mat.NewDense(4, 4, []float64{
-0.6681110197952722, 0.7064764857539533, -0.14026590216895132, -0.18666578956412125,
-0.7166344774801547, -0.6427036135482664, -0.135650285905254, 0.23444848208629923,
-0.164411275166307, 0.11898477441068218, 0.9136367900709548, 0.35224901970831746,
-0.11415613655453069, -0.2714141920887426, 0.35664028439226514, -0.8866286823515034,
-0.6681110197952723, 0.706476485753953, 0.14026590216895127, 0.18666578956412122,
-0.7166344774801547, -0.6427036135482663, 0.13565028590525394, -0.23444848208629923,
-0.16441127516630702, 0.11898477441068217, -0.9136367900709544, -0.35224901970831735,
-0.11415613655453066, -0.27141419208874273, -0.3566402843922649, 0.8866286823515032,
}),
wantVars: []float64{0.1665786313282786, 0.02065509475412993, 0.007944620317765855, 0.0019327647109368329},
epsilon: 1e-12,
@@ -118,10 +118,10 @@ tests:
}),
weights: []float64{1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
wantVecs: mat.NewDense(4, 4, []float64{
-0.6681110197952722, 0.7064764857539533, -0.14026590216895132, -0.18666578956412125,
-0.7166344774801547, -0.6427036135482664, -0.135650285905254, 0.23444848208629923,
-0.164411275166307, 0.11898477441068218, 0.9136367900709548, 0.35224901970831746,
-0.11415613655453069, -0.2714141920887426, 0.35664028439226514, -0.8866286823515034,
-0.6681110197952723, 0.706476485753953, 0.14026590216895127, 0.18666578956412122,
-0.7166344774801547, -0.6427036135482663, 0.13565028590525394, -0.23444848208629923,
-0.16441127516630702, 0.11898477441068217, -0.9136367900709544, -0.35224901970831735,
-0.11415613655453066, -0.27141419208874273, -0.3566402843922649, 0.8866286823515032,
}),
wantVars: []float64{0.1665786313282786, 0.02065509475412993, 0.007944620317765855, 0.0019327647109368329},
epsilon: 1e-12,