Algosim documentation: GramSchmidt

GramSchmidt

Performs the Gram–Schmidt orthonormalisation process on (the columns of) a matrix.

Syntax

Description

If A is a matrix, not necessarily square, then GramSchmidt(A) is the matrix obtained form A by the Gram–Schmidt orthonormalisation process.

Examples

A ≔ ❨❨2, 2, −5, 0, −1❩, ❨1, 5, −2, 1, 5❩, ❨0, 1, 3, 2, 6❩, ❨−2, 1, 4, 6, 9❩, ❨3, −2, 7, −2, 6❩❩
⎛ 2   2  −5   0  −1⎞
⎜ 1   5  −2   1   5⎟
⎜ 0   1   3   2   6⎟
⎜−2   1   4   6   9⎟
⎝ 3  −2   7  −2   6⎠
v ≔ ❨1, 2, 1, 0, 1❩
 ⎛1⎞
 ⎜2⎟
e⎜1⎟
 ⎜0⎟
 ⎝1⎠
B ≔ GramSchmidt(A);
B ⋅ B* ⋅ v
 ⎛0.971874108932⎞
 ⎜2.07377282903 ⎟
e⎜0.710902726238⎟
 ⎜0.10558736155 ⎟
 ⎝ 1.0645512254 ⎠
ColumnSpaceProjection(A, v)
 ⎛0.971874108932⎞
 ⎜2.07377282903 ⎟
e⎜0.710902726238⎟
 ⎜0.10558736155 ⎟
 ⎝ 1.0645512254 ⎠

See also