<?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>E01SBF : 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/e01sbf.pdf">E01SBF (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/>E01SBF</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="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#fcomments">8&#160;&#160;<b>Further Comments</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#example">9&#160;&#160;<b>Example</b></a>
</div>
</div>
</div><h2 class="standard"><a class="sec" name="purpose" id="purpose"/>1&#160;&#160;Purpose</h2>
<div class="paramtext">E01SBF evaluates at a given point the two-dimensional interpolant function computed by 
<a class="rout" href="../E01/e01saf.xml">E01SAF</a>.

</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;E01SBF&#160;(</td><td class="tdfspec2"><a class="arg" href="#M">M</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="#TRIANG">TRIANG</a>, <a class="arg" href="#GRADS">GRADS</a>, <a class="arg" href="#PX">PX</a>, <a class="arg" href="#PY">PY</a>, <a class="arg" href="#PF">PF</a>, <a class="arg" href="#IFAIL">IFAIL</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">M, TRIANG(7*M), IFAIL</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">X(M), Y(M), F(M), GRADS(2,M), PX, PY, PF</td></tr></table><h2 class="standard"><a class="sec" name="description" id="description"/>3&#160;&#160;Description</h2>
<div class="paramtext">E01SBF takes as input the parameters defining the interpolant <m:math><m:mrow><m:mi>F</m:mi><m:mfenced separators=""><m:mi>x</m:mi><m:mo>,</m:mo><m:mi>y</m:mi></m:mfenced></m:mrow></m:math>&#160;of a set of scattered data points <m:math><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi>r</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:mi>r</m:mi></m:msub></m:mfenced></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:mi>m</m:mi></m:math>,
as computed by 
<a class="rout" href="../E01/e01saf.xml">E01SAF</a>,

and evaluates the interpolant at the point <m:math><m:mfenced separators=""><m:mrow><m:mi>p</m:mi><m:mi>x</m:mi></m:mrow><m:mo>,</m:mo><m:mrow><m:mi>p</m:mi><m:mi>y</m:mi></m:mrow></m:mfenced></m:math>.</div><div class="paramtext">If <m:math><m:mfenced separators=""><m:mrow><m:mi>p</m:mi><m:mi>x</m:mi></m:mrow><m:mo>,</m:mo><m:mrow><m:mi>p</m:mi><m:mi>y</m:mi></m:mrow></m:mfenced></m:math>&#160;is equal to <m:math><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi>r</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>&#160;for some value of <m:math><m:mi>r</m:mi></m:math>, the returned value will be equal to <m:math><m:msub><m:mi>f</m:mi><m:mi>r</m:mi></m:msub></m:math>.</div><div class="paramtext">If <m:math><m:mfenced separators=""><m:mrow><m:mi>p</m:mi><m:mi>x</m:mi></m:mrow><m:mo>,</m:mo><m:mrow><m:mi>p</m:mi><m:mi>y</m:mi></m:mrow></m:mfenced></m:math>&#160;is not equal to <m:math><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi>r</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>&#160;for any <m:math><m:mi>r</m:mi></m:math>, the derivatives in <a class="arg" href="#GRADS">GRADS</a> will be used to compute the interpolant.  A triangle is sought which contains the point <m:math><m:mfenced separators=""><m:mrow><m:mi>p</m:mi><m:mi>x</m:mi></m:mrow><m:mo>,</m:mo><m:mrow><m:mi>p</m:mi><m:mi>y</m:mi></m:mrow></m:mfenced></m:math>, and the vertices of the triangle along with the partial derivatives and <m:math><m:msub><m:mi>f</m:mi><m:mi>r</m:mi></m:msub></m:math>&#160;values at the vertices are used to compute the value
<m:math><m:mrow><m:mi>F</m:mi><m:mfenced separators=""><m:mrow><m:mi>p</m:mi><m:mi>x</m:mi></m:mrow><m:mo>,</m:mo><m:mrow><m:mi>p</m:mi><m:mi>y</m:mi></m:mrow></m:mfenced></m:mrow></m:math>.  If the point <m:math><m:mfenced separators=""><m:mrow><m:mi>p</m:mi><m:mi>x</m:mi></m:mrow><m:mo>,</m:mo><m:mrow><m:mi>p</m:mi><m:mi>y</m:mi></m:mrow></m:mfenced></m:math>&#160;lies outside the triangulation defined by the input parameters, the returned value is obtained by extrapolation.  In this case, the interpolating function <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 extended linearly beyond the triangulation boundary.  The method is described in more detail in <a class="ref" href="#ref049">Renka and Cline (1984)</a> and the code is derived from <a class="ref" href="#ref048">Renka (1984)</a>.</div><div class="paramtext">E01SBF must only be called after a call to 
<a class="rout" href="../E01/e01saf.xml">E01SAF</a>.

