<?xml-stylesheet type="text/xsl" href="../styles/pmathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:dsi="http://www.w3.org/1999/xlink" xml:space="preserve"><head>
<!-- saved from url=(0014)about:internet -->
<title>
    NAG Fortran Library Manual, Mark 21 : 
   F Chapter Introduction</title><link rel="stylesheet" href="../styles/libdoc.css" type="text/css"/><script type="text/javascript">
   function showLevel(_levelId){
    var thisLevel = document.getElementById(_levelId);
    var thisplus = document.getElementById( _levelId.concat('plus'));
    var thisminus = document.getElementById( _levelId.concat('minus'));
    if(thisLevel.style.display != "block"){
     thisLevel.style.display = "block";
     thisplus.style.display = "none";
     thisminus.style.display = "inline";
     }
    else{
     thisLevel.style.display = "none";
     thisminus.style.display = "none";
     thisplus.style.display = "inline";
     }
    }
  </script></head><body><hr/><div><a href="../../pdf/F/f_intro.pdf">F Chapter Introduction (pdf version)</a></div><div><a href="f_conts.xml">Chapter Contents</a></div>
<div><a href="../mark21.xml">NAG Library Manual</a></div><hr/><h1 class="libdoc">NAG Fortran Library  Chapter Introduction<br/><br/>F &#8212; Linear Algebra</h1>
<div class="toc"><h3>Contents</h3>
<h2 class="toc"><a class="rtnref" href="#fintroduction">1&#160;&#160;Introduction</a></h2>
<h2 class="toc"><a class="rtnref" href="#fintlineqn">2&#160;&#160;Linear Equations</a></h2>
<h2 class="toc"><a class="rtnref" href="#fintlinlsq">3&#160;&#160;Linear Least-squares</a></h2>
<h2 class="toc"><a class="rtnref" href="#finteigen">4&#160;&#160;Eigenvalue Problems and Singular Value Problems</a></h2>
<h2 class="toc"><a class="rtnref" href="#fintinverse">5&#160;&#160;Inversion and Determinants</a></h2>
<h2 class="toc"><a class="rtnref" href="#fintmatops">6&#160;&#160;Matrix Operations</a></h2>
<h2 class="toc"><a class="rtnref" href="#fintsupport">7&#160;&#160;Support Routines</a></h2>
<h2 class="toc"><a class="rtnref" href="#references">8&#160;&#160;References</a></h2></div><h2><a name="fintroduction" id="fintroduction"/>1&#160;&#160;Introduction</h2><div class="paramtext">The 
F 
 
Chapters of the Library are concerned with linear algebra and cover a large area.  This general introduction is intended to help you decide which particular 
F 
 
Chapter is relevant to your problem.  The following Chapters are currently available:
</div><ul class="listind"><li class="listind"><a class="secref" href="../F01/f01_conts.xml">F01 &#8211; Matrix Operations, Including Inversion</a></li><li class="listind"><a class="secref" href="../F02/f02_conts.xml">F02 &#8211; Eigenvalues and Eigenvectors</a></li><li class="listind"><a class="secref" href="../F03/f03_conts.xml">F03 &#8211; Determinants</a></li><li class="listind"><a class="secref" href="../F04/f04_conts.xml">F04 &#8211; Simultaneous Linear Equations</a></li><li class="listind"><a class="secref" href="../F05/f05_conts.xml">F05 &#8211; Orthogonalisation</a></li><li class="listind"><a class="secref" href="../F06/f06_conts.xml">F06 &#8211; Linear Algebra Support Routines</a></li><li class="listind"><a class="secref" href="../F07/f07_conts.xml">F07 &#8211; Linear Equations (LAPACK)</a></li><li class="listind"><a class="secref" href="../F08/f08_conts.xml">F08 &#8211; Least-squares and Eigenvalue Problems (LAPACK)</a></li><li class="listind"><a class="secref" href="../F11/f11_conts.xml">F11 &#8211; Large Scale Linear Systems</a></li><li class="listind"><a class="secref" href="../F12/f12_conts.xml">F12 &#8211; Large Scale Eigenproblems</a></li></ul><div class="paramtext">
The principal problem areas addressed by the above Chapters are
</div><ul class="listind"><li class="listind">Systems of linear equations</li><li class="listind">Linear least-squares problems</li><li class="listind">Eigenvalue and singular value problems</li></ul><div class="paramtext">
The solution of these problems usually involves several matrix operations,  such as a matrix factorization followed by the solution of the factorized form, and the routines for these operations themselves utilize lower level support routines, typically from
Chapter <a class="secref" href="../F06/f06_conts.xml">F06</a>.

