method
new
v2_4_6 -
Show latest stable
- Class:
Matrix
new(rows, column_count = rows[0].size)public
Matrix.new is private; use Matrix.rows, columns, [], etc… to create.
# File lib/matrix.rb, line 356
def initialize(rows, column_count = rows[0].size)
# No checking is done at this point. rows must be an Array of Arrays.
# column_count must be the size of the first row, if there is one,
# otherwise it *must* be specified and can be any integer >= 0
@rows = rows
@column_count = column_count
end Related methods
- Instance methods
- *
- **
- +
- +@
- -
- -@
- /
- ==
- []
- adjugate
- clone
- coerce
- cofactor
- cofactor_expansion
- collect
- column
- column_vectors
- component
- conj
- conjugate
- det
- det_e
- determinant
- determinant_e
- diagonal?
- each
- each_with_index
- eigen
- eigensystem
- element
- elements_to_f
- elements_to_i
- elements_to_r
- empty?
- eql?
- find_index
- first_minor
- hash
- hermitian?
- hstack
- imag
- imaginary
- index
- inspect
- inv
- inverse
- laplace_expansion
- lower_triangular?
- lup
- lup_decomposition
- map
- minor
- normal?
- orthogonal?
- permutation?
- rank
- rank_e
- real
- real?
- rect
- rectangular
- regular?
- round
- row
- row_count
- row_size
- row_vectors
- singular?
- square?
- symmetric?
- t
- to_a
- to_s
- tr
- trace
- transpose
- unitary?
- upper_triangular?
- vstack
- zero?
- Class methods
- I
- []
- build
- column_vector
- columns
- diagonal
- empty
- hstack
- identity
- new
- row_vector
- rows
- scalar
- unit
- vstack
- zero
- Private methods
-
new -
[]= -
determinant_bareiss -
inverse_from -
new_matrix -
set_component -
set_element