<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>HippoDraw Class Library</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> <link rel="shortcut icon" href="hippoApp.ico"> </head><body> <!-- Generated by Doxygen 1.6.2 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="dir_0274a9be98ae47925200be6537e3d505.html">functions</a> </div> </div> <div class="contents"> <h1>Erfc.h</h1><a href="Erfc_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* -*- mode: c++ -*- */</span> <a name="l00002"></a>00002 <a name="l00011"></a>00011 <span class="preprocessor">#ifndef _Erfc_H_</span> <a name="l00012"></a>00012 <span class="preprocessor"></span><span class="preprocessor">#define _Erfc_H_</span> <a name="l00013"></a>00013 <span class="preprocessor"></span> <a name="l00014"></a>00014 <span class="preprocessor">#include "<a class="code" href="FunctionBase_8h.html" title="hippodraw::FunctionBase class interface">FunctionBase.h</a>"</span> <a name="l00015"></a>00015 <a name="l00016"></a>00016 <span class="keyword">namespace </span>hippodraw { <a name="l00017"></a>00017 <a name="l00044"></a><a class="code" href="classhippodraw_1_1Erfc.html">00044</a> <span class="keyword">class </span><a class="code" href="libhippo_8h.html#a480024fd54849c743866874550153711">MDL_HIPPOPLOT_API</a> <a class="code" href="classhippodraw_1_1Erfc.html" title="A function that can be used with a fitter.">Erfc</a> : <span class="keyword">public</span> <a class="code" href="classhippodraw_1_1FunctionBase.html" title="A function that can be added to a DataRep and used in a fitter.">FunctionBase</a> <a name="l00045"></a>00045 { <a name="l00046"></a>00046 <span class="keyword">private</span>: <a name="l00047"></a><a class="code" href="classhippodraw_1_1Erfc.html#a06fc87d81c62e9abb8790b6e5713c55bad3071ccb5d54bbadcd61b726d215b10f">00047</a> <span class="keyword">enum</span>{MEAN,SIGMA,NORM}; <a name="l00048"></a>00048 <a name="l00049"></a>00049 <span class="keyword">protected</span>: <a name="l00051"></a>00051 <span class="keyword">virtual</span> <span class="keywordtype">void</span> initialize(); <a name="l00052"></a>00052 <a name="l00053"></a>00053 <span class="keyword">public</span>: <a name="l00055"></a>00055 <a class="code" href="classhippodraw_1_1Erfc.html" title="A function that can be used with a fitter.">Erfc</a> (); <a name="l00056"></a>00056 <a name="l00058"></a>00058 <a class="code" href="classhippodraw_1_1Erfc.html" title="A function that can be used with a fitter.">Erfc</a> ( <span class="keywordtype">double</span> mean, <span class="keywordtype">double</span> sigma, <span class="keywordtype">double</span> <a class="code" href="namespacehippodraw_1_1Numeric.html#a2fc63b8199da4a6f45b4a9590fbab38f" title="Computes the two norm of the vector.">norm</a> ); <a name="l00059"></a>00059 <a name="l00060"></a>00060 <span class="keyword">virtual</span> <a class="code" href="classhippodraw_1_1FunctionBase.html" title="A function that can be added to a DataRep and used in a fitter.">FunctionBase</a> * <a class="code" href="namespacenum__util.html#a8d145d73a173083711a3829a2bc75f5c">clone</a> () <span class="keyword">const</span>; <a name="l00061"></a>00061 <a name="l00063"></a>00063 <span class="keyword">virtual</span> <span class="keywordtype">double</span> operator () ( <span class="keywordtype">double</span> x ) <span class="keyword">const</span>; <a name="l00064"></a>00064 <a name="l00065"></a>00065 <span class="keyword">virtual</span> <span class="keywordtype">void</span> initialParameters ( <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1FunctionHelper.html" title="An abstract base class to help FunctionBase objects perform some operations.">FunctionHelper</a> * helper ); <a name="l00066"></a>00066 <a name="l00067"></a>00067 <span class="comment">//Help functions:</span> <a name="l00068"></a>00068 <span class="keywordtype">double</span> calcErfc(<span class="keywordtype">double</span> x) <span class="keyword">const</span>; <a name="l00069"></a>00069 <a name="l00070"></a>00070 <span class="keyword">protected</span>: <a name="l00071"></a>00071 <span class="keyword">virtual</span> <span class="keywordtype">double</span> derivByParm ( <span class="keywordtype">int</span> i, <span class="keywordtype">double</span> x ) <span class="keyword">const</span>; <a name="l00072"></a>00072 <a name="l00073"></a>00073 <span class="keywordtype">double</span> derivByRed ( <span class="keywordtype">double</span> value) <span class="keyword">const</span>; <a name="l00074"></a>00074 <a name="l00075"></a>00075 <span class="keyword">private</span>: <a name="l00077"></a><a class="code" href="classhippodraw_1_1Erfc.html#a5610f1b8c5396e3b3a5216896d6a28e4">00077</a> <span class="keyword">inline</span> <span class="keywordtype">double</span> calcRed(<span class="keywordtype">double</span> value)<span class="keyword"> const </span> <a name="l00078"></a>00078 <span class="keyword"> </span>{ <a name="l00079"></a>00079 <span class="keywordflow">if</span>(m_parms[SIGMA] == 0.0) { <a name="l00080"></a>00080 <a class="code" href="classhippodraw_1_1Erfc.html" title="A function that can be used with a fitter.">Erfc</a> * p = const_cast < <a class="code" href="classhippodraw_1_1Erfc.html" title="A function that can be used with a fitter.">Erfc</a> * > ( this ); <a name="l00081"></a>00081 p-><a class="code" href="classhippodraw_1_1FunctionBase.html#aa892dcf9755ccd651b666f353b723c34" title="The parameter values.">m_parms</a>[SIGMA] = 0.0001; <span class="comment">//dummy lower value</span> <a name="l00082"></a>00082 } <a name="l00083"></a>00083 <a name="l00084"></a>00084 <span class="keywordflow">return</span> (value - m_parms[MEAN])/m_parms[SIGMA]; <a name="l00085"></a>00085 } <a name="l00086"></a>00086 <a name="l00087"></a>00087 <a name="l00088"></a>00088 <a name="l00089"></a>00089 }; <a name="l00090"></a>00090 <a name="l00091"></a>00091 } <span class="comment">// namespace hippodraw</span> <a name="l00092"></a>00092 <a name="l00093"></a>00093 <span class="preprocessor">#endif// _Erfc_H_</span> </pre></div></div> <hr size="1"><address style="align: right;"><small> Generated for HippoDraw Class Library by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border=0> </a> </small></address> </body> </html>