You will not normally need to be concerned with these support routines.</div>
<div class="paramtext">NAG has been involved in a project, called LAPACK (see <a class="litref" href="#ref562">Anderson <i>et al.</i> (1999)</a>),  to develop a linear algebra package for modern high-performance computers,  and the routines developed within that project are

incorporated into the Library as Chapters <a class="secref" href="../F07/f07_conts.xml">F07</a> and <a class="secref" href="../F08/f08_conts.xml">F08</a>.  It should be emphasised that, while the LAPACK project has been concerned with high-performance computers,  the routines do not compromise efficiency on conventional machines.</div>
<div class="paramtext">Chapters <a class="secref" href="../F11/f11_conts.xml">F11</a> and <a class="secref" href="../F12/f12_conts.xml">F12</a> contain routines for solving large scale problems, but a few earlier routines are still located in Chapters <a class="secref" href="../F01/f01_conts.xml">F01</a>, <a class="secref" href="../F02/f02_conts.xml">F02</a> and <a class="secref" href="../F04/f04_conts.xml">F04</a>.</div>
<div class="paramtext">For background information on numerical algorithms for the solution of linear algebra problems see <a class="litref" href="#ref105">Golub  and Van Loan (1996)</a>.
For the three main problem areas listed above you generally have 

the choice of selecting a single routine to solve the problem, a so-called  <span class="italic">Black Box</span> routine, or selecting more than one routine  to solve the problem, such as a factorization routine followed by a solve routine, so-called <span class="italic">General Purpose</span> routines.  The following sections indicate which chapters are relevant to particular problem areas.</div><h2><a name="fintlineqn" id="fintlineqn"/>2&#160;&#160;Linear Equations</h2><div class="paramtext">The Black Box routines for solving linear equations of the form
</div>
<div class="formula"><table class="formula"><tr><td class="formula"><m:math xmlns:m="http://www.w3.org/1998/Math/MathML" display="block">
<m:mi>A</m:mi><m:mi>x</m:mi><m:mo>=</m:mo><m:mi>b</m:mi><m:mtext>&#8195; and &#8195;</m:mtext><m:mi>A</m:mi><m:mi>X</m:mi><m:mo>=</m:mo><m:mi>B</m:mi><m:mtext>,</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>
<div class="paramtext">
where <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>A</m:mi></m:math>&#160;is an <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>n</m:mi></m:math>&#160;by <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>n</m:mi></m:math>&#160;real or complex non-singular matrix, are to be found in Chapters <a class="secref" href="../F04/f04_conts.xml">F04</a> and <a class="secref" href="../F07/f07_conts.xml">F07</a>.  Such equations can also be solved by selecting a general purpose factorization routine from   Chapter <a class="secref" href="../F01/f01_conts.xml">F01</a>
or  Chapter <a class="secref" href="../F03/f03_conts.xml">F03</a>
and combining them with a solve routine in Chapter <a class="secref" href="../F04/f04_conts.xml">F04</a>,  or by selecting a factorization and a solve routine from  Chapter <a class="secref" href="../F07/f07_conts.xml">F07</a>.  For large sparse problems, routines from Chapter <a class="secref" href="../F11/f11_conts.xml">F11</a> should be used.  In addition there are routines to estimate condition numbers
in Chapters <a class="secref" href="../F04/f04_conts.xml">F04</a> and <a class="secref" href="../F07/f07_conts.xml">F07</a>,
and routines to give error estimates in Chapters <a class="secref" href="../F02/f02_conts.xml">F02</a>, <a class="secref" href="../F04/f04_conts.xml">F04</a> and <a class="secref" href="../F07/f07_conts.xml">F07</a>.</div>
<div class="paramtext">There are routines to cater for a variety of types of matrix, including general, symmetric or Hermitian, symmetric or Hermitian positive-definite,  banded, skyline and sparse matrices.</div>
<div class="paramtext">In order to select the appropriate routine, you are recommended to consult the <a class="secref" href="../F04/f04_intro.xml">F04</a> Chapter Introduction in the first instance, although the decision trees will often in fact point to a routine in Chapters <a class="secref" href="../F07/f07_conts.xml">F07</a> or <a class="secref" href="../F11/f11_conts.xml">F11</a>.</div><h2><a name="fintlinlsq" id="fintlinlsq"/>3&#160;&#160;Linear Least-squares</h2><div class="paramtext">
The Black Box routines

