<?xml-stylesheet type="text/xsl" href="../styles/pmathml.xsl"?>
<!-- saved from url=(0014)about:internet -->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:dsi="http://www.w3.org/1999/xlink" xmlns:m="http://www.w3.org/1998/Math/MathML" xml:space="preserve"><head><meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"/><title>E01DAF : NAG Library, Mark 22</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 class="rout" href="../../pdf/E01/e01daf.pdf">E01DAF (PDF version)</a></div><div><a class="chap" href="e01conts.xml">E01 Chapter Contents</a></div><div><a class="chapint" href="e01intro.xml">E01 Chapter Introduction</a></div>
<div><a class="htmltoc" href="../FRONTMATTER/manconts.xml">NAG Library Manual</a></div><hr/><h1 class="libdoc">NAG Library Routine Document<br/><br/>E01DAF</h1><div class="paramtext"><div class="header"><b>Note:</b>&#160; before using this routine, please read the Users' Note for your implementation to check the interpretation of <span class="bitalic">bold italicised</span> terms and other implementation-dependent details.</div></div> 
<div class="htmltoc">
<h2 class="htmltoc"><span class="htmltochead" onclick="showLevel('htmltoc');"><span class="htmltocplus" id="htmltocplus">+</span><span class="htmltocminus" id="htmltocminus">&#8722;</span></span>&#160;Contents</h2>
<div class="htmltocitem" id="htmltoc">
<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#purpose">1&#160;&#160;<b>Purpose</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#specification">2&#160;&#160;<b>Specification</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#description">3&#160;&#160;<b>Description</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#references">4&#160;&#160;<b>References</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#parameters">5&#160;&#160;<b>Parameters</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#errors">6&#160;&#160;<b>Error Indicators and Warnings</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#accuracy">7&#160;&#160;<b>Accuracy</b></a>
</div><div class="htmltoc">
<span class="htmltoc" onclick="showLevel('tocfcomments');"><span class="htmltocplus" id="tocfcommentsplus">+</span><span class="htmltocminus" id="tocfcommentsminus">&#8722;</span></span>
<a class="htmltoc" href="#fcomments">8&#160;&#160;<b>Further Comments</b></a>
<div class="htmltocitem" id="tocfcomments">
<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#fcomments1">8.1&#160;&#160;<b>Timing</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#fcomments2">8.2&#160;&#160;<b>Outline of Method Used</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#fcomments3">8.3&#160;&#160;<b>Evaluation of Computed Spline</b></a>
</div>
</div>
</div><div class="htmltoc">
<span class="htmltoc" onclick="showLevel('tocexample');"><span class="htmltocplus" id="tocexampleplus">+</span><span class="htmltocminus" id="tocexampleminus">&#8722;</span></span>
<a class="htmltoc" href="#example">9&#160;&#160;<b>Example</b></a>
<div class="htmltocitem" id="tocexample">
<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#examtext">9.1&#160;&#160;<b>Program Text</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#examdata">9.2&#160;&#160;<b>Program Data</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#examresults">9.3&#160;&#160;<b>Program Results</b></a>
</div>
</div>
</div>
</div>
</div><h2 class="standard"><a class="sec" name="purpose" id="purpose"/>1&#160;&#160;Purpose</h2>
<div class="paramtext">E01DAF computes a bicubic spline interpolating surface through a set of data values, given on a rectangular grid in the  <m:math><m:mi>x</m:mi></m:math>-<m:math><m:mi>y</m:mi></m:math>&#160;plane.</div><h2 class="standard"><a class="sec" name="specification" id="specification"/>2&#160;&#160;Specification</h2>
<table class="fspec"><tr><td class="tdfspec1">SUBROUTINE&#160;E01DAF&#160;(</td><td class="tdfspec2"><a class="arg" href="#MX">MX</a>, <a class="arg" href="#MY">MY</a>, <a class="arg" href="#X">X</a>, <a class="arg" href="#Y">Y</a>, <a class="arg" href="#F">F</a>, <a class="arg" href="#PX">PX</a>, <a class="arg" href="#PY">PY</a>, <a class="arg" href="#LAMDA">LAMDA</a>, <a class="arg" href="#MU">MU</a>, <a class="arg" href="#C">C</a>, <a class="arg" href="#WRK">WRK</a>, <a class="arg" href="#IFAIL">IFAIL</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">MX, MY, PX, PY, IFAIL</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">X(MX), Y(MY), F(MX*MY), LAMDA(MX+4), MU(MY+4), C(MX*MY), WRK((MX+6)*(MY+6))</td></tr></table><h2 class="standard"><a class="sec" name="description" id="description"/>3&#160;&#160;Description</h2>
<div class="paramtext">E01DAF determines a bicubic spline interpolant to the set of data points 
<m:math>
 <m:mfenced separators=""><m:msub>
   <m:mi>x</m:mi>
   <m:mi>q</m:mi>
  </m:msub><m:mo>,</m:mo><m:msub>
   <m:mi>y</m:mi>
   <m:mi>r</m:mi>
  </m:msub><m:mo>,</m:mo><m:msub>
   <m:mi>f</m:mi>
   <m:mrow>
    <m:mi>q</m:mi>
    <m:mo>,</m:mo>
    <m:mi>r</m:mi>
   </m:mrow>
  </m:msub></m:mfenced>
