Skip to content
This repository was archived by the owner on Nov 24, 2018. It is now read-only.

Commit 88aa36b

Browse files
committed
all: switch to subscript+brace notation for elementary reflectors
1 parent cae2fd6 commit 88aa36b

20 files changed

+71
-71
lines changed

cgo/lapack.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,13 @@ func (impl Implementation) Dbdsqr(uplo blas.Uplo, n, ncvt, nru, ncc int, d, e, v
254254
//
255255
// The remaining elements of A store the data needed to construct Q and P.
256256
// The matrices Q and P are products of elementary reflectors
257-
// if m >= n, Q = H(0) * H(1) * ... * H(n-1),
258-
// P = G(0) * G(1) * ... * G(n-2),
259-
// if m < n, Q = H(0) * H(1) * ... * H(m-2),
260-
// P = G(0) * G(1) * ... * G(m-1),
257+
// if m >= n, Q = H_0 * H_1 * ... * H_{n-1},
258+
// P = G_0 * G_1 * ... * G_{n-2},
259+
// if m < n, Q = H_0 * H_1 * ... * H_{m-2},
260+
// P = G_0 * G_1 * ... * G_{m-1},
261261
// where
262-
// H(i) = I - tauQ[i] * v_i * v_i^T,
263-
// G(i) = I - tauP[i] * u_i * u_i^T.
262+
// H_i = I - tauQ[i] * v_i * v_i^T,
263+
// G_i = I - tauP[i] * u_i * u_i^T.
264264
//
265265
// As an example, on exit the entries of A when m = 6, and n = 5
266266
// [ d e u1 u1 u1]
@@ -354,7 +354,7 @@ func (impl Implementation) Dgecon(norm lapack.MatrixNorm, n int, a []float64, ld
354354
//
355355
// See Dgeqr2 for a description of the elementary reflectors and orthonormal
356356
// matrix Q. Q is constructed as a product of these elementary reflectors,
357-
// Q = H(k-1) * ... * H(1) * H(0),
357+
// Q = H_{k-1} * ... * H_1 * H_0,
358358
// where k = min(m,n).
359359
//
360360
// Work is temporary storage of length at least m and this function will panic otherwise.
@@ -412,10 +412,10 @@ func (impl Implementation) Dgelqf(m, n int, a []float64, lda int, tau, work []fl
412412
// v[j] = 0 j < i
413413
// v[j] = 1 j == i
414414
// v[j] = a[j*lda+i] j > i
415-
// and computing H(i) = I - tau[i] * v * v^T.
415+
// and computing H_i = I - tau[i] * v * v^T.
416416
//
417417
// The orthonormal matrix Q can be constucted from a product of these elementary
418-
// reflectors, Q = H(0) * H(1) * ... * H(k-1), where k = min(m,n).
418+
// reflectors, Q = H_0 * H_1 * ... * H_{k-1}, where k = min(m,n).
419419
//
420420
// Work is temporary storage of length at least n and this function will panic otherwise.
421421
func (impl Implementation) Dgeqr2(m, n int, a []float64, lda int, tau, work []float64) {
@@ -739,7 +739,7 @@ func (impl Implementation) Dorgbr(vect lapack.DecompUpdate, m, n, k int, a []flo
739739

740740
// Dorglq generates an m×n matrix Q with orthonormal rows defined by the product
741741
// of elementary reflectors
742-
// Q = H(k-1) * ... * H(1) * H(0)
742+
// Q = H_{k-1} * ... * H_1 * H_0
743743
// as computed by Dgelqf. Dorglq is the blocked version of Dorgl2 that makes
744744
// greater use of level-3 BLAS routines.
745745
//
@@ -781,7 +781,7 @@ func (impl Implementation) Dorglq(m, n, k int, a []float64, lda int, tau, work [
781781

782782
// Dorgqr generates an m×n matrix Q with orthonormal columns defined by the
783783
// product of elementary reflectors
784-
// Q = H(0) * H(1) * ... * H(k-1)
784+
// Q = H_0 * H_1 * ... * H_{k-1}
785785
// as computed by Dgeqrf. Dorgqr is the blocked version of Dorg2r that makes
786786
// greater use of level-3 BLAS routines.
787787
//

lapack.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ type Float64 interface {
4848
type Direct byte
4949

5050
const (
51-
Forward Direct = 'F' // Reflectors are right-multiplied, H(0) * H(1) * ... * H(k-1).
52-
Backward Direct = 'B' // Reflectors are left-multiplied, H(k-1) * ... * H(1) * H(0).
51+
Forward Direct = 'F' // Reflectors are right-multiplied, H_0 * H_1 * ... * H_{k-1}.
52+
Backward Direct = 'B' // Reflectors are left-multiplied, H_{k-1} * ... * H_1 * H_0.
5353
)
5454

5555
// Sort is the sorting order.

lapack64/lapack64.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ func Gels(trans blas.Transpose, a blas64.General, b blas64.General, work []float
112112
// v[j] = 0 j < i
113113
// v[j] = 1 j == i
114114
// v[j] = a[j*lda+i] j > i
115-
// and computing H(i) = I - tau[i] * v * v^T.
115+
// and computing H_i = I - tau[i] * v * v^T.
116116
//
117117
// The orthonormal matrix Q can be constucted from a product of these elementary
118-
// reflectors, Q = H(0) * H(1) * ... * H(k-1), where k = min(m,n).
118+
// reflectors, Q = H_0 * H_1 * ... * H_{k-1}, where k = min(m,n).
119119
//
120120
// Work is temporary storage, and lwork specifies the usable memory length.
121121
// At minimum, lwork >= m and this function will panic otherwise.
@@ -135,7 +135,7 @@ func Geqrf(a blas64.General, tau, work []float64, lwork int) {
135135
//
136136
// See Geqrf for a description of the elementary reflectors and orthonormal
137137
// matrix Q. Q is constructed as a product of these elementary reflectors,
138-
// Q = H(k-1) * ... * H(1) * H(0).
138+
// Q = H_{k-1} * ... * H_1 * H_0.
139139
//
140140
// Work is temporary storage, and lwork specifies the usable memory length.
141141
// At minimum, lwork >= m and this function will panic otherwise.

native/dgebd2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func (impl Implementation) Dgebd2(m, n int, a []float64, lda int, d, e, tauQ, ta
3636
a[i*lda+i], tauQ[i] = impl.Dlarfg(m-i, a[i*lda+i], a[min(i+1, m-1)*lda+i:], lda)
3737
d[i] = a[i*lda+i]
3838
a[i*lda+i] = 1
39-
// Apply H(i) to A[i:m, i+1:n] from the left.
39+
// Apply H_i to A[i:m, i+1:n] from the left.
4040
if i < n-1 {
4141
impl.Dlarf(blas.Left, m-i, n-i-1, a[i*lda+i:], lda, tauQ[i], a[i*lda+i+1:], lda, work)
4242
}

native/dgebrd.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ import (
1919
//
2020
// The remaining elements of A store the data needed to construct Q and P.
2121
// The matrices Q and P are products of elementary reflectors
22-
// if m >= n, Q = H(0) * H(1) * ... * H(n-1),
23-
// P = G(0) * G(1) * ... * G(n-2),
24-
// if m < n, Q = H(0) * H(1) * ... * H(m-2),
25-
// P = G(0) * G(1) * ... * G(m-1),
22+
// if m >= n, Q = H_0 * H_1 * ... * H_{n-1},
23+
// P = G_0 * G_1 * ... * G_{n-2},
24+
// if m < n, Q = H_0 * H_1 * ... * H_{m-2},
25+
// P = G_0 * G_1 * ... * G_{m-1},
2626
// where
27-
// H(i) = I - tauQ[i] * v_i * v_i^T,
28-
// G(i) = I - tauP[i] * u_i * u_i^T.
27+
// H_i = I - tauQ[i] * v_i * v_i^T,
28+
// G_i = I - tauP[i] * u_i * u_i^T.
2929
//
3030
// As an example, on exit the entries of A when m = 6, and n = 5
3131
// [ d e u1 u1 u1]

native/dgelq2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import "github.com/gonum/blas"
1919
//
2020
// See Dgeqr2 for a description of the elementary reflectors and orthonormal
2121
// matrix Q. Q is constructed as a product of these elementary reflectors,
22-
// Q = H(k-1) * ... * H(1) * H(0).
22+
// Q = H_{k-1} * ... * H_1 * H_0.
2323
//
2424
// work is temporary storage of length at least m and this function will panic otherwise.
2525
//

native/dgeql2.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import "github.com/gonum/blas"
1212
// where Q is an m×m orthonormal matrix and L is a lower trapezoidal matrix.
1313
//
1414
// Q is represented as a product of elementary reflectors,
15-
// Q = H(k-1) * ... * H(1) * H(0)
16-
// where k = min(m,n) and each H(i) has the form
17-
// H(i) = I - tau[i] * v_i * v_i^T
15+
// Q = H_{k-1} * ... * H_1 * H_0
16+
// where k = min(m,n) and each H_i has the form
17+
// H_i = I - tau[i] * v_i * v_i^T
1818
// Vector v_i has v[m-k+i+1:m] = 0, v[m-k+i] = 1, and v[:m-k+i+1] is stored on
1919
// exit in A[0:m-k+i-1, n-k+i].
2020
//
@@ -34,10 +34,10 @@ func (impl Implementation) Dgeql2(m, n int, a []float64, lda int, tau, work []fl
3434
k := min(m, n)
3535
var aii float64
3636
for i := k - 1; i >= 0; i-- {
37-
// Generate elementary reflector H(i) to annihilate A[0:m-k+i-1, n-k+i].
37+
// Generate elementary reflector H_i to annihilate A[0:m-k+i-1, n-k+i].
3838
aii, tau[i] = impl.Dlarfg(m-k+i+1, a[(m-k+i)*lda+n-k+i], a[n-k+i:], lda)
3939

40-
// Apply H(i) to A[0:m-k+i, 0:n-k+i-1] from the left.
40+
// Apply H_i to A[0:m-k+i, 0:n-k+i-1] from the left.
4141
a[(m-k+i)*lda+n-k+i] = 1
4242
impl.Dlarf(blas.Left, m-k+i+1, n-k+i, a[n-k+i:], lda, tau[i], a, lda, work)
4343
a[(m-k+i)*lda+n-k+i] = aii

native/dgeqr2.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ import "github.com/gonum/blas"
2222
// v[j] = 0 j < i
2323
// v[j] = 1 j == i
2424
// v[j] = a[j*lda+i] j > i
25-
// and computing H(i) = I - tau[i] * v * v^T.
25+
// and computing H_i = I - tau[i] * v * v^T.
2626
//
2727
// The orthonormal matrix Q can be constructed from a product of these elementary
28-
// reflectors, Q = H(0) * H(1) * ... * H(k-1), where k = min(m,n).
28+
// reflectors, Q = H_0 * H_1 * ... * H_{k-1}, where k = min(m,n).
2929
//
3030
// work is temporary storage of length at least n and this function will panic otherwise.
3131
//
@@ -43,7 +43,7 @@ func (impl Implementation) Dgeqr2(m, n int, a []float64, lda int, tau, work []fl
4343
panic(badTau)
4444
}
4545
for i := 0; i < k; i++ {
46-
// Generate elementary reflector H(i).
46+
// Generate elementary reflector H_i.
4747
a[i*lda+i], tau[i] = impl.Dlarfg(m-i, a[i*lda+i], a[min((i+1), m-1)*lda+i:], lda)
4848
if i < n-1 {
4949
aii := a[i*lda+i]

native/dlabrd.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ import (
2222
// elements, and e are the off-diagonal elements.
2323
//
2424
// The matrices Q and P are products of elementary reflectors
25-
// Q = H(0) * H(1) * ... * H(nb-1)
26-
// P = G(0) * G(1) * ... * G(nb-1)
25+
// Q = H_0 * H_1 * ... * H_{nb-1}
26+
// P = G_0 * G_1 * ... * G_{nb-1}
2727
// where
28-
// H(i) = I - tauQ[i] * v_i * v_i^T
29-
// G(i) = I - tauP[i] * u_i * u_i^T
28+
// H_i = I - tauQ[i] * v_i * v_i^T
29+
// G_i = I - tauP[i] * u_i * u_i^T
3030
//
3131
// As an example, on exit the entries of A when m = 6, n = 5, and nb = 2
3232
// [ 1 1 u1 u1 u1]

native/dlarft.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import (
1515
// H = I - V * T * V^T if store == lapack.ColumnWise
1616
// H = I - V^T * T * V if store == lapack.RowWise
1717
// H is defined by a product of the elementary reflectors where
18-
// H = H(0) * H(1) * ... * H(k-1) if direct == lapack.Forward
19-
// H = H(k-1) * ... * H(1) * H(0) if direct == lapack.Backward
18+
// H = H_0 * H_1 * ... * H_{k-1} if direct == lapack.Forward
19+
// H = H_{k-1} * ... * H_1 * H_0 if direct == lapack.Backward
2020
//
2121
// t is a k×k triangular matrix. t is upper triangular if direct = lapack.Forward
2222
// and lower triangular otherwise. This function will panic if t is not of
@@ -25,7 +25,7 @@ import (
2525
// store describes the storage of the elementary reflectors in v. Please see
2626
// Dlarfb for a description of layout.
2727
//
28-
// tau contains the scalar factors of the elementary reflectors H(i).
28+
// tau contains the scalar factors of the elementary reflectors H_i.
2929
//
3030
// Dlarft is an internal routine. It is exported for testing purposes.
3131
func (Implementation) Dlarft(direct lapack.Direct, store lapack.StoreV, n, k int,

0 commit comments

Comments
 (0)