From f42c07e8cbea534b003124f60cf48ebebe5fec2e Mon Sep 17 00:00:00 2001 From: Dan Kortschak Date: Wed, 1 Jan 2025 07:21:09 +1030 Subject: [PATCH] all: fix typos --- README.md | 2 +- graph/product/product_ext_example_test.go | 4 ++-- mat/vector_test.go | 2 +- mathext/beta.go | 2 +- optimize/functions/functions.go | 4 ++-- stat/distmv/dirichlet.go | 2 +- stat/distmv/interfaces.go | 4 +++- stat/distmv/normal.go | 4 ++-- stat/distmv/studentst.go | 2 +- stat/distmv/uniform.go | 2 +- stat/samplemv/halton_test.go | 2 +- 11 files changed, 16 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index b01b9e1e..9c90a76f 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ The current list of non-internal tags is as follows: - safe — do not use assembly or unsafe - bounds — use bounds checks even in internal calls - noasm — do not use assembly implementations -- tomita — use [Tomita, Tanaka, Takahashi pivot choice](https://doi.org/10.1016%2Fj.tcs.2006.06.015) for maximimal clique calculation, otherwise use random pivot (only in [topo package](https://pkg.go.dev/gonum.org/v1/gonum/graph/topo)) +- tomita — use [Tomita, Tanaka, Takahashi pivot choice](https://doi.org/10.1016%2Fj.tcs.2006.06.015) for maximal clique calculation, otherwise use random pivot (only in [topo package](https://pkg.go.dev/gonum.org/v1/gonum/graph/topo)) ## Issues [![TODOs](https://badgen.net/https/api.tickgit.com/badgen/github.com/gonum/gonum)](https://www.tickgit.com/browse?repo=github.com/gonum/gonum) diff --git a/graph/product/product_ext_example_test.go b/graph/product/product_ext_example_test.go index e868faaf..955e5b5d 100644 --- a/graph/product/product_ext_example_test.go +++ b/graph/product/product_ext_example_test.go @@ -54,13 +54,13 @@ func ExampleModularExt_subgraphIsomorphism() { // Make a graph for the query pattern: a love triangle. pattern := simple.NewDirectedGraph() - for _, relationsip := range []simple.WeightedEdge{ + for _, relationship := range []simple.WeightedEdge{ {F: person{name: "A", id: -1}, T: person{name: "B", id: -2}, W: 1}, {F: person{name: "B", id: -2}, T: person{name: "A", id: -1}, W: 1}, {F: person{name: "C", id: -3}, T: person{name: "A", id: -1}, W: -1}, {F: person{name: "C", id: -3}, T: person{name: "B", id: -2}, W: 1}, } { - pattern.SetEdge(relationsip) + pattern.SetEdge(relationship) } // Produce the modular product of the two graphs. diff --git a/mat/vector_test.go b/mat/vector_test.go index 89e3fceb..258cab7a 100644 --- a/mat/vector_test.go +++ b/mat/vector_test.go @@ -118,7 +118,7 @@ func TestCap(t *testing.T) { } { got := test.vector.Cap() if got != test.want { - t.Errorf("unexpected capacty for test %d: got: %d want: %d", i, got, test.want) + t.Errorf("unexpected capacity for test %d: got: %d want: %d", i, got, test.want) } } } diff --git a/mathext/beta.go b/mathext/beta.go index 203ec577..2df51f3d 100644 --- a/mathext/beta.go +++ b/mathext/beta.go @@ -18,7 +18,7 @@ import "gonum.org/v1/gonum/mathext/internal/gonum" // B(a,b) returns NaN if a or b is < 0 // B(a,b) returns +Inf if a xor b is 0. // -// See http://mathworld.wolfram.com/BetaFunction.html for more detailed informations. +// See http://mathworld.wolfram.com/BetaFunction.html for more detailed information. func Beta(a, b float64) float64 { return gonum.Beta(a, b) } diff --git a/optimize/functions/functions.go b/optimize/functions/functions.go index 233d71dc..d3ae55a0 100644 --- a/optimize/functions/functions.go +++ b/optimize/functions/functions.go @@ -710,7 +710,7 @@ func (BrownAndDennis) Minima() []Minimum { // // References: // - Spedicato E.: Computational experience with quasi-Newton algorithms for -// minimization problems of moderatly large size. Towards Global +// minimization problems of moderately large size. Towards Global // Optimization 2 (1978), 209-219 // - More, J., Garbow, B.S., Hillstrom, K.E.: Testing unconstrained // optimization software. ACM Trans Math Softw 7 (1981), 17-41 @@ -1334,7 +1334,7 @@ func (PowellBadlyScaled) Minima() []Minimum { // // References: // - Spedicato E.: Computational experience with quasi-Newton algorithms for -// minimization problems of moderatly large size. Towards Global +// minimization problems of moderately large size. Towards Global // Optimization 2 (1978), 209-219 // - More, J., Garbow, B.S., Hillstrom, K.E.: Testing unconstrained // optimization software. ACM Trans Math Softw 7 (1981), 17-41 diff --git a/stat/distmv/dirichlet.go b/stat/distmv/dirichlet.go index 4869f022..fec49ce4 100644 --- a/stat/distmv/dirichlet.go +++ b/stat/distmv/dirichlet.go @@ -134,7 +134,7 @@ func (d *Dirichlet) Prob(x []float64) float64 { return math.Exp(d.LogProb(x)) } -// Rand generates a random number according to the distributon. +// Rand generates a random number according to the distribution. // // If dst is not nil, the sample will be stored in-place into dst and returned, // otherwise a new slice will be allocated first. If dst is not nil, it must diff --git a/stat/distmv/interfaces.go b/stat/distmv/interfaces.go index 35dd2550..04f56aa2 100644 --- a/stat/distmv/interfaces.go +++ b/stat/distmv/interfaces.go @@ -18,9 +18,11 @@ type LogProber interface { LogProb(x []float64) float64 } -// Rander generates a random number according to the distributon. +// Rander generates a random number according to the distribution. +// // If the input is non-nil, len(x) must equal len(p) and the dimension of the distribution, // otherwise Quantile will panic. +// // If the input is nil, a new slice will be allocated and returned. type Rander interface { Rand(x []float64) []float64 diff --git a/stat/distmv/normal.go b/stat/distmv/normal.go index bd609eeb..8d6cc814 100644 --- a/stat/distmv/normal.go +++ b/stat/distmv/normal.go @@ -294,7 +294,7 @@ func (n *Normal) Quantile(dst, p []float64) []float64 { return dst } -// Rand generates a random sample according to the distributon. +// Rand generates a random sample according to the distribution. // // If dst is not nil, the sample will be stored in-place into dst and returned, // otherwise a new slice will be allocated first. If dst is not nil, it must @@ -303,7 +303,7 @@ func (n *Normal) Rand(dst []float64) []float64 { return NormalRand(dst, n.mu, &n.chol, n.src) } -// NormalRand generates a random sample from a multivariate normal distributon +// NormalRand generates a random sample from a multivariate normal distribution // given by the mean and the Cholesky factorization of the covariance matrix. // // If dst is not nil, the sample will be stored in-place into dst and returned, diff --git a/stat/distmv/studentst.go b/stat/distmv/studentst.go index e038d506..2ef71bec 100644 --- a/stat/distmv/studentst.go +++ b/stat/distmv/studentst.go @@ -331,7 +331,7 @@ func (s *StudentsT) Prob(y []float64) float64 { return math.Exp(s.LogProb(y)) } -// Rand generates a random sample according to the distributon. +// Rand generates a random sample according to the distribution. // // If dst is not nil, the sample will be stored in-place into dst and returned, // otherwise a new slice will be allocated first. If dst is not nil, it must diff --git a/stat/distmv/uniform.go b/stat/distmv/uniform.go index 74235903..75082f7a 100644 --- a/stat/distmv/uniform.go +++ b/stat/distmv/uniform.go @@ -155,7 +155,7 @@ func (u *Uniform) Prob(x []float64) float64 { return math.Exp(u.LogProb(x)) } -// Rand generates a random sample according to the distributon. +// Rand generates a random sample according to the distribution. // // If dst is not nil, the sample will be stored in-place into dst and returned, // otherwise a new slice will be allocated first. If dst is not nil, it must diff --git a/stat/samplemv/halton_test.go b/stat/samplemv/halton_test.go index 7a03ca46..b2381950 100644 --- a/stat/samplemv/halton_test.go +++ b/stat/samplemv/halton_test.go @@ -28,7 +28,7 @@ func TestHalton(t *testing.T) { batch := mat.NewDense(test.n, test.d, nil) Halton{Kind: Owen, Q: distmv.NewUnitUniform(test.d, nil), Src: src}.Sample(batch) - // In each dimension, the samples should be stratefied according to the + // In each dimension, the samples should be stratified according to the // prime for that dimension. There should be at most 1 sample per // 1/b^k block, where k is log(n)/log(b). for d := 0; d < test.d; d++ {