Ruby | Matrix lup_decomposition() function Last Updated : 07 Jan, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report The lup_decomposition() is an inbuilt method in Ruby returns the LUP decomposition of the given matrix. Syntax: mat1.lup_decomposition() Parameters: The function needs the matrix whose LUP decomposition is to be returned. Return Value: It returns the LUP decomposition of the matrix. Example 1: CPP #Ruby program for lup_decomposition() method in Matrix #Include matrix require "matrix" #Initialize a matrix mat1 = Matrix[[ 1, 21 ], [ 31, 18 ]] #Prints the decomposition puts mat1.lup_decomposition() Output: Matrix[[1, 0], [1/31, 1]] Matrix[[31, 18], [0, 633/31]] Matrix[[0, 1], [1, 0]] Example 2: CPP #Ruby program for lup_decomposition() method in Matrix #Include matrix require "matrix" #Initialize a matrix mat1 = Matrix[[ 1, 0, 0 ], [ 2, 3, 0 ], [ 31, 18, 19 ]] #Prints the decomposition puts mat1.lup_decomposition() Output: Matrix[[1, 0, 0], [2/31, 1, 0], [1/31, -6/19, 1]] Matrix[[31, 18, 19], [0, 57/31, -38/31], [0, 0, -1/1]] Matrix[[0, 0, 1], [0, 1, 0], [1, 0, 0]] Comment More infoAdvertise with us Next Article Ruby | Matrix lup() function G gopaldave Follow Improve Article Tags : Ruby Ruby-Methods Ruby Matrix-class Similar Reads Ruby | Matrix laplace_expansion() function The laplace_expansion() is an inbuilt method in Ruby returns the laplace_expansion of the given matrix along a given row or column. In other words, it returns the Laplace expansion.  Syntax: mat1.laplace_expansion(row: num or col:num)Parameters: The function accepts one mandatory parameter row or c 1 min read Ruby | Matrix component() function The component() is an inbuilt method in Ruby returns the element present at the intersection of i-th row and j-th column. Syntax: mat1.component(i, j) Parameters: The function accepts two parameters i and j which signifies the row_number and column_number. Return Value: It returns the element at mat 1 min read Ruby | Matrix lup() function The lup() is an inbuilt method in Ruby returns the LUP decomposition of the given matrix. Syntax: mat1.lup() Parameters: The function needs the matrix whose LUP decomposition is to be returned. Return Value: It returns the LUP decomposition of the matrix. Example 1: CPP #Ruby program for lup() metho 1 min read Ruby | Matrix column() function The column() is an inbuilt method in Ruby returns a vector that has all the elements in the column number col_num. Syntax: mat1.column(col_num) Parameters: The function accepts a parameter col_num which is the column number. Return Value: It returns a vector which has all the elements of column col_ 1 min read Ruby | Matrix det() function The det() is an inbuilt method in Ruby returns the determinant of the given matrix Syntax: mat1.det() Parameters: The function does not accepts any parameter. Return Value: It returns the determinant of the given matrix. Example 1: Ruby # Ruby program for det() method in Matrix # Include matrix requ 1 min read Ruby | Matrix conj() function The conj() is an inbuilt method in Ruby returns the conjugate matrix. Syntax: mat1.conj() Parameters: The function does not accepts any parameter. Return Value: It returns the conjugate matrix. Example 1: Ruby # Ruby program for conj() method in Matrix # Include matrix require "matrix" # I 1 min read Like