for solving linear least-squares problems of the form
</div>
<div class="formula"><table class="formula"><tr><td class="formula"><m:math xmlns:m="http://www.w3.org/1998/Math/MathML" display="block">
<m:munder>
 <m:mi mathvariant="normal">minimize</m:mi>
 <m:mi>x</m:mi>
</m:munder><m:mspace width="0.25em"/>
<m:msup><m:mi>r</m:mi><m:mi mathvariant="normal">T</m:mi></m:msup><m:mi>r</m:mi><m:mtext>, &#8195; where &#8203;</m:mtext><m:mi>r</m:mi><m:mo>=</m:mo><m:mi>b</m:mi><m:mo>-</m:mo><m:mi>A</m:mi><m:mi>x</m:mi><m:mtext>,</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>
<div class="paramtext">
and <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>A</m:mi></m:math>&#160;is an <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>m</m:mi></m:math>&#160;by <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>n</m:mi></m:math>, possibly rank deficient, matrix,
are to be found in  Chapters <a class="secref" href="../F04/f04_conts.xml">F04</a> and <a class="secref" href="../F08/f08_conts.xml">F08</a>.  Such problems can also

be solved by selecting one or more general purpose factorization routines from  Chapters <a class="secref" href="../F02/f02_conts.xml">F02</a> or <a class="secref" href="../F08/f08_conts.xml">F08</a> and combining them with a solve routine  in Chapter <a class="secref" href="../F04/f04_conts.xml">F04</a>,  which also contains a routine to compute covariance matrices, or Chapter <a class="secref" href="../F08/f08_conts.xml">F08</a>.
Linear least-squares problems can also be solved by routines in the statistical  Chapter <a class="secref" href="../G02/g02_conts.xml">G02</a>.</div>
<div class="paramtext">In order to select the appropriate routine, you are recommended to consult  the <a class="secref" href="../F04/f04_intro.xml">F04</a> Chapter Introduction in the first instance, but if you have additional statistical requirements you may prefer to consult  Section <a class="secref" href="../G02/g02_intro.xml#background2">2.2</a> in the G02 Chapter Introduction.</div>
<div class="paramtext">Chapter <a class="secref" href="../F08/f08_conts.xml">F08</a> also contains routines for solving linear equality constrained least-squares problems, and the general Guass&#8211;Markov linear model problem.  Chapter <a class="secref" href="../E04/e04_conts.xml">E04</a> contains a routine to solve general linearly constrained linear least-squares problems.</div><h2><a name="finteigen" id="finteigen"/>4&#160;&#160;Eigenvalue Problems and Singular Value Problems</h2><div class="paramtext">The Black Box routines for solving standard matrix eigenvalue problems of the form
</div>
<div class="formula"><table class="formula"><tr><td class="formula"><m:math xmlns:m="http://www.w3.org/1998/Math/MathML" display="block">
<m:mi>A</m:mi><m:mi>x</m:mi><m:mo>=</m:mo><m:mi>&#955;</m:mi><m:mi>x</m:mi><m:mtext>,</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>
<div class="paramtext">
where <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>A</m:mi></m:math>&#160;is an <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>n</m:mi></m:math>&#160;by <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>n</m:mi></m:math>&#160;real or complex matrix, and generalized matrix eigenvalue problems of the form
</div>
<div class="formula"><table class="formula"><tr><td class="formula"><m:math xmlns:m="http://www.w3.org/1998/Math/MathML" display="block">
<m:mi>A</m:mi><m:mi>x</m:mi><m:mo>=</m:mo><m:mi>&#955;</m:mi><m:mi>B</m:mi><m:mi>x</m:mi><m:mtext>&#8195;and&#8195;</m:mtext><m:mi>A</m:mi><m:mi>B</m:mi><m:mi>x</m:mi><m:mo>=</m:mo><m:mi>&#955;</m:mi><m:mi>x</m:mi><m:mtext>,</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>
<div class="paramtext">
where <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>B</m:mi></m:math>&#160;is also an <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>n</m:mi></m:math>&#160;by <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>n</m:mi></m:math>&#160;matrix, are to be found in Chapters <a class="secref" href="../F02/f02_conts.xml">F02</a>, <a class="secref" href="../F08/f08_conts.xml">F08</a> and <a class="secref" href="../F12/f12_conts.xml">F12</a>.  These eigenvalue problems can also be solved by a combination of General Purpose routines
(which are mostly
in Chapter <a class="secref" href="../F08/f08_conts.xml">F08</a>, but a few are in Chapter <a class="secref" href="../F02/f02_conts.xml">F02</a>).
</div>
<div class="paramtext">There are routines to cater for various types of matrices, including general,  symmetric or Hermitian, and banded and sparse matrices.
</div>
<div class="paramtext">Similarly, the Black Box routines for finding singular values and/or singular vectors of an <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>m</m:mi></m:math>&#160;by <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>n</m:mi></m:math>&#160;real or complex matrix  <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>A</m:mi></m:math>&#160;are to be found in  Chapters <a class="secref" href="../F02/f02_conts.xml">F02</a> and <a class="secref" href="../F08/f08_conts.xml">F08</a>, and such problems may also be solved by routines from Chapter <a class="secref" href="../F12/f12_conts.xml">F12</a>, and by combining routines from Chapter <a class="secref" href="../F08/f08_conts.xml">F08</a>.</div>
<div class="paramtext">In order to select the appropriate routine, you are recommended to consult Chapters <a class="secref" href="../F02/f02_conts.xml">F02</a> and <a class="secref" href="../F08/f08_conts.xml">F08</a> in the first instance.</div><h2><a name="fintinverse" id="fintinverse"/>5&#160;&#160;Inversion and Determinants</h2><div class="paramtext">Routines for matrix inversion are to be found in
Chapters <a class="secref" href="../F01/f01_conts.xml">F01</a> and <a class="secref" href="../F07/f07_conts.xml">F07</a>.

