Module Linalg::Iterators
In: lib/linalg/iterators.rb

Enumerables and Enumerable-like methods for matrices.

For blocks which yield i,j indexes, the visitation is always in column-major order — that is, i changes faster than j.

To visit in row-major order, one would say

  m.rows.each_with_index { |row, i|
     row.elems.each_with_index { |e, j|
        # e == m[i,j]
     }
  }

Methods

Classes and Modules

Class Linalg::Iterators::ColumnEnum
Class Linalg::Iterators::DiagEnum
Class Linalg::Iterators::ElemEnum
Class Linalg::Iterators::MatrixEnum
Class Linalg::Iterators::RowEnum

Public Instance methods

Returns an Enumerable of the columns

Returns an Enumerable of the diagonal elements

Like Array#each_index, but with an index pair

Visit below-diagonal elements, with index pair

Visit above-diagonal elements, with index pair

Like Enumerable#each_with_index, but with an index pair

Returns an Enumerable of the matrix elements

Like Enumerable#map, but the resultant is a another matrix

Returns an Enumerable of the rows

[Validate]