<?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="libDC_8cpp" kind="file">
    <compoundname>libDC.cpp</compoundname>
    <includes local="no">itpp/itbase.h</includes>
    <includes refid="libDC_8h" local="yes">libDC.h</includes>
    <incdepgraph>
      <node id="300">
        <label>itpp/itbase.h</label>
      </node>
      <node id="299">
        <label>work/git/mixpp/bdm/math/libDC.cpp</label>
        <link refid="libDC.cpp"/>
        <childnode refid="300" relation="include">
        </childnode>
        <childnode refid="301" relation="include">
        </childnode>
      </node>
      <node id="301">
        <label>libDC.h</label>
        <link refid="libDC_8h"/>
        <childnode refid="300" relation="include">
        </childnode>
      </node>
    </incdepgraph>
      <sectiondef kind="func">
      <memberdef kind="function" id="libDC_8cpp_1a797c793c4a08bf1b05d8259dfb2c676" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>std::ostream &amp;</type>
        <definition>std::ostream&amp; operator&lt;&lt;</definition>
        <argsstring>(std::ostream &amp;os, const fsqmat &amp;ld)</argsstring>
        <name>operator&lt;&lt;</name>
        <param>
          <type>std::ostream &amp;</type>
          <declname>os</declname>
        </param>
        <param>
          <type>const <ref refid="classfsqmat" kindref="compound">fsqmat</ref> &amp;</type>
          <declname>ld</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/bdm/math/libDC.cpp" line="26" bodyfile="/home/smidl/work/git/mixpp/bdm/math/libDC.cpp" bodystart="26" bodyend="29"/>
      </memberdef>
      <memberdef kind="function" id="libDC_8cpp_13fdcec63285777e273bd639b0023d4bb" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>std::ostream &amp;</type>
        <definition>std::ostream&amp; operator&lt;&lt;</definition>
        <argsstring>(std::ostream &amp;os, const ldmat &amp;ld)</argsstring>
        <name>operator&lt;&lt;</name>
        <param>
          <type>std::ostream &amp;</type>
          <declname>os</declname>
        </param>
        <param>
          <type>const <ref refid="classldmat" kindref="compound">ldmat</ref> &amp;</type>
          <declname>ld</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/bdm/math/libDC.cpp" line="74" bodyfile="/home/smidl/work/git/mixpp/bdm/math/libDC.cpp" bodystart="74" bodyend="78"/>
      </memberdef>
      <memberdef kind="function" id="libDC_8cpp_16715d039e6d5d97005cf9e2522dfa474" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>mat</type>
        <definition>mat ltuinv</definition>
        <argsstring>(const mat &amp;L)</argsstring>
        <name>ltuinv</name>
        <param>
          <type>const mat &amp;</type>
          <declname>L</declname>
        </param>
        <briefdescription>
<para>Auxiliary function ltuinv; inversion of a triangular matrix;. </para>        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/bdm/math/libDC.cpp" line="301" bodyfile="/home/smidl/work/git/mixpp/bdm/math/libDC.cpp" bodystart="301" bodyend="320"/>
        <references refid="classsqmat_10abed904bdc0882373ba9adba919689d" compoundref="libDC_8h" startline="99">sqmat::dim</references>
        <references refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" compoundref="libDC_8h" startline="266">ldmat::L</references>
      </memberdef>
      <memberdef kind="function" id="libDC_8cpp_14ed56e73b49db8e7f4a63fa926a8dca4" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void dydr</definition>
        <argsstring>(double *r, double *f, double *Dr, double *Df, double *R, int jl, int jh, double *kr, int m, int mx)</argsstring>
        <name>dydr</name>
        <param>
          <type>double *</type>
          <declname>r</declname>
        </param>
        <param>
          <type>double *</type>
          <declname>f</declname>
        </param>
        <param>
          <type>double *</type>
          <declname>Dr</declname>
        </param>
        <param>
          <type>double *</type>
          <declname>Df</declname>
        </param>
        <param>
          <type>double *</type>
          <declname>R</declname>
        </param>
        <param>
          <type>int</type>
          <declname>jl</declname>
        </param>
        <param>
          <type>int</type>
          <declname>jh</declname>
        </param>
        <param>
          <type>double *</type>
          <declname>kr</declname>
        </param>
        <param>
          <type>int</type>
          <declname>m</declname>
        </param>
        <param>
          <type>int</type>
          <declname>mx</declname>
        </param>
        <briefdescription>
