struct LA::Utils::Columns(T)

Overview

Indexable(SubMatrix(T)) that allows iterating over columns

Included Modules

Defined in:

matrix/iteration.cr:30
matrix/iteration.cr:35

Instance Method Summary

Instance methods inherited from module Enumerable(LA::SubMatrix(T))

product(initial : Complex)
product(initial : Complex, &)
product

Instance Method Detail

def [](range : Range) #

Returns SubMatrix that consist of given columns

Example:

m = GMat32.new([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]])
m.columns[1...3].should eq m[0..2, 1..2]

[View source]