</m:math>, for <m:math><m:mi>q</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:msub><m:mi>m</m:mi><m:mi>x</m:mi></m:msub></m:math>&#160;and <m:math><m:mi>r</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:msub><m:mi>m</m:mi><m:mi>y</m:mi></m:msub></m:math>.  The spline is given in the B-spline representation

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>s</m:mi><m:mfenced separators=""><m:mi>x</m:mi><m:mo>,</m:mo><m:mi>y</m:mi></m:mfenced><m:mo>=</m:mo><m:munderover><m:mo>&#8721;</m:mo><m:mrow><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>1</m:mn></m:mrow><m:msub><m:mi>m</m:mi><m:mi>x</m:mi></m:msub></m:munderover><m:munderover><m:mo>&#8721;</m:mo><m:mrow><m:mi>j</m:mi><m:mo>=</m:mo><m:mn>1</m:mn></m:mrow><m:msub><m:mi>m</m:mi><m:mi>y</m:mi></m:msub></m:munderover><m:msub><m:mi>c</m:mi><m:mrow><m:mi>i</m:mi><m:mi>j</m:mi></m:mrow></m:msub><m:msub><m:mi>M</m:mi><m:mi>i</m:mi></m:msub><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:msub><m:mi>N</m:mi><m:mi>j</m:mi></m:msub><m:mfenced separators=""><m:mi>y</m:mi></m:mfenced><m:mtext>,</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

such that

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>s</m:mi><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi>q</m:mi></m:msub><m:mo>,</m:mo><m:msub><m:mi>y</m:mi><m:mi>r</m:mi></m:msub></m:mfenced><m:mo>=</m:mo><m:msub><m:mi>f</m:mi><m:mrow><m:mi>q</m:mi><m:mo>,</m:mo><m:mi>r</m:mi></m:mrow></m:msub><m:mtext>,</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

where <m:math><m:msub><m:mi>M</m:mi><m:mi>i</m:mi></m:msub><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;and <m:math><m:msub><m:mi>N</m:mi><m:mi>j</m:mi></m:msub><m:mfenced separators=""><m:mi>y</m:mi></m:mfenced></m:math>&#160;denote normalized cubic B-splines, the former defined on the knots <m:math><m:msub><m:mi>&#955;</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;to <m:math><m:msub><m:mi>&#955;</m:mi><m:mrow><m:mi>i</m:mi><m:mo>+</m:mo><m:mn>4</m:mn></m:mrow></m:msub></m:math>&#160;and the latter on the knots  <m:math><m:msub><m:mi>&#956;</m:mi><m:mi>j</m:mi></m:msub></m:math>&#160;to <m:math><m:msub><m:mi>&#956;</m:mi><m:mrow><m:mi>j</m:mi><m:mo>+</m:mo><m:mn>4</m:mn></m:mrow></m:msub></m:math>, and the  <m:math><m:msub><m:mi>c</m:mi><m:mrow><m:mi>i</m:mi><m:mi>j</m:mi></m:mrow></m:msub></m:math>&#160;are the spline coefficients.  These knots, as well as the coefficients, are determined by the routine, which is derived from the  routine B2IRE in <a class="ref" href="#ref043">Anthony <span class="italic">et al.</span> (1982)</a>.  The method used is described in <a class="sec" href="#fcomments2">Section 8.2</a>.</div><div class="paramtext">For further information on splines, see <a class="ref" href="#ref045">Hayes and Halliday (1974)</a>  for bicubic splines and <a class="ref" href="#ref044">de Boor (1972)</a> for normalized B-splines.</div><div class="paramtext">Values of the computed spline can subsequently be obtained by calling  <a class="rout" href="../E02/e02def.xml">E02DEF</a> or <a class="rout" href="../E02/e02dff.xml">E02DFF</a>  as described in  <a class="sec" href="#fcomments3">Section 8.3</a>.</div><h2 class="standard"><a class="sec" name="references" id="references"/>4&#160;&#160;References</h2><div class="paramtext"><a name="ref043" id="ref043"/>Anthony G T, Cox M G and Hayes J G (1982)  <i>DASL &#8211; Data Approximation Subroutine Library</i> National Physical Laboratory </div>
<div class="paramtext"><a name="ref039" id="ref039"/>Cox M G (1975)  An algorithm for spline interpolation <i>J. Inst. Math. Appl.</i> <b>15</b> 95&#8211;108 </div>
<div class="paramtext"><a name="ref044" id="ref044"/>de Boor C (1972)  On calculating with B-splines <i>J. Approx. Theory</i> <b>6</b> 50&#8211;62 </div>
<div class="paramtext"><a name="ref045" id="ref045"/>Hayes J G and Halliday J (1974)  The least-squares fitting of cubic spline surfaces to general data sets <i>J. Inst. Math. Appl.</i> <b>14</b> 89&#8211;103 </div><h2 class="standard"><a class="sec" name="parameters" id="parameters"/>5&#160;&#160;Parameters</h2>
<dl><dt class="paramhead"><a name="MX" id="MX"/>1: &#160;&#160;&#8194; MX &#8211; INTEGER<span class="pclass">Input</span></dt><dt class="multi-paramhead"><a name="MY" id="MY"/>2: &#160;&#160;&#8194; MY &#8211; INTEGER<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: 
 
