class

Matrix(T)

Inherits Enumerable < Reference < Object

Class methods

[](*rows : Array(U)) forall U
Source
build(row_size : Int, column_size : Int = row_size, & : Int32, Int32 -> T)
Source
column_vector(column : Array(T))
Source
columns(columns : Array(Array(T)))
Source
combine(*matrices, &)
Source
diagonal(*values)
Source
empty(row_size = 0, column_size = 0)
Source
hstack(*matrices)
Source
identity(n : Int)
Source
row_vector(row : Array(T))
Source
rows(rows : Array(Array(T)), copy = false)
Source
scalar(n : Int, value : T)
Source
vstack(*matrices : Matrix(T))
Source
zero(row_size : Int, column_size : Int = row_size)
Source

Instance methods

&(other : Matrix(U)) forall U
Source
*(other : Matrix(U)) forall U
Source
*(other) forall U
Source
**(exponent : Int)
Source
+(other : Matrix(U)) forall U
Source
-(other : Matrix(U)) forall U
Source
/(other) forall U
Source
//(other) forall U
Source
==(other : Matrix(U)) forall U
Source
[](i : Int, j : Int)
Source
[]=(i : Int, j : Int, value : T)
Source
[]?(i : Int, j : Int)
Source
^(other : Matrix(U)) forall U
Source
|(other : Matrix(U)) forall U
Source
adjugate
Source
antisymmetric?
Source
clone
Source
cofactor(i : Int, j : Int)
Source
column_size
Source
diagonal?
Source
each(which = :all, &block : T -> )

Must yield this collection's elements to the block.

Source
each(which = :all)
Source
each_with_index(which = :all, & : T -> )

Iterates over the collection, yielding both the elements and their index.

["Alice", "Bob"].each_with_index do |user, i|
  puts "User ##{i}: #{user}"
end

Prints:

User # 0: Alice
User # 1: Bob

Accepts an optional offset parameter, which tells it to start counting from there. So, a more human friendly version of the previous snippet would be:

["Alice", "Bob"].each_with_index(1) do |user, i|
  puts "User ##{i}: #{user}"
end

Which would print:

User # 1: Alice
User # 2: Bob
Source
empty?

Returns true if self does not contain any element.

([] of Int32).empty? # => true
([1]).empty?         # => false
[nil, false].empty?  # => false
  • #present? returns the inverse.
Source
first_minor(i : Int, j : Int)
Source
row(i : Int)
Source
row_size
Source
skew_symmetric?
Source
square?
Source
swap_column(i : Int, j : Int)
Source
swap_row(i : Int, j : Int)
Source
sweep(extended? : Bool = false) : Int32
Source
symmetric?
Source
to_s(io : IO)

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>
Source
unsafe_fetch(i : Int, j : Int)
Source
unsafe_put(i : Int, j : Int, value : T)
Source