abstract class GSL::Matrix

Direct Known Subclasses

Defined in:

gsl/base/iterator.cr
gsl/base/matrix.cr

Instance Method Summary

Instance Method Detail

abstract def ==(m : Matrix) #

[View source]
abstract def [](row : Int32, column : Int32) : Float64 #

[View source]
def [](row : Symbol | Int32, column : Symbol | Int32) : Vector #

[View source]
abstract def column(c : Int32 | Symbol) : Vector #

[View source]
abstract def copy : Matrix #

[View source]
def each_columns(&block : Vector -> _) #

[View source]
def each_rows(&block : Vector -> _) #

[View source]
abstract def get(row, column) : Float64 #

[View source]
def inspect #
Description copied from class Object

Returns a String representation of this object suitable to be embedded inside other expressions, sometimes providing more information about this object.

#inspect (and #inspect(io)) are the methods used when you invoke #to_s or #inspect on an object that holds other objects and wants to show them. For example when you invoke Array#to_s, #inspect will be invoked on each element:

ary = ["one", "two", "three, etc."]
ary.inspect # => ["one", "two", "three, etc."]

Note that if Array invoked #to_s on each of the elements above, the output would have been this:

ary = ["one", "two", "three, etc."]
# If inspect invoked to_s on each element...
ary.inspect # => [one, two, three, etc.]

Note that it's not clear how many elements the array has, or which are they, because #to_s doesn't guarantee that the string representation is clearly delimited (in the case of String the quotes are not shown).

Also note that sometimes the output of #inspect will look like a Crystal expression that will compile, but this isn't always the case, nor is it necessary. Notably, Reference#inspect and Struct#inspect return values that don't compile.

Classes must usually not override this method. Instead, they must override inspect(io), which must append to the given IO object.


[View source]
abstract def like : Matrix #

[View source]
def map_columns(&block : Vector -> _) #

[View source]
def map_rows(&block : Vector -> _) #

[View source]
def ncols : LibC::SizeT #

[View source]
def nrows : LibC::SizeT #

[View source]
def pointer #

[View source]
abstract def row(r : Int32 | Symbol) : Vector #

[View source]
abstract def set(row, column, x) #

[View source]
abstract def set_zero #

[View source]
def shape #

[View source]
abstract def t : Matrix #

alias to transpose


[View source]
abstract def transpose : Matrix #

[View source]