Module: CsrMatrix::Decompositions

Includes:
Contracts::Core
Included in:
TwoDMatrix
Defined in:
lib/csrmatrix/decompositions.rb

Constant Summary collapse

C =
Contracts

Instance Method Summary collapse

Instance Method Details

#eigenObject



7
8
9
10
11
12
13
# File 'lib/csrmatrix/decompositions.rb', line 7

def eigen()
  # alias for eigensystem
  # returns a list in the form {eigenvalues, eigenvectors}
  is_invariant?
  
    self.eigenvalue()
end

#eigenvalueObject



16
17
18
19
20
21
22
# File 'lib/csrmatrix/decompositions.rb', line 16

def eigenvalue()
  # identifies the eigenvalues of a matrix
  is_invariant?
  # post   eigenvalues of the matrix
  m = Matrix.rows(self.decompose)
  return m.eigensystem().to_a[1].round().to_a
end