<a class="arg" href="#MX">MX</a> and <a class="arg" href="#MY">MY</a> must specify <m:math><m:msub><m:mi>m</m:mi><m:mi>x</m:mi></m:msub></m:math>&#160;and <m:math><m:msub><m:mi>m</m:mi><m:mi>y</m:mi></m:msub></m:math>&#160;respectively, the number of points along the <m:math><m:mi>x</m:mi></m:math>&#160;and <m:math><m:mi>y</m:mi></m:math>&#160;axis that define the rectangular grid.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MX"><m:mi mathcolor="#EE0000" mathvariant="bold">MX</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>4</m:mn></m:math>&#160;and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MY"><m:mi mathcolor="#EE0000" mathvariant="bold">MY</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>4</m:mn></m:math>.
</div></dd><dt class="paramhead"><a name="X" id="X"/>3: &#160;&#160;&#8194; X(<a class="arg" href="#MX">MX</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input</span></dt><dt class="multi-paramhead"><a name="Y" id="Y"/>4: &#160;&#160;&#8194; Y(<a class="arg" href="#MY">MY</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#X"><m:mi mathcolor="#EE0000" mathvariant="bold">X</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>q</m:mi></m:mfenced></m:mrow></m:math>&#160;and <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#Y"><m:mi mathcolor="#EE0000" mathvariant="bold">Y</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>r</m:mi></m:mfenced></m:mrow></m:math>&#160;must contain <m:math><m:msub><m:mi>x</m:mi><m:mi>q</m:mi></m:msub></m:math>, for <m:math><m:mi>q</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:msub><m:mi>m</m:mi><m:mi>x</m:mi></m:msub></m:math>, and <m:math><m:msub><m:mi>y</m:mi><m:mi>r</m:mi></m:msub></m:math>, for <m:math><m:mi>r</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:msub><m:mi>m</m:mi><m:mi>y</m:mi></m:msub></m:math>, respectively.</div><div class="paramtext"><i>Constraints</i>:
   <div class="paramtext"/><ul class="listcons">
<li class="listcons"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#X"><m:mi mathcolor="#EE0000" mathvariant="bold">X</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi mathvariant="italic">q</m:mi></m:mfenced></m:mrow><m:mo>&lt;</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#X"><m:mi mathcolor="#EE0000" mathvariant="bold">X</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><m:mi mathvariant="italic">q</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:mrow></m:math>,  for <m:math><m:mi mathvariant="italic">q</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mrow><m:msub><m:mi>m</m:mi><m:mi>x</m:mi></m:msub><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:math>;</li>
<li class="listcons"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#Y"><m:mi mathcolor="#EE0000" mathvariant="bold">Y</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi mathvariant="italic">r</m:mi></m:mfenced></m:mrow><m:mo>&lt;</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#Y"><m:mi mathcolor="#EE0000" mathvariant="bold">Y</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><m:mi mathvariant="italic">r</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:mrow></m:math>,  for <m:math><m:mi mathvariant="italic">r</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mrow><m:msub><m:mi>m</m:mi><m:mi>y</m:mi></m:msub><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:math>.</li>
</ul></div></dd><dt class="paramhead"><a name="F" id="F"/>5: &#160;&#160;&#8194; F(<m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MX"><m:mi mathcolor="#EE0000" mathvariant="bold">MX</m:mi></m:maction><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#MY"><m:mi mathcolor="#EE0000" mathvariant="bold">MY</m:mi></m:maction></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#F"><m:mi mathcolor="#EE0000" mathvariant="bold">F</m:mi></m:maction><m:mfenced separators=""><m:msub><m:mi>m</m:mi><m:mi>y</m:mi></m:msub><m:mo>&#215;</m:mo><m:mfenced separators=""><m:mi>q</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mfenced><m:mo>+</m:mo><m:mi>r</m:mi></m:mfenced></m:math>&#160;must contain <m:math><m:msub><m:mi>f</m:mi><m:mrow><m:mi>q</m:mi><m:mo>,</m:mo><m:mi>r</m:mi></m:mrow></m:msub></m:math>, for <m:math><m:mi>q</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:msub><m:mi>m</m:mi><m:mi>x</m:mi></m:msub></m:math>&#160;and <m:math><m:mi>r</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:msub><m:mi>m</m:mi><m:mi>y</m:mi></m:msub></m:math>.</div></dd><dt class="paramhead"><a name="PX" id="PX"/>6: &#160;&#160;&#8194; PX &#8211; INTEGER<span class="pclass">Output</span></dt><dt class="multi-paramhead"><a name="PY" id="PY"/>7: &#160;&#160;&#8194; PY &#8211; INTEGER<span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: <a class="arg" href="#PX">PX</a> and <a class="arg" href="#PY">PY</a> contain <m:math><m:msub><m:mi>m</m:mi><m:mi>x</m:mi></m:msub><m:mo>+</m:mo><m:mn>4</m:mn></m:math>&#160;and <m:math><m:msub><m:mi>m</m:mi><m:mi>y</m:mi></m:msub><m:mo>+</m:mo><m:mn>4</m:mn></m:math>, the total number of knots of the computed spline with respect to the <m:math><m:mi>x</m:mi></m:math>&#160;and <m:math><m:mi>y</m:mi></m:math>&#160;variables, respectively.</div></dd><dt class="paramhead"><a name="LAMDA" id="LAMDA"/>8: &#160;&#160;&#8194; LAMDA(<m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MX"><m:mi mathcolor="#EE0000" mathvariant="bold">MX</m:mi></m:maction><m:mo>+</m:mo><m:mn>4</m:mn></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Output</span></dt><dt class="multi-paramhead"><a name="MU" id="MU"/>9: &#160;&#160;&#8194; MU(<m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MY"><m:mi mathcolor="#EE0000" mathvariant="bold">MY</m:mi></m:maction><m:mo>+</m:mo><m:mn>4</m:mn></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: <a class="arg" href="#LAMDA">LAMDA</a> contains the complete set of knots <m:math><m:msub><m:mi>&#955;</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;associated with the <m:math><m:mi>x</m:mi></m:math>&#160;variable, i.e., the interior knots <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#LAMDA"><m:mi mathcolor="#EE0000" mathvariant="bold">LAMDA</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>5</m:mn></m:mfenced></m:mrow><m:mo>,</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#LAMDA"><m:mi mathcolor="#EE0000" mathvariant="bold">LAMDA</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>6</m:mn></m:mfenced></m:mrow><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#LAMDA"><m:mi mathcolor="#EE0000" mathvariant="bold">LAMDA</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#PX"><m:mi mathcolor="#EE0000" mathvariant="bold">PX</m:mi></m:maction><m:mo>-</m:mo><m:mn>4</m:mn></m:mrow></m:mfenced></m:mrow></m:math>, as well as the additional knots

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#LAMDA"><m:mi mathcolor="#EE0000" mathvariant="bold">LAMDA</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow><m:mo>=</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#LAMDA"><m:mi mathcolor="#EE0000" mathvariant="bold">LAMDA</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>2</m:mn></m:mfenced></m:mrow><m:mo>=</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#LAMDA"><m:mi mathcolor="#EE0000" mathvariant="bold">LAMDA</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>3</m:mn></m:mfenced></m:mrow><m:mo>=</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#LAMDA"><m:mi mathcolor="#EE0000" mathvariant="bold">LAMDA</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>4</m:mn></m:mfenced></m:mrow><m:mo>=</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#X"><m:mi mathcolor="#EE0000" mathvariant="bold">X</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow>
</m:math></td><td class="formula2"/></tr></table></div>

