From 5388aeb8c96d3695d5bf2c5c1456a32340012e84 Mon Sep 17 00:00:00 2001 From: surtur Date: Wed, 15 Jun 2022 23:27:05 +0200 Subject: [PATCH] go: add Min,Max methods for funcParams --- bench/bench.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bench/bench.go b/bench/bench.go index e1c4157..a428c65 100644 --- a/bench/bench.go +++ b/bench/bench.go @@ -25,6 +25,16 @@ var ( DeJong2Params = funcParams{min: -5.0, max: 5.0} ) +// Min returns the non-exported "min" field of a funcParams struct. +func (*funcParams) Min(self *funcParams) float64 { + return self.max +} + +// Max returns the non-exported 'max' field of a funcParams struct. +func (*funcParams) Max(self *funcParams) float64 { + return self.max +} + // Schwefel computes a value of the Schwefel function for x. func Schwefel(x []float64) float64 { var res float64