<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.5.6">
  <compounddef id="linefit2_8cpp" kind="file">
    <compoundname>linefit2.cpp</compoundname>
    <includes local="no">itpp/itmex.h</includes>
    <includes refid="arx_8h" local="yes">../../bdm/estim/arx.h</includes>
    <incdepgraph>
      <node id="530">
        <label>libBM.h</label>
        <link refid="libBM_8h"/>
        <childnode refid="528" relation="include">
        </childnode>
      </node>
      <node id="526">
        <label>itpp/itmex.h</label>
      </node>
      <node id="533">
        <label>../itpp_ext.h</label>
        <link refid="itpp__ext_8h-source"/>
        <childnode refid="528" relation="include">
        </childnode>
      </node>
      <node id="531">
        <label>../stat/libEF.h</label>
        <link refid="libEF_8h"/>
        <childnode refid="528" relation="include">
        </childnode>
        <childnode refid="532" relation="include">
        </childnode>
        <childnode refid="530" relation="include">
        </childnode>
        <childnode refid="533" relation="include">
        </childnode>
      </node>
      <node id="527">
        <label>../../bdm/estim/arx.h</label>
        <link refid="arx_8h"/>
        <childnode refid="528" relation="include">
        </childnode>
        <childnode refid="529" relation="include">
        </childnode>
        <childnode refid="531" relation="include">
        </childnode>
      </node>
      <node id="529">
        <label>../stat/libFN.h</label>
        <link refid="libFN_8h-source"/>
        <childnode refid="528" relation="include">
        </childnode>
        <childnode refid="530" relation="include">
        </childnode>
      </node>
      <node id="528">
        <label>itpp/itbase.h</label>
      </node>
      <node id="525">
        <label>work/git/mixpp/matlab/mex/linefit2.cpp</label>
        <link refid="linefit2.cpp"/>
        <childnode refid="526" relation="include">
        </childnode>
        <childnode refid="527" relation="include">
        </childnode>
      </node>
      <node id="532">
        <label>../math/libDC.h</label>
        <link refid="libDC_8h"/>
        <childnode refid="528" relation="include">
        </childnode>
      </node>
    </incdepgraph>
      <sectiondef kind="func">
      <memberdef kind="function" id="linefit2_8cpp_182033299688d607730e08333ff7471f8" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void mexFunction</definition>
        <argsstring>(int n_output, mxArray *output[], int n_input, const mxArray *input[])</argsstring>
        <name>mexFunction</name>
        <param>
          <type>int</type>
          <declname>n_output</declname>
        </param>
        <param>
          <type>mxArray *</type>
          <declname>output</declname>
          <array>[]</array>
        </param>
        <param>
          <type>int</type>
          <declname>n_input</declname>
        </param>
        <param>
          <type>const mxArray *</type>
          <declname>input</declname>
          <array>[]</array>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/matlab/mex/linefit2.cpp" line="7" bodyfile="/home/smidl/work/git/mixpp/matlab/mex/linefit2.cpp" bodystart="7" bodyend="85"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="preprocessor">#include<sp/>&lt;itpp/itmex.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2"><highlight class="normal"></highlight></codeline>