and

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#LAMDA"><m:mi mathcolor="#EE0000" mathvariant="bold">LAMDA</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#PX"><m:mi mathcolor="#EE0000" mathvariant="bold">PX</m:mi></m:maction><m:mo>-</m:mo><m:mn>3</m:mn></m:mrow></m:mfenced></m:mrow><m:mo>=</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#LAMDA"><m:mi mathcolor="#EE0000" mathvariant="bold">LAMDA</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#PX"><m:mi mathcolor="#EE0000" mathvariant="bold">PX</m:mi></m:maction><m:mo>-</m:mo><m:mn>2</m:mn></m:mrow></m:mfenced></m:mrow><m:mo>=</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#LAMDA"><m:mi mathcolor="#EE0000" mathvariant="bold">LAMDA</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#PX"><m:mi mathcolor="#EE0000" mathvariant="bold">PX</m:mi></m:maction><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:mrow><m:mo>=</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#LAMDA"><m:mi mathcolor="#EE0000" mathvariant="bold">LAMDA</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:maction actiontype="link" dsi:type="simple" dsi:href="#PX"><m:mi mathcolor="#EE0000" mathvariant="bold">PX</m:mi></m:maction></m:mfenced></m:mrow><m:mo>=</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#X"><m:mi mathcolor="#EE0000" mathvariant="bold">X</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:maction actiontype="link" dsi:type="simple" dsi:href="#MX"><m:mi mathcolor="#EE0000" mathvariant="bold">MX</m:mi></m:maction></m:mfenced></m:mrow>
</m:math></td><td class="formula2"/></tr></table></div>

