CoCoA:AlmostQR

From ApCoCoAWiki

AlmostQR

QR decomposition of a matrix

Description

This function computes the decomposition of the matrix into an

orthogonal and an upper triangular matrix with 1 on the diagonal.

[orthogonal meaning that <formula>QT * Q</formula> is a diagonal matrix]


The auxiliary (possibly slow!) function Mat.SimplifySquareFactorsInAQR

modifies Q and R in the decomposition so that the entries of the diagonal matrix <formula>QT * Q</formula> are squarefree rationals.

Example

  M := Mat([  [4, -2, 3],  [3, 2, -2],  [0, 0, 3] ]);
  Dec := AlmostQR(M);
  Dec;
Record[Q = Mat([
  [4, -42/25, 0],
  [3, 56/25, 0],
  [0, 0, 3]
]), R = Mat([
  [1, -2/25, 6/25],
  [0, 1, -17/14],
  [0, 0, 1]
])]
-------------------------------
  Mat.SimplifySquareFactorsInAQR(Dec);
  Dec;
Record[Q = Mat([
  [4/5, -3/5, 0],
  [3/5, 4/5, 0],
  [0, 0, 1]
]), R = Mat([
  [5, -2/5, 6/5],
  [0, 14/5, -17/5],
  [0, 0, 3]
]), SqDiag = [1, 1, 1]]

Syntax

AlmostQR(M:MAT):RECORD

Matrix Normal Form

   <type>matrix</type>