</div><h2 class="standard"><a class="sec" name="references" id="references"/>4&#160;&#160;References</h2><div class="paramtext"><a name="ref048" id="ref048"/>Renka R L (1984)  Algorithm 624: Triangulation and interpolation of arbitrarily distributed points in the plane <i>ACM Trans. Math. Software</i> <b>10</b> 440&#8211;442 </div>
<div class="paramtext"><a name="ref049" id="ref049"/>Renka R L and Cline A K (1984)  A triangle-based <m:math><m:msup><m:mi>C</m:mi><m:mn>1</m:mn></m:msup></m:math>&#160;interpolation method <i>Rocky Mountain J. Math.</i> <b>14</b> 223&#8211;237 </div><h2 class="standard"><a class="sec" name="parameters" id="parameters"/>5&#160;&#160;Parameters</h2>
<dl><dt class="paramhead"><a name="M" id="M"/>1: &#160;&#160;&#8194; M &#8211; INTEGER<span class="pclass">Input</span></dt><dt class="multi-paramhead"><a name="X" id="X"/>2: &#160;&#160;&#8194; X(<a class="arg" href="#M">M</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input</span></dt><dt class="multi-paramhead"><a name="Y" id="Y"/>3: &#160;&#160;&#8194; Y(<a class="arg" href="#M">M</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input</span></dt><dt class="multi-paramhead"><a name="F" id="F"/>4: &#160;&#160;&#8194; F(<a class="arg" href="#M">M</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input</span></dt><dt class="multi-paramhead"><a name="TRIANG" id="TRIANG"/>5: &#160;&#160;&#8194; TRIANG(<m:math><m:mn>7</m:mn><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction></m:math>) &#8211; INTEGER array<span class="pclass">Input</span></dt><dt class="multi-paramhead"><a name="GRADS" id="GRADS"/>6: &#160;&#160;&#8194; GRADS(<m:math><m:mn>2</m:mn></m:math>,<a class="arg" href="#M">M</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: 

<a class="arg" href="#M">M</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="#TRIANG">TRIANG</a> and <a class="arg" href="#GRADS">GRADS</a> must be unchanged from the previous call of 
<a class="rout" href="../E01/e01saf.xml">E01SAF</a>.</div></dd><dt class="paramhead"><a name="PX" id="PX"/>7: &#160;&#160;&#8194; PX &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dt class="multi-paramhead"><a name="PY" id="PY"/>8: &#160;&#160;&#8194; PY &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the point <m:math><m:mfenced separators=""><m:mrow><m:mi>p</m:mi><m:mi>x</m:mi></m:mrow><m:mo>,</m:mo><m:mrow><m:mi>p</m:mi><m:mi>y</m:mi></m:mrow></m:mfenced></m:math>&#160;at which the interpolant is to be evaluated.</div></dd><dt class="paramhead"><a name="PF" id="PF"/>9: &#160;&#160;&#8194; PF &#8211; <span class="bitalic">double precision</span><span class="pclass">Output</span></dt><dd>
<div class="paramtext"><i>On exit</i>: the value of the interpolant evaluated at the point <m:math><m:mfenced separators=""><m:mrow><m:mi>p</m:mi><m:mi>x</m:mi></m:mrow><m:mo>,</m:mo><m:mrow><m:mi>p</m:mi><m:mi>y</m:mi></m:mrow></m:mfenced></m:math>.</div></dd><dt class="paramhead"><a name="IFAIL" id="IFAIL"/>10: &#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="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>3</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, the triangulation information held in the array <a class="arg" href="#TRIANG">TRIANG</a> does not specify a valid triangulation of the data points.  <a class="arg" href="#TRIANG">TRIANG</a> may have been corrupted since the call to 
<a class="rout" href="../E01/e01saf.xml">E01SAF</a>.
</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">The evaluation point (<a class="arg" href="#PX">PX</a>,<a class="arg" href="#PY">PY</a>) lies outside the nodal triangulation,
and the value returned in <a class="arg" href="#PF">PF</a> is computed by extrapolation.</div>
</dd>
</dl><h2 class="standard"><a class="sec" name="accuracy" id="accuracy"/>7&#160;&#160;Accuracy</h2>
<div class="paramtext">Computational errors should be negligible in most practical situations.</div><h2 class="standard"><a class="sec" name="fcomments" id="fcomments"/>8&#160;&#160;Further Comments</h2>
<div class="paramtext">The time taken for a call of E01SBF is approximately proportional to the number of data points, <m:math><m:mi>m</m:mi></m:math>.</div><div class="paramtext">The results returned by this routine are particularly suitable for applications such as graph plotting, producing a smooth surface from a number of scattered points.</div><h2 class="standard"><a class="sec" name="example" id="example"/>9&#160;&#160;Example</h2>
<div class="paramtext">See 
<a class="sec" href="../E01/e01saf.xml#example">Section 9</a> in E01SAF.

</div>
<hr/><div><a class="rout" href="../../pdf/E01/e01sbf.pdf">E01SBF (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>
