Difference between revisions of "ApCoCoA-1:Num.QR"

From ApCoCoAWiki
m (replaced <quotes> tag by real quotes)
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
   <command>
+
   {{Version|1}}
 +
<command>
 
     <title>Num.QR</title>
 
     <title>Num.QR</title>
     <short_description>QR-decomposition of a matrix</short_description>
+
     <short_description>Computes the QR-decomposition of a matrix.</short_description>
 
<syntax>
 
<syntax>
 
Num.QR(A:MAT):[Q:MAT,R:MAT]
 
Num.QR(A:MAT):[Q:MAT,R:MAT]
Line 8: Line 9:
 
<em>Please note:</em> The function(s) explained on this page is/are using the <em>ApCoCoAServer</em>. You will have to start the ApCoCoAServer in order to use it/them.
 
<em>Please note:</em> The function(s) explained on this page is/are using the <em>ApCoCoAServer</em>. You will have to start the ApCoCoAServer in order to use it/them.
 
<par/>
 
<par/>
Calculates the QR decomposition of a matrix using Lapack.
+
This command computes the QR-decomposition of a matrix using the external library Lapack, i.e. the matrix <tt>A</tt> will be decomposed into the product of an orthogonal matrix <tt>Q</tt> and an upper-right triangular matrix <tt>R</tt>.
  
 
<itemize>
 
<itemize>
<item>@param <em>A</em> Matrix A</item>
+
<item>@param <em>A</em> The matrix to decompose.</item>
<item>@return An orthogonal matrix Q and an upper-right triangular matrix R such that Q*R=A.</item>
+
<item>@return An orthogonal matrix <tt>Q</tt> and an upper-right triangular matrix <tt>R</tt> such that <tt>Q*R=A</tt>.</item>
 
</itemize>
 
</itemize>
  
 
<example>
 
<example>
 
Points:=Mat([[1,2,3],[2,3,4],[3,4,5]]);
 
Points:=Mat([[1,2,3],[2,3,4],[3,4,5]]);
$numerical.QR(Points);
+
QR := Num.QR(Points);
 +
Dec(QR[1]*QR[2],3);
 +
 
 +
-- CoCoAServer: computing Cpu Time = 0
 
-------------------------------
 
-------------------------------
[Mat([
+
Mat([
   [-601818814743685/2251799813685248, 11221204152260750623490098342212473544619072342960407833413029/12855504354071922204335696738729300820177623950262342682411008, 47271922480373450167411707109523238704832584221077416524231372166340777774771/115792089237316195423570985008687907853269984665640564039457584007913129639936],
+
   ["0.999", "1.999", "2.999"],
   [-21682807918593711888147761857797/40564819207303340847894502572032, 50535810838769898760508425874290037828518802391596092889928280803858452207141/231584178474632390847141970017375815706539969331281128078915168015826259279872, -1703150499741573022389535271505216648161852967701209661846360168011288983405834487511405397453/2085924839766513752338888384931203236916703635113918720651407820138886450957656787131798913024],
+
   ["1.999", "2.999", "3.999"],
   [-16262105938945284629515478500581/20282409603651670423947251286016, -50535810838769832038494686341702987883818294138398199855497298160515307568635/115792089237316195423570985008687907853269984665640564039457584007913129639936, 425787624935393028634420116827871332361842515189763323298971758853897488257161264158457298771/1042962419883256876169444192465601618458351817556959360325703910069443225478828393565899456512]
+
   ["2.999", "3.999", "4.999"]
]), Mat([
+
])
  [-8425463406411593/2251799813685248, -1504547036859213/281474976710656, -7823644591667907/1125899906842624],
 
  [0, 5896596054914343/9007199254740992, 5896596054914343/4503599627370496],
 
  [0, 0, 1197/9223372036854775808]
 
])]
 
 
-------------------------------
 
-------------------------------
 
</example>
 
</example>
 
     </description>
 
     </description>
 
     <seealso>
 
     <seealso>
       <see>Introduction to CoCoAServer</see>
+
       <see>ApCoCoA-1:Introduction to CoCoAServer|Introduction to CoCoAServer</see>
       <see>Num.SVD</see>
+
       <see>ApCoCoA-1:Num.SVD|Num.SVD</see>
       <see>Num.EigenValues</see>
+
       <see>ApCoCoA-1:Num.EigenValues|Num.EigenValues</see>
       <see>Num.EigenValuesAndVectors</see>
+
       <see>ApCoCoA-1:Num.EigenValuesAndVectors|Num.EigenValuesAndVectors</see>
       <see>Num.EigenValuesAndAllVectors</see>
+
       <see>ApCoCoA-1:Num.EigenValuesAndAllVectors|Num.EigenValuesAndAllVectors</see>
 
     </seealso>
 
     </seealso>
 
     <types>
 
     <types>
Line 44: Line 44:
 
     <key>num.qr</key>
 
     <key>num.qr</key>
 
     <key>qr</key>
 
     <key>qr</key>
     <wiki-category>Package_numerical</wiki-category>
+
    <key>numerical.qr</key>
 +
     <wiki-category>ApCoCoA-1:Package_numerical</wiki-category>
 
   </command>
 
   </command>

Latest revision as of 13:48, 29 October 2020

This article is about a function from ApCoCoA-1.

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.

This command computes the QR-decomposition of a matrix using the external library Lapack, i.e. the matrix A will be decomposed into the product of an orthogonal matrix Q and an upper-right triangular matrix R.

  • @param A The matrix to decompose.

  • @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([
  ["0.999", "1.999", "2.999"],
  ["1.999", "2.999", "3.999"],
  ["2.999", "3.999", "4.999"]
])
-------------------------------

See also

Introduction to CoCoAServer

Num.SVD

Num.EigenValues

Num.EigenValuesAndVectors

Num.EigenValuesAndAllVectors