all: fix repeated word typos in comments
Found with m/\b([a-zA-Z]+) \1\b/ and m/\b([a-zA-Z]+)\n[ \t]*// \1\b/.
MODIFY
fourier/fourier.go
fourier/fourier.go
@@ -230,11 +230,11 @@ func (t *CmplxFFT) Freq(i int) float64 {
return step * float64(i-t.Len())
}
-// ShiftIdx returns returns a shifted index into a slice of
-// coefficients returned by the CmplxFFT so that indexing
-// into the coefficients places the zero frequency component
-// at the center of the spectrum. ShiftIdx will panic if i is
-// negative or greater than or equal to t.Len().
+// ShiftIdx returns a shifted index into a slice of coefficients
+// returned by the CmplxFFT so that indexing into the coefficients
+// places the zero frequency component at the center of the spectrum.
+// ShiftIdx will panic if i is negative or greater than or equal to
+// t.Len().
func (t *CmplxFFT) ShiftIdx(i int) int {
if i < 0 || t.Len() <= i {
panic("fourier: index out of range")

MODIFY
graph/network/page.go
graph/network/page.go
@@ -379,7 +379,7 @@ func (r *compressedRow) addTo(j int, v float64) {
}
// dotUnitary performs a simplified scatter-based Ddot operations on
-// v and the receiver. v must have have a unitary vector increment.
+// v and the receiver. v must have a unitary vector increment.
func (r compressedRow) dotUnitary(v *mat.VecDense) float64 {
var sum float64
vec := v.RawVector().Data
@@ -396,8 +396,8 @@ type sparseElement struct {
}
// onesDotUnitary performs the equivalent of a Ddot of v with
-// a ones vector of equal length. v must have have a unitary
-// vector increment.
+// a ones vector of equal length. v must have a unitary vector
+// increment.
func onesDotUnitary(alpha float64, v *mat.VecDense) float64 {
var sum float64
for _, f := range v.RawVector().Data {

MODIFY
integrate/quad/hermite.go
integrate/quad/hermite.go
@@ -12,7 +12,7 @@ import (
)
// Hermite generates sample locations and weights for performing quadrature with
-// with a squared-exponential weight
+// a squared-exponential weight
// int_-inf^inf e^(-x^2) f(x) dx .
type Hermite struct{}

MODIFY
lapack/gonum/dlaqr5.go
lapack/gonum/dlaqr5.go
@@ -348,7 +348,7 @@ func (impl Implementation) Dlaqr5(wantt, wantz bool, kacc22 int, n, ktop, kbot,
h[j*ldh+k+3] -= refsum * v[m*ldv+2]
}
if accum {
- // Accumulate U. (If necessary, update Z later with with an
+ // Accumulate U. (If necessary, update Z later with an
// efficient matrix-matrix multiply.)
kms := k - incol
for j := max(0, ktop-incol-1); j < kdu; j++ {

MODIFY
lapack/gonum/doc.go
lapack/gonum/doc.go
// Most LAPACK functions are built on top the routines defined in the BLAS API,
// and as such the computation time for many LAPACK functions is
// dominated by BLAS calls. Here, BLAS is accessed through the
-// the blas64 package (https://godoc.org/golang.org/v1/gonum/blas/blas64). In particular,
+// blas64 package (https://godoc.org/golang.org/v1/gonum/blas/blas64). In particular,
// this implies that an external BLAS library will be used if it is
// registered in blas64.
//

MODIFY
mat/format.go
mat/format.go
@@ -66,7 +66,7 @@ func (f formatter) Format(fs fmt.State, c rune) {
}
// format prints a pretty representation of m to the fs io.Writer. The format character c
-// specifies the numerical representation of of elements; valid values are those for float64
+// specifies the numerical representation of elements; valid values are those for float64
// specified in the fmt package, with their associated flags. In addition to this, a space
// preceding a verb indicates that zero values should be represented by the dot character.
// The printed range of the matrix can be limited by specifying a positive value for margin;

MODIFY
stat/distuv/categorical.go
stat/distuv/categorical.go
@@ -24,8 +24,8 @@ type Categorical struct {
//
// Each element holds the sum of weights for
// the corresponding index, plus the sum of
- // of its children's weights; the children
- // of an element i can be found at positions
+ // its children's weights; the children of
+ // an element i can be found at positions
// 2*(i+1)-1 and 2*(i+1). The root of the
// weight heap is at element 0.
//

MODIFY
stat/sampleuv/weighted.go
stat/sampleuv/weighted.go
@@ -22,8 +22,8 @@ type Weighted struct {
//
// Each element holds the sum of weights for
// the corresponding index, plus the sum of
- // of its children's weights; the children
- // of an element i can be found at positions
+ // its children's weights; the children of
+ // an element i can be found at positions
// 2*(i+1)-1 and 2*(i+1). The root of the
// weight heap is at element 0.
//

MODIFY
stat/spatial/spatial.go
stat/spatial/spatial.go
@@ -13,7 +13,7 @@ import (
// TODO(kortschak): Implement weighted routines.
-// GetisOrdGStar returns the Local Getis-Ord G*i statistic for element of of the
+// GetisOrdGStar returns the Local Getis-Ord G*i statistic for element of the
// weighted data using the provided locality matrix. The returned value is a z-score.
//
// G^*_i = num_i / den_i

all: fix repeated word typos in comments

Found with m/\b([a-zA-Z]+) \1\b/ and m/\b([a-zA-Z]+)\n[ \t]*// \1\b/.