From b4c9ebcf5af786d6a3293ef06a44e5457455f547 Mon Sep 17 00:00:00 2001 From: surtur Date: Wed, 3 Aug 2022 21:25:37 +0200 Subject: [PATCH] go(algo): add GetMeanStats func --- algo/algo.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/algo/algo.go b/algo/algo.go index fb339bc..3351272 100644 --- a/algo/algo.go +++ b/algo/algo.go @@ -4,6 +4,7 @@ package algo import ( + "sort" "sync" "git.dotya.ml/wanderer/math-optim/bench" @@ -21,6 +22,14 @@ var meanStats = &stats.MeanStats{} var comparisonOfMeansPicList = &report.PicList{Algo: "Comparison of Means"} +// GetMeanStats returns a pointer of type stats.MeanStats to a sorted package +// global 'meanStats'. +func GetMeanStats() *stats.MeanStats { + sort.Sort(meanStats) + + return meanStats +} + // DoRandomSearch executes a search using the 'Random search' method. func DoRandomSearch(wg *sync.WaitGroup, m *sync.Mutex) { defer wg.Done()