Method: Daru::Vector#set_at
- Defined in:
- lib/daru/vector.rb
#set_at(positions, val) ⇒ Object
Change value at given positions
290 291 292 293 294 |
# File 'lib/daru/vector.rb', line 290 def set_at positions, val validate_positions(*positions) positions.map { |pos| @data[pos] = val } update_position_cache end |