From aa7baaf8d12542043564d3f47c67ad0557d7b36e Mon Sep 17 00:00:00 2001 From: Vladimir Chalupecky Date: Fri, 15 Apr 2016 11:58:58 +0900 Subject: [PATCH] native: zero index elementary reflectors --- native/dgebrd.go | 10 ++++++---- native/dgelq2.go | 2 +- native/dlabrd.go | 8 ++++---- native/dlarft.go | 12 ++++++------ 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/native/dgebrd.go b/native/dgebrd.go index 0ec2ab60..ecf4d420 100644 --- a/native/dgebrd.go +++ b/native/dgebrd.go @@ -19,11 +19,13 @@ import ( // // The remaining elements of A store the data needed to construct Q and P. // The matrices Q and P are products of elementary reflectors -// Q = H_1 * H_2 * ... * H_nb -// P = G_1 * G_2 * ... * G_nb +// if m >= n, Q = H(0) * H(1) * ... * H(n-1), +// P = G(0) * G(1) * ... * G(n-2), +// if m < n, Q = H(0) * H(1) * ... * H(m-2), +// P = G(0) * G(1) * ... * G(m-1), // where -// H_i = I - tauQ[i] * v_i * v_i^T -// G_i = I - tauP[i] * u_i * u_i^T +// H(i) = I - tauQ[i] * v_i * v_i^T, +// G(i) = I - tauP[i] * u_i * u_i^T. // // As an example, on exit the entries of A when m = 6, and n = 5 // [ d e u1 u1 u1] diff --git a/native/dgelq2.go b/native/dgelq2.go index e2012457..2521ef52 100644 --- a/native/dgelq2.go +++ b/native/dgelq2.go @@ -19,7 +19,7 @@ import "github.com/gonum/blas" // // See Dgeqr2 for a description of the elementary reflectors and orthonormal // matrix Q. Q is constructed as a product of these elementary reflectors, -// Q = H_k ... H_2*H_1. +// Q = H(k-1) ... H(1) * H(0). // // work is temporary storage of length at least m and this function will panic otherwise. // diff --git a/native/dlabrd.go b/native/dlabrd.go index 03cd4233..037d9ae1 100644 --- a/native/dlabrd.go +++ b/native/dlabrd.go @@ -22,11 +22,11 @@ import ( // elements, and e are the off-diagonal elements. // // The matrices Q and P are products of elementary reflectors -// Q = H_1 * H_2 * ... * H_nb -// P = G_1 * G_2 * ... * G_nb +// Q = H(0) * H(1) ... H(nb-1) +// P = G(0) * G(1) ... G(nb-1) // where -// H_i = I - tauQ[i] * v_i * v_i^T -// G_i = I - tauP[i] * u_i * u_i^T +// H(i) = I - tauQ[i] * v_i * v_i^T +// G(i) = I - tauP[i] * u_i * u_i^T // // As an example, on exit the entries of A when m = 6, n = 5, and nb = 2 // [ 1 1 u1 u1 u1] diff --git a/native/dlarft.go b/native/dlarft.go index ca0a5c16..b3e69c16 100644 --- a/native/dlarft.go +++ b/native/dlarft.go @@ -10,13 +10,13 @@ import ( "github.com/gonum/lapack" ) -// Dlarft forms the triangular factor t of a block reflector, storing the answer +// Dlarft forms the triangular factor T of a block reflector H, storing the answer // in t. -// H = 1 - V * T * V^T if store == lapack.ColumnWise -// H = 1 - V^T * T * V if store == lapack.RowWise +// H = I - V * T * V^T if store == lapack.ColumnWise +// H = I - V^T * T * V if store == lapack.RowWise // H is defined by a product of the elementary reflectors where -// H = H_1 * H_2 * ... * H_k if direct == lapack.Forward -// H = H_k * H_k-1 * ... * H_1 if direct == lapack.Backward +// H = H(0) * H(1) ... H(k-1) if direct == lapack.Forward +// H = H(k-1) ... H(1) * H(0) if direct == lapack.Backward // // t is a k×k triangular matrix. t is upper triangular if direct = lapack.Forward // and lower triangular otherwise. This function will panic if t is not of @@ -25,7 +25,7 @@ import ( // store describes the storage of the elementary reflectors in v. Please see // Dlarfb for a description of layout. // -// tau contains the scalar factor of the elementary reflectors h. +// tau contains the scalar factors of the elementary reflectors H(i). // // Dlarft is an internal routine. It is exported for testing purposes. func (Implementation) Dlarft(direct lapack.Direct, store lapack.StoreV, n, k int,