Class: Sphere
- Inherits:
-
Object
- Object
- Sphere
- Defined in:
- lib/gimuby/problem/sphere/sphere.rb
Instance Method Summary collapse
Instance Method Details
#evaluate(x_values) ⇒ Object
2 3 4 5 6 7 8 |
# File 'lib/gimuby/problem/sphere/sphere.rb', line 2 def evaluate(x_values) sum = 0 x_values.each do |x_value| sum += x_value ** 2 end sum end |