Method: Daru::Maths::Statistics::Vector#index_of_min
- Defined in:
- lib/daru/maths/statistics/vector.rb
#index_of_min(size = nil, &block) ⇒ Object
Returns the index of the minimum value(s) present in the vector, with an optional comparator block.
310 311 312 313 314 |
# File 'lib/daru/maths/statistics/vector.rb', line 310 def index_of_min(size=nil,&block) vals = min(size, &block) dv = reject_values(*Daru::MISSING_VALUES) vals.is_a?(Array) ? (vals.map { |x| dv.index_of(x) }) : dv.index_of(vals) end |