<para>Auxiliary function dydr; dyadic reduction. </para>        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/bdm/math/libDC.cpp" line="352" bodyfile="/home/smidl/work/git/mixpp/bdm/math/libDC.cpp" bodystart="322" bodyend="382"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="preprocessor">#include<sp/>&lt;itpp/itbase.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;<ref refid="libDC_8h" kindref="compound" tooltip="Matrices in decomposed forms (LDL&amp;#39;, LU, UDU&amp;#39;, etc).">libDC.h</ref>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3"><highlight class="normal"></highlight></codeline>
<codeline lineno="4"><highlight class="normal"></highlight><highlight class="keyword">using<sp/>namespace<sp/></highlight><highlight class="normal">itpp;</highlight></codeline>
<codeline lineno="5"><highlight class="normal"></highlight></codeline>
<codeline lineno="6"><highlight class="normal"></highlight><highlight class="keyword">using</highlight><highlight class="normal"><sp/>std::endl;</highlight></codeline>
<codeline lineno="7"><highlight class="normal"></highlight></codeline>
<codeline lineno="8" refid="classfsqmat_1b36530e155667fe9f1bd58394e50c65a" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classfsqmat_1b36530e155667fe9f1bd58394e50c65a" kindref="member">fsqmat::opupdt</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;v,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>w<sp/>)<sp/>{<ref refid="classfsqmat_1a7a1fcb9aae19d1e4daddfc9c22ce453" kindref="member" tooltip="Full matrix on which the operations are performed.">M</ref>+=outer_product<sp/>(<sp/>v,v*w<sp/>);};</highlight></codeline>
<codeline lineno="9" refid="classfsqmat_1cedf4f048309056f4262c930914dfda8" refkind="member"><highlight class="normal">mat<sp/><ref refid="classfsqmat_1cedf4f048309056f4262c930914dfda8" kindref="member" tooltip="Conversion to full matrix.">fsqmat::to_mat</ref>()<sp/><sp/>{</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classfsqmat_1a7a1fcb9aae19d1e4daddfc9c22ce453" kindref="member" tooltip="Full matrix on which the operations are performed.">M</ref>;};</highlight></codeline>
<codeline lineno="10" refid="classfsqmat_15530d2756b5d991de755e6121c9a452e" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classfsqmat_15530d2756b5d991de755e6121c9a452e" kindref="member" tooltip="Inplace symmetric multiplication by a SQUARE matrix , i.e. .">fsqmat::mult_sym</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mat<sp/>&amp;C)<sp/>{<ref refid="classfsqmat_1a7a1fcb9aae19d1e4daddfc9c22ce453" kindref="member" tooltip="Full matrix on which the operations are performed.">M</ref>=C<sp/>*<ref refid="classfsqmat_1a7a1fcb9aae19d1e4daddfc9c22ce453" kindref="member" tooltip="Full matrix on which the operations are performed.">M</ref>*C.T();};</highlight></codeline>
<codeline lineno="11" refid="classfsqmat_192052a8adc2054b63e42d1373d145c89" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classfsqmat_192052a8adc2054b63e42d1373d145c89" kindref="member" tooltip="Inplace symmetric multiplication by a SQUARE transpose of matrix , i.e. .">fsqmat::mult_sym_t</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mat<sp/>&amp;C)<sp/>{<ref refid="classfsqmat_1a7a1fcb9aae19d1e4daddfc9c22ce453" kindref="member" tooltip="Full matrix on which the operations are performed.">M</ref>=C.T()<sp/>*<ref refid="classfsqmat_1a7a1fcb9aae19d1e4daddfc9c22ce453" kindref="member" tooltip="Full matrix on which the operations are performed.">M</ref>*C;};</highlight></codeline>
<codeline lineno="12" refid="classfsqmat_1d4eddc3743c8865cc5ed92d14de0e3e3" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classfsqmat_15530d2756b5d991de755e6121c9a452e" kindref="member" tooltip="Inplace symmetric multiplication by a SQUARE matrix , i.e. .">fsqmat::mult_sym</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mat<sp/>&amp;C,<sp/><ref refid="classfsqmat" kindref="compound" tooltip="Fake sqmat. This class maps sqmat operations to operations on full matrix.">fsqmat</ref><sp/>&amp;U)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{<sp/>U.<ref refid="classfsqmat_1a7a1fcb9aae19d1e4daddfc9c22ce453" kindref="member" tooltip="Full matrix on which the operations are performed.">M</ref><sp/>=<sp/>(<sp/>C<sp/>*(<ref refid="classfsqmat_1a7a1fcb9aae19d1e4daddfc9c22ce453" kindref="member" tooltip="Full matrix on which the operations are performed.">M</ref>*C.T())<sp/>);};</highlight></codeline>
<codeline lineno="13" refid="classfsqmat_1ae4949ad2a32553c7fa04d6d1483770a" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classfsqmat_192052a8adc2054b63e42d1373d145c89" kindref="member" tooltip="Inplace symmetric multiplication by a SQUARE transpose of matrix , i.e. .">fsqmat::mult_sym_t</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mat<sp/>&amp;C,<sp/><ref refid="classfsqmat" kindref="compound" tooltip="Fake sqmat. This class maps sqmat operations to operations on full matrix.">fsqmat</ref><sp/>&amp;U)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{<sp/>U.<ref refid="classfsqmat_1a7a1fcb9aae19d1e4daddfc9c22ce453" kindref="member" tooltip="Full matrix on which the operations are performed.">M</ref><sp/>=<sp/>(<sp/>C.T()<sp/>*(<ref refid="classfsqmat_1a7a1fcb9aae19d1e4daddfc9c22ce453" kindref="member" tooltip="Full matrix on which the operations are performed.">M</ref>*C)<sp/>);};</highlight></codeline>
<codeline lineno="14" refid="classfsqmat_19fa853e1ca28f2a1a1c43377e798ecb1" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classfsqmat_19fa853e1ca28f2a1a1c43377e798ecb1" kindref="member" tooltip="Matrix inversion preserving the chosen form.">fsqmat::inv</ref><sp/>(<sp/><ref refid="classfsqmat" kindref="compound" tooltip="Fake sqmat. This class maps sqmat operations to operations on full matrix.">fsqmat</ref><sp/>&amp;Inv<sp/>)<sp/>{mat<sp/>IM<sp/>=<sp/>itpp::inv<sp/>(<sp/><ref refid="classfsqmat_1a7a1fcb9aae19d1e4daddfc9c22ce453" kindref="member" tooltip="Full matrix on which the operations are performed.">M</ref><sp/>);<sp/>Inv=IM;};</highlight></codeline>
<codeline lineno="15" refid="classfsqmat_1cfa4c359483d2322f32d1d50050f8ac4" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classfsqmat_1cfa4c359483d2322f32d1d50050f8ac4" kindref="member" tooltip="Clearing matrix so that it corresponds to zeros.">fsqmat::clear</ref>()<sp/>{<ref refid="classfsqmat_1a7a1fcb9aae19d1e4daddfc9c22ce453" kindref="member" tooltip="Full matrix on which the operations are performed.">M</ref>.clear();};</highlight></codeline>
<codeline lineno="16" refid="classfsqmat_11929fbc9fe375f1d67f979d0d302336f" refkind="member"><highlight class="normal"><ref refid="classfsqmat_179e3f73e0ccd663c7f7e08083d272940" kindref="member" tooltip="Default initialization.">fsqmat::fsqmat</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mat<sp/>&amp;M0<sp/>)<sp/>:<sp/><ref refid="classsqmat" kindref="compound" tooltip="Virtual class for representation of double symmetric matrices in square-root form...">sqmat</ref>(M0.<ref refid="classsqmat_1ecc2e2540f95a04f4449842588170f5b" kindref="member" tooltip="Reimplementing common functions of mat: cols().">cols</ref>())</highlight></codeline>
<codeline lineno="17"><highlight class="normal">{</highlight></codeline>
<codeline lineno="18"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>it_assert_debug<sp/>(<sp/>(<sp/>M0.cols()<sp/>==M0.rows()<sp/>),</highlight><highlight class="stringliteral">&quot;M0<sp/>must<sp/>be<sp/>square&quot;</highlight><highlight class="normal"><sp/>);</highlight></codeline>
<codeline lineno="19"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classfsqmat_1a7a1fcb9aae19d1e4daddfc9c22ce453" kindref="member" tooltip="Full matrix on which the operations are performed.">M</ref>=M0;</highlight></codeline>
<codeline lineno="20"><highlight class="normal">};</highlight></codeline>
<codeline lineno="21"><highlight class="normal"></highlight></codeline>
<codeline lineno="22"><highlight class="normal"></highlight><highlight class="comment">//fsqmat::fsqmat()<sp/>{};</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="23"><highlight class="normal"></highlight></codeline>
<codeline lineno="24" refid="classfsqmat_140eae99305e7c7240fa95cfec125b06f" refkind="member"><highlight class="normal"><ref refid="classfsqmat_179e3f73e0ccd663c7f7e08083d272940" kindref="member" tooltip="Default initialization.">fsqmat::fsqmat</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>dim0):<sp/><ref refid="classsqmat" kindref="compound" tooltip="Virtual class for representation of double symmetric matrices in square-root form...">sqmat</ref>(dim0),<sp/><ref refid="classfsqmat_1a7a1fcb9aae19d1e4daddfc9c22ce453" kindref="member" tooltip="Full matrix on which the operations are performed.">M</ref>(dim0,dim0)<sp/>{};</highlight></codeline>
<codeline lineno="25"><highlight class="normal"></highlight></codeline>
<codeline lineno="26" refid="classfsqmat_1e06aba54d61e807b41bd68b5ee6ac22f" refkind="member"><highlight class="normal">std::ostream<sp/>&amp;<ref refid="classfsqmat_1e06aba54d61e807b41bd68b5ee6ac22f" kindref="member" tooltip="print full matrix">operator&lt;&lt; </ref>(<sp/>std::ostream<sp/>&amp;os,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classfsqmat" kindref="compound" tooltip="Fake sqmat. This class maps sqmat operations to operations on full matrix.">fsqmat</ref><sp/>&amp;ld<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="27"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>os<sp/>&lt;&lt;<sp/>ld.<ref refid="classfsqmat_1a7a1fcb9aae19d1e4daddfc9c22ce453" kindref="member" tooltip="Full matrix on which the operations are performed.">M</ref><sp/>&lt;&lt;<sp/>endl;</highlight></codeline>
<codeline lineno="28"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>os;</highlight></codeline>
<codeline lineno="29"><highlight class="normal">}</highlight></codeline>
<codeline lineno="30"><highlight class="normal"></highlight></codeline>
<codeline lineno="31"><highlight class="normal"></highlight></codeline>
<codeline lineno="32" refid="classldmat_1968113788422e858da23a477e98fd3a1" refkind="member"><highlight class="normal"><ref refid="classldmat_1a12dda6f529580b0377cc45226b43303" kindref="member" tooltip="Default constructor.">ldmat::ldmat</ref>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mat<sp/>&amp;exL,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;exD<sp/>)<sp/>:<sp/><ref refid="classsqmat" kindref="compound" tooltip="Virtual class for representation of double symmetric matrices in square-root form...">sqmat</ref>(exD.length())<sp/>{</highlight></codeline>
<codeline lineno="33"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref><sp/>=<sp/>exD;</highlight></codeline>
<codeline lineno="34"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref><sp/>=<sp/>exL;</highlight></codeline>
<codeline lineno="35"><highlight class="normal">}</highlight></codeline>
<codeline lineno="36"><highlight class="normal"></highlight></codeline>
<codeline lineno="37" refid="classldmat_1a12dda6f529580b0377cc45226b43303" refkind="member"><highlight class="normal"><ref refid="classldmat_1a12dda6f529580b0377cc45226b43303" kindref="member" tooltip="Default constructor.">ldmat::ldmat</ref>()<sp/>:<ref refid="classsqmat" kindref="compound" tooltip="Virtual class for representation of double symmetric matrices in square-root form...">sqmat</ref>(0)<sp/>{}</highlight></codeline>
<codeline lineno="38"><highlight class="normal"></highlight></codeline>
<codeline lineno="39" refid="classldmat_1163ee002a7858d104da1c59dd11f016d" refkind="member"><highlight class="normal"><ref refid="classldmat_1a12dda6f529580b0377cc45226b43303" kindref="member" tooltip="Default constructor.">ldmat::ldmat</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>dim0):<sp/><ref refid="classsqmat" kindref="compound" tooltip="Virtual class for representation of double symmetric matrices in square-root form...">sqmat</ref>(dim0),<sp/><ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref>(dim0),<ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>(dim0,dim0)<sp/>{}</highlight></codeline>
<codeline lineno="40"><highlight class="normal"></highlight></codeline>
<codeline lineno="41" refid="classldmat_1abe16e0f86668ef61a9a4896c8565dee" refkind="member"><highlight class="normal"><ref refid="classldmat_1a12dda6f529580b0377cc45226b43303" kindref="member" tooltip="Default constructor.">ldmat::ldmat</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>D0):<ref refid="classsqmat" kindref="compound" tooltip="Virtual class for representation of double symmetric matrices in square-root form...">sqmat</ref>(D0.length())<sp/>{</highlight></codeline>
<codeline lineno="42"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref><sp/>=<sp/>D0;</highlight></codeline>
<codeline lineno="43"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref><sp/>=<sp/>eye(<ref refid="classsqmat_10abed904bdc0882373ba9adba919689d" kindref="member" tooltip="dimension of the square matrix">dim</ref>);</highlight></codeline>
<codeline lineno="44"><highlight class="normal">}</highlight></codeline>
<codeline lineno="45"><highlight class="normal"></highlight></codeline>
<codeline lineno="46" refid="classldmat_15f21785358072d36892d538eed1d1ea5" refkind="member"><highlight class="normal"><ref refid="classldmat_1a12dda6f529580b0377cc45226b43303" kindref="member" tooltip="Default constructor.">ldmat::ldmat</ref>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mat<sp/>&amp;V<sp/>):<ref refid="classsqmat" kindref="compound" tooltip="Virtual class for representation of double symmetric matrices in square-root form...">sqmat</ref>(V.<ref refid="classldmat_10fceb6b5b637cec89bb0a3d2e6be1306" kindref="member" tooltip="access function">cols</ref>())<sp/>{</highlight></codeline>
<codeline lineno="47"><highlight class="normal"></highlight><highlight class="comment">//TODO<sp/>check<sp/>if<sp/>correct!!<sp/>Based<sp/>on<sp/>heuristic<sp/>observation<sp/>of<sp/>lu()</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="48"><highlight class="normal"></highlight></codeline>
<codeline lineno="49"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>it_assert_debug(<sp/><ref refid="classsqmat_10abed904bdc0882373ba9adba919689d" kindref="member" tooltip="dimension of the square matrix">dim</ref><sp/>==<sp/>V.rows(),</highlight><highlight class="stringliteral">&quot;ldmat::ldmat<sp/>matrix<sp/>V<sp/>is<sp/>not<sp/>square!&quot;</highlight><highlight class="normal"><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/></highlight></codeline>
<codeline lineno="51"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>L<sp/>and<sp/>D<sp/>will<sp/>be<sp/>allocated<sp/>by<sp/>ldform()</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="52"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="53"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//Chol<sp/>is<sp/>unstable</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="54"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>this-&gt;<ref refid="classldmat_1f291faa073e7bc8dfafc7ae93daa2506" kindref="member" tooltip="Transforms general  into pure .">ldform</ref>(chol(V),ones(<ref refid="classsqmat_10abed904bdc0882373ba9adba919689d" kindref="member" tooltip="dimension of the square matrix">dim</ref>));</highlight></codeline>
<codeline lineno="55"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/>this-&gt;ldform(ul(V),ones(dim));</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="56"><highlight class="normal">}</highlight></codeline>
<codeline lineno="57"><highlight class="normal"></highlight></codeline>
<codeline lineno="58" refid="classldmat_10f0f6e083e6d947cf58097ffce3ccd1a" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classldmat_10f0f6e083e6d947cf58097ffce3ccd1a" kindref="member">ldmat::opupdt</ref>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;v,<sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>w<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="59"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="classsqmat_10abed904bdc0882373ba9adba919689d" kindref="member" tooltip="dimension of the square matrix">dim</ref><sp/>=<sp/><ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref>.length();</highlight></codeline>
<codeline lineno="60"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>kr;</highlight></codeline>
<codeline lineno="61"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>r<sp/>=<sp/>v;</highlight></codeline>
<codeline lineno="62"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//beware!<sp/>it<sp/>is<sp/>potentionally<sp/>dangerous,<sp/>if<sp/>ITpp<sp/>change<sp/>_behaviour<sp/>of<sp/>_data()!</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="63"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>*Lraw<sp/>=<sp/><ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>._data();</highlight></codeline>
<codeline lineno="64"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>*Draw<sp/>=<sp/><ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref>._data();</highlight></codeline>
<codeline lineno="65"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>*rraw<sp/>=<sp/>r._data();</highlight></codeline>
<codeline lineno="66"><highlight class="normal"></highlight></codeline>
<codeline lineno="67"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>it_assert_debug(<sp/>v.length()<sp/>==<sp/>dim,<sp/></highlight><highlight class="stringliteral">&quot;LD::ldupdt<sp/>vector<sp/>v<sp/>is<sp/>not<sp/>compatible<sp/>with<sp/>this<sp/>ld.&quot;</highlight><highlight class="normal"><sp/>);</highlight></codeline>
<codeline lineno="68"><highlight class="normal"></highlight></codeline>
<codeline lineno="69"><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<sp/>=<sp/>dim<sp/>-<sp/>1;<sp/>i<sp/>&gt;=<sp/>0;<sp/>i--<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="70"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>dydr(<sp/>rraw,<sp/>Lraw<sp/>+<sp/>i,<sp/>&amp;w,<sp/>Draw<sp/>+<sp/>i,<sp/>rraw<sp/>+<sp/>i,<sp/>0,<sp/>i,<sp/>&amp;kr,<sp/>1,<sp/>dim<sp/>);</highlight></codeline>
<codeline lineno="71"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="72"><highlight class="normal">}</highlight></codeline>
<codeline lineno="73"><highlight class="normal"></highlight></codeline>
<codeline lineno="74" refid="classldmat_1eaaa0baa6026b84cfcbced41c84599d1" refkind="member"><highlight class="normal">std::ostream<sp/>&amp;<ref refid="classldmat_1eaaa0baa6026b84cfcbced41c84599d1" kindref="member" tooltip="print both L and D ">operator&lt;&lt; </ref>(<sp/>std::ostream<sp/>&amp;os,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classldmat" kindref="compound" tooltip="Matrix stored in LD form, (typically known as UD).">ldmat</ref><sp/>&amp;ld<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="75"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>os<sp/>&lt;&lt;<sp/></highlight><highlight class="stringliteral">&quot;L:&quot;</highlight><highlight class="normal"><sp/>&lt;&lt;<sp/>ld.<ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref><sp/>&lt;&lt;<sp/>endl;</highlight></codeline>
<codeline lineno="76"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>os<sp/>&lt;&lt;<sp/></highlight><highlight class="stringliteral">&quot;D:&quot;</highlight><highlight class="normal"><sp/>&lt;&lt;<sp/>ld.<ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref><sp/>&lt;&lt;<sp/>endl;</highlight></codeline>
<codeline lineno="77"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>os;</highlight></codeline>
<codeline lineno="78"><highlight class="normal">}</highlight></codeline>
<codeline lineno="79"><highlight class="normal"></highlight></codeline>
<codeline lineno="80" refid="classldmat_15b0515da8dc2293d9e4360b74cc26c9e" refkind="member"><highlight class="normal">mat<sp/><ref refid="classldmat_15b0515da8dc2293d9e4360b74cc26c9e" kindref="member" tooltip="Conversion to full matrix.">ldmat::to_mat</ref>()<sp/>{</highlight></codeline>
<codeline lineno="81"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="classsqmat_10abed904bdc0882373ba9adba919689d" kindref="member" tooltip="dimension of the square matrix">dim</ref><sp/>=<sp/><ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref>.length();</highlight></codeline>
<codeline lineno="82"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>V(<sp/>dim,<sp/>dim<sp/>);</highlight></codeline>
<codeline lineno="83"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>sum;</highlight></codeline>
<codeline lineno="84"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>r,<sp/>c,<sp/>cc;</highlight></codeline>
<codeline lineno="85"><highlight class="normal"></highlight></codeline>
<codeline lineno="86"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/>r<sp/>=<sp/>0;r<sp/>&lt;<sp/>dim;r++<sp/>)<sp/>{<sp/></highlight><highlight class="comment">//row<sp/>cycle</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="87"><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/>c<sp/>=<sp/>r;c<sp/>&lt;<sp/>dim;c++<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="88"><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/></highlight><highlight class="comment">//column<sp/>cycle,<sp/>using<sp/>symmetricity<sp/>=&gt;<sp/>c=r!</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="89"><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/>sum<sp/>=<sp/>0.0;</highlight></codeline>
<codeline lineno="90"><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/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/>cc<sp/>=<sp/>c;cc<sp/>&lt;<sp/>dim;cc++<sp/>)<sp/>{<sp/></highlight><highlight class="comment">//cycle<sp/>over<sp/>the<sp/>remaining<sp/>part<sp/>of<sp/>the<sp/>vector</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="91"><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/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>sum<sp/>+=<sp/><ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>(<sp/>cc,<sp/>r<sp/>)<sp/>*<sp/><ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref>(<sp/>cc<sp/>)<sp/>*<sp/><ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>(<sp/>cc,<sp/>c<sp/>);</highlight></codeline>
<codeline lineno="92"><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/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//here<sp/>L(cc,r)<sp/>=<sp/>L(r,cc)&apos;;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="93"><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/>}</highlight></codeline>
<codeline lineno="94"><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/>V(<sp/>r,<sp/>c<sp/>)<sp/>=<sp/>sum;</highlight></codeline>
<codeline lineno="95"><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/></highlight><highlight class="comment">//<sp/>symmetricity</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="96"><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/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>r<sp/>!=<sp/>c<sp/>)<sp/>{V(<sp/>c,<sp/>r<sp/>)<sp/>=<sp/>sum;};</highlight></codeline>
<codeline lineno="97"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="98"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="99"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>V2<sp/>=<sp/><ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>.transpose()*diag(<sp/><ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref><sp/>)*<ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>;</highlight></codeline>
<codeline lineno="100"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>V2;</highlight></codeline>
<codeline lineno="101"><highlight class="normal">}</highlight></codeline>
<codeline lineno="102"><highlight class="normal"></highlight></codeline>
<codeline lineno="103"><highlight class="normal"></highlight></codeline>
<codeline lineno="104" refid="classldmat_1a60f2c7e4f3c6a7738eaaaab81ffad20" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classldmat_1a60f2c7e4f3c6a7738eaaaab81ffad20" kindref="member" tooltip="Add another matrix in LD form with weight w.">ldmat::add</ref>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classldmat" kindref="compound" tooltip="Matrix stored in LD form, (typically known as UD).">ldmat</ref><sp/>&amp;ld2,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>w<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="105"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="classsqmat_10abed904bdc0882373ba9adba919689d" kindref="member" tooltip="dimension of the square matrix">dim</ref><sp/>=<sp/><ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref>.length();</highlight></codeline>
<codeline lineno="106"><highlight class="normal"></highlight></codeline>
<codeline lineno="107"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>it_assert_debug(<sp/>ld2.<ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref>.length()<sp/>==<sp/>dim,<sp/></highlight><highlight class="stringliteral">&quot;LD.add()<sp/>incompatible<sp/>sizes<sp/>of<sp/>LDs;&quot;</highlight><highlight class="normal"><sp/>);</highlight></codeline>
<codeline lineno="108"><highlight class="normal"></highlight></codeline>
<codeline lineno="109"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//Fixme<sp/>can<sp/>be<sp/>done<sp/>more<sp/>efficiently<sp/>either<sp/>via<sp/>dydr<sp/>or<sp/>ldform</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="110"><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/>r<sp/>=<sp/>0;<sp/>r<sp/>&lt;<sp/>dim;<sp/>r++<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="111"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Add<sp/>columns<sp/>of<sp/>ld2.L&apos;<sp/>(i.e.<sp/>rows<sp/>of<sp/>ld2.L)<sp/>as<sp/>dyads<sp/>weighted<sp/>by<sp/>ld2.D</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="112"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>this-&gt;<ref refid="classldmat_10f0f6e083e6d947cf58097ffce3ccd1a" kindref="member">opupdt</ref>(<sp/>ld2.<ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>.get_row(<sp/>r<sp/>),<sp/>w*ld2.<ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref>(<sp/>r<sp/>)<sp/>);</highlight></codeline>
<codeline lineno="113"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="114"><highlight class="normal">}</highlight></codeline>
<codeline lineno="115"><highlight class="normal"></highlight></codeline>
<codeline lineno="116" refid="classldmat_14d6e401de9607332305c27e67972a07a" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classldmat_14d6e401de9607332305c27e67972a07a" kindref="member" tooltip="Clearing matrix so that it corresponds to zeros.">ldmat::clear</ref>(){<ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>.clear();<sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i=0;i&lt;<ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>.cols();i++<sp/>){<ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>(<sp/>i,i<sp/>)=1;};<sp/><ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref>.clear();}</highlight></codeline>
<codeline lineno="117"><highlight class="normal"></highlight></codeline>
<codeline lineno="118" refid="classldmat_12c160cb123c1102face7a50ec566a031" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classldmat_12c160cb123c1102face7a50ec566a031" kindref="member" tooltip="Matrix inversion preserving the chosen form.">ldmat::inv</ref>(<sp/><ref refid="classldmat" kindref="compound" tooltip="Matrix stored in LD form, (typically known as UD).">ldmat</ref><sp/>&amp;Inv<sp/>)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="119"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Inv.<ref refid="classldmat_14d6e401de9607332305c27e67972a07a" kindref="member" tooltip="Clearing matrix so that it corresponds to zeros.">clear</ref>();<sp/><sp/><sp/></highlight><highlight class="comment">//Inv<sp/>=<sp/>zero<sp/>in<sp/>LD</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="120"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>U<sp/>=<sp/>ltuinv(<sp/><ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref><sp/>);</highlight></codeline>
<codeline lineno="121"><highlight class="normal"></highlight></codeline>
<codeline lineno="122"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Inv.<ref refid="classldmat_1f291faa073e7bc8dfafc7ae93daa2506" kindref="member" tooltip="Transforms general  into pure .">ldform</ref>(<sp/>U.transpose(),<sp/>1.0<sp/>/<sp/><ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref><sp/>);</highlight></codeline>
<codeline lineno="123"><highlight class="normal">}</highlight></codeline>
<codeline lineno="124"><highlight class="normal"></highlight></codeline>
<codeline lineno="125" refid="classldmat_1e967b9425007f0cb6cd59b845f9756d8" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classldmat_1e967b9425007f0cb6cd59b845f9756d8" kindref="member" tooltip="Inplace symmetric multiplication by a SQUARE matrix , i.e. .">ldmat::mult_sym</ref>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mat<sp/>&amp;C)<sp/>{</highlight></codeline>
<codeline lineno="126"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>A<sp/>=<sp/><ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>*C.T();</highlight></codeline>
<codeline lineno="127"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>this-&gt;<ref refid="classldmat_1f291faa073e7bc8dfafc7ae93daa2506" kindref="member" tooltip="Transforms general  into pure .">ldform</ref>(A,<ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref>);</highlight></codeline>
<codeline lineno="128"><highlight class="normal">}</highlight></codeline>
<codeline lineno="129"><highlight class="normal"></highlight></codeline>
<codeline lineno="130" refid="classldmat_14fd155f38eb6dd5af4bdf9c98a7999a9" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classldmat_14fd155f38eb6dd5af4bdf9c98a7999a9" kindref="member" tooltip="Inplace symmetric multiplication by a SQUARE transpose of matrix , i.e. .">ldmat::mult_sym_t</ref>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mat<sp/>&amp;C)<sp/>{</highlight></codeline>
<codeline lineno="131"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>A<sp/>=<sp/><ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>*C;</highlight></codeline>
<codeline lineno="132"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>this-&gt;<ref refid="classldmat_1f291faa073e7bc8dfafc7ae93daa2506" kindref="member" tooltip="Transforms general  into pure .">ldform</ref>(A,<ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref>);</highlight></codeline>
<codeline lineno="133"><highlight class="normal">}</highlight></codeline>
<codeline lineno="134"><highlight class="normal"></highlight></codeline>
<codeline lineno="135" refid="classldmat_1e7207748909325bb0f99b43f090a2b7e" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classldmat_1e967b9425007f0cb6cd59b845f9756d8" kindref="member" tooltip="Inplace symmetric multiplication by a SQUARE matrix , i.e. .">ldmat::mult_sym</ref>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mat<sp/>&amp;C,<sp/><ref refid="classldmat" kindref="compound" tooltip="Matrix stored in LD form, (typically known as UD).">ldmat</ref><sp/>&amp;U)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="136"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>A=<ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>*C.T();<sp/></highlight><highlight class="comment">//could<sp/>be<sp/>done<sp/>more<sp/>efficiently<sp/>using<sp/>BLAS</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="137"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>U.<ref refid="classldmat_1f291faa073e7bc8dfafc7ae93daa2506" kindref="member" tooltip="Transforms general  into pure .">ldform</ref>(A,<ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref>);</highlight></codeline>
<codeline lineno="138"><highlight class="normal">}</highlight></codeline>
<codeline lineno="139"><highlight class="normal"></highlight></codeline>
<codeline lineno="140" refid="classldmat_1f94dc3a233f3d40fc853d8d4ac3b8eab" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classldmat_14fd155f38eb6dd5af4bdf9c98a7999a9" kindref="member" tooltip="Inplace symmetric multiplication by a SQUARE transpose of matrix , i.e. .">ldmat::mult_sym_t</ref>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mat<sp/>&amp;C,<sp/><ref refid="classldmat" kindref="compound" tooltip="Matrix stored in LD form, (typically known as UD).">ldmat</ref><sp/>&amp;U)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="141"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>A=<ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>*C;</highlight></codeline>
<codeline lineno="142"><highlight class="normal"></highlight><highlight class="comment">/*<sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>nD=zeros(U.rows());</highlight></codeline>
<codeline lineno="143"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>nD.replace_mid(0,<sp/>D);<sp/>//I<sp/>case<sp/>that<sp/>D<sp/>&lt;<sp/>nD*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="144"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>U.<ref refid="classldmat_1f291faa073e7bc8dfafc7ae93daa2506" kindref="member" tooltip="Transforms general  into pure .">ldform</ref>(A,<ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref>);</highlight></codeline>
<codeline lineno="145"><highlight class="normal">}</highlight></codeline>
<codeline lineno="146"><highlight class="normal"></highlight></codeline>
<codeline lineno="147"><highlight class="normal"></highlight></codeline>
<codeline lineno="148" refid="classldmat_12b42750ba4962d439aa52a77ae12949b" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classldmat_12b42750ba4962d439aa52a77ae12949b" kindref="member" tooltip="Logarithm of a determinant.">ldmat::logdet</ref>()</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="149"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>ldet<sp/>=<sp/>0.0;</highlight></codeline>
<codeline lineno="150"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
<codeline lineno="151"><highlight class="normal"></highlight><highlight class="comment">//<sp/>sum<sp/>logarithms<sp/>of<sp/>diagobal<sp/>elements</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="152"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/>i=0;<sp/>i&lt;<ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref>.length();<sp/>i++<sp/>){ldet+=log(<sp/><ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref>(<sp/>i<sp/>)<sp/>);};</highlight></codeline>
<codeline lineno="153"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ldet;</highlight></codeline>
<codeline lineno="154"><highlight class="normal">}</highlight></codeline>
<codeline lineno="155"><highlight class="normal"></highlight></codeline>
<codeline lineno="156" refid="classldmat_1d64f331b781903e913cb2ee836886f3f" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classldmat_1d64f331b781903e913cb2ee836886f3f" kindref="member" tooltip="Evaluates quadratic form ;.">ldmat::qform</ref>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;v<sp/>)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="157"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>x<sp/>=<sp/>0.0,<sp/>sum;</highlight></codeline>
<codeline lineno="158"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i,j;</highlight></codeline>
<codeline lineno="159"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>s(v.length());</highlight></codeline>
<codeline lineno="160"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>S=<ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>*v;</highlight></codeline>
<codeline lineno="161"><highlight class="normal"></highlight></codeline>
<codeline lineno="162"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/>i=0;<sp/>i&lt;<ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref>.length();<sp/>i++<sp/>)<sp/>{<sp/></highlight><highlight class="comment">//rows<sp/>of<sp/>L</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="163"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>sum<sp/>=<sp/>0.0;</highlight></codeline>
<codeline lineno="164"><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/>j=0;<sp/>j&lt;=i;<sp/>j++<sp/>){sum+=<ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>(<sp/>i,j<sp/>)*v(<sp/>j<sp/>);}</highlight></codeline>
<codeline lineno="165"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>x<sp/>+=<ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref>(<sp/>i<sp/>)*sum*sum;</highlight></codeline>
<codeline lineno="166"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>s(i)=sum;</highlight></codeline>
<codeline lineno="167"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>};</highlight></codeline>
<codeline lineno="168"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>x;</highlight></codeline>
<codeline lineno="169"><highlight class="normal">}</highlight></codeline>
<codeline lineno="170"><highlight class="normal"></highlight></codeline>
<codeline lineno="171" refid="classldmat_1d876c5f83e02b3e809b35c9de5068f14" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/><ref refid="classldmat_1d876c5f83e02b3e809b35c9de5068f14" kindref="member" tooltip="Evaluates quadratic form ;.">ldmat::invqform</ref>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;v<sp/>)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="172"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>x<sp/>=<sp/>0.0;</highlight></codeline>
<codeline lineno="173"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
<codeline lineno="174"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>pom(v.length());</highlight></codeline>
<codeline lineno="175"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="176"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>backward_substitution(<ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>.T(),v,pom);</highlight></codeline>
<codeline lineno="177"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="178"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/>i=0;<sp/>i&lt;<ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref>.length();<sp/>i++<sp/>)<sp/>{<sp/></highlight><highlight class="comment">//rows<sp/>of<sp/>L</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="179"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>x<sp/>+=pom(i)*pom(i)/<ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref>(i);</highlight></codeline>
<codeline lineno="180"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>};</highlight></codeline>
<codeline lineno="181"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>x;</highlight></codeline>
<codeline lineno="182"><highlight class="normal">}</highlight></codeline>
<codeline lineno="183"><highlight class="normal"></highlight></codeline>
<codeline lineno="184" refid="classldmat_1875b7e6dcf73ae7001329099019fdb1d" refkind="member"><highlight class="normal"><ref refid="classldmat" kindref="compound" tooltip="Matrix stored in LD form, (typically known as UD).">ldmat</ref>&amp;<sp/><ref refid="classldmat_1875b7e6dcf73ae7001329099019fdb1d" kindref="member" tooltip="multiply by a scalar">ldmat::operator *= </ref>(<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>x<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="185"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref>*=x;</highlight></codeline>
<codeline lineno="186"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>*</highlight><highlight class="keyword">this</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="187"><highlight class="normal">}</highlight></codeline>
<codeline lineno="188"><highlight class="normal"></highlight></codeline>
<codeline lineno="189" refid="classldmat_1fc380626ced6f9244fb58c5f0231174d" refkind="member"><highlight class="normal">vec<sp/><ref refid="classldmat_1fc380626ced6f9244fb58c5f0231174d" kindref="member" tooltip="Multiplies square root of  by vector .">ldmat::sqrt_mult</ref>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;x<sp/>)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="190"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i,j;</highlight></codeline>
<codeline lineno="191"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>res(<sp/><ref refid="classsqmat_10abed904bdc0882373ba9adba919689d" kindref="member" tooltip="dimension of the square matrix">dim</ref><sp/>);</highlight></codeline>
<codeline lineno="192"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//double<sp/>sum;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="193"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/>i=0;i&lt;<ref refid="classsqmat_10abed904bdc0882373ba9adba919689d" kindref="member" tooltip="dimension of the square matrix">dim</ref>;i++<sp/>)<sp/>{</highlight><highlight class="comment">//for<sp/>each<sp/>element<sp/>of<sp/>result</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="194"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>res(<sp/>i<sp/>)<sp/>=<sp/>0.0;</highlight></codeline>
<codeline lineno="195"><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/>j=i;j&lt;dim;j++<sp/>)<sp/>{</highlight><highlight class="comment">//sum<sp/>D(j)*L(:,i).*x</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="196"><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/>res(<sp/>i<sp/>)<sp/>+=<sp/>sqrt(<sp/><ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref>(<sp/>j<sp/>)<sp/>)*<ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>(<sp/>j,i<sp/>)*x(<sp/>j<sp/>);</highlight></codeline>
<codeline lineno="197"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="198"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="199"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>res2<sp/>=<sp/>L.transpose()*diag(<sp/>sqrt(<sp/>D<sp/>)<sp/>)*x;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="200"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>res;</highlight></codeline>
<codeline lineno="201"><highlight class="normal">}</highlight></codeline>
<codeline lineno="202"><highlight class="normal"></highlight></codeline>
<codeline lineno="203" refid="classldmat_1f291faa073e7bc8dfafc7ae93daa2506" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classldmat_1f291faa073e7bc8dfafc7ae93daa2506" kindref="member" tooltip="Transforms general  into pure .">ldmat::ldform</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mat<sp/>&amp;A,</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;D0<sp/>)</highlight></codeline>
<codeline lineno="204"><highlight class="normal">{</highlight></codeline>
<codeline lineno="205"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>m<sp/>=<sp/>A.rows();</highlight></codeline>
<codeline lineno="206"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n<sp/>=<sp/>A.cols();</highlight></codeline>
<codeline lineno="207"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>mn<sp/>=<sp/>(m&lt;n)<sp/>?<sp/>m<sp/>:n<sp/>;</highlight></codeline>
<codeline lineno="208"><highlight class="normal"></highlight></codeline>
<codeline lineno="209"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/>it_assert_debug(<sp/>A.cols()==dim,&quot;ldmat::ldform<sp/>A<sp/>is<sp/>not<sp/>compatible&quot;<sp/>);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="210"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>it_assert_debug(<sp/>D0.length()==A.rows(),</highlight><highlight class="stringliteral">&quot;ldmat::ldform<sp/>Vector<sp/>D<sp/>must<sp/>have<sp/>the<sp/>length<sp/>as<sp/>row<sp/>count<sp/>of<sp/>A&quot;</highlight><highlight class="normal"><sp/>);</highlight></codeline>
<codeline lineno="211"><highlight class="normal"></highlight></codeline>
<codeline lineno="212"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>=concat_vertical(<sp/>zeros(<sp/>n,n<sp/>),<sp/>diag(<sp/>sqrt(<sp/>D0<sp/>)<sp/>)*A<sp/>);</highlight></codeline>
<codeline lineno="213"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref>=zeros(<sp/>n+m<sp/>);</highlight></codeline>
<codeline lineno="214"><highlight class="normal"></highlight></codeline>
<codeline lineno="215"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//unnecessary<sp/>big<sp/>L<sp/>and<sp/>D<sp/>will<sp/>be<sp/>made<sp/>smaller<sp/>at<sp/>the<sp/>end<sp/>of<sp/>file<sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="216"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>w=zeros(<sp/>n+m<sp/>);</highlight></codeline>
<codeline lineno="217"><highlight class="normal"><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="218"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>sum,<sp/>beta,<sp/>pom;</highlight></codeline>
<codeline lineno="219"><highlight class="normal"></highlight></codeline>
<codeline lineno="220"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>cc=0;</highlight></codeline>
<codeline lineno="221"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i=n;<sp/></highlight><highlight class="comment">//<sp/>indexovani<sp/>o<sp/>1<sp/>niz,<sp/>nez<sp/>v<sp/>matlabu</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="222"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ii,j,jj;</highlight></codeline>
<codeline lineno="223"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(<sp/>(i&gt;n-mn-cc)<sp/>&amp;&amp;<sp/>(i&gt;0)<sp/>)<sp/></highlight></codeline>
<codeline lineno="224"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="225"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>i--;</highlight></codeline>
<codeline lineno="226"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>sum<sp/>=<sp/>0.0;</highlight></codeline>
<codeline lineno="227"><highlight class="normal"></highlight></codeline>
<codeline lineno="228"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>last_v<sp/>=<sp/>m+i-n+cc+1;</highlight></codeline>
<codeline lineno="229"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="230"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>v<sp/>=<sp/>zeros(<sp/>last_v<sp/>+<sp/>1<sp/>);<sp/></highlight><highlight class="comment">//prepare<sp/>v</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="231"><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/>ii=n-cc-1;ii&lt;m+i+1;ii++<sp/>)<sp/></highlight></codeline>
<codeline lineno="232"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="233"><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/>sum+=<sp/><ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>(<sp/>ii,i<sp/>)*<ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>(<sp/>ii,i<sp/>);</highlight></codeline>
<codeline lineno="234"><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/>v(<sp/>ii-n+cc+1<sp/>)=<ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>(<sp/>ii,i<sp/>);<sp/></highlight><highlight class="comment">//assign<sp/>v</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="235"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="236"><highlight class="normal"></highlight></codeline>
<codeline lineno="237"><highlight class="normal"><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/><ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>(<sp/>m+i,i<sp/>)==0<sp/>)<sp/></highlight></codeline>
<codeline lineno="238"><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/>beta<sp/>=<sp/>sqrt(<sp/>sum<sp/>);<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="239"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="240"><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/>beta<sp/>=<sp/><ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>(<sp/>m+i,i<sp/>)+sign(<sp/><ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>(<sp/>m+i,i<sp/>)<sp/>)*sqrt(<sp/>sum<sp/>);<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="241"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="242"><highlight class="normal"><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/>std::fabs(<sp/>beta<sp/>)&lt;eps<sp/>)</highlight></codeline>
<codeline lineno="243"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="244"><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/>cc++;</highlight></codeline>
<codeline lineno="245"><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/>L.set_row(<sp/>n-cc,<sp/>L.get_row(<sp/>m+i<sp/>)<sp/>);</highlight></codeline>
<codeline lineno="246"><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/>L.set_row(<sp/>m+i,zeros(L.cols())<sp/>);</highlight></codeline>
<codeline lineno="247"><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/><ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref>(<sp/>m+i<sp/>)=0;<sp/><ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>(<sp/>m+i,i<sp/>)=1;</highlight></codeline>
<codeline lineno="248"><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/>L.set_submatrix(<sp/>n-cc,m+i-1,i,i,0<sp/>);</highlight></codeline>
<codeline lineno="249"><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/></highlight><highlight class="keywordflow">continue</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="250"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="251"><highlight class="normal"></highlight></codeline>
<codeline lineno="252"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>sum-=v(last_v)*v(last_v);</highlight></codeline>
<codeline lineno="253"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>sum/=beta*beta;</highlight></codeline>
<codeline lineno="254"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>sum++;</highlight></codeline>
<codeline lineno="255"><highlight class="normal"></highlight></codeline>
<codeline lineno="256"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>v/=beta;</highlight></codeline>
<codeline lineno="257"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>v(last_v)=1;</highlight></codeline>
<codeline lineno="258"><highlight class="normal"></highlight></codeline>
<codeline lineno="259"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>pom=-2.0/sum;</highlight></codeline>
<codeline lineno="260"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>echo<sp/>to<sp/>venca<sp/><sp/><sp/></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="261"><highlight class="normal"></highlight></codeline>
<codeline lineno="262"><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/>j=i;j&gt;=0;j--<sp/>)<sp/></highlight></codeline>
<codeline lineno="263"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="264"><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/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>w_elem<sp/>=<sp/>0;<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="265"><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/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/>ii=n-<sp/><sp/><sp/><sp/><sp/>cc;ii&lt;=m+i+1;ii++<sp/>)<sp/></highlight></codeline>
<codeline lineno="266"><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/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>w_elem+=<sp/>v(<sp/>ii-n+cc<sp/>)*<ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>(<sp/>ii-1,j<sp/>);<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="267"><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/>w(j)=w_elem*pom;</highlight></codeline>
<codeline lineno="268"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="269"><highlight class="normal"></highlight></codeline>
<codeline lineno="270"><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/>ii=n-cc-1;ii&lt;=m+i;ii++<sp/>)<sp/></highlight></codeline>
<codeline lineno="271"><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/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/>jj=0;jj&lt;i;jj++<sp/>)<sp/></highlight></codeline>
<codeline lineno="272"><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/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>(<sp/>ii,jj<sp/>)+=<sp/>v(<sp/>ii-n+cc+1)*w(<sp/>jj<sp/>);</highlight></codeline>
<codeline lineno="273"><highlight class="normal"></highlight></codeline>
<codeline lineno="274"><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/>ii=n-cc-1;ii&lt;m+i;ii++<sp/>)</highlight></codeline>
<codeline lineno="275"><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/><ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>(<sp/>ii,i<sp/>)=<sp/>0;</highlight></codeline>
<codeline lineno="276"><highlight class="normal"></highlight></codeline>
<codeline lineno="277"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>(<sp/>m+i,i<sp/>)+=w(<sp/>i<sp/>);</highlight></codeline>
<codeline lineno="278"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref>(<sp/>m+i<sp/>)=<ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>(<sp/>m+i,i<sp/>)*<ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>(<sp/>m+i,i<sp/>);</highlight></codeline>
<codeline lineno="279"><highlight class="normal"></highlight></codeline>
<codeline lineno="280"><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/>ii=0;ii&lt;=i;ii++<sp/>)<sp/></highlight></codeline>
<codeline lineno="281"><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/><ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>(<sp/>m+i,ii<sp/>)/=<ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>(<sp/>m+i,i<sp/>);<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="282"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="283"><highlight class="normal"></highlight></codeline>
<codeline lineno="284"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>i&gt;=0<sp/>)</highlight></codeline>
<codeline lineno="285"><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/>ii=0;ii&lt;i;ii++<sp/>)<sp/></highlight></codeline>
<codeline lineno="286"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="287"><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/>jj<sp/>=<sp/><ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref>.length()-1-n+ii;</highlight></codeline>
<codeline lineno="288"><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/><ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref>(jj)<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="289"><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/>L.set_row(jj,zeros(L.cols()));<sp/></highlight><highlight class="comment">//TODO:<sp/>set_row<sp/>accepts<sp/>Num_T</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="290"><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/><ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>(jj,jj)=1;</highlight></codeline>
<codeline lineno="291"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="292"><highlight class="normal"></highlight></codeline>
<codeline lineno="293"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>L.del_rows(0,m-1);</highlight></codeline>
<codeline lineno="294"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classldmat_14cce04824539c4a8d062d9a36d6e014e" kindref="member" tooltip="Positive vector .">D</ref>.del(0,m-1);</highlight></codeline>
<codeline lineno="295"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="296"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classsqmat_10abed904bdc0882373ba9adba919689d" kindref="member" tooltip="dimension of the square matrix">dim</ref><sp/>=<sp/>L.rows();</highlight></codeline>
<codeline lineno="297"><highlight class="normal">}</highlight></codeline>
<codeline lineno="298"><highlight class="normal"></highlight></codeline>
<codeline lineno="300"><highlight class="normal"></highlight></codeline>
<codeline lineno="301" refid="libDC_8h_16715d039e6d5d97005cf9e2522dfa474" refkind="member"><highlight class="normal">mat<sp/>ltuinv(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mat<sp/>&amp;<ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref><sp/>)<sp/>{</highlight></codeline>
<codeline lineno="302"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="classsqmat_10abed904bdc0882373ba9adba919689d" kindref="member" tooltip="dimension of the square matrix">dim</ref><sp/>=<sp/>L.cols();</highlight></codeline>
<codeline lineno="303"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>Il<sp/>=<sp/>eye(<sp/>dim<sp/>);</highlight></codeline>
<codeline lineno="304"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i,<sp/>j,<sp/>k,<sp/>m;</highlight></codeline>
<codeline lineno="305"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>s;</highlight></codeline>
<codeline lineno="306"><highlight class="normal"></highlight></codeline>
<codeline lineno="307"><highlight class="normal"></highlight><highlight class="comment">//Fixme<sp/>blind<sp/>transcription<sp/>of<sp/>ltuinv.m</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="308"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/>k<sp/>=<sp/>1;<sp/>k<sp/>&lt;<sp/>(<sp/>dim<sp/>);k++<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="309"><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/>i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>(<sp/>dim<sp/>-<sp/>k<sp/>);i++<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="310"><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/>j<sp/>=<sp/>i<sp/>+<sp/>k;<sp/></highlight><highlight class="comment">//change<sp/>in<sp/>.m<sp/>1+1=2,<sp/>here<sp/>0+0+1=1</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="311"><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/>s<sp/>=<sp/><ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>(<sp/>j,<sp/>i<sp/>);</highlight></codeline>
<codeline lineno="312"><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/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/>m<sp/>=<sp/>i<sp/>+<sp/>1;<sp/>m<sp/>&lt;<sp/>(<sp/>j<sp/>);<sp/>m++<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="313"><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/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>s<sp/>+=<sp/><ref refid="classldmat_1f74a64b99fe58a75ebd37bb679e121ea" kindref="member" tooltip="Lower-triangular matrix .">L</ref>(<sp/>m,<sp/>i<sp/>)<sp/>*<sp/>Il(<sp/>j,<sp/>m<sp/>);</highlight></codeline>
<codeline lineno="314"><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/>}</highlight></codeline>
<codeline lineno="315"><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/>Il(<sp/>j,<sp/>i<sp/>)<sp/>=<sp/>-s;</highlight></codeline>
<codeline lineno="316"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="317"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="318"><highlight class="normal"></highlight></codeline>
<codeline lineno="319"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>Il;</highlight></codeline>
<codeline lineno="320"><highlight class="normal">}</highlight></codeline>
<codeline lineno="321"><highlight class="normal"></highlight></codeline>
<codeline lineno="322" refid="libDC_8h_14ed56e73b49db8e7f4a63fa926a8dca4" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>dydr(<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>*<sp/>r,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>*f,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>*Dr,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>*Df,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>*R,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>jl,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>jh,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>*kr,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>m,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>mx<sp/>)</highlight></codeline>
<codeline lineno="323"><highlight class="normal"></highlight><highlight class="comment">/********************************************************************</highlight></codeline>
<codeline lineno="324"><highlight class="comment"></highlight></codeline>
<codeline lineno="325"><highlight class="comment"><sp/><sp/><sp/>dydr<sp/>=<sp/>dyadic<sp/>reduction,<sp/>performs<sp/>transformation<sp/>of<sp/>sum<sp/>of</highlight></codeline>
<codeline lineno="326"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>2<sp/>dyads<sp/>r*Dr*r&apos;+<sp/>f*Df*f&apos;<sp/>so<sp/>that<sp/>the<sp/>element<sp/>of<sp/>r<sp/>pointed</highlight></codeline>
<codeline lineno="327"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>by<sp/>R<sp/>is<sp/>zeroed.<sp/>This<sp/>version<sp/>allows<sp/>Dr<sp/>to<sp/>be<sp/>NEGATIVE.<sp/>Hence<sp/>the<sp/>name<sp/>negdydr<sp/>or<sp/>dydr_withneg.</highlight></codeline>
<codeline lineno="328"><highlight class="comment"></highlight></codeline>
<codeline lineno="329"><highlight class="comment"><sp/><sp/><sp/>Parameters<sp/>:</highlight></codeline>
<codeline lineno="330"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/>r<sp/>...<sp/>pointer<sp/>to<sp/>reduced<sp/>dyad</highlight></codeline>
<codeline lineno="331"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/>f<sp/>...<sp/>pointer<sp/>to<sp/>reducing<sp/>dyad</highlight></codeline>
<codeline lineno="332"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/>Dr<sp/>..<sp/>pointer<sp/>to<sp/>the<sp/>weight<sp/>of<sp/>reduced<sp/>dyad</highlight></codeline>
<codeline lineno="333"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/>Df<sp/>..<sp/>pointer<sp/>to<sp/>the<sp/>weight<sp/>of<sp/>reducing<sp/>dyad</highlight></codeline>
<codeline lineno="334"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/>R<sp/>...<sp/>pointer<sp/>to<sp/>the<sp/>element<sp/>of<sp/>r,<sp/>which<sp/>is<sp/>to<sp/>be<sp/>reduced<sp/>to</highlight></codeline>
<codeline lineno="335"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>zero;<sp/>the<sp/>corresponding<sp/>element<sp/>of<sp/>f<sp/>is<sp/>assumed<sp/>to<sp/>be<sp/>1.</highlight></codeline>
<codeline lineno="336"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/>jl<sp/>..<sp/>lower<sp/>index<sp/>of<sp/>the<sp/>range<sp/>within<sp/>which<sp/>the<sp/>dyads<sp/>are</highlight></codeline>
<codeline lineno="337"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>modified</highlight></codeline>
<codeline lineno="338"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/>ju<sp/>..<sp/>upper<sp/>index<sp/>of<sp/>the<sp/>range<sp/>within<sp/>which<sp/>the<sp/>dyads<sp/>are</highlight></codeline>
<codeline lineno="339"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>modified</highlight></codeline>
<codeline lineno="340"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/>kr<sp/>..<sp/>pointer<sp/>to<sp/>the<sp/>coefficient<sp/>used<sp/>in<sp/>the<sp/>transformation<sp/>of<sp/>r</highlight></codeline>
<codeline lineno="341"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>rnew<sp/>=<sp/>r<sp/>+<sp/>kr*f</highlight></codeline>
<codeline lineno="342"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/>m<sp/><sp/>..<sp/>number<sp/>of<sp/>rows<sp/>of<sp/>modified<sp/>matrix<sp/>(part<sp/>of<sp/>which<sp/>is<sp/>r)</highlight></codeline>
<codeline lineno="343"><highlight class="comment"><sp/><sp/>Remark<sp/>:<sp/>Constant<sp/>mzero<sp/>means<sp/>machine<sp/>zero<sp/>and<sp/>should<sp/>be<sp/>modified</highlight></codeline>
<codeline lineno="344"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>according<sp/>to<sp/>the<sp/>precision<sp/>of<sp/>particular<sp/>machine</highlight></codeline>
<codeline lineno="345"><highlight class="comment"></highlight></codeline>
<codeline lineno="346"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>V.<sp/>Peterka<sp/>17-7-89</highlight></codeline>
<codeline lineno="347"><highlight class="comment"></highlight></codeline>
<codeline lineno="348"><highlight class="comment"><sp/><sp/>Added:</highlight></codeline>
<codeline lineno="349"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/>mx<sp/>..<sp/>number<sp/>of<sp/>rows<sp/>of<sp/>modified<sp/>matrix<sp/>(part<sp/>of<sp/>which<sp/>is<sp/>f)<sp/><sp/>-PN</highlight></codeline>
<codeline lineno="350"><highlight class="comment"></highlight></codeline>
<codeline lineno="351"><highlight class="comment">********************************************************************/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="352"><highlight class="normal">{</highlight></codeline>
<codeline lineno="353"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>j,<sp/>jm;</highlight></codeline>
<codeline lineno="354"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>kD,<sp/>r0;</highlight></codeline>
<codeline lineno="355"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>mzero<sp/>=<sp/>2.2e-16;</highlight></codeline>
<codeline lineno="356"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>threshold<sp/>=<sp/>1e-4;</highlight></codeline>
<codeline lineno="357"><highlight class="normal"></highlight></codeline>
<codeline lineno="358"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>fabs(<sp/>*Dr<sp/>)<sp/>&lt;<sp/>mzero<sp/>)<sp/>*Dr<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="359"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>r0<sp/>=<sp/>*R;</highlight></codeline>
<codeline lineno="360"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*R<sp/>=<sp/>0.0;</highlight></codeline>
<codeline lineno="361"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>kD<sp/>=<sp/>*Df;</highlight></codeline>
<codeline lineno="362"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*kr<sp/>=<sp/>r0<sp/>*<sp/>*Dr;</highlight></codeline>
<codeline lineno="363"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*Df<sp/>=<sp/>kD<sp/>+<sp/>r0<sp/>*<sp/>(<sp/>*kr<sp/>);</highlight></codeline>
<codeline lineno="364"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>*Df<sp/>&gt;<sp/>mzero<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="365"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>kD<sp/>/=<sp/>*Df;</highlight></codeline>
<codeline lineno="366"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*kr<sp/>/=<sp/>*Df;</highlight></codeline>
<codeline lineno="367"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="368"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>kD<sp/>=<sp/>1.0;</highlight></codeline>
<codeline lineno="369"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*kr<sp/>=<sp/>0.0;</highlight></codeline>
<codeline lineno="370"><highlight class="normal"><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/>*Df<sp/>&lt;<sp/>-threshold<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="371"><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/>it_warning(<sp/></highlight><highlight class="stringliteral">&quot;Problem<sp/>in<sp/>dydr:<sp/>subraction<sp/>of<sp/>dyad<sp/>results<sp/>in<sp/>negative<sp/>definitness.<sp/>Likely<sp/>mistake<sp/>in<sp/>calling<sp/>function.&quot;</highlight><highlight class="normal"><sp/>);</highlight></codeline>
<codeline lineno="372"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="373"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*Df<sp/>=<sp/>0.0;</highlight></codeline>
<codeline lineno="374"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="375"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*Dr<sp/>*=<sp/>kD;</highlight></codeline>
<codeline lineno="376"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>jm<sp/>=<sp/>mx<sp/>*<sp/>jl;</highlight></codeline>
<codeline lineno="377"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/>j<sp/>=<sp/>m<sp/>*<sp/>jl;<sp/>j<sp/>&lt;<sp/>m*jh;<sp/>j<sp/>+=<sp/>m<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="378"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>r[j]<sp/>-=<sp/><sp/>r0<sp/>*<sp/>f[jm];</highlight></codeline>
<codeline lineno="379"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>f[jm]<sp/>+=<sp/>*kr<sp/>*<sp/>r[j];</highlight></codeline>
<codeline lineno="380"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>jm<sp/>+=<sp/>mx;</highlight></codeline>
<codeline lineno="381"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="382"><highlight class="normal">}</highlight></codeline>
    </programlisting>
    <location file="/home/smidl/work/git/mixpp/bdm/math/libDC.cpp"/>
  </compounddef>
</doxygen>