You are recommended to consult Chapter <a class="secref" href="../F01/f01_conts.xml">F01</a> in the first instance, although the decision tree will often in fact point to a routine in Chapter <a class="secref" href="../F07/f07_conts.xml">F07</a>.
It should be noted that you are strongly encouraged not to use matrix inversion routines for the solution of linear equations,  since these can be solved more efficiently and accurately using routines directed specifically at such problems.  Indeed many problems, which superficially appear to be matrix inversion, can be posed as the solution of a system of linear equations and this is almost invariably preferable.</div>
<div class="paramtext">Routines to compute determinants of matrices are to be found in  Chapter <a class="secref" href="../F03/f03_conts.xml">F03</a>.  You are recommended to consult Chapter <a class="secref" href="../F03/f03_conts.xml">F03</a> in the first instance.</div><h2><a name="fintmatops" id="fintmatops"/>6&#160;&#160;Matrix Operations</h2><div class="paramtext">Routines for various sorts of matrix operation are to be found in Chapter <a class="secref" href="../F01/f01_conts.xml">F01</a>, including matrix transposition, addition and multiplication, and conversion between different matrix representation storage formats.  Facilities for matrix manipulation can also be found in Chapter <a class="secref" href="../F06/f06_conts.xml">F06</a> (see next section).</div><h2><a name="fintsupport" id="fintsupport"/>7&#160;&#160;Support Routines</h2><div class="paramtext">
Chapter <a class="secref" href="../F06/f06_conts.xml">F06</a> contains

