functionhouseholderVector
Calculate a normalized householder vector to reflect vector a onto vector b
Extends from Modelica.Icons.Function (Icon for functions), Modelica.Icons.ObsoleteModel (Icon for classes that are obsolete and will be removed in later versions).
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
i.e., vector a is mapped toQ = I - 2*u*u',
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.a -> Q*a=c*b
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.householderReflectionMatrices.Utilities.householderReflection
Matrices.Utilities.householderSimilarityTransformation
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real[:] | a | Real vector to be reflected | |
| Real[size(a, 1)] | b | Real vector b vector a is mapped onto |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real[size(a, 1)] | u | Householder vector to map a onto b |
Revisions
- 2010/04/30 by Marcus Baur, DLR-RM