householderReflectionReflect each of the vectors a_i of matrix A=[a_1, a_2, ..., a_n] on a plane with orthogonal vector u |
This information is part of the Modelica Standard Library maintained by the Modelica Association.
Matrices.householderReflection(A,u);
This function computes the Householder reflection (transformation)
Ar = Q*Awith
Q = I -2*u*u'/(u'*u)
where u is Householder vector, i.e., the normal vector of the reflection plane.
Householder reflection is widely used in numerical linear algebra, e.g., to perform QR decompositions.
// First step of QR decomposition import Modelica.Math.Vectors.Utilities; Real A[3,3] = [1,2,3; 3,4,5; 2,1,4]; Real Ar[3,3]; Real u[:]; u=Utilities.householderVector(A[:,1],{1,0,0}); // u= {0.763, 0.646, 0} Ar=householderReflection(A,u); // Ar = [-6.0828, -5.2608, -4.4388; // 0.0, -1.1508, -2.3016; // 0.0, 2.0, 0.0]
Matrices.Utilities.housholderSimilarityTransformation,
Vectors.Utilities.householderReflection,
Vectors.Utilities.householderVector
A |
Type: Real[:,:] Description: Rectangular matrix |
---|---|
u |
Type: Real[size(A, 1)] Description: Householder vector |
RA |
Type: Real[size(A, 1),size(A, 2)] Description: Reflexion of A |
---|