Sophie

Sophie

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

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>LinearSumFunction.cxx</h1><a href="LinearSumFunction_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="LinearSumFunction_8h.html" title="hippodraw::LinearSumFunction class interface">LinearSumFunction.h</a>&quot;</span>
<a name="l00017"></a>00017 
<a name="l00018"></a>00018 <span class="preprocessor">#include &quot;<a class="code" href="string__convert_8h.html" title="The namespace for conversion to string.">pattern/string_convert.h</a>&quot;</span>
<a name="l00019"></a>00019 
<a name="l00020"></a>00020 <span class="preprocessor">#include &lt;cassert&gt;</span>
<a name="l00021"></a>00021 
<a name="l00022"></a>00022 <span class="preprocessor">#ifdef ITERATOR_MEMBER_DEFECT</span>
<a name="l00023"></a>00023 <span class="preprocessor"></span><span class="keyword">using namespace </span>std;
<a name="l00024"></a>00024 <span class="preprocessor">#else</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="keyword">using</span> std::vector;
<a name="l00026"></a>00026 <span class="keyword">using</span> std::string;
<a name="l00027"></a>00027 <span class="preprocessor">#endif</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span>
<a name="l00029"></a>00029 <span class="keyword">using namespace </span>hippodraw;
<a name="l00030"></a>00030 
<a name="l00031"></a><a class="code" href="classhippodraw_1_1LinearSumFunction.html#ac24d0b79c08f704a34e370c003a12897">00031</a> LinearSumFunction::LinearSumFunction ( )
<a name="l00032"></a>00032 {
<a name="l00033"></a>00033   <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a25a40b6614565f755233080a384c35f1" title="Initializes the function and parameter names.">initialize</a> ();
<a name="l00034"></a>00034 }
<a name="l00035"></a>00035 
<a name="l00036"></a>00036 <a class="code" href="classhippodraw_1_1LinearSumFunction.html#ac24d0b79c08f704a34e370c003a12897" title="The default constructor.">LinearSumFunction::</a>
<a name="l00037"></a><a class="code" href="classhippodraw_1_1LinearSumFunction.html#a744f2d25e08c16bc77990974eedbad3a">00037</a> <a class="code" href="classhippodraw_1_1LinearSumFunction.html#ac24d0b79c08f704a34e370c003a12897" title="The default constructor.">LinearSumFunction</a> ( <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1LinearSumFunction.html" title="A function that can be used with a fitter.">LinearSumFunction</a> &amp; old )
<a name="l00038"></a>00038   : <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="l00039"></a>00039 {
<a name="l00040"></a>00040   FunctionList_t::const_iterator it = old.<a class="code" href="classhippodraw_1_1LinearSumFunction.html#a99e59d1550fcf6d9fc8a184713e4be5a">m_functions</a>.begin();
<a name="l00041"></a>00041   <span class="keywordflow">while</span> ( it != old.<a class="code" href="classhippodraw_1_1LinearSumFunction.html#a99e59d1550fcf6d9fc8a184713e4be5a">m_functions</a>.end() ) {
<a name="l00042"></a>00042     <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 = (*it)-&gt;clone ();
<a name="l00043"></a>00043     <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a99e59d1550fcf6d9fc8a184713e4be5a">m_functions</a>.push_back ( function );
<a name="l00044"></a>00044   }
<a name="l00045"></a>00045 
<a name="l00046"></a>00046   <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a25a40b6614565f755233080a384c35f1" title="Initializes the function and parameter names.">initialize</a> ();
<a name="l00047"></a>00047 }
<a name="l00048"></a>00048 
<a name="l00049"></a><a class="code" href="classhippodraw_1_1LinearSumFunction.html#a25a40b6614565f755233080a384c35f1">00049</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a25a40b6614565f755233080a384c35f1" title="Initializes the function and parameter names.">LinearSumFunction::initialize</a> ()
<a name="l00050"></a>00050 {
<a name="l00051"></a>00051   <a class="code" href="classhippodraw_1_1FunctionBase.html#adb41893ba19e889e56c559f25fc1a68a" title="The name of the function.">m_name</a> = <span class="stringliteral">&quot;Linear Sum&quot;</span>;
<a name="l00052"></a>00052 }
<a name="l00053"></a>00053 
<a name="l00054"></a><a class="code" href="classhippodraw_1_1LinearSumFunction.html#a5e4b003c4faa8b7729e762445c7578d8">00054</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_1LinearSumFunction.html#a5e4b003c4faa8b7729e762445c7578d8" title="Creates a new function object by copying an existing one.">LinearSumFunction::clone</a> ()<span class="keyword"> const</span>
<a name="l00055"></a>00055 <span class="keyword"></span>{
<a name="l00056"></a>00056 
<a name="l00057"></a>00057   <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classhippodraw_1_1LinearSumFunction.html#ac24d0b79c08f704a34e370c003a12897" title="The default constructor.">LinearSumFunction</a> ( *<span class="keyword">this</span> );
<a name="l00058"></a>00058 }
<a name="l00059"></a>00059 
<a name="l00060"></a><a class="code" href="classhippodraw_1_1LinearSumFunction.html#a5cd61d6494588c53f64ea1b4497a58e8">00060</a> <span class="keyword">const</span> vector &lt; string &gt; &amp; <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a5cd61d6494588c53f64ea1b4497a58e8" title="Returns a reference to a vector of parameter names.">LinearSumFunction::parmNames</a>()<span class="keyword"> const</span>
<a name="l00061"></a>00061 <span class="keyword"></span>{
<a name="l00062"></a>00062   <a class="code" href="classhippodraw_1_1LinearSumFunction.html" title="A function that can be used with a fitter.">LinearSumFunction</a> * <span class="keyword">self</span> = const_cast &lt; <a class="code" href="classhippodraw_1_1LinearSumFunction.html" title="A function that can be used with a fitter.">LinearSumFunction</a> * &gt; ( this );
<a name="l00063"></a>00063 
<a name="l00064"></a>00064   <span class="keyword">self</span>-&gt;m_parm_names.clear();
<a name="l00065"></a>00065 
<a name="l00066"></a>00066   <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> f_size = <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a99e59d1550fcf6d9fc8a184713e4be5a">m_functions</a>.size ();
<a name="l00067"></a>00067   <span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; f_size; i++ ) {
<a name="l00068"></a>00068     <span class="keywordtype">string</span> suffix ( <span class="stringliteral">&quot;-&quot;</span> );
<a name="l00069"></a>00069     suffix += <a class="code" href="namespacehippodraw_1_1Axes.html#ae2337bddf33bc8b17dd5c08e665422cd" title="Converts from string representation ot Axes::Type representation.">String::convert</a> ( i );
<a name="l00070"></a>00070 
<a name="l00071"></a>00071     <span class="keyword">const</span> vector&lt; string &gt; &amp; names = <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a99e59d1550fcf6d9fc8a184713e4be5a">m_functions</a>[i] -&gt; <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a5cd61d6494588c53f64ea1b4497a58e8" title="Returns a reference to a vector of parameter names.">parmNames</a> ();
<a name="l00072"></a>00072     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> n_size = names.size ();
<a name="l00073"></a>00073     <span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j = 0; j &lt; n_size; j++ ) {
<a name="l00074"></a>00074       <span class="keywordtype">string</span> <a class="code" href="classhippodraw_1_1FunctionBase.html#a11c23a386abb9eb8a42f0c2c2835d640" title="Returns the name of the function.">name</a> = names [j];
<a name="l00075"></a>00075       name += suffix;
<a name="l00076"></a>00076       <span class="keyword">self</span> -&gt; <a class="code" href="classhippodraw_1_1FunctionBase.html#a96bf64e362e48f2ad4ecd76c32e4bc54" title="The names of the function parameters.">m_parm_names</a>.push_back ( name );
<a name="l00077"></a>00077     }
<a name="l00078"></a>00078   }
<a name="l00079"></a>00079 
<a name="l00080"></a>00080   <span class="keywordflow">return</span> <a class="code" href="classhippodraw_1_1FunctionBase.html#a96bf64e362e48f2ad4ecd76c32e4bc54" title="The names of the function parameters.">m_parm_names</a>;
<a name="l00081"></a>00081 }
<a name="l00082"></a>00082 
<a name="l00083"></a><a class="code" href="classhippodraw_1_1LinearSumFunction.html#ab6d95a533aca7f862becee6eca151a68">00083</a> <span class="keyword">const</span> vector&lt;double&gt; &amp; <a class="code" href="classhippodraw_1_1LinearSumFunction.html#ab6d95a533aca7f862becee6eca151a68" title="Returns the values of the parameters as a vector.">LinearSumFunction::getParameters</a> ()<span class="keyword"> const</span>
<a name="l00084"></a>00084 <span class="keyword"></span>{
<a name="l00085"></a>00085   <a class="code" href="classhippodraw_1_1LinearSumFunction.html" title="A function that can be used with a fitter.">LinearSumFunction</a>  * p = const_cast &lt; <a class="code" href="classhippodraw_1_1LinearSumFunction.html" title="A function that can be used with a fitter.">LinearSumFunction</a> * &gt; ( this );
<a name="l00086"></a>00086   p-&gt;<a class="code" href="classhippodraw_1_1FunctionBase.html#aa892dcf9755ccd651b666f353b723c34" title="The parameter values.">m_parms</a>.clear ();
<a name="l00087"></a>00087   FunctionList_t::const_iterator it = <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a99e59d1550fcf6d9fc8a184713e4be5a">m_functions</a>.begin ();
<a name="l00088"></a>00088   <span class="keywordflow">for</span> ( ; it != <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a99e59d1550fcf6d9fc8a184713e4be5a">m_functions</a>.end (); ++it ) {
<a name="l00089"></a>00089     <span class="keyword">const</span> vector&lt;double&gt; &amp; vals = (*it)-&gt;getParameters ();
<a name="l00090"></a>00090     p-&gt;<a class="code" href="classhippodraw_1_1FunctionBase.html#aa892dcf9755ccd651b666f353b723c34" title="The parameter values.">m_parms</a>.insert ( p-&gt;<a class="code" href="classhippodraw_1_1FunctionBase.html#aa892dcf9755ccd651b666f353b723c34" title="The parameter values.">m_parms</a>.end (), vals.begin(), vals.end () ); 
<a name="l00091"></a>00091   }
<a name="l00092"></a>00092   <span class="keywordflow">return</span> <a class="code" href="classhippodraw_1_1FunctionBase.html#aa892dcf9755ccd651b666f353b723c34" title="The parameter values.">m_parms</a>;
<a name="l00093"></a>00093 }
<a name="l00094"></a>00094 
<a name="l00095"></a>00095 
<a name="l00096"></a>00096 vector&lt; double &gt;::const_iterator
<a name="l00097"></a>00097 <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a893adb244f76732ad5c1c46066ae1463" title="Sets the parameter values to the value pointed to by the iterator.">LinearSumFunction::</a>
<a name="l00098"></a><a class="code" href="classhippodraw_1_1LinearSumFunction.html#a893adb244f76732ad5c1c46066ae1463">00098</a> <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a893adb244f76732ad5c1c46066ae1463" title="Sets the parameter values to the value pointed to by the iterator.">setParameters</a> ( std::vector&lt; double &gt;::const_iterator it )
<a name="l00099"></a>00099 {
<a name="l00100"></a>00100   FunctionList_t::iterator fit = <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a99e59d1550fcf6d9fc8a184713e4be5a">m_functions</a>.begin();
<a name="l00101"></a>00101 
<a name="l00102"></a>00102   <span class="keywordflow">for</span> ( ;fit != <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a99e59d1550fcf6d9fc8a184713e4be5a">m_functions</a>.end (); ++fit ) {
<a name="l00103"></a>00103     it = (*fit)-&gt;setParameters ( it );
<a name="l00104"></a>00104   }
<a name="l00105"></a>00105 
<a name="l00106"></a>00106   <span class="keywordflow">return</span> it;
<a name="l00107"></a>00107 }
<a name="l00108"></a>00108 
<a name="l00109"></a>00109 
<a name="l00110"></a><a class="code" href="classhippodraw_1_1LinearSumFunction.html#a8617a1aa7536e4cb61f2a4ec29a39f36">00110</a> <span class="keywordtype">double</span> <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a8617a1aa7536e4cb61f2a4ec29a39f36" title="Returns the function&amp;#39;s derivative at the coordinate value x with respect to the...">LinearSumFunction::derivByParm</a> ( <span class="keywordtype">int</span> index, <span class="keywordtype">double</span> x )<span class="keyword"> const</span>
<a name="l00111"></a>00111 <span class="keyword"></span>{
<a name="l00112"></a>00112   <span class="keywordtype">double</span> value = 0;
<a name="l00113"></a>00113   <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numf = <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a99e59d1550fcf6d9fc8a184713e4be5a">m_functions</a>.size ();
<a name="l00114"></a>00114   <span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; numf; i++ ) {
<a name="l00115"></a>00115     <span class="keywordtype">int</span> <a class="code" href="classhippodraw_1_1LinearSumFunction.html#ab8e4e3e2a7bf18888b71bdf9dda0770b" title="Returns the number of parameters.">size</a> = <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a99e59d1550fcf6d9fc8a184713e4be5a">m_functions</a> [i] -&gt; <a class="code" href="classhippodraw_1_1LinearSumFunction.html#ab8e4e3e2a7bf18888b71bdf9dda0770b" title="Returns the number of parameters.">size</a> ();
<a name="l00116"></a>00116     <span class="keywordflow">if</span> ( index &lt; size ) {
<a name="l00117"></a>00117       value = <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a99e59d1550fcf6d9fc8a184713e4be5a">m_functions</a> [i] -&gt; <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a8617a1aa7536e4cb61f2a4ec29a39f36" title="Returns the function&amp;#39;s derivative at the coordinate value x with respect to the...">derivByParm</a> ( index, x );
<a name="l00118"></a>00118       <span class="keywordflow">break</span>;
<a name="l00119"></a>00119     }
<a name="l00120"></a>00120     <span class="keywordflow">else</span> {
<a name="l00121"></a>00121       index -= size;
<a name="l00122"></a>00122     }
<a name="l00123"></a>00123   }
<a name="l00124"></a>00124 
<a name="l00125"></a>00125   <span class="keywordflow">return</span> value;
<a name="l00126"></a>00126 }
<a name="l00127"></a>00127 
<a name="l00128"></a><a class="code" href="classhippodraw_1_1LinearSumFunction.html#a9ba94da7db769b98d02381d872dd9bbb">00128</a> <span class="keywordtype">int</span> <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a9ba94da7db769b98d02381d872dd9bbb" title="Returns the number of functions that are a part of this composite.">LinearSumFunction::count</a> ()
<a name="l00129"></a>00129 {
<a name="l00130"></a>00130   <span class="keywordflow">return</span> <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a99e59d1550fcf6d9fc8a184713e4be5a">m_functions</a>.size();
<a name="l00131"></a>00131 }
<a name="l00132"></a>00132 
<a name="l00133"></a>00133 <span class="keywordtype">int</span>
<a name="l00134"></a>00134 <a class="code" href="classhippodraw_1_1LinearSumFunction.html#ab8e4e3e2a7bf18888b71bdf9dda0770b" title="Returns the number of parameters.">LinearSumFunction::</a>
<a name="l00135"></a><a class="code" href="classhippodraw_1_1LinearSumFunction.html#ab8e4e3e2a7bf18888b71bdf9dda0770b">00135</a> <a class="code" href="classhippodraw_1_1LinearSumFunction.html#ab8e4e3e2a7bf18888b71bdf9dda0770b" title="Returns the number of parameters.">size</a> ()<span class="keyword"> const</span>
<a name="l00136"></a>00136 <span class="keyword"></span>{
<a name="l00137"></a>00137   <span class="keywordtype">int</span> number = 0;
<a name="l00138"></a>00138   <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numf = <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a99e59d1550fcf6d9fc8a184713e4be5a">m_functions</a>.size ();
<a name="l00139"></a>00139 
<a name="l00140"></a>00140   <span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; numf; i++ ) {
<a name="l00141"></a>00141     <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 = <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a99e59d1550fcf6d9fc8a184713e4be5a">m_functions</a> [i];
<a name="l00142"></a>00142     number += function -&gt; <a class="code" href="classhippodraw_1_1LinearSumFunction.html#ab8e4e3e2a7bf18888b71bdf9dda0770b" title="Returns the number of parameters.">size</a> ();
<a name="l00143"></a>00143   }
<a name="l00144"></a>00144 
<a name="l00145"></a>00145   <span class="keywordflow">return</span> number;
<a name="l00146"></a>00146 }
<a name="l00147"></a>00147 
<a name="l00148"></a><a class="code" href="classhippodraw_1_1LinearSumFunction.html#af5ca0e3b3f772eb5785976bf9f8975c9">00148</a> <span class="keywordtype">bool</span> <a class="code" href="classhippodraw_1_1LinearSumFunction.html#af5ca0e3b3f772eb5785976bf9f8975c9" title="Returns true.">LinearSumFunction::isComposite</a> ()<span class="keyword"> const</span>
<a name="l00149"></a>00149 <span class="keyword"></span>{
<a name="l00150"></a>00150   <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00151"></a>00151 }
<a name="l00152"></a>00152 
<a name="l00153"></a><a class="code" href="classhippodraw_1_1LinearSumFunction.html#aff0ce151e66257591a964e347d330b1a">00153</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1LinearSumFunction.html#aff0ce151e66257591a964e347d330b1a" title="Adds the function to the linear sum of functions.">LinearSumFunction:: addToComposite</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="l00154"></a>00154 {
<a name="l00155"></a>00155   <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a99e59d1550fcf6d9fc8a184713e4be5a">m_functions</a>.push_back ( function );
<a name="l00156"></a>00156 }
<a name="l00157"></a>00157 
<a name="l00158"></a>00158 <span class="keywordtype">void</span>
<a name="l00159"></a>00159 <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a6b7a91fdf914a37fc34b8996e862528d" title="Removes the function from the linear sum of functions.">LinearSumFunction::</a>
<a name="l00160"></a><a class="code" href="classhippodraw_1_1LinearSumFunction.html#a6b7a91fdf914a37fc34b8996e862528d">00160</a> <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a6b7a91fdf914a37fc34b8996e862528d" title="Removes the function from the linear sum of functions.">removeFromComposite</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="l00161"></a>00161 {
<a name="l00162"></a>00162   FunctionList_t::iterator it = <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a99e59d1550fcf6d9fc8a184713e4be5a">m_functions</a>.begin ();
<a name="l00163"></a>00163 
<a name="l00164"></a>00164   <span class="keywordflow">while</span> ( it != <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a99e59d1550fcf6d9fc8a184713e4be5a">m_functions</a>.end () ) {
<a name="l00165"></a>00165     <span class="keywordflow">if</span> ( (*it) == function ){
<a name="l00166"></a>00166       it = <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a99e59d1550fcf6d9fc8a184713e4be5a">m_functions</a>.erase ( it );
<a name="l00167"></a>00167     }
<a name="l00168"></a>00168     <span class="keywordflow">else</span>{
<a name="l00169"></a>00169       it ++;
<a name="l00170"></a>00170     }
<a name="l00171"></a>00171   }
<a name="l00172"></a>00172 }
<a name="l00173"></a>00173 
<a name="l00174"></a><a class="code" href="classhippodraw_1_1LinearSumFunction.html#a3a71b677f013fdbc07bdf5dd65ee5f27">00174</a> <span class="keywordtype">double</span> <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a3a71b677f013fdbc07bdf5dd65ee5f27" title="The function call operator.">LinearSumFunction::operator () </a>( <span class="keywordtype">double</span> x )<span class="keyword"> const</span>
<a name="l00175"></a>00175 <span class="keyword"></span>{
<a name="l00176"></a>00176   <span class="keywordtype">double</span> sum = 0.0;
<a name="l00177"></a>00177   FunctionList_t::const_iterator it = <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a99e59d1550fcf6d9fc8a184713e4be5a">m_functions</a>.begin ();
<a name="l00178"></a>00178 
<a name="l00179"></a>00179   <span class="keywordflow">for</span> ( ; it != <a class="code" href="classhippodraw_1_1LinearSumFunction.html#a99e59d1550fcf6d9fc8a184713e4be5a">m_functions</a>.end (); ++it ) {
<a name="l00180"></a>00180     sum += (*it)-&gt;operator () ( x );
<a name="l00181"></a>00181   }
<a name="l00182"></a>00182   <span class="keywordflow">return</span> sum;
<a name="l00183"></a>00183 }
<a name="l00184"></a>00184 
<a name="l00185"></a>00185 <span class="keywordtype">void</span> 
<a name="l00186"></a>00186 <a class="code" href="classhippodraw_1_1LinearSumFunction.html#ac89ece7f0010b352e8d897f0a352f811" title="Sets the FunctionHelper so that the function can calculate a reasonable set of initial...">LinearSumFunction::</a>
<a name="l00187"></a><a class="code" href="classhippodraw_1_1LinearSumFunction.html#ac89ece7f0010b352e8d897f0a352f811">00187</a> <a class="code" href="classhippodraw_1_1LinearSumFunction.html#ac89ece7f0010b352e8d897f0a352f811" title="Sets the FunctionHelper so that the function can calculate a reasonable set of initial...">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> * )
<a name="l00188"></a>00188 {
<a name="l00189"></a>00189   <span class="comment">// does nothing</span>
<a name="l00190"></a>00190 }
</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>