class Matrix(T)
- Matrix(T)
- Reference
- Object
Included Modules
Defined in:
math/matrix.crConstructors
- .from(*rows) : self
- .identity(size : Int32) : self
- .new(height, width, value : T)
- .new(data : Array(Array(T)))
- .new
- .new(height, width, &)
Instance Method Summary
- #*(other : self) : self
- #**(k : Int) : self
- #+(other : self) : self
- #-(other : self) : self
- #==(other : Matrix) : Bool
- #[](i : Int, j : Int) : T
- #[]?(i : Int, j : Int) : T?
- #data : Array(Array(T))
- #fetch(i : Int, j : Int, &)
- #fetch(i : Int, j : Int, default)
- #height : Int32
- #inspect(io) : Nil
-
#size : Int32
Returns the number of elements in this container.
- #to_s(io) : Nil
-
#unsafe_fetch(index : Int) : Array(T)
Returns the element at the given index, without doing any bounds check.
- #unsafe_fetch(i : Int, j : Int) : T
- #width : Int32
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 Uaccumulate : 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
Instance Method Detail
def size : Int32
#
Description copied from module Indexable(Array(T))
Returns the number of elements in this container.
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.