needed for the B-spline representation. <a class="arg" href="#MU">MU</a> contains the corresponding complete set of knots <m:math><m:msub><m:mi>&#956;</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;associated with the <m:math><m:mi>y</m:mi></m:math>&#160;variable.
</div></dd><dt class="paramhead"><a name="C" id="C"/>10: &#8194; C(<m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MX"><m:mi mathcolor="#EE0000" mathvariant="bold">MX</m:mi></m:maction><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#MY"><m:mi mathcolor="#EE0000" mathvariant="bold">MY</m:mi></m:maction></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: the coefficients of the spline interpolant. <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#C"><m:mi mathcolor="#EE0000" mathvariant="bold">C</m:mi></m:maction><m:mfenced separators=""><m:msub><m:mi>m</m:mi><m:mi>y</m:mi></m:msub><m:mo>&#215;</m:mo><m:mfenced separators=""><m:mi>i</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mfenced><m:mo>+</m:mo><m:mi>j</m:mi></m:mfenced></m:math>&#160;contains the coefficient <m:math><m:msub><m:mi>c</m:mi><m:mrow><m:mi>i</m:mi><m:mi>j</m:mi></m:mrow></m:msub></m:math>&#160;described in <a class="sec" href="#description">Section 3</a>.</div></dd><dt class="paramhead"><a name="WRK" id="WRK"/>11: &#8194; WRK(<m:math><m:mfenced separators=""><m:maction actiontype="link" dsi:type="simple" dsi:href="#MX"><m:mi mathcolor="#EE0000" mathvariant="bold">MX</m:mi></m:maction><m:mo>+</m:mo><m:mn>6</m:mn></m:mfenced><m:mo>&#215;</m:mo><m:mfenced separators=""><m:maction actiontype="link" dsi:type="simple" dsi:href="#MY"><m:mi mathcolor="#EE0000" mathvariant="bold">MY</m:mi></m:maction><m:mo>+</m:mo><m:mn>6</m:mn></m:mfenced></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Workspace</span></dt><dt class="paramhead"><a name="IFAIL" id="IFAIL"/>12: &#8194; IFAIL &#8211; INTEGER<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On entry</i>: <a class="arg" href="#IFAIL">IFAIL</a> must be set to <m:math><m:mn>0</m:mn></m:math>, <m:math><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow><m:mtext>&#8203; or &#8203;</m:mtext><m:mn>1</m:mn></m:math>. If you are unfamiliar with this parameter you should refer to <a class="sec" href="../GENINT/essint.xml#library3">Section 3.3</a> in  the Essential Introduction for details.</div>
<div class="paramtext"><i>On exit</i>: <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#errors"><m:mn mathcolor="#003399" mathvariant="bold">0</m:mn></m:maction></m:math>&#160;unless the routine detects an error (see <a class="sec" href="#errors">Section 6</a>). <div class="paramtext">For environments where it might be inappropriate to halt program execution when an error is detected, the value <m:math><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow><m:mtext>&#8203; or &#8203;</m:mtext><m:mn>1</m:mn></m:math>&#160;is recommended.  If the output of error messages is undesirable, then the value <m:math><m:mn>1</m:mn></m:math>&#160;is recommended.  Otherwise, if you are not familiar with this parameter, the recommended value is <m:math><m:mn>0</m:mn></m:math>.  <b>When the value <m:math><m:mrow><m:mo>-</m:mo><m:mn mathvariant="bold">1</m:mn></m:mrow><m:mtext>&#8203; or &#8203;</m:mtext><m:mn mathvariant="bold">1</m:mn></m:math>&#160;is used it is essential to test the value of <a class="arg" href="#IFAIL">IFAIL</a> on exit.</b></div></div></dd></dl><h2 class="standard"><a class="sec" name="errors" id="errors"/>6&#160;&#160;Error Indicators and Warnings</h2>
<div class="paramtext">If on entry <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#errors"><m:mn mathcolor="#003399" mathvariant="bold">0</m:mn></m:maction></m:math>&#160;or <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#errors"><m:mn mathcolor="#003399" mathvariant="bold">-1</m:mn></m:maction></m:math>, explanatory error messages are output on the current error message unit (as defined by <a class="rout" href="../X04/x04aaf.xml">X04AAF</a>).</div><div class="paramtext">Errors or warnings detected by the routine:</div>
<dl class="ifail">
<dt class="errorhead"><a name="IFeq1" id="IFeq1"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math></dt>
<dd>
<table class="ifail"><tr><td class="ifail1">On&#160;entry,</td><td class="ifail2-90"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MX"><m:mi mathcolor="#EE0000" mathvariant="bold">MX</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>4</m:mn></m:math>,</td></tr><tr><td class="ifail1">or</td><td class="ifail2-90"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MY"><m:mi mathcolor="#EE0000" mathvariant="bold">MY</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>4</m:mn></m:math>.</td></tr></table>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq2" id="IFeq2"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>2</m:mn></m:math></dt>
<dd>
<div class="paramtext">On entry, either the values in the <a class="arg" href="#X">X</a> array or the values in the <a class="arg" href="#Y">Y</a> array are not in increasing order if not already there.</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq3" id="IFeq3"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>3</m:mn></m:math></dt>
<dd>
<div class="paramtext">A system of linear equations defining the B-spline coefficients was singular; the problem is too ill-conditioned to permit solution.</div>
</dd>
</dl><h2 class="standard"><a class="sec" name="accuracy" id="accuracy"/>7&#160;&#160;Accuracy</h2>
<div class="paramtext">The main sources of rounding errors are in steps <m:math><m:mn>2</m:mn></m:math>, <m:math><m:mn>3</m:mn></m:math>, <m:math><m:mn>6</m:mn></m:math>&#160;and <m:math><m:mn>7</m:mn></m:math>&#160;of the algorithm described in <a class="sec" href="#fcomments2">Section 8.2</a>.  It can be shown (see <a class="ref" href="#ref039">Cox (1975)</a>) that the matrix <m:math><m:msub><m:mi>A</m:mi><m:mi>x</m:mi></m:msub></m:math>&#160;formed in step <m:math><m:mn>2</m:mn></m:math>&#160;has elements differing relatively from their true values by at most a small multiple of <m:math><m:mn>3</m:mn><m:mi>&#949;</m:mi></m:math>, where <m:math><m:mi>&#949;</m:mi></m:math>&#160;is the <span class="bitalic">machine precision</span>.  <m:math><m:msub><m:mi>A</m:mi><m:mi>x</m:mi></m:msub></m:math>&#160;is &#8216;totally positive&#8217;, and a linear system with such a coefficient matrix can be solved quite safely by elimination without pivoting.  Similar comments apply to steps <m:math><m:mn>6</m:mn></m:math>&#160;and <m:math><m:mn>7</m:mn></m:math>.  Thus the complete process is numerically stable.</div><h2 class="standard"><a class="sec" name="fcomments" id="fcomments"/>8&#160;&#160;Further Comments</h2><h3 class="standard"><a class="sec" name="fcomments1" id="fcomments1"/>8.1&#160;&#160;Timing</h3>
<div class="paramtext">The time taken by E01DAF is approximately proportional to <m:math><m:msub><m:mi>m</m:mi><m:mi>x</m:mi></m:msub><m:msub><m:mi>m</m:mi><m:mi>y</m:mi></m:msub></m:math>.</div><h3 class="standard"><a class="sec" name="fcomments2" id="fcomments2"/>8.2&#160;&#160;Outline of Method Used</h3>
<div class="paramtext">The process of computing the spline consists of the following steps:
<ol class="listnumber"><li class="listnumber">choice of the interior <m:math><m:mi>x</m:mi></m:math>-knots <m:math><m:msub><m:mi>&#955;</m:mi><m:mn>5</m:mn></m:msub></m:math>, <m:math><m:msub><m:mi>&#955;</m:mi><m:mn>6</m:mn></m:msub><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:msub><m:mi>&#955;</m:mi><m:msub><m:mi>m</m:mi><m:mi>x</m:mi></m:msub></m:msub></m:math>&#160;as  <m:math><m:msub><m:mi>&#955;</m:mi><m:mi>i</m:mi></m:msub><m:mo>=</m:mo><m:msub><m:mi>x</m:mi><m:mrow><m:mi>i</m:mi><m:mo>-</m:mo><m:mn>2</m:mn></m:mrow></m:msub></m:math>, for <m:math><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>5</m:mn><m:mo>,</m:mo><m:mn>6</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:msub><m:mi>m</m:mi><m:mi>x</m:mi></m:msub></m:math>,</li><li class="listnumber">formation of the system

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:msub><m:mi>A</m:mi><m:mi>x</m:mi></m:msub><m:mi>E</m:mi><m:mo>=</m:mo><m:mi>F</m:mi><m:mtext>,</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

