Method: Matrix::LU.gauss_vector
- Defined in:
- lib/extendmatrix.rb
.gauss_vector(mat, k) ⇒ Object
Return the Gauss vector, MC, Golub, 3.2.1 Gauss Transformation, p94
699 700 701 702 703 704 705 706 |
# File 'lib/extendmatrix.rb', line 699 def self.gauss_vector(mat, k) t = mat.column2matrix(k) tk = t[k, 0] (0..k).each{|i| t[i, 0] = 0} return t if tk == 0 (k+1...mat.row_size).each{|i| t[i, 0] = t[i, 0].to_f / tk} t end |