mirror of
https://github.com/gonum/gonum.git
synced 2025-10-13 02:43:59 +08:00
Fixed typos
This commit is contained in:
@@ -194,8 +194,8 @@ func Logsumexp(s []float64) (logsumexp float64) {
|
|||||||
}
|
}
|
||||||
// Subtract off the largest value, so the largest value in
|
// Subtract off the largest value, so the largest value in
|
||||||
// the new slice is 0
|
// the new slice is 0
|
||||||
AddConst(s, -minval)
|
Addconst(s, -minval)
|
||||||
defer AddConst(s, minval) // make sure we add it back on at the end
|
defer Addconst(s, minval) // make sure we add it back on at the end
|
||||||
|
|
||||||
// compute the sumexp part
|
// compute the sumexp part
|
||||||
for _, val := range s {
|
for _, val := range s {
|
||||||
@@ -248,7 +248,7 @@ func Find(s []float64, f func(float64) bool) (inds []int) {
|
|||||||
|
|
||||||
type InsufficientElements struct{}
|
type InsufficientElements struct{}
|
||||||
|
|
||||||
func (i *InsufficientElements) Error() string {
|
func (i InsufficientElements) Error() string {
|
||||||
return "Insufficient elements found"
|
return "Insufficient elements found"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -268,5 +268,5 @@ func Findfirst(s []float64, f func(float64) bool, k int) (inds []int, err error)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return inds, InsufficientElements
|
return inds, InsufficientElements{}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user