.Modelica.Math.Vectors.Utilities.householderVector

Information

Syntax

Vectors.Utilities.householderVector(a,b);

Description

The function call "householderVector(a, b)" returns the normalized Householder vector u for Householder reflection of input vector a onto vector b, i.e., Householder vector u is the normal vector of the reflection plane. Algebraically, the reflection is performed by transformation matrix Q

Q = I - 2*u*u',

i.e., vector a is mapped to

a -> Q*a=c*b

with scalar c, |c| = ||a|| / ||b||. Q*a is the reflection of a about the hyperplane orthogonal to u. Q is an orthogonal matrix, i.e.

Q = inv(Q) = Q'

Example

  a = {2, -4, -2, -1};
  b = {1, 0, 0, 0};

  u = householderVector(a,b);    // {0.837, -0.478, -0.239, -0.119}
                               // Computation (identity(4) - 2*matrix(u)*transpose(matrix(u)))*a results in
                               // {-5, 0, 0, 0} = -5*b

See also

Vectors.Utilities.householderReflection
Matrices.Utilities.householderReflection
Matrices.Utilities.householderSimilarityTransformation

Interface

function householderVector
  extends Modelica.Icons.Function;
  import Modelica.Math.Vectors.norm;
  input Real a[:] "Real vector to be reflected";
  input Real b[size(a, 1)] "Real vector b vector a is mapped onto";
  output Real u[size(a, 1)] "Householder vector to map a onto b";
end householderVector;

Revisions


Generated at 2020-06-05T07:38:22Z by OpenModelica 1.16.0~dev-420-gc007a39