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

From ApCoCoAWiki
m
m (replaced <quotes> tag by real quotes)
 
(21 intermediate revisions by 7 users not shown)
Line 1: Line 1:
<command>
+
  {{Version|1}}
     <title>Numerical.QR</title>
+
<command>
     <short_description>QR-decomposition of a matrix</short_description>
+
     <title>Num.QR</title>
 +
     <short_description>Computes the QR-decomposition of a matrix.</short_description>
 
<syntax>
 
<syntax>
$numerical.QR(A:Matrix):Matrix;
+
Num.QR(A:MAT):[Q:MAT,R:MAT]
 
</syntax>
 
</syntax>
 
     <description>
 
     <description>
This function returns a matrix, containing the <em>IMPI</em>. The matrix consists
+
<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.
of the upper-right triangular matrix and the lower left triangular matrix,
+
<par/>
describing the input matrix's QR-decomposition.
+
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>
 +
<item>@param <em>A</em> The matrix to decompose.</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>
  
 
<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([
   [-8425463406411593/2251799813685248, 7598355191047809/18014398509481984, 5698766393285857/9007199254740992],
+
   ["0.999", "1.999", "2.999"],
   [-1504547036859213/281474976710656, 737074506864293/1125899906842624, 7744099468837749/9007199254740992],
+
   ["1.999", "2.999", "3.999"],
   [-7823644591667907/1125899906842624, 5896596054914343/4503599627370496, -809/4611686018427387904]
+
   ["2.999", "3.999", "4.999"]
 
])
 
])
 
-------------------------------
 
-------------------------------
Line 23: Line 32:
 
     </description>
 
     </description>
 
     <seealso>
 
     <seealso>
       <see>Introduction to CoCoAServer</see>
+
       <see>ApCoCoA-1:Introduction to CoCoAServer|Introduction to CoCoAServer</see>
       <see>Numerical.SVD</see>
+
       <see>ApCoCoA-1:Num.SVD|Num.SVD</see>
       <see>Numerical.EigenValues</see>
+
       <see>ApCoCoA-1:Num.EigenValues|Num.EigenValues</see>
       <see>Numerical.EigenValuesAndVectors</see>
+
       <see>ApCoCoA-1:Num.EigenValuesAndVectors|Num.EigenValuesAndVectors</see>
       <see>Numerical.EigenValuesAndAllVectors</see>
+
       <see>ApCoCoA-1:Num.EigenValuesAndAllVectors|Num.EigenValuesAndAllVectors</see>
 
     </seealso>
 
     </seealso>
 
     <types>
 
     <types>
       <type>cocoaserver</type>
+
       <type>apcocoaserver</type>
 +
      <type>matrix</type>
 
     </types>
 
     </types>
     <key>Heldt</key>
+
     <key>num.qr</key>
 +
    <key>qr</key>
 
     <key>numerical.qr</key>
 
     <key>numerical.qr</key>
    <key>numericalqr</key>
+
     <wiki-category>ApCoCoA-1:Package_numerical</wiki-category>
     <wiki-category>Package_Numerical|QR</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