Method: EvoSynth::Problems::FloatBenchmarkFuntions.double_sum

Defined in:
lib/evosynth/problems/float_benchmark_functions.rb

.double_sum(xs) ⇒ Object

Double Sum function (Schwefel 1977)

global minimum: f(x) = 0 at x(i) = 0, i = 1..n



45
46
47
48
49
# File 'lib/evosynth/problems/float_benchmark_functions.rb', line 45

def FloatBenchmarkFuntions.double_sum(xs)
  xs.inject(0.0) do |sum, i|
    sum += xs[0..i].inject(0.0) { |sum, x| sum += x }
  end
end