stats: correct slices init
This commit is contained in:
parent
01cdd03dac
commit
cc8ede3772
@ -19,7 +19,7 @@ func Variance(f []float64) float64 {
|
||||
func Autocorrelate(f []float64, maxShift float64) []float64 {
|
||||
fLen := len(f)
|
||||
m := float64(fLen) * maxShift
|
||||
v := make([]float64, int(m), int(m)*4)
|
||||
v := make([]float64, 0, int(m)*4)
|
||||
currentShift := 0
|
||||
|
||||
for m >= float64(currentShift) {
|
||||
@ -43,7 +43,7 @@ func Autocorrelate(f []float64, maxShift float64) []float64 {
|
||||
func AutocorrelateMP(f []float64, maxShift float64) []float64 {
|
||||
fLen := len(f)
|
||||
m := float64(fLen) * maxShift
|
||||
v := make([]float64, int(m), 10)
|
||||
v := make([]float64, 0, int(m)*4)
|
||||
currentShift := 0
|
||||
|
||||
for m >= float64(currentShift) {
|
||||
|
Loading…
Reference in New Issue
Block a user