class Matrix(T)

Included Modules

Defined in:

math/matrix.cr

Constructors

Instance Method Summary

Macro Summary

Instance methods inherited from module Indexable(Array(T))

[](point : Point) [], []?(point : Point) []?, each_pair(&)
each_pair
each_pair
, fetch(point : Point, &) fetch

Instance methods inherited from module Enumerable(Array(T))

accumulate(init : U) : Array(U) forall U
accumulate : Array(T(T))
accumulate(init : U, &block : U, T(T) -> U) : Array(U) forall U
accumulate(&block : T(T), T(T) -> T(T)) : Array(T(T))
accumulate
, mex : T(T) mex, mex_sorted : T(T) mex_sorted, tally(*, default : Int32) : Hash(T(T), Int32) tally, unique : self
unique(&) : self
unique

Constructor Detail

def self.from(*rows) : self #

[View source]
def self.identity(size : Int32) : self #

[View source]
def self.new(height, width, value : T) #

[View source]
def self.new(data : Array(Array(T))) #

[View source]
def self.new #

[View source]
def self.new(height, width, &) #

[View source]

Instance Method Detail

def *(other : self) : self #

[View source]
def **(k : Int) : self #

[View source]
def +(other : self) : self #

[View source]
def -(other : self) : self #

[View source]
def ==(other : Matrix) : Bool #

[View source]
def [](i : Int, j : Int) : T #

[View source]
def []?(i : Int, j : Int) : T? #

[View source]
def data : Array(Array(T)) #

[View source]
def fetch(i : Int, j : Int, &) #

[View source]
def fetch(i : Int, j : Int, default) #

[View source]
def height : Int32 #

[View source]
def inspect(io) : Nil #

[View source]
def size : Int32 #
Description copied from module Indexable(Array(T))

Returns the number of elements in this container.


[View source]
def to_s(io) : Nil #

[View source]
def unsafe_fetch(index : Int) : Array(T) #
Description copied from module Indexable(Array(T))

Returns the element at the given index, without doing any bounds check.

Indexable makes sure to invoke this method with index in 0...size, so converting negative indices to positive ones is not needed here.

Clients never invoke this method directly. Instead, they access elements with #[](index) and #[]?(index).

This method should only be directly invoked if you are absolutely sure the index is in bounds, to avoid a bounds check for a small boost of performance.


[View source]
def unsafe_fetch(i : Int, j : Int) : T #

[View source]
def width : Int32 #

[View source]

Macro Detail

macro [](*rows) #

[View source]