Vectors.Utilities.householderReflection(a,u);
Function "householderReflection(a, u)
" performs the
reflection of vector a about a plane orthogonal to
vector u (Householder vector). Algebraically the
operation is defined by
withb=Q*a
where Q is an orthogonal matrix, i.e.Q = I - 2*u*u',
Q = inv(Q) = Q'
a = {2, -4, -2, -1}; u = {0.837, -0.478, -0.239, -0.119}; householderReflection(a,u); // = {-5.0, -0.001, -0.0005, -0.0044}
function householderReflection extends Modelica.Icons.Function; import Modelica.Math.Vectors; input Real a[:] "Real vector a to be reflected"; input Real u[size(a, 1)] "householder vector"; output Real ra[size(u, 1)] "reflexion of a"; end householderReflection;