a variety of routines to perform elementary algebraic operations involving scalars, vectors and matrices, such as setting up a plane rotation, performing a dot product and computing a matrix norm.
Chapter <a class="secref" href="../F06/f06_conts.xml">F06</a> contains

routines that meet the specification of the BLAS  (Basic Linear Algebra Subprograms) (see <a class="litref" href="#ref094">Lawson <i>et al.</i> (1979)</a>, <a class="litref" href="#ref525">Dodson <i>et al.</i> (1991)</a>, <a class="litref" href="#ref234">Dongarra <i>et al.</i> (1988)</a>, <a class="litref" href="#ref235">Dongarra <i>et al.</i> (1990)</a> and <a class="litref" href="#ref763">Blackford <i>et al.</i> (2002)</a>).  The routines in this chapter will not normally be required by the general user, but are intended for use by those who require to build specialist linear algebra modules.  These routines, especially the BLAS, are extensively used by other NAG Fortran Library routines.</div><h2><a name="references" id="references"/>8&#160;&#160;References</h2><div class="paramtext">
<p><a name="ref562" id="ref562"/>Anderson E, Bai Z, Bischof C, Blackford S, Demmel J, Dongarra J J, Du Croz J J, Greenbaum A, Hammarling S, McKenney A and Sorensen D (1999) <i>LAPACK Users' Guide</i> (3rd Edition) SIAM, Philadelphia </p>
<p><a name="ref763" id="ref763"/>Blackford L S, Demmel J, Dongarra J J, Duff I S, Hammarling S, Henry G, Heroux M, Kaufman L, Lumsdaine A, Petitet A, Pozo R, Remington K and Whaley R C (2002) An Updated Set of <span class="italic">Basic Linear Algebra Subprograms (BLAS)</span> <i>ACM Trans. Math. Software</i> <b>28</b> 135&#8211;151 </p>
<p><a name="ref525" id="ref525"/>Dodson D S, Grimes R G and Lewis J G (1991) Sparse extensions to the Fortran basic linear algebra subprograms <i>ACM Trans. Math. Software</i> <b>17</b> 253&#8211;263 </p>
<p><a name="ref235" id="ref235"/>Dongarra J J, Du Croz J J, Duff I S and Hammarling S (1990) A set of Level 3 basic linear algebra subprograms <i>ACM Trans. Math. Software</i> <b>16</b> 1&#8211;28 </p>
<p><a name="ref234" id="ref234"/>Dongarra J J, Du Croz J J, Hammarling S and Hanson R J (1988) An extended set of FORTRAN basic linear algebra subprograms <i>ACM Trans. Math. Software</i> <b>14</b> 1&#8211;32 </p>
<p><a name="ref105" id="ref105"/>Golub G H and Van Loan C F (1996) <i>Matrix Computations</i> (3rd Edition) Johns Hopkins University Press, Baltimore </p>
<p><a name="ref094" id="ref094"/>Lawson C L, Hanson R J, Kincaid D R and Krogh F T (1979) Basic linear algebra supbrograms for Fortran usage <i>ACM Trans. Math. Software</i> <b>5</b> 308&#8211;325 </p>
</div><hr/><div><a href="../../pdf/F/f_intro.pdf">F Chapter Introduction (pdf version)</a></div><div><a href="f_conts.xml">Chapter Contents</a></div>
<div><a href="../mark21.xml">NAG Library Manual</a></div>
<div><hr/>
  &#169; The Numerical Algorithms Group Ltd, Oxford, UK. 2006
  </div></body></html>