class

Crystalla::Matrix

Inherits Crystalla::BlasHelper / Crystalla::LapackHelper / Reference / Object

Constructors

[](*values : Array(Number)) : Matrix
Source
new(values : Array(Float64), number_of_rows : Int32, number_of_cols : Int32)
Source

Class methods

columns(columns : Array(Array(Number))) : Crystalla::Matrix
Source
constant_matrix(value : Number, number_of_rows : Int32, number_of_cols : Int32) : Crystalla::Matrix
Source
diag(diagonal : Array(Number), number_of_rows : Int32, number_of_cols : Int32) : Crystalla::Matrix
Source
diag(diagonal : Array(Number)) : Crystalla::Matrix
Source
empty
Source
eye(number_of_rows : Int32, number_of_cols : Int32) : Crystalla::Matrix
Source
eye(number_of_rows_and_cols : Int32) : Crystalla::Matrix
Source
load(file : String) : Crystalla::Matrix
Source
ones(number_of_rows : Int32, number_of_cols : Int32) : Crystalla::Matrix
Source
rand(number_of_rows : Int32, number_of_cols : Int32, range : Range(Int32, Int32)) : Crystalla::Matrix
Source
rand(number_of_rows : Int32, number_of_cols : Int32) : Crystalla::Matrix
Source
rand_perm(n : Int32) : Crystalla::Matrix
Source
repeat_column(column : Array(Number), times : Int32) : Crystalla::Matrix
Source
repeat_row(row : Array(Number), times : Int32) : Crystalla::Matrix
Source
row_vector(values : Array(Number)) : Crystalla::Matrix
Source
rows(rows : Array(Array(Number)))
Source
validate_dimensions(number_of_rows, number_of_cols)
Source
zeros(number_of_rows : Int32, number_of_cols : Int32) : Crystalla::Matrix
Source

Instance methods

*(other : self) : Matrix
Source
+(other : self) : Matrix
Source
-(other : self) : Matrix
Source
==(other : Matrix) : Bool
Source
[](rows : Range(Int32, Int32), cols : Range(Int32, Int32)) : Matrix
Source
[](row, col) : Float64
Source
[]=(row : Int32, col : Int32, value : Number)
Source
add_rows(index : Int32, rows : Matrix) : Matrix
Source
all_close(other : Matrix, absolute_tolerance = nil, relative_tolerance = nil) : Bool
Source
append(row : Matrix) : Matrix
Source
clone
Source
compare(other : Matrix, &) : Bool
Source
dimensions
Source
each_by_col
Source
each_by_row
Source
each_col
Source
each_row
Source
inspect(io)
Source
invert!
Source
mean
Source
mean_by_col
Source
mean_by_row
Source
number_of_cols
Source
number_of_rows
Source
pca_fit(n_components : Int32) : Transformations::PCA

Uses this matrix as a n_samples * n_features model to fit a PCA transformation with the specified number of components

Source
pca_transform(n_components : Int32) : Crystalla::Matrix

Uses this matrix as a n_samples * n_features model to fit a PCA transformation and reduces it to the specified number of components

Source
prepend(row : Matrix) : Matrix
Source
row_vector?
Source
shuffle_cols
Source
singular_values(count : Int32) : Array(Float64)
Source
singular_values
Source
solve(b : self) : Matrix
Source
square?
Source
svd(count : Int32) : Tuple(Matrix, Array(Float64), Matrix)
Source
to_s(io)
Source
to_unsafe
Source
trace

Returns the sum of the diagonal elements. Only useful for numeric matrices.

Source
transpose
Source
values
Source
zip_with(other : Matrix, &) : Matrix
Source