<codeline lineno="3"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;../../bdm/estim/arx.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="4"><highlight class="normal"></highlight></codeline>
<codeline lineno="5"><highlight class="normal"></highlight><highlight class="keyword">using<sp/>namespace<sp/></highlight><highlight class="normal">itpp;</highlight></codeline>
<codeline lineno="6"><highlight class="normal"></highlight></codeline>
<codeline lineno="7"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>mexFunction<sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n_output,<sp/>mxArray<sp/>*output[],<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n_input,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mxArray<sp/>*input[]<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="8"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Check<sp/>the<sp/>number<sp/>of<sp/>inputs<sp/>and<sp/>output<sp/>arguments</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="9"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>n_output&lt;1<sp/>)<sp/>mexErrMsgTxt<sp/>(<sp/></highlight><highlight class="stringliteral">&quot;Wrong<sp/>number<sp/>of<sp/>output<sp/>variables!&quot;</highlight><highlight class="normal"><sp/>);</highlight></codeline>
<codeline lineno="10"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>n_input!=3<sp/>)<sp/>mexErrMsgTxt<sp/>(<sp/></highlight><highlight class="stringliteral">&quot;Wrong<sp/>number<sp/>of<sp/>input<sp/>variables!&quot;</highlight><highlight class="normal"><sp/>);</highlight></codeline>
<codeline lineno="11"><highlight class="normal"></highlight></codeline>
<codeline lineno="12"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Convert<sp/>input<sp/>variables<sp/>to<sp/>IT++<sp/>format</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="13"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>Data<sp/>=<sp/>mxArray2mat<sp/>(<sp/>input[0]<sp/>);</highlight></codeline>
<codeline lineno="14"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>Data.rows()<sp/>!=2<sp/>)</highlight></codeline>
<codeline lineno="15"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{<sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>Data.cols()<sp/>==2<sp/>)<sp/>Data=Data.T();<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>mexErrMsgTxt<sp/>(<sp/></highlight><highlight class="stringliteral">&quot;Data<sp/>are<sp/>not<sp/>2D!&quot;</highlight><highlight class="normal"><sp/>);}</highlight></codeline>
<codeline lineno="16"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ilow<sp/>=<sp/>mxArray2int<sp/>(<sp/>input[1]<sp/>)-1;</highlight></codeline>
<codeline lineno="17"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ihi<sp/>=<sp/>mxArray2int<sp/>(<sp/>input[2]<sp/>)-1;<sp/></highlight><highlight class="comment">//coreection<sp/>for<sp/>different<sp/>indeces</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="18"><highlight class="normal"></highlight></codeline>
<codeline lineno="19"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>------------------<sp/>Start<sp/>of<sp/>routine<sp/>---------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="20"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>------------------<sp/>Start<sp/>of<sp/>routine<sp/>---------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="21"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ndat=Data.cols();</highlight></codeline>
<codeline lineno="22"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>npsi=Data.rows()<sp/>+1;<sp/></highlight><highlight class="comment">//add<sp/>a<sp/>constant</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="23"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>thr<sp/>(<sp/></highlight><highlight class="stringliteral">&quot;1&quot;</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">&quot;{<sp/>theta_r<sp/>}&quot;</highlight><highlight class="normal">,vec_1<sp/>(<sp/>npsi<sp/>),vec_1<sp/>(<sp/>0<sp/>)<sp/>);</highlight></codeline>
<codeline lineno="24"><highlight class="normal"></highlight></codeline>
<codeline lineno="25"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>V0=1e-8*eye<sp/>(<sp/>npsi<sp/>);<sp/>V0<sp/>(<sp/>0,0<sp/>)<sp/>=1e-4;</highlight></codeline>
<codeline lineno="26"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>rgr<sp/>(<sp/>npsi<sp/>);</highlight></codeline>
<codeline lineno="27"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>nu0=0.1;</highlight></codeline>
<codeline lineno="28"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>fitting<sp/>a<sp/>linear<sp/>part<sp/>=&gt;<sp/>third<sp/>coef<sp/>is<sp/>&quot;1&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="29"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>rgr<sp/>(<sp/>2<sp/>)<sp/>=<sp/>1.0;</highlight></codeline>
<codeline lineno="30"><highlight class="normal"></highlight></codeline>
<codeline lineno="31"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>RESULTS</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="32"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>Tlls=zeros<sp/>(<sp/>ihi+1,ihi+1);</highlight></codeline>
<codeline lineno="33"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>AR<sp/>model</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="34"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classARX" kindref="compound" tooltip="Linear Autoregressive model with Gaussian noise.">ARX</ref><sp/>Ar<sp/>(<sp/>thr,V0,nu0<sp/>);</highlight></codeline>
<codeline lineno="35"><highlight class="normal"></highlight></codeline>
<codeline lineno="36"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//Initialize</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="37"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i=ilow+2;<sp/>i&lt;ihi-2;<sp/>i++<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="38"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>rgr.set_subvector<sp/>(<sp/>0,Data.get_col<sp/>(<sp/>i<sp/>)<sp/>);</highlight></codeline>
<codeline lineno="39"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Ar.bayes<sp/>(<sp/>rgr<sp/>);</highlight></codeline>
<codeline lineno="40"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="41"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>FLATTEN</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="42"><highlight class="normal"></highlight><highlight class="comment">/*<sp/><sp/><sp/><sp/><sp/><sp/>Ar.get_parameters<sp/>(<sp/>V0,nu0<sp/>);</highlight></codeline>
<codeline lineno="43"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>V0<sp/>*=1.0/nu0/10000.;<sp/>//<sp/>same<sp/>flattening<sp/>factor<sp/>as<sp/>for<sp/>nu0</highlight></codeline>
<codeline lineno="44"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>nu0=1./10000.;*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="45"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Ar.set_parameters<sp/>(<sp/>V0,nu0<sp/>);</highlight></codeline>
<codeline lineno="46"><highlight class="normal"></highlight></codeline>
<codeline lineno="47"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i=ilow;<sp/>i&lt;=ihi;<sp/>i++<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="48"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Ar.set_parameters<sp/>(<sp/>V0,nu0<sp/>);</highlight></codeline>
<codeline lineno="49"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>t=i;<sp/>t&lt;=ihi;<sp/>t++<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="50"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>rgr.set_subvector<sp/>(<sp/>0,Data.get_col<sp/>(<sp/>t<sp/>)<sp/>);</highlight></codeline>
<codeline lineno="51"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Ar.bayes<sp/>(<sp/>rgr<sp/>);</highlight></codeline>
<codeline lineno="52"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Tlls<sp/>(<sp/>i,t<sp/>)<sp/>=Ar._tll();</highlight></codeline>
<codeline lineno="53"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="54"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="55"><highlight class="normal"></highlight></codeline>
<codeline lineno="56"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>max_index<sp/>(<sp/>Tlls,ilow,ihi<sp/>);</highlight></codeline>
<codeline lineno="57"><highlight class="normal"></highlight></codeline>
<codeline lineno="58"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>------------------<sp/>End<sp/>of<sp/>routine<sp/>-----------------------------</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="59"><highlight class="normal"></highlight></codeline>
<codeline lineno="60"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0]<sp/>=<sp/>mxCreateDoubleMatrix<sp/>(<sp/>2,1,<sp/>mxREAL<sp/>);</highlight></codeline>
<codeline lineno="61"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ivec2mxArray<sp/>(<sp/>vec_2<sp/>(<sp/>ilow+1,ihi+1<sp/>)<sp/>,<sp/>output[0]<sp/>);</highlight></codeline>
<codeline lineno="62"><highlight class="normal"></highlight></codeline>
<codeline lineno="63"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>n_output&gt;1<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="64"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Create<sp/>output<sp/>vectors</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="65"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[1]<sp/>=<sp/>mxCreateDoubleMatrix<sp/>(<sp/>Tlls.rows(),Tlls.cols(),<sp/>mxREAL<sp/>);</highlight></codeline>
<codeline lineno="66"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Convert<sp/>the<sp/>IT++<sp/>format<sp/>to<sp/>Matlab<sp/>format<sp/>for<sp/>output</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="67"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat2mxArray<sp/>(<sp/>Tlls,<sp/>output[1]<sp/>);</highlight></codeline>
<codeline lineno="68"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="69"><highlight class="normal"></highlight></codeline>
<codeline lineno="70"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>n_output&gt;2<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="71"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Ar.set_parameters<sp/>(<sp/>V0,nu0<sp/>);</highlight></codeline>
<codeline lineno="72"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Redo<sp/>Ar<sp/>for<sp/>given<sp/>points</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="73"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i=ilow;<sp/>i&lt;=ihi;<sp/>i++<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="74"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>rgr.set_subvector<sp/>(<sp/>0,Data.get_col<sp/>(<sp/>i<sp/>)<sp/>);</highlight></codeline>
<codeline lineno="75"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Ar.bayes<sp/>(<sp/>rgr<sp/>);</highlight></codeline>
<codeline lineno="76"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="77"><highlight class="normal"></highlight></codeline>
<codeline lineno="78"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Create<sp/>output<sp/>vectors</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="79"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[2]<sp/>=<sp/>mxCreateDoubleMatrix<sp/>(<sp/>3,1,<sp/>mxREAL<sp/>);</highlight></codeline>
<codeline lineno="80"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Convert<sp/>the<sp/>IT++<sp/>format<sp/>to<sp/>Matlab<sp/>format<sp/>for<sp/>output</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="81"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat2mxArray<sp/>(<sp/>Ar._epdf().mean(),<sp/>output[2]<sp/>);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="82"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat2mxArray<sp/>(<sp/>Ar._epdf().mean(),<sp/>output[2]<sp/>);</highlight></codeline>
<codeline lineno="83"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="84"><highlight class="normal"></highlight></codeline>
<codeline lineno="85"><highlight class="normal">}</highlight></codeline>
    </programlisting>
    <location file="/home/smidl/work/git/mixpp/matlab/mex/linefit2.cpp"/>
  </compounddef>
</doxygen>