where <m:math><m:msub><m:mi>A</m:mi><m:mi>x</m:mi></m:msub></m:math>&#160;is a band matrix of order <m:math><m:msub><m:mi>m</m:mi><m:mi>x</m:mi></m:msub></m:math>&#160;and bandwidth <m:math><m:mn>4</m:mn></m:math>, containing in its <m:math><m:mi>q</m:mi></m:math>th row the values at  <m:math><m:msub><m:mi>x</m:mi><m:mi>q</m:mi></m:msub></m:math>&#160;of the B-splines in <m:math><m:mi>x</m:mi></m:math>, <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#F"><m:mi mathcolor="#EE0000" mathvariant="bold">F</m:mi></m:maction></m:math>&#160;is the <m:math><m:msub><m:mi>m</m:mi><m:mi>x</m:mi></m:msub></m:math>&#160;by <m:math><m:msub><m:mi>m</m:mi><m:mi>y</m:mi></m:msub></m:math>&#160;rectangular matrix of values <m:math><m:msub><m:mi>f</m:mi><m:mrow><m:mi>q</m:mi><m:mo>,</m:mo><m:mi>r</m:mi></m:mrow></m:msub></m:math>, and <m:math><m:mi>E</m:mi></m:math>&#160;denotes an  <m:math><m:msub><m:mi>m</m:mi><m:mi>x</m:mi></m:msub></m:math>&#160;by <m:math><m:msub><m:mi>m</m:mi><m:mi>y</m:mi></m:msub></m:math>&#160;rectangular matrix of intermediate coefficients,</li><li class="listnumber">use of Gaussian elimination to reduce this system to band triangular form,</li><li class="listnumber">solution of this triangular system for <m:math><m:mi>E</m:mi></m:math>,</li><li class="listnumber">choice of the interior <m:math><m:mi>y</m:mi></m:math>&#160;knots <m:math><m:msub><m:mi>&#956;</m:mi><m:mn>5</m:mn></m:msub></m:math>, <m:math><m:msub><m:mi>&#956;</m:mi><m:mn>6</m:mn></m:msub><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:msub><m:mi>&#956;</m:mi><m:msub><m:mi>m</m:mi><m:mi>y</m:mi></m:msub></m:msub></m:math>&#160;as  <m:math><m:msub><m:mi>&#956;</m:mi><m:mi>i</m:mi></m:msub><m:mo>=</m:mo><m:msub><m:mi>y</m:mi><m:mrow><m:mi>i</m:mi><m:mo>-</m:mo><m:mn>2</m:mn></m:mrow></m:msub></m:math>, for <m:math><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>5</m:mn><m:mo>,</m:mo><m:mn>6</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:msub><m:mi>m</m:mi><m:mi>y</m:mi></m:msub></m:math>,</li><li class="listnumber">formation of the system

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:msub><m:mi>A</m:mi><m:mi>y</m:mi></m:msub><m:msup><m:mi>C</m:mi><m:mi mathvariant="normal">T</m:mi></m:msup><m:mo>=</m:mo><m:msup><m:mi>E</m:mi><m:mi mathvariant="normal">T</m:mi></m:msup><m:mtext>,</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

where <m:math><m:msub><m:mi>A</m:mi><m:mi>y</m:mi></m:msub></m:math>&#160;is the counterpart of <m:math><m:msub><m:mi>A</m:mi><m:mi>x</m:mi></m:msub></m:math>&#160;for the <m:math><m:mi>y</m:mi></m:math>&#160;variable, and <m:math><m:mi>C</m:mi></m:math>&#160;denotes the  <m:math><m:msub><m:mi>m</m:mi><m:mi>x</m:mi></m:msub></m:math>&#160;by <m:math><m:msub><m:mi>m</m:mi><m:mi>y</m:mi></m:msub></m:math>&#160;rectangular matrix of values of <m:math><m:msub><m:mi>c</m:mi><m:mrow><m:mi>i</m:mi><m:mi>j</m:mi></m:mrow></m:msub></m:math>,</li><li class="listnumber">use of Gaussian elimination to reduce this system to band triangular form,</li><li class="listnumber">solution of this triangular system for <m:math><m:msup><m:mi>C</m:mi><m:mi mathvariant="normal">T</m:mi></m:msup></m:math>&#160;and hence  <m:math><m:mi>C</m:mi></m:math>.</li></ol>
</div><div class="paramtext">For computational convenience, steps <m:math><m:mn>2</m:mn></m:math>&#160;and <m:math><m:mn>3</m:mn></m:math>,  and likewise steps <m:math><m:mn>6</m:mn></m:math>&#160;and <m:math><m:mn>7</m:mn></m:math>, are combined so that the formation of <m:math><m:msub><m:mi>A</m:mi><m:mi>x</m:mi></m:msub></m:math>&#160;and <m:math><m:msub><m:mi>A</m:mi><m:mi>y</m:mi></m:msub></m:math>&#160;and the reductions to triangular form are carried out one row at a time.</div><h3 class="standard"><a class="sec" name="fcomments3" id="fcomments3"/>8.3&#160;&#160;Evaluation of Computed Spline</h3>
<div class="paramtext">The values of the computed spline at the points <m:math>
 <m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi>k</m:mi></m:msub><m:mo>,</m:mo><m:msub><m:mi>y</m:mi><m:mi>k</m:mi></m:msub></m:mfenced>
