Tensorex.Analyzer.qr_decomposition

You're seeing just the function qr_decomposition, go back to Tensorex.Analyzer module for more information.
Link to this function

qr_decomposition(matrix)

View Source

Specs

qr_decomposition(Tensorex.t()) :: {Tensorex.t(), Tensorex.t()}

Decomposites a matrix into a pair of an orthogonal matrix and an upper triangular matrix.

Returns a 2-element tuple containing an orthogonal matrix (Q) and an upper triangular matrix (R). The dot product of them (Q·R) results to the given matrix.

iex> Tensorex.Analyzer.qr_decomposition(Tensorex.from_list([[1, 2],
...>                                                        [3, 4],
...>                                                        [5, 6]]))
{%Tensorex{data: %{[0, 0] => -0.16903085094570347, [0, 1] =>  0.89708522714506   ,
                   [1, 0] => -0.50709255283711   , [1, 1] =>  0.27602622373694213,
                   [2, 0] => -0.8451542547285165 , [2, 1] => -0.34503277967117735}, shape: [3, 2]},
 %Tensorex{data: %{[0, 0] => -5.916079783099616  , [0, 1] => -7.437357441610946  ,
                                                   [1, 1] =>  0.8280786712108249 }, shape: [2, 2]}}

iex> Tensorex.Analyzer.qr_decomposition(Tensorex.from_list([[1, 2, 3],
...>                                                        [3, 4, 5]]))
{%Tensorex{data: %{[0, 0] => -0.316227766016838 , [0, 1] => -0.9486832980505137,
                   [1, 0] => -0.9486832980505137, [1, 1] =>  0.3162277660168382}, shape: [2, 2]},
 %Tensorex{data: %{[0, 0] => -3.1622776601683795, [0, 1] => -4.42718872423573  , [0, 2] => -5.692099788303082,
                                                  [1, 1] => -0.6324555320336744, [1, 2] => -1.26491106406735}, shape: [2, 3]}}