Method: Stick::Vector#collect2
- Defined in:
- lib/stick/matrix/core.rb
#collect2(v) ⇒ Object
Collects (as in Enumerable#collect) over the elements of this vector and v in conjunction.
1186 1187 1188 1189 1190 1191 1192 |
# File 'lib/stick/matrix/core.rb', line 1186 def collect2(v) # :yield: e1, e2 Vector.Raise ErrDimensionMismatch if size != v.size (0 .. size - 1).collect do |i| yield @elements[i], v[i] end end |