</m:math>, for <m:math><m:mi>k</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mi>m</m:mi></m:math>, may be obtained in the <span class="bitalic">double precision</span> array <a class="arg" href="../E02/e02def.xml#FF">FF</a> (see <a class="rout" href="../E02/e02def.xml">E02DEF</a>), of length at least <m:math><m:mi>m</m:mi></m:math>, by the following call:
<pre class="verbatim">
IFAIL = 0
CALL E02DEF(M,PX,PY,X,Y,LAMDA,MU,C,FF,WRK,IWRK,IFAIL)
</pre>


where <m:math><m:mi mathvariant="monospace">M</m:mi><m:mo>=</m:mo><m:mi>m</m:mi></m:math>&#160;and the co-ordinates <m:math><m:msub><m:mi>x</m:mi><m:mi>k</m:mi></m:msub></m:math>, <m:math><m:msub><m:mi>y</m:mi><m:mi>k</m:mi></m:msub></m:math>&#160;are stored in <m:math><m:mi mathvariant="monospace">X</m:mi><m:mfenced separators=""><m:mi>k</m:mi></m:mfenced></m:math>, <m:math><m:mi mathvariant="monospace">Y</m:mi><m:mfenced separators=""><m:mi>k</m:mi></m:mfenced></m:math>.
<span class="mono">PX</span> and <span class="mono">PY</span>, 
<span class="mono">LAMDA</span>, <span class="mono">MU</span> and <span class="mono">C</span> have the same values as 
<a class="arg" href="#PX">PX</a> and <a class="arg" href="#PY">PY</a> 
<a class="arg" href="#LAMDA">LAMDA</a>, <a class="arg" href="#MU">MU</a> and <a class="arg" href="#C">C</a> output from E01DAF.
<span class="mono">WRK</span> is a <span class="bitalic">double precision</span> workspace array of length at least <span class="mono">PY</span>, and <span class="mono">IWRK</span> is an integer workspace array of length at least <m:math><m:mi mathvariant="monospace">PY</m:mi><m:mo>-</m:mo><m:mn>4</m:mn></m:math>.
(See <a class="rout" href="../E02/e02def.xml">E02DEF</a>.)</div><div class="paramtext">To evaluate the computed spline on an <m:math><m:msub><m:mi>m</m:mi><m:mi>x</m:mi></m:msub></m:math>&#160;by <m:math><m:msub><m:mi>m</m:mi><m:mi>y</m:mi></m:msub></m:math>&#160;rectangular grid of points in the <m:math><m:mi>x</m:mi></m:math>-<m:math><m:mi>y</m:mi></m:math>&#160;plane, which is defined by the <m:math><m:mi>x</m:mi></m:math>&#160;co-ordinates stored in <m:math><m:mi mathvariant="monospace">X</m:mi><m:mfenced separators=""><m:mi>j</m:mi></m:mfenced></m:math>, for <m:math><m:mi>j</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:msub><m:mi>m</m:mi><m:mi>x</m:mi></m:msub></m:math>, and the <m:math><m:mi>y</m:mi></m:math>&#160;co-ordinates stored in <m:math><m:mi mathvariant="monospace">Y</m:mi><m:mfenced separators=""><m:mi>k</m:mi></m:mfenced></m:math>, for <m:math><m:mi>k</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:msub><m:mi>m</m:mi><m:mi>y</m:mi></m:msub></m:math>, returning the results in the <span class="bitalic">double precision</span> array <a class="arg" href="../E02/e02dff.xml#FF">FF</a> (see <a class="rout" href="../E02/e02dff.xml">E02DFF</a>) which is of length at least <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="../E02/e02dff.xml#MX"><m:mi mathcolor="#EE0000" mathvariant="bold">MX</m:mi></m:maction><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="../E02/e02dff.xml#MY"><m:mi mathcolor="#EE0000" mathvariant="bold">MY</m:mi></m:maction></m:math>, the following call may be used:
<pre class="verbatim">
 IFAIL = 0
 CALL E02DFF(MX,MY,PX,PY,X,Y,LAMDA,MU,C,FG,WRK,LWRK,
*            IWRK,LIWRK,IFAIL)
</pre>


where <m:math><m:mi mathvariant="monospace">MX</m:mi><m:mo>=</m:mo><m:msub><m:mi>m</m:mi><m:mi>x</m:mi></m:msub></m:math>, <m:math><m:mi mathvariant="monospace">MY</m:mi><m:mo>=</m:mo><m:msub><m:mi>m</m:mi><m:mi>y</m:mi></m:msub></m:math>.
<span class="mono">PX</span> and <span class="mono">PY</span>, 
<span class="mono">LAMDA</span>, <span class="mono">MU</span> and <span class="mono">C</span> have the same values as 
<a class="arg" href="#PX">PX</a>, <a class="arg" href="#PY">PY</a>, 
<a class="arg" href="#LAMDA">LAMDA</a>, <a class="arg" href="#MU">MU</a> and <a class="arg" href="#C">C</a> output from E01DAF.
<span class="mono">WRK</span> is a <span class="bitalic">double precision</span> workspace array of length at least <m:math>
 <m:mi mathvariant="monospace">LWRK</m:mi>
 <m:mo>=</m:mo>
 <m:mrow><m:mi>min</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mi mathvariant="italic">nwrk1</m:mi><m:mo>,</m:mo><m:mi mathvariant="italic">nwrk2</m:mi></m:mfenced></m:mrow>
