Tensorex.Analyzer.householder
You're seeing just the function
householder
, go back to Tensorex.Analyzer module for more information.
Specs
householder(Tensorex.t()) :: {Tensorex.t(), Tensorex.t()}
Performs the householder conversion.
Returns a tuple of the converted vecter and the reflection matrix (P
). The dot product of the
reflection matrix and the given vector (V
) (P·V
) results to the converted vector.
iex> Tensorex.Analyzer.householder(Tensorex.from_list([2, 3.5, -1.6, 8.2]))
{
%Tensorex{data: %{[0] => -9.276313923105448}, shape: [4]},
%Tensorex{data: %{[0, 0] => -0.21560288025811625, [0, 1] => -0.3773050404517033 , [0, 2] => 0.172482304206493 , [0, 3] => -0.8839718090582762 ,
[1, 0] => -0.3773050404517033 , [1, 1] => 0.8828901314218394 , [1, 2] => 0.05353593992144486, [1, 3] => -0.27437169209740486,
[2, 0] => 0.172482304206493 , [2, 1] => 0.05353593992144486, [2, 2] => 0.9755264274644824 , [2, 3] => 0.12542705924452796,
[3, 0] => -0.8839718090582762 , [3, 1] => -0.27437169209740486, [3, 2] => 0.12542705924452796, [3, 3] => 0.3571863213717944 }, shape: [4, 4]}
}
iex> Tensorex.Analyzer.householder(Tensorex.from_list([3.8, 0.0, 0.0, 0.0, 0.0]))
{
%Tensorex{data: %{[0] => 3.8}, shape: [5]},
%Tensorex{data: %{[0, 0] => 1,
[1, 1] => 1,
[2, 2] => 1,
[3, 3] => 1,
[4, 4] => 1}, shape: [5, 5]}
}