<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_6633238f5107fd0d748d9093e08c459d.html">minimizers</a> </div> </div> <div class="contents"> <h1>Fitter.cxx</h1><a href="Fitter_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">#include "<a class="code" href="Fitter_8h.html" title="hippodraw::Fitter class interface">Fitter.h</a>"</span> <a name="l00013"></a>00013 <a name="l00014"></a>00014 <span class="preprocessor">#include "<a class="code" href="StatedFCN_8h.html" title="hippodraw::StatedFCN class interface">StatedFCN.h</a>"</span> <a name="l00015"></a>00015 <a name="l00016"></a>00016 <span class="preprocessor">#include <climits></span> <a name="l00017"></a>00017 <span class="preprocessor">#include <cstdlib></span> <a name="l00018"></a>00018 <span class="preprocessor">#include <stdexcept></span> <a name="l00019"></a>00019 <a name="l00020"></a>00020 <span class="keyword">using</span> std::string; <a name="l00021"></a>00021 <span class="keyword">using</span> std::vector; <a name="l00022"></a>00022 <a name="l00023"></a>00023 <span class="keyword">using namespace </span>hippodraw; <a name="l00024"></a>00024 <a name="l00025"></a>00025 Fitter:: <a name="l00026"></a><a class="code" href="classhippodraw_1_1Fitter.html#a60c5d31430c281b2cb37ceb0242ff735">00026</a> Fitter ( <span class="keyword">const</span> <span class="keywordtype">char</span> * name ) <a name="l00027"></a>00027 : m_name ( name ), <a name="l00028"></a>00028 m_fcn ( 0 ), <a name="l00029"></a>00029 m_max_iterations ( 100 ) <a name="l00030"></a>00030 { <a name="l00031"></a>00031 } <a name="l00032"></a>00032 <a name="l00033"></a>00033 <a class="code" href="classhippodraw_1_1Fitter.html#a8edc4bd55da391c5340d06b92cac3a04" title="The copy constructor.">Fitter::</a> <a name="l00034"></a><a class="code" href="classhippodraw_1_1Fitter.html#a8edc4bd55da391c5340d06b92cac3a04">00034</a> <a class="code" href="classhippodraw_1_1Fitter.html#a8edc4bd55da391c5340d06b92cac3a04" title="The copy constructor.">Fitter</a> ( <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1Fitter.html" title="The base class for fitters.">Fitter</a> & fitter ) <a name="l00035"></a>00035 : m_name ( fitter.m_name ), <a name="l00036"></a>00036 m_max_iterations ( fitter.m_max_iterations ) <a name="l00037"></a>00037 { <a name="l00038"></a>00038 <span class="keywordflow">if</span> ( fitter.<a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> != 0 ) <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> = fitter.<a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> -> <a class="code" href="classhippodraw_1_1Fitter.html#a49797ee4ba71bccf2e03498bde9a89a7" title="Makes a copy of the receiving object.">clone</a> (); <a name="l00039"></a>00039 } <a name="l00040"></a>00040 <a name="l00041"></a>00041 <a class="code" href="classhippodraw_1_1Fitter.html#a4918e50aa35e17d26a8c7d90dc7aee56" title="The virtual destructor.">Fitter::</a> <a name="l00042"></a><a class="code" href="classhippodraw_1_1Fitter.html#a4918e50aa35e17d26a8c7d90dc7aee56">00042</a> <a class="code" href="classhippodraw_1_1Fitter.html#a4918e50aa35e17d26a8c7d90dc7aee56" title="The virtual destructor.">~Fitter</a> () <a name="l00043"></a>00043 { <a name="l00044"></a>00044 <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> != 0 ) <span class="keyword">delete</span> <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a>; <a name="l00045"></a>00045 } <a name="l00046"></a>00046 <a name="l00047"></a>00047 <span class="keywordtype">void</span> <a name="l00048"></a>00048 <a class="code" href="classhippodraw_1_1Fitter.html#ae7d8c0797a5ee009d0d3170ed2e9105f" title="Makes a copy of other.">Fitter::</a> <a name="l00049"></a><a class="code" href="classhippodraw_1_1Fitter.html#ae7d8c0797a5ee009d0d3170ed2e9105f">00049</a> <a class="code" href="classhippodraw_1_1Fitter.html#ae7d8c0797a5ee009d0d3170ed2e9105f" title="Makes a copy of other.">copyFrom</a> ( <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1Fitter.html" title="The base class for fitters.">Fitter</a> * fitter ) <a name="l00050"></a>00050 { <a name="l00051"></a>00051 <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> -> <a class="code" href="classhippodraw_1_1Fitter.html#ae7d8c0797a5ee009d0d3170ed2e9105f" title="Makes a copy of other.">copyFrom</a> ( fitter -> <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> ); <a name="l00052"></a>00052 } <a name="l00053"></a>00053 <a name="l00054"></a>00054 <span class="keyword">const</span> std::string & <a name="l00055"></a>00055 <a class="code" href="classhippodraw_1_1Fitter.html#af8370604529de0f829b8424e1288a104" title="Returns the name of the fitter.">Fitter::</a> <a name="l00056"></a><a class="code" href="classhippodraw_1_1Fitter.html#af8370604529de0f829b8424e1288a104">00056</a> <a class="code" href="classhippodraw_1_1Fitter.html#af8370604529de0f829b8424e1288a104" title="Returns the name of the fitter.">name</a> ()<span class="keyword"> const</span> <a name="l00057"></a>00057 <span class="keyword"></span>{ <a name="l00058"></a>00058 <span class="keywordflow">return</span> <a class="code" href="classhippodraw_1_1Fitter.html#adb41893ba19e889e56c559f25fc1a68a" title="The name of the fitter.">m_name</a>; <a name="l00059"></a>00059 } <a name="l00060"></a>00060 <a name="l00061"></a>00061 <span class="keywordtype">void</span> <a name="l00062"></a>00062 <a class="code" href="classhippodraw_1_1Fitter.html#a1164064b5cf02ebb921a5643a78b41f4" title="Sets the objective function object.">Fitter::</a> <a name="l00063"></a><a class="code" href="classhippodraw_1_1Fitter.html#a1164064b5cf02ebb921a5643a78b41f4">00063</a> <a class="code" href="classhippodraw_1_1Fitter.html#a1164064b5cf02ebb921a5643a78b41f4" title="Sets the objective function object.">setFCN</a> ( <a class="code" href="classhippodraw_1_1StatedFCN.html" title="A derived class for FCNBase class.">StatedFCN</a> * fcn ) <a name="l00064"></a>00064 { <a name="l00065"></a>00065 <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> != 0 ) <span class="keyword">delete</span> <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a>; <a name="l00066"></a>00066 <a name="l00067"></a>00067 <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> = fcn; <a name="l00068"></a>00068 } <a name="l00069"></a>00069 <a name="l00070"></a>00070 <a class="code" href="classhippodraw_1_1StatedFCN.html" title="A derived class for FCNBase class.">StatedFCN</a> * <a name="l00071"></a>00071 <a class="code" href="classhippodraw_1_1Fitter.html#af96a5a267a12c934ce39d73df7003f0d" title="Returns the objective function object.">Fitter::</a> <a name="l00072"></a><a class="code" href="classhippodraw_1_1Fitter.html#af96a5a267a12c934ce39d73df7003f0d">00072</a> <a class="code" href="classhippodraw_1_1Fitter.html#af96a5a267a12c934ce39d73df7003f0d" title="Returns the objective function object.">getFCN</a> () <a name="l00073"></a>00073 { <a name="l00074"></a>00074 <span class="keywordflow">return</span> <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a>; <a name="l00075"></a>00075 } <a name="l00076"></a>00076 <a name="l00077"></a>00077 <span class="keywordtype">bool</span> <a name="l00078"></a>00078 <a class="code" href="classhippodraw_1_1Fitter.html#afb07a512dba156a736e361e9ba19b065" title="Returns true if the function is compatible with the objective function.">Fitter::</a> <a name="l00079"></a><a class="code" href="classhippodraw_1_1Fitter.html#afb07a512dba156a736e361e9ba19b065">00079</a> <a class="code" href="classhippodraw_1_1Fitter.html#afb07a512dba156a736e361e9ba19b065" title="Returns true if the function is compatible with the objective function.">isCompatible</a> ( <span class="keyword">const</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> * function )<span class="keyword"> const</span> <a name="l00080"></a>00080 <span class="keyword"></span>{ <a name="l00081"></a>00081 <span class="keywordtype">bool</span> yes = <span class="keyword">false</span>; <a name="l00082"></a>00082 <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> != 0 ) { <a name="l00083"></a>00083 yes = <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> -> <a class="code" href="classhippodraw_1_1Fitter.html#afb07a512dba156a736e361e9ba19b065" title="Returns true if the function is compatible with the objective function.">isCompatible</a> ( function ); <a name="l00084"></a>00084 } <a name="l00085"></a>00085 <span class="keywordflow">return</span> yes; <a name="l00086"></a>00086 } <a name="l00087"></a>00087 <a name="l00088"></a>00088 <span class="keywordtype">void</span> <a name="l00089"></a>00089 <a class="code" href="classhippodraw_1_1Fitter.html#a65ce3c605e5795ae822acda0c0aab146" title="Sets the model function.">Fitter::</a> <a name="l00090"></a><a class="code" href="classhippodraw_1_1Fitter.html#a65ce3c605e5795ae822acda0c0aab146">00090</a> <a class="code" href="classhippodraw_1_1Fitter.html#a65ce3c605e5795ae822acda0c0aab146" title="Sets the model function.">setFunction</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> * function ) <a name="l00091"></a>00091 { <a name="l00092"></a>00092 <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> != 0 ) { <a name="l00093"></a>00093 <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> -> <a class="code" href="classhippodraw_1_1Fitter.html#a65ce3c605e5795ae822acda0c0aab146" title="Sets the model function.">setFunction</a> ( function ); <a name="l00094"></a>00094 } <a name="l00095"></a>00095 } <a name="l00096"></a>00096 <a name="l00097"></a>00097 <span class="keywordtype">void</span> <a name="l00098"></a>00098 <a class="code" href="classhippodraw_1_1Fitter.html#af5e61f87813b72805dbd38266f4d5a91" title="Sets the source of data to be used.">Fitter::</a> <a name="l00099"></a><a class="code" href="classhippodraw_1_1Fitter.html#af5e61f87813b72805dbd38266f4d5a91">00099</a> <a class="code" href="classhippodraw_1_1Fitter.html#af5e61f87813b72805dbd38266f4d5a91" title="Sets the source of data to be used.">setDataSource</a> ( <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1DataSource.html" title="Base class for DataSource.">DataSource</a> * source ) <a name="l00100"></a>00100 { <a name="l00101"></a>00101 <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> != 0 ) { <a name="l00102"></a>00102 <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> -> <a class="code" href="classhippodraw_1_1Fitter.html#af5e61f87813b72805dbd38266f4d5a91" title="Sets the source of data to be used.">setDataSource</a> ( source ); <a name="l00103"></a>00103 <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> -> <a class="code" href="classhippodraw_1_1Fitter.html#ab0b2626a4d61f7757eeb4422f305a97f" title="Sets the fitter to use error data from the DataSource, if available.">setUseErrors</a> (); <a name="l00104"></a>00104 } <a name="l00105"></a>00105 } <a name="l00106"></a>00106 <a name="l00107"></a>00107 <span class="keywordtype">void</span> <a name="l00108"></a>00108 <a class="code" href="classhippodraw_1_1Fitter.html#ab0b2626a4d61f7757eeb4422f305a97f" title="Sets the fitter to use error data from the DataSource, if available.">Fitter::</a> <a name="l00109"></a><a class="code" href="classhippodraw_1_1Fitter.html#ab0b2626a4d61f7757eeb4422f305a97f">00109</a> <a class="code" href="classhippodraw_1_1Fitter.html#ab0b2626a4d61f7757eeb4422f305a97f" title="Sets the fitter to use error data from the DataSource, if available.">setUseErrors</a> ( <span class="keywordtype">bool</span> yes ) <a name="l00110"></a>00110 { <a name="l00111"></a>00111 <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> != 0 ) { <a name="l00112"></a>00112 <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> -> <a class="code" href="classhippodraw_1_1Fitter.html#ab0b2626a4d61f7757eeb4422f305a97f" title="Sets the fitter to use error data from the DataSource, if available.">setUseErrors</a> ( yes ); <a name="l00113"></a>00113 } <a name="l00114"></a>00114 } <a name="l00115"></a>00115 <a name="l00116"></a>00116 <span class="keywordtype">bool</span> <a name="l00117"></a>00117 <a class="code" href="classhippodraw_1_1Fitter.html#a5db61f264b6fbebf40b61faedae06dc6" title="Returns true if error data from the DataSource will be used if available.">Fitter::</a> <a name="l00118"></a><a class="code" href="classhippodraw_1_1Fitter.html#a5db61f264b6fbebf40b61faedae06dc6">00118</a> <a class="code" href="classhippodraw_1_1Fitter.html#a5db61f264b6fbebf40b61faedae06dc6" title="Returns true if error data from the DataSource will be used if available.">getUseErrors</a> ()<span class="keyword"> const</span> <a name="l00119"></a>00119 <span class="keyword"></span>{ <a name="l00120"></a>00120 <span class="keywordtype">bool</span> yes = <span class="keyword">false</span>; <a name="l00121"></a>00121 <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> != 0 ) { <a name="l00122"></a>00122 yes = <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> -> <a class="code" href="classhippodraw_1_1Fitter.html#a5db61f264b6fbebf40b61faedae06dc6" title="Returns true if error data from the DataSource will be used if available.">getUseErrors</a> (); <a name="l00123"></a>00123 } <a name="l00124"></a>00124 <a name="l00125"></a>00125 <span class="keywordflow">return</span> yes; <a name="l00126"></a>00126 } <a name="l00127"></a>00127 <a name="l00128"></a>00128 <span class="keywordtype">bool</span> <a name="l00129"></a>00129 <a class="code" href="classhippodraw_1_1Fitter.html#a19687104100dbb1e3492a0952da14319" title="Returns true if the Fitter needs integrated intervals.">Fitter::</a> <a name="l00130"></a><a class="code" href="classhippodraw_1_1Fitter.html#a19687104100dbb1e3492a0952da14319">00130</a> <a class="code" href="classhippodraw_1_1Fitter.html#a19687104100dbb1e3492a0952da14319" title="Returns true if the Fitter needs integrated intervals.">needsIntegrated</a> ()<span class="keyword"> const</span> <a name="l00131"></a>00131 <span class="keyword"></span>{ <a name="l00132"></a>00132 <span class="keywordtype">bool</span> yes = <span class="keyword">true</span>; <a name="l00133"></a>00133 <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> != 0 ) { <a name="l00134"></a>00134 yes = <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> -> <a class="code" href="classhippodraw_1_1Fitter.html#a19687104100dbb1e3492a0952da14319" title="Returns true if the Fitter needs integrated intervals.">needsIntegrated</a> (); <a name="l00135"></a>00135 } <a name="l00136"></a>00136 <span class="keywordflow">return</span> yes; <a name="l00137"></a>00137 } <a name="l00138"></a>00138 <a name="l00139"></a>00139 <span class="keywordtype">void</span> <a name="l00140"></a>00140 <a class="code" href="classhippodraw_1_1Fitter.html#a5ff9860d858cb80f4db7e42c08b9df93" title="Fills the vector with the free parameters values.">Fitter::</a> <a name="l00141"></a><a class="code" href="classhippodraw_1_1Fitter.html#a5ff9860d858cb80f4db7e42c08b9df93">00141</a> <a class="code" href="classhippodraw_1_1Fitter.html#a5ff9860d858cb80f4db7e42c08b9df93" title="Fills the vector with the free parameters values.">fillFreeParameters</a> ( std::vector < double > & free_parms)<span class="keyword"> const</span> <a name="l00142"></a>00142 <span class="keyword"></span>{ <a name="l00143"></a>00143 <span class="keywordflow">return</span> <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> -> <a class="code" href="classhippodraw_1_1Fitter.html#a5ff9860d858cb80f4db7e42c08b9df93" title="Fills the vector with the free parameters values.">fillFreeParameters</a> ( free_parms ); <a name="l00144"></a>00144 } <a name="l00145"></a>00145 <a name="l00146"></a>00146 <span class="keywordtype">void</span> <a name="l00147"></a>00147 <a class="code" href="classhippodraw_1_1Fitter.html#ac50591297b951f99124f66a4b9b5e785" title="Sets the parameters that are to be held fixed during objective function minimization...">Fitter::</a> <a name="l00148"></a><a class="code" href="classhippodraw_1_1Fitter.html#ac50591297b951f99124f66a4b9b5e785">00148</a> <a class="code" href="classhippodraw_1_1Fitter.html#ac50591297b951f99124f66a4b9b5e785" title="Sets the parameters that are to be held fixed during objective function minimization...">setFixedFlags</a> ( <span class="keyword">const</span> std::vector < int > & flags ) <a name="l00149"></a>00149 { <a name="l00150"></a>00150 <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> -> <a class="code" href="classhippodraw_1_1Fitter.html#ac50591297b951f99124f66a4b9b5e785" title="Sets the parameters that are to be held fixed during objective function minimization...">setFixedFlags</a> ( flags ); <a name="l00151"></a>00151 } <a name="l00152"></a>00152 <a name="l00153"></a>00153 <span class="keyword">const</span> vector < int > & <a name="l00154"></a>00154 <a class="code" href="classhippodraw_1_1Fitter.html#a777e60f0c60999be4d87fa177c88977e" title="Sets the limits of the model function parameter values.">Fitter::</a> <a name="l00155"></a><a class="code" href="classhippodraw_1_1Fitter.html#a777e60f0c60999be4d87fa177c88977e">00155</a> <a class="code" href="classhippodraw_1_1Fitter.html#a777e60f0c60999be4d87fa177c88977e" title="Sets the limits of the model function parameter values.">getFixedFlags</a> ( )<span class="keyword"> const</span> <a name="l00156"></a>00156 <span class="keyword"></span>{ <a name="l00157"></a>00157 <span class="keywordflow">return</span> <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> -> <a class="code" href="classhippodraw_1_1Fitter.html#a777e60f0c60999be4d87fa177c88977e" title="Sets the limits of the model function parameter values.">getFixedFlags</a> (); <a name="l00158"></a>00158 } <a name="l00159"></a>00159 <a name="l00160"></a>00160 <span class="keywordtype">void</span> <a name="l00161"></a>00161 <a class="code" href="classhippodraw_1_1Fitter.html#a5500ef2b9a787bd77e5f0dbbc0591b5f" title="Sets the limits for the parameter of the model function indexed by i.">Fitter::</a> <a name="l00162"></a><a class="code" href="classhippodraw_1_1Fitter.html#a5500ef2b9a787bd77e5f0dbbc0591b5f">00162</a> <a class="code" href="classhippodraw_1_1Fitter.html#a5500ef2b9a787bd77e5f0dbbc0591b5f" title="Sets the limits for the parameter of the model function indexed by i.">setLimits</a> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span> ) <a name="l00163"></a>00163 { <a name="l00164"></a>00164 <span class="keywordtype">string</span> what ( <span class="stringliteral">"The "</span> ); <a name="l00165"></a>00165 what += <a class="code" href="classhippodraw_1_1Fitter.html#adb41893ba19e889e56c559f25fc1a68a" title="The name of the fitter.">m_name</a>; <a name="l00166"></a>00166 what += <span class="stringliteral">" minimizer does not support limits on parameters"</span>; <a name="l00167"></a>00167 <span class="keywordflow">throw</span> std::runtime_error ( what ); <a name="l00168"></a>00168 } <a name="l00169"></a>00169 <a name="l00170"></a>00170 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a name="l00171"></a>00171 <a class="code" href="classhippodraw_1_1Fitter.html#a677c73c54ea62dc9fc5613ecf1f91af9" title="Returns the index to the model function parameters name.">Fitter::</a> <a name="l00172"></a><a class="code" href="classhippodraw_1_1Fitter.html#a677c73c54ea62dc9fc5613ecf1f91af9">00172</a> <a class="code" href="classhippodraw_1_1Fitter.html#a677c73c54ea62dc9fc5613ecf1f91af9" title="Returns the index to the model function parameters name.">getParameterIndex</a> ( <span class="keyword">const</span> std::string & name ) <a name="l00173"></a>00173 { <a name="l00174"></a>00174 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> index = UINT_MAX; <a name="l00175"></a>00175 <span class="keyword">const</span> vector < string > & names = <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> -> getParmNames (); <a name="l00176"></a>00176 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="namespacenum__util.html#a137f48a49d12a7dae8ba7c86db2a0c01">size</a> = names.size(); <a name="l00177"></a>00177 <span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i < size; i++ ) { <a name="l00178"></a>00178 <span class="keyword">const</span> <span class="keywordtype">string</span> & pname = names [i]; <a name="l00179"></a>00179 <span class="keywordflow">if</span> ( pname == name ) { <a name="l00180"></a>00180 index = i; <a name="l00181"></a>00181 <span class="keywordflow">break</span>; <a name="l00182"></a>00182 } <a name="l00183"></a>00183 } <a name="l00184"></a>00184 <span class="keywordflow">if</span> ( index == UINT_MAX ) { <a name="l00185"></a>00185 <span class="keywordtype">string</span> what ( <span class="stringliteral">"No parameter named `"</span> ); <a name="l00186"></a>00186 what += name; <a name="l00187"></a>00187 what += <span class="stringliteral">"' for this function."</span>; <a name="l00188"></a>00188 <span class="keywordflow">throw</span> std::runtime_error ( what ); <a name="l00189"></a>00189 } <a name="l00190"></a>00190 <a name="l00191"></a>00191 <span class="keywordflow">return</span> index; <a name="l00192"></a>00192 } <a name="l00193"></a>00193 <a name="l00194"></a>00194 <span class="keywordtype">void</span> <a name="l00195"></a>00195 <a class="code" href="classhippodraw_1_1Fitter.html#a5500ef2b9a787bd77e5f0dbbc0591b5f" title="Sets the limits for the parameter of the model function indexed by i.">Fitter::</a> <a name="l00196"></a><a class="code" href="classhippodraw_1_1Fitter.html#a849b3c78f5f3a5e9b187d926ee28839e">00196</a> <a class="code" href="classhippodraw_1_1Fitter.html#a5500ef2b9a787bd77e5f0dbbc0591b5f" title="Sets the limits for the parameter of the model function indexed by i.">setLimits</a> ( <span class="keyword">const</span> std::string & name, <span class="keywordtype">double</span> lower, <span class="keywordtype">double</span> upper ) <a name="l00197"></a>00197 { <a name="l00198"></a>00198 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> index = <a class="code" href="classhippodraw_1_1Fitter.html#a677c73c54ea62dc9fc5613ecf1f91af9" title="Returns the index to the model function parameters name.">getParameterIndex</a> ( name ); <a name="l00199"></a>00199 <a class="code" href="classhippodraw_1_1Fitter.html#a5500ef2b9a787bd77e5f0dbbc0591b5f" title="Sets the limits for the parameter of the model function indexed by i.">setLimits</a> ( index, lower, upper ); <a name="l00200"></a>00200 } <a name="l00201"></a>00201 <a name="l00202"></a>00202 <span class="keywordtype">void</span> <a name="l00203"></a>00203 <a class="code" href="classhippodraw_1_1Fitter.html#a1bf21edfa7650b8451f18707b00b210c" title="Sets the step size for parameter of the minimization.">Fitter::</a> <a name="l00204"></a><a class="code" href="classhippodraw_1_1Fitter.html#a1bf21edfa7650b8451f18707b00b210c">00204</a> <a class="code" href="classhippodraw_1_1Fitter.html#a1bf21edfa7650b8451f18707b00b210c" title="Sets the step size for parameter of the minimization.">setStepSize</a> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, <span class="keywordtype">double</span> ) <a name="l00205"></a>00205 { <a name="l00206"></a>00206 <span class="keywordtype">string</span> what ( <span class="stringliteral">"This "</span> ); <a name="l00207"></a>00207 what += <a class="code" href="classhippodraw_1_1Fitter.html#adb41893ba19e889e56c559f25fc1a68a" title="The name of the fitter.">m_name</a>; <a name="l00208"></a>00208 what += <span class="stringliteral">" minimizer does not support setting step size."</span>; <a name="l00209"></a>00209 <span class="keywordflow">throw</span> std::runtime_error ( what ); <a name="l00210"></a>00210 } <a name="l00211"></a>00211 <a name="l00212"></a>00212 <span class="keywordtype">void</span> <a name="l00213"></a>00213 <a class="code" href="classhippodraw_1_1Fitter.html#a1bf21edfa7650b8451f18707b00b210c" title="Sets the step size for parameter of the minimization.">Fitter::</a> <a name="l00214"></a><a class="code" href="classhippodraw_1_1Fitter.html#a721f43136d1cfb49830da38a0fd696e1">00214</a> <a class="code" href="classhippodraw_1_1Fitter.html#a1bf21edfa7650b8451f18707b00b210c" title="Sets the step size for parameter of the minimization.">setStepSize</a> ( <span class="keyword">const</span> std::string & name, <span class="keywordtype">double</span> <a class="code" href="namespacenum__util.html#a137f48a49d12a7dae8ba7c86db2a0c01">size</a> ) <a name="l00215"></a>00215 { <a name="l00216"></a>00216 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> index = <a class="code" href="classhippodraw_1_1Fitter.html#a677c73c54ea62dc9fc5613ecf1f91af9" title="Returns the index to the model function parameters name.">getParameterIndex</a> ( name ); <a name="l00217"></a>00217 <a class="code" href="classhippodraw_1_1Fitter.html#a1bf21edfa7650b8451f18707b00b210c" title="Sets the step size for parameter of the minimization.">setStepSize</a> ( index, size ); <a name="l00218"></a>00218 } <a name="l00219"></a>00219 <a name="l00220"></a>00220 <span class="keywordtype">double</span> <a name="l00221"></a><a class="code" href="classhippodraw_1_1Fitter.html#a35d807e079d04d56ca61b604d49deae8">00221</a> <a class="code" href="classhippodraw_1_1Fitter.html#a35d807e079d04d56ca61b604d49deae8" title="Calculates the value of the objective function at the current set of parameters.">Fitter::objectiveValue</a> ()<span class="keyword"> const</span> <a name="l00222"></a>00222 <span class="keyword"></span>{ <a name="l00223"></a>00223 <span class="keywordflow">return</span> <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> -> <a class="code" href="classhippodraw_1_1Fitter.html#a35d807e079d04d56ca61b604d49deae8" title="Calculates the value of the objective function at the current set of parameters.">objectiveValue</a> (); <a name="l00224"></a>00224 } <a name="l00225"></a>00225 <a name="l00226"></a>00226 <span class="keywordtype">int</span> <a name="l00227"></a>00227 <a class="code" href="classhippodraw_1_1Fitter.html#abb9b6e0a214042e968b50f9925572d0d" title="Returns the number of degrees of freedom in the fit.">Fitter::</a> <a name="l00228"></a><a class="code" href="classhippodraw_1_1Fitter.html#abb9b6e0a214042e968b50f9925572d0d">00228</a> <a class="code" href="classhippodraw_1_1Fitter.html#abb9b6e0a214042e968b50f9925572d0d" title="Returns the number of degrees of freedom in the fit.">calcDegreesOfFreedom</a> ()<span class="keyword"> const</span> <a name="l00229"></a>00229 <span class="keyword"></span>{ <a name="l00230"></a>00230 <span class="keywordflow">return</span> <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> -> degreesOfFreedom(); <a name="l00231"></a>00231 } <a name="l00232"></a>00232 <a name="l00233"></a>00233 <span class="keywordtype">int</span> <a name="l00234"></a>00234 <a class="code" href="classhippodraw_1_1Fitter.html#a3ca477145d995d896e7cdce3d23a8c0d" title="Calculates the covariance matrix.">Fitter::</a> <a name="l00235"></a><a class="code" href="classhippodraw_1_1Fitter.html#a3ca477145d995d896e7cdce3d23a8c0d">00235</a> <a class="code" href="classhippodraw_1_1Fitter.html#a3ca477145d995d896e7cdce3d23a8c0d" title="Calculates the covariance matrix.">calcCovariance</a> ( std::vector < std::vector < double > > & ) <a name="l00236"></a>00236 { <a name="l00237"></a>00237 <span class="keywordflow">return</span> EXIT_FAILURE; <a name="l00238"></a>00238 } <a name="l00239"></a>00239 <a name="l00240"></a>00240 <span class="keywordtype">void</span> <a name="l00241"></a>00241 <a class="code" href="classhippodraw_1_1Fitter.html#af6777101133629cf4ec9665cb87692bf" title="Sets the cut to limit range of fitting.">Fitter::</a> <a name="l00242"></a><a class="code" href="classhippodraw_1_1Fitter.html#af6777101133629cf4ec9665cb87692bf">00242</a> <a class="code" href="classhippodraw_1_1Fitter.html#af6777101133629cf4ec9665cb87692bf" title="Sets the cut to limit range of fitting.">setFitCut</a> ( <a class="code" href="classhippodraw_1_1TupleCut.html" title="The class expresses a cut on a DataSource, i.e.">TupleCut</a> * cut ) <a name="l00243"></a>00243 { <a name="l00244"></a>00244 <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> -> <a class="code" href="classhippodraw_1_1Fitter.html#af6777101133629cf4ec9665cb87692bf" title="Sets the cut to limit range of fitting.">setFitCut</a> ( cut ); <a name="l00245"></a>00245 } <a name="l00246"></a>00246 <a name="l00247"></a>00247 <span class="keywordtype">void</span> <a name="l00248"></a>00248 <a class="code" href="classhippodraw_1_1Fitter.html#ae9ffca067177b475c7b4d334a9e0ecec" title="Sets use of a fitting range on or off.">Fitter::</a> <a name="l00249"></a><a class="code" href="classhippodraw_1_1Fitter.html#ae9ffca067177b475c7b4d334a9e0ecec">00249</a> <a class="code" href="classhippodraw_1_1Fitter.html#ae9ffca067177b475c7b4d334a9e0ecec" title="Sets use of a fitting range on or off.">setFitRange</a> ( <span class="keywordtype">bool</span> yes ) <a name="l00250"></a>00250 { <a name="l00251"></a>00251 <a class="code" href="classhippodraw_1_1Fitter.html#a1f88348dd4b35c18128ec042fea57ee2" title="The objective function.">m_fcn</a> -> <a class="code" href="classhippodraw_1_1Fitter.html#ae9ffca067177b475c7b4d334a9e0ecec" title="Sets use of a fitting range on or off.">setFitRange</a> ( yes ); <a name="l00252"></a>00252 } </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>