</m:math>, for <m:math>
 <m:mi mathvariant="italic">nwrk1</m:mi>
 <m:mo>=</m:mo>
 <m:mi mathvariant="monospace">MX</m:mi>
 <m:mo>&#215;</m:mo>
 <m:mn>4</m:mn>
 <m:mo>+</m:mo>
 <m:mi mathvariant="monospace">PX</m:mi>
</m:math>, <m:math>
 <m:mi mathvariant="italic">nwrk2</m:mi>
 <m:mo>=</m:mo>
 <m:mi mathvariant="monospace">MY</m:mi>
 <m:mo>&#215;</m:mo>
 <m:mn>4</m:mn>
 <m:mo>+</m:mo>
 <m:mi mathvariant="monospace">PY</m:mi>
</m:math>, and <span class="mono">IWRK</span> is an integer workspace array of length at least <m:math>
 <m:mi mathvariant="monospace">LIWRK</m:mi>
 <m:mo>=</m:mo>
 <m:mi mathvariant="monospace">MY</m:mi>
 <m:mo>+</m:mo>
 <m:mi mathvariant="monospace">PY</m:mi>
 <m:mo>-</m:mo>
 <m:mn>4</m:mn>
</m:math>&#160;if <m:math>
 <m:mi mathvariant="italic">nwrk1</m:mi>
 <m:mo>&gt;</m:mo>
 <m:mi mathvariant="italic">nwrk2</m:mi>
</m:math>, or <m:math>
 <m:mi mathvariant="monospace">MX</m:mi>
 <m:mo>+</m:mo>
 <m:mi mathvariant="monospace">PX</m:mi>
 <m:mo>-</m:mo>
 <m:mn>4</m:mn>
</m:math>&#160;otherwise.</div><div class="paramtext">The result of the spline evaluated at grid point <m:math>
 <m:mfenced separators=""><m:mi>j</m:mi><m:mo>,</m:mo><m:mi>k</m:mi></m:mfenced>
</m:math>&#160;is returned in element (<m:math>
 <m:mrow> <m:mi mathvariant="monospace">MY</m:mi><m:mo>&#215;</m:mo><m:mfenced separators=""><m:mi>j</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mfenced><m:mo>+</m:mo><m:mi>k</m:mi></m:mrow>
 </m:math>) of the array <span class="mono">FG</span>.</div><h2 class="standard"><a class="sec" name="example" id="example"/>9&#160;&#160;Example</h2>
<div class="paramtext">This example reads in values of <m:math><m:msub><m:mi>m</m:mi><m:mi>x</m:mi></m:msub></m:math>, <m:math><m:msub><m:mi>x</m:mi><m:mi>q</m:mi></m:msub></m:math>, for <m:math><m:mi>q</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:msub><m:mi>m</m:mi><m:mi>x</m:mi></m:msub></m:math>, <m:math><m:msub><m:mi>m</m:mi><m:mi>y</m:mi></m:msub></m:math>&#160;and <m:math><m:msub><m:mi>y</m:mi><m:mi>r</m:mi></m:msub></m:math>, for  <m:math><m:mi>r</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:msub><m:mi>m</m:mi><m:mi>y</m:mi></m:msub></m:math>, followed by values of the ordinates <m:math><m:msub><m:mi>f</m:mi><m:mrow><m:mi>q</m:mi><m:mo>,</m:mo><m:mi>r</m:mi></m:mrow></m:msub></m:math>&#160;defined at the grid points <m:math><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi>q</m:mi></m:msub><m:mo>,</m:mo><m:msub><m:mi>y</m:mi><m:mi>r</m:mi></m:msub></m:mfenced></m:math>.</div><div class="paramtext">It then calls E01DAF to compute a bicubic spline interpolant of the data values, and prints the values of the knots and B-spline coefficients.  Finally it evaluates the spline at a small sample of points on a rectangular grid.</div><h3 class="standard"><a class="sec" name="examtext" id="examtext"/>9.1&#160;&#160;Program Text</h3>
<p><a class="verbatimref" href="../../examples/source/e01dafe.f">Program Text (e01dafe.f)</a></p><h3 class="standard"><a class="sec" name="examdata" id="examdata"/>9.2&#160;&#160;Program Data</h3>
<p><a class="verbatimref" href="../../examples/data/e01dafe.d">Program&#160;Data (e01dafe.d)</a></p><h3 class="standard"><a class="sec" name="examresults" id="examresults"/>9.3&#160;&#160;Program Results</h3>
<p><a class="verbatimref" href="../../examples/baseresults/e01dafe.r">Program Results (e01dafe.r)</a></p>
<hr/><div><a class="rout" href="../../pdf/E01/e01daf.pdf">E01DAF (PDF version)</a></div><div><a class="chap" href="e01conts.xml">E01 Chapter Contents</a></div><div><a class="chapint" href="e01intro.xml">E01 Chapter Introduction</a></div>
<div><a class="htmltoc" href="../FRONTMATTER/manconts.xml">NAG Library Manual</a></div>
<div><hr/><a class="genint" href="../FRONTMATTER/copyright.xml">&#169; The Numerical Algorithms Group Ltd, Oxford, UK. 2009</a></div></body></html>
