class
SHAInet::SimpleMatrix
- SHAInet::SimpleMatrix
- Reference
- Object
Defined in:
shainet/math/simple_matrix.crConstructors
Class Method Summary
-
.from_a(array : Array(Array(GenNum)))
Construct a matrix from a nested Array
- .ones(rows : Int32, cols : Int32)
- .zeros(rows : Int32, cols : Int32)
Instance Method Summary
- #*(other : SimpleMatrix)
- #*(scalar : Number)
- #+(other : SimpleMatrix)
- #-(other : SimpleMatrix)
- #[](r : Int32, c : Int32)
- #[]=(r : Int32, c : Int32, v : Float64)
- #clone
- #cols : Int32
- #cols=(cols : Int32)
- #data : Array(Float64)
-
#random_fill!(min : Float64 = -0.1, max : Float64 = 0.1)
Fill the matrix with random values in the given range
- #rows : Int32
- #rows=(rows : Int32)
-
#set_cols!(start_col : Int32, other : SimpleMatrix)
Set a range of columns in-place from another matrix
-
#slice_cols(start_col : Int32, length : Int32)
Slice a range of columns from the matrix
- #to_a
- #transpose
Constructor Detail
Class Method Detail
Construct a matrix from a nested Array
Instance Method Detail
Fill the matrix with random values in the given range
def set_cols!(start_col : Int32, other : SimpleMatrix)
#
Set a range of columns in-place from another matrix