Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > eebc325dc36bd6e3b09b9b45133e42f8 > files > 1320

HippoDraw-devel-docs-1.21.1-10.fc13.i686.rpm

<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&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;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&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="dir_0274a9be98ae47925200be6537e3d505.html">functions</a>
  </div>
</div>
<div class="contents">
<h1>LogNormal.cxx</h1><a href="LogNormal_8cxx.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00012"></a>00012 <span class="preprocessor">#ifdef _MSC_VER</span>
<a name="l00013"></a>00013 <span class="preprocessor"></span><span class="preprocessor">#include &quot;msdevstudio/MSconfig.h&quot;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#endif</span>
<a name="l00015"></a>00015 <span class="preprocessor"></span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &quot;<a class="code" href="LogNormal_8h.html" title="hippodraw::LogNormal class interface">LogNormal.h</a>&quot;</span>
<a name="l00017"></a>00017 
<a name="l00018"></a>00018 <span class="preprocessor">#include &quot;<a class="code" href="FunctionHelper_8h.html" title="FunctionHelper class interface.">FunctionHelper.h</a>&quot;</span>
<a name="l00019"></a>00019 
<a name="l00020"></a>00020 <span class="preprocessor">#include &lt;cmath&gt;</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include &lt;cassert&gt;</span>
<a name="l00022"></a>00022 
<a name="l00023"></a>00023 <span class="keyword">using</span> std::distance;
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 <span class="keyword">using</span> std::exp;
<a name="l00026"></a>00026 <span class="keyword">using</span> std::vector;
<a name="l00027"></a>00027 
<a name="l00028"></a>00028 <span class="keyword">namespace </span>{
<a name="l00031"></a>00031   <span class="keyword">enum</span> { <a class="code" href="namespacehippodraw_1_1Numeric.html#a2fc63b8199da4a6f45b4a9590fbab38f" title="Computes the two norm of the vector.">norm</a> = 0, mu = 1, sigma = 2 };
<a name="l00032"></a>00032 }
<a name="l00033"></a>00033 
<a name="l00034"></a>00034 <span class="keyword">using namespace </span>hippodraw;
<a name="l00035"></a>00035 
<a name="l00036"></a><a class="code" href="classhippodraw_1_1LogNormal.html#a688d8fa8b74d3c35a98028e9587461d2">00036</a> LogNormal::LogNormal ( )
<a name="l00037"></a>00037 {
<a name="l00038"></a>00038   <a class="code" href="classhippodraw_1_1LogNormal.html#a25a40b6614565f755233080a384c35f1" title="Initializes the function and parameter names.">initialize</a> ();
<a name="l00039"></a>00039 }
<a name="l00040"></a>00040 
<a name="l00041"></a><a class="code" href="classhippodraw_1_1LogNormal.html#a6a1cb67c0067e2ce7bc3d802217f9e55">00041</a> <a class="code" href="classhippodraw_1_1LogNormal.html#a688d8fa8b74d3c35a98028e9587461d2" title="The default constructor.">LogNormal::LogNormal</a> ( <span class="keywordtype">double</span> n, <span class="keywordtype">double</span> m, <span class="keywordtype">double</span> s )
<a name="l00042"></a>00042 {
<a name="l00043"></a>00043   <a class="code" href="classhippodraw_1_1LogNormal.html#a25a40b6614565f755233080a384c35f1" title="Initializes the function and parameter names.">initialize</a> ();
<a name="l00044"></a>00044   
<a name="l00045"></a>00045   <a class="code" href="classhippodraw_1_1FunctionBase.html#aa892dcf9755ccd651b666f353b723c34" title="The parameter values.">m_parms</a>[<a class="code" href="namespacehippodraw_1_1Numeric.html#a2fc63b8199da4a6f45b4a9590fbab38f" title="Computes the two norm of the vector.">norm</a>] = n;
<a name="l00046"></a>00046   <a class="code" href="classhippodraw_1_1FunctionBase.html#aa892dcf9755ccd651b666f353b723c34" title="The parameter values.">m_parms</a>[mu] = m;
<a name="l00047"></a>00047   <a class="code" href="classhippodraw_1_1FunctionBase.html#aa892dcf9755ccd651b666f353b723c34" title="The parameter values.">m_parms</a>[sigma] = s;
<a name="l00048"></a>00048 }
<a name="l00049"></a>00049 
<a name="l00050"></a><a class="code" href="classhippodraw_1_1LogNormal.html#a25a40b6614565f755233080a384c35f1">00050</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1LogNormal.html#a25a40b6614565f755233080a384c35f1" title="Initializes the function and parameter names.">LogNormal::initialize</a> ()
<a name="l00051"></a>00051 {
<a name="l00052"></a>00052   <a class="code" href="classhippodraw_1_1FunctionBase.html#adb41893ba19e889e56c559f25fc1a68a" title="The name of the function.">m_name</a> = <span class="stringliteral">&quot;LogNormal&quot;</span>;
<a name="l00053"></a>00053 
<a name="l00054"></a>00054   <a class="code" href="classhippodraw_1_1FunctionBase.html#a96bf64e362e48f2ad4ecd76c32e4bc54" title="The names of the function parameters.">m_parm_names</a>.push_back ( <span class="stringliteral">&quot;Norm&quot;</span> );
<a name="l00055"></a>00055   <a class="code" href="classhippodraw_1_1FunctionBase.html#a96bf64e362e48f2ad4ecd76c32e4bc54" title="The names of the function parameters.">m_parm_names</a>.push_back ( <span class="stringliteral">&quot;Mu&quot;</span> );
<a name="l00056"></a>00056   <a class="code" href="classhippodraw_1_1FunctionBase.html#a96bf64e362e48f2ad4ecd76c32e4bc54" title="The names of the function parameters.">m_parm_names</a>.push_back ( <span class="stringliteral">&quot;Sigma&quot;</span> );
<a name="l00057"></a>00057 
<a name="l00058"></a>00058   <a class="code" href="classhippodraw_1_1FunctionBase.html#a0fc3d585aa53859602ac79c9c421f2a9" title="Re-sizes the appropriate vectors maintained in this base class.">resize</a> ();
<a name="l00059"></a>00059 }
<a name="l00060"></a>00060 
<a name="l00061"></a><a class="code" href="classhippodraw_1_1LogNormal.html#a5e4b003c4faa8b7729e762445c7578d8">00061</a> <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="classhippodraw_1_1LogNormal.html#a5e4b003c4faa8b7729e762445c7578d8" title="Creates a new function object by copying an existing one.">LogNormal::clone</a> ()<span class="keyword"> const</span>
<a name="l00062"></a>00062 <span class="keyword"></span>{
<a name="l00063"></a>00063   <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classhippodraw_1_1LogNormal.html#a688d8fa8b74d3c35a98028e9587461d2" title="The default constructor.">LogNormal</a> ( *<span class="keyword">this</span> );
<a name="l00064"></a>00064 }
<a name="l00065"></a>00065 
<a name="l00066"></a><a class="code" href="classhippodraw_1_1LogNormal.html#a3a71b677f013fdbc07bdf5dd65ee5f27">00066</a> <span class="keywordtype">double</span> <a class="code" href="classhippodraw_1_1LogNormal.html#a3a71b677f013fdbc07bdf5dd65ee5f27" title="The function call operator.">LogNormal::operator () </a>( <span class="keywordtype">double</span> x )<span class="keyword"> const</span>
<a name="l00067"></a>00067 <span class="keyword"></span>{
<a name="l00068"></a>00068   <span class="keywordtype">double</span> t = ( log ( x ) - <a class="code" href="classhippodraw_1_1FunctionBase.html#aa892dcf9755ccd651b666f353b723c34" title="The parameter values.">m_parms</a>[mu] ) / <a class="code" href="classhippodraw_1_1FunctionBase.html#aa892dcf9755ccd651b666f353b723c34" title="The parameter values.">m_parms</a>[sigma];
<a name="l00069"></a>00069   <span class="keywordtype">double</span> result = <a class="code" href="classhippodraw_1_1FunctionBase.html#aa892dcf9755ccd651b666f353b723c34" title="The parameter values.">m_parms</a>[<a class="code" href="namespacehippodraw_1_1Numeric.html#a2fc63b8199da4a6f45b4a9590fbab38f" title="Computes the two norm of the vector.">norm</a>] * exp ( -0.5 * t*t );
<a name="l00070"></a>00070 
<a name="l00071"></a>00071   <span class="keywordflow">return</span> result;
<a name="l00072"></a>00072 }
<a name="l00073"></a>00073 
<a name="l00076"></a>00076 <span class="keywordtype">void</span> 
<a name="l00077"></a>00077 <a class="code" href="classhippodraw_1_1LogNormal.html#ac89ece7f0010b352e8d897f0a352f811">LogNormal::</a>
<a name="l00078"></a><a class="code" href="classhippodraw_1_1LogNormal.html#ac89ece7f0010b352e8d897f0a352f811">00078</a> <a class="code" href="classhippodraw_1_1LogNormal.html#ac89ece7f0010b352e8d897f0a352f811">initialParameters</a> ( <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="l00079"></a>00079 {
<a name="l00080"></a>00080   <a class="code" href="classhippodraw_1_1FunctionBase.html#aa892dcf9755ccd651b666f353b723c34" title="The parameter values.">m_parms</a>[<a class="code" href="namespacehippodraw_1_1Numeric.html#a2fc63b8199da4a6f45b4a9590fbab38f" title="Computes the two norm of the vector.">norm</a>] = 1.0;
<a name="l00081"></a>00081   <a class="code" href="classhippodraw_1_1FunctionBase.html#aa892dcf9755ccd651b666f353b723c34" title="The parameter values.">m_parms</a>[mu] =  log ( helper-&gt;<a class="code" href="classhippodraw_1_1FunctionHelper.html#a1402e98aa11796bfa8a52d5b8f4fc37b" title="Returns the mean of the coordinates along a X axis in the data set.">meanCoord</a> () );
<a name="l00082"></a>00082   <a class="code" href="classhippodraw_1_1FunctionBase.html#aa892dcf9755ccd651b666f353b723c34" title="The parameter values.">m_parms</a>[sigma] = 0.5;
<a name="l00083"></a>00083 }
<a name="l00084"></a>00084 
<a name="l00085"></a>00085 <span class="keywordtype">double</span>
<a name="l00086"></a>00086 <a class="code" href="classhippodraw_1_1LogNormal.html#a8617a1aa7536e4cb61f2a4ec29a39f36" title="Returns the function&amp;#39;s derivative at the coordinate value x with respect to the...">LogNormal::</a>
<a name="l00087"></a><a class="code" href="classhippodraw_1_1LogNormal.html#a8617a1aa7536e4cb61f2a4ec29a39f36">00087</a> <a class="code" href="classhippodraw_1_1LogNormal.html#a8617a1aa7536e4cb61f2a4ec29a39f36" title="Returns the function&amp;#39;s derivative at the coordinate value x with respect to the...">derivByParm</a> ( <span class="keywordtype">int</span> , <span class="keywordtype">double</span> )<span class="keyword"> const</span>
<a name="l00088"></a>00088 <span class="keyword"></span>{
<a name="l00089"></a>00089   assert ( <span class="keyword">false</span> );
<a name="l00090"></a>00090   <span class="keywordflow">return</span> 0.;
<a name="l00091"></a>00091 }
<a name="l00092"></a>00092 
<a name="l00093"></a>00093 <span class="keywordtype">bool</span>
<a name="l00094"></a>00094 <a class="code" href="classhippodraw_1_1LogNormal.html#a014f51d18e05dbf02fc11ea7245a03f8" title="Returns false as this function has not implemented calculation of partial derivatives...">LogNormal::</a>
<a name="l00095"></a><a class="code" href="classhippodraw_1_1LogNormal.html#a014f51d18e05dbf02fc11ea7245a03f8">00095</a> <a class="code" href="classhippodraw_1_1LogNormal.html#a014f51d18e05dbf02fc11ea7245a03f8" title="Returns false as this function has not implemented calculation of partial derivatives...">hasDerivatives</a> ()<span class="keyword"> const</span>
<a name="l00096"></a>00096 <span class="keyword"></span>{
<a name="l00097"></a>00097   <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00098"></a>00098 }
</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>