ApCoCoA-1:Num.QR: Difference between revisions
From ApCoCoAWiki
No edit summary |
Updated example. Use Dec to make result human readable. |
||
Line 17: | Line 17: | ||
<example> | <example> | ||
Points:=Mat([[1,2,3],[2,3,4],[3,4,5]]); | Points:=Mat([[1,2,3],[2,3,4],[3,4,5]]); | ||
Num.QR(Points); | QR := Num.QR(Points); | ||
Dec(QR[1]*QR[2],3); | |||
-- CoCoAServer: computing Cpu Time = 0 | |||
------------------------------- | ------------------------------- | ||
Mat([ | |||
[ | [<quote>0.999</quote>, <quote>1.999</quote>, <quote>2.999</quote>], | ||
[ | [<quote>1.999</quote>, <quote>2.999</quote>, <quote>3.999</quote>], | ||
[ | [<quote>2.999</quote>, <quote>3.999</quote>, <quote>4.999</quote>] | ||
]) | ]) | ||
------------------------------- | ------------------------------- | ||
</example> | </example> |
Revision as of 08:12, 7 July 2009
Num.QR
Computes the QR-decomposition of a matrix.
Syntax
Num.QR(A:MAT):[Q:MAT,R:MAT]
Description
Please note: The function(s) explained on this page is/are using the ApCoCoAServer. You will have to start the ApCoCoAServer in order to use it/them.
Calculates the QR decomposition of a matrix using Lapack.
@param A Matrix A
@return An orthogonal matrix Q and an upper-right triangular matrix R such that Q*R=A.
Example
Points:=Mat([[1,2,3],[2,3,4],[3,4,5]]); QR := Num.QR(Points); Dec(QR[1]*QR[2],3); -- CoCoAServer: computing Cpu Time = 0 ------------------------------- Mat([ [<quote>0.999</quote>, <quote>1.999</quote>, <quote>2.999</quote>], [<quote>1.999</quote>, <quote>2.999</quote>, <quote>3.999</quote>], [<quote>2.999</quote>, <quote>3.999</quote>, <quote>4.999</quote>] ]) -------------------------------
See also