mirror of
https://github.com/gonum/gonum.git
synced 2025-10-26 16:50:28 +08:00
native,cgo: update docs for Dlacn2
This commit is contained in:
committed by
Vladimír Chalupecký
parent
ab9be2d016
commit
7024c297e1
@@ -105,15 +105,18 @@ var _ lapack.Float64 = Implementation{}
|
||||
// Dlacn2 estimates the 1-norm of an n×n matrix A using sequential updates with
|
||||
// matrix-vector products provided externally.
|
||||
//
|
||||
// Dlacn2 is called sequentially. In between calls, x should be overwritten by
|
||||
// A * X if kase == 1
|
||||
// A^T * X if kase == 2
|
||||
// all other parameters should be unchanged during sequential calls, and the updated
|
||||
// values of est and kase should be used. On the final return (when kase is returned
|
||||
// as 0), V = A * W, where est = norm(V) / norm(W).
|
||||
// Dlacn2 is called sequentially and it returns the value of est and kase to be
|
||||
// used on the next call.
|
||||
// On the initial call, kase must be 0.
|
||||
// In between calls, x must be overwritten by
|
||||
// A * X if kase was returned as 1,
|
||||
// A^T * X if kase was returned as 2,
|
||||
// and all other parameters must not be changed.
|
||||
// On the final return, kase is returned as 0, v contains A*W where W is a
|
||||
// vector, and est = norm(V)/norm(W) is a lower bound for 1-norm of A.
|
||||
//
|
||||
// isign, v, and x must all have length n and will panic otherwise. isave is used
|
||||
// for temporary storage.
|
||||
// v, x, and isgn must all have length n and n must be at least 1, otherwise
|
||||
// Dlacn2 will panic. isave is used for temporary storage.
|
||||
//
|
||||
// Dlacn2 is an internal routine. It is exported for testing purposes.
|
||||
func (impl Implementation) Dlacn2(n int, v, x []float64, isgn []int, est float64, kase int, isave *[3]int) (float64, int) {
|
||||
@@ -138,7 +141,7 @@ func (impl Implementation) Dlacn2(n int, v, x []float64, isgn []int, est float64
|
||||
}
|
||||
pest := []float64{est}
|
||||
// Save one allocation by putting isave and kase into the same slice.
|
||||
isavekase := []int32{ int32(isave[0]),int32(isave[1]),int32(isave[2]),int32(kase)}
|
||||
isavekase := []int32{int32(isave[0]), int32(isave[1]), int32(isave[2]), int32(kase)}
|
||||
lapacke.Dlacn2(n, v, x, isgn32, pest, isavekase[3:], isavekase[:3])
|
||||
for i, v := range isgn32 {
|
||||
isgn[i] = int(v)
|
||||
|
||||
Reference in New Issue
Block a user