class SHAInet::SimpleMatrix

Defined in:

shainet/math/simple_matrix.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(rows : Int32, cols : Int32, init : Float64 = 0.0) #

[View source]

Class Method Detail

def self.from_a(array : Array(Array(GenNum))) #

Construct a matrix from a nested Array


[View source]
def self.ones(rows : Int32, cols : Int32) #

[View source]
def self.zeros(rows : Int32, cols : Int32) #

[View source]

Instance Method Detail

def *(other : SimpleMatrix) #

[View source]
def *(scalar : Number) #

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

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

[View source]
def [](r : Int32, c : Int32) #

[View source]
def []=(r : Int32, c : Int32, v : Float64) #

[View source]
def clone #

[View source]
def cols : Int32 #

[View source]
def cols=(cols : Int32) #

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

[View source]
def random_fill!(min : Float64 = -0.1, max : Float64 = 0.1) #

Fill the matrix with random values in the given range


[View source]
def rows : Int32 #

[View source]
def rows=(rows : Int32) #

[View source]
def set_cols!(start_col : Int32, other : SimpleMatrix) #

Set a range of columns in-place from another matrix


[View source]
def slice_cols(start_col : Int32, length : Int32) #

Slice a range of columns from the matrix


[View source]
def to_a #

[View source]
def transpose #

[View source]