Fixed typos

This commit is contained in:
btracey
2013-06-05 16:34:31 -07:00
parent 53d16403a8
commit ee4efd58d5

View File

@@ -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{}
} }