struct PF::Matrix(T, S)
- PF::Matrix(T, S)
- Struct
- Value
- Object
Included Modules
- Indexable::Mutable(T)
Defined in:
matrix.crConstructors
Macro Summary
Instance Method Summary
- #*(other : Matrix)
-
#==(other : Matrix)
Tests the equality of two matricies
-
#[](col : Int, row : Int)
Fetch a value at a specified column and row
-
#[]=(col : Int, row : Int, value : T)
Put a value at a specified column and row
- #fill(*args, **options)
- #fill(*args, **options, &)
- #height : UInt8
- #index(col : Int, row : Int)
-
#size
Returns the number of elements in this container.
- #to_s(io)
-
#unsafe_fetch(index : Int)
Returns the element at the given index, without doing any bounds check.
-
#unsafe_put(index : Int, value : T)
Sets the element at the given index to value, without doing any bounds check.
- #values : StaticArray(T, S)
- #width : UInt8
Constructor Detail
Macro Detail
Creates a new square Matrix
with the given args
m = Matrix[1, 2, 3, 4] # => Matrix(Int32, 4) 2x2 [1, 2, 3, 4]
Instance Method Detail
Returns the number of elements in this container.
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.
Sets the element at the given index to value, without doing any bounds check.
Indexable::Mutable
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 modify elements
with #[]=(index, value)
.
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.