<?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="matrix_8cpp" kind="file">
    <compoundname>matrix.cpp</compoundname>
    <includes refid="matrix_8h" local="yes">matrix.h</includes>
    <incdepgraph>
      <node id="757">
        <label>work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp</label>
        <link refid="matrix.cpp"/>
        <childnode refid="758" relation="include">
        </childnode>
      </node>
      <node id="758">
        <label>matrix.h</label>
        <link refid="matrix_8h-source"/>
      </node>
    </incdepgraph>
      <sectiondef kind="func">
      <memberdef kind="function" id="matrix_8cpp_1dc97517fcf76dba18a7b7eadbf485783" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void madd</definition>
        <argsstring>(int *m1, int *m2, int *result, unsigned int rows, unsigned int columns)</argsstring>
        <name>madd</name>
        <param>
          <type>int *</type>
          <declname>m1</declname>
        </param>
        <param>
          <type>int *</type>
          <declname>m2</declname>
        </param>
        <param>
          <type>int *</type>
          <declname>result</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>rows</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>columns</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" line="18" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" bodystart="79" bodyend="86"/>
      </memberdef>
      <memberdef kind="function" id="matrix_8cpp_1eb7b1130cdfdad80c1f6ff08bdabcd9e" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void maddD</definition>
        <argsstring>(int *m1, int *m2, unsigned int minrowcol, unsigned int columns)</argsstring>
        <name>maddD</name>
        <param>
          <type>int *</type>
          <declname>m1</declname>
        </param>
        <param>
          <type>int *</type>
          <declname>m2</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>minrowcol</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>columns</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" line="21" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" bodystart="90" bodyend="102"/>
      </memberdef>
      <memberdef kind="function" id="matrix_8cpp_1fc147fb81a107ed3d11edce11680c73b" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void msub</definition>
        <argsstring>(int *m1, int *m2, int *result, unsigned int rows, unsigned int columns)</argsstring>
        <name>msub</name>
        <param>
          <type>int *</type>
          <declname>m1</declname>
        </param>
        <param>
          <type>int *</type>
          <declname>m2</declname>
        </param>
        <param>
          <type>int *</type>
          <declname>result</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>rows</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>columns</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" line="24" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" bodystart="105" bodyend="112"/>
      </memberdef>
      <memberdef kind="function" id="matrix_8cpp_10dd80217f9ca5906058c49a7383a4498" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void mmult</definition>
        <argsstring>(int *m1, int *m2, int *result, unsigned int rows, unsigned int columnsx, unsigned int columns)</argsstring>
        <name>mmult</name>
        <param>
          <type>int *</type>
          <declname>m1</declname>
        </param>
        <param>
          <type>int *</type>
          <declname>m2</declname>
        </param>
        <param>
          <type>int *</type>
          <declname>result</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>rows</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>columnsx</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>columns</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" line="28" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" bodystart="116" bodyend="147"/>
      </memberdef>
      <memberdef kind="function" id="matrix_8cpp_1aad8e0b5c84bc2ef9c3442d7904493b7" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void mmultt</definition>
        <argsstring>(int *m1, int *m2, int *result, unsigned int rows, unsigned int columnsx, unsigned int columns)</argsstring>
        <name>mmultt</name>
        <param>
          <type>int *</type>
          <declname>m1</declname>
        </param>
        <param>
          <type>int *</type>
          <declname>m2</declname>
        </param>
        <param>
          <type>int *</type>
          <declname>result</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>rows</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>columnsx</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>columns</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" line="32" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" bodystart="151" bodyend="178"/>
      </memberdef>
      <memberdef kind="function" id="matrix_8cpp_180321ddd04c2295a7898aaac3e1f7ca7" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void mmult15</definition>
        <argsstring>(int *m1, int *m2, int *result, unsigned int rows, unsigned int columnsx, unsigned int columns)</argsstring>
        <name>mmult15</name>
        <param>
          <type>int *</type>
          <declname>m1</declname>
        </param>
        <param>
          <type>int *</type>
          <declname>m2</declname>
        </param>
        <param>
          <type>int *</type>
          <declname>result</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>rows</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>columnsx</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>columns</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" line="36" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" bodystart="182" bodyend="212"/>
      </memberdef>
      <memberdef kind="function" id="matrix_8cpp_17b21ce82e50b9491450fbe8f0ba45830" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void mmultt15</definition>
        <argsstring>(int *m1, int *m2, int *result, unsigned int rows, unsigned int columnsx, unsigned int columns)</argsstring>
        <name>mmultt15</name>
        <param>
          <type>int *</type>
          <declname>m1</declname>
        </param>
        <param>
          <type>int *</type>
          <declname>m2</declname>
        </param>
        <param>
          <type>int *</type>
          <declname>result</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>rows</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>columnsx</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>columns</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" line="41" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" bodystart="216" bodyend="242"/>
      </memberdef>
      <memberdef kind="function" id="matrix_8cpp_1acfc7e3b42ad50e39b11f11753b749f6" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void mmult1530</definition>
        <argsstring>(int *m1, long *m2, int *result, unsigned int rows, unsigned int columnsx, unsigned int columns)</argsstring>
        <name>mmult1530</name>
        <param>
          <type>int *</type>
          <declname>m1</declname>
        </param>
        <param>
          <type>long *</type>
          <declname>m2</declname>
        </param>
        <param>
          <type>int *</type>
          <declname>result</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>rows</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>columnsx</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>columns</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" line="46" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" bodystart="246" bodyend="277"/>
      </memberdef>
      <memberdef kind="function" id="matrix_8cpp_1ff076c1db8aa1be1797eede839441da8" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void mmultDl</definition>
        <argsstring>(int *m2, int *result, unsigned int rows, unsigned int columnsx, unsigned int columns, unsigned int minrowcol)</argsstring>
        <name>mmultDl</name>
        <param>
          <type>int *</type>
          <declname>m2</declname>
        </param>
        <param>
          <type>int *</type>
          <declname>result</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>rows</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>columnsx</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>columns</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>minrowcol</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" line="51" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" bodystart="282" bodyend="297"/>
      </memberdef>
      <memberdef kind="function" id="matrix_8cpp_1094cd71f8538a5e9375f0ab2759b688d" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void mmultDl15</definition>
        <argsstring>(int *DIAG, int *m2, int *result, unsigned int rows, unsigned int columnsx, unsigned int columns, unsigned int minrowcol)</argsstring>
        <name>mmultDl15</name>
        <param>
          <type>int *</type>
          <declname>DIAG</declname>
        </param>
        <param>
          <type>int *</type>
          <declname>m2</declname>
        </param>
        <param>
          <type>int *</type>
          <declname>result</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>rows</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>columnsx</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>columns</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>minrowcol</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" line="56" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" bodystart="302" bodyend="321"/>
      </memberdef>
      <memberdef kind="function" id="matrix_8cpp_1ececc21a99cfdc6238b5fbe1a0e61bb4" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void mmultDr</definition>
        <argsstring>(int *m1, int *result, unsigned int rows, unsigned int columnsx, unsigned int columns, unsigned int minrowcol)</argsstring>
        <name>mmultDr</name>
        <param>
          <type>int *</type>
          <declname>m1</declname>
        </param>
        <param>
          <type>int *</type>
          <declname>result</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>rows</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>columnsx</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>columns</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>minrowcol</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" line="61" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" bodystart="326" bodyend="346"/>
      </memberdef>
      <memberdef kind="function" id="matrix_8cpp_1001bd19384a1c2f9fb3450c4f3476fa4" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void mmultDr15</definition>
        <argsstring>(int *m1, int *DIAG, int *result, unsigned int rows, unsigned int columnsx, unsigned int columns, unsigned int minrowcol)</argsstring>
        <name>mmultDr15</name>
        <param>
          <type>int *</type>
          <declname>m1</declname>
        </param>
        <param>
          <type>int *</type>
          <declname>DIAG</declname>
        </param>
        <param>
          <type>int *</type>
          <declname>result</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>rows</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>columnsx</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>columns</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>minrowcol</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" line="66" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" bodystart="352" bodyend="377"/>
      </memberdef>
      <memberdef kind="function" id="matrix_8cpp_10803daba60892817dd95383f10e2b501" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void mtrans</definition>
        <argsstring>(int *m1, int *result, unsigned int rows, unsigned int columns)</argsstring>
        <name>mtrans</name>
        <param>
          <type>int *</type>
          <declname>m1</declname>
        </param>
        <param>
          <type>int *</type>
          <declname>result</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>rows</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>columns</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" line="69" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" bodystart="381" bodyend="388"/>
      </memberdef>
      <memberdef kind="function" id="matrix_8cpp_16281b33c494f55a0e1f56cc6ec226728" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void minv2</definition>
        <argsstring>(int *matrix, long *result)</argsstring>
        <name>minv2</name>
        <param>
          <type>int *</type>
          <declname>matrix</declname>
        </param>
        <param>
          <type>long *</type>
          <declname>result</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" line="72" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" bodystart="391" bodyend="403"/>
      </memberdef>
      <memberdef kind="function" id="matrix_8cpp_14cf0ac2cd86f2dfd9c984ae7599bad65" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void choice_P</definition>
        <argsstring>(int *m, int *result, unsigned int columns)</argsstring>
        <name>choice_P</name>
        <param>
          <type>int *</type>
          <declname>m</declname>
        </param>
        <param>
          <type>int *</type>
          <declname>result</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>columns</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" line="74" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" bodystart="406" bodyend="412"/>
      </memberdef>
      <memberdef kind="function" id="matrix_8cpp_117f6067daa5a602765f81590b8c69189" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void choice_x</definition>
        <argsstring>(int *m, int *result)</argsstring>
        <name>choice_x</name>
        <param>
          <type>int *</type>
          <declname>m</declname>
        </param>
        <param>
          <type>int *</type>
          <declname>result</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" line="75" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp" bodystart="415" bodyend="419"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="comment">/************************************</highlight></codeline>
<codeline lineno="2"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Extended<sp/>Kalman<sp/>Filter</highlight></codeline>
<codeline lineno="3"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Matrix<sp/>operations</highlight></codeline>
<codeline lineno="4"><highlight class="comment"></highlight></codeline>
<codeline lineno="5"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Z.<sp/>Peroutka</highlight></codeline>
<codeline lineno="6"><highlight class="comment"></highlight></codeline>
<codeline lineno="7"><highlight class="comment">Rev.<sp/>15.3.2008</highlight></codeline>
<codeline lineno="8"><highlight class="comment"></highlight></codeline>
<codeline lineno="9"><highlight class="comment">15.3.<sp/>2008<sp/><sp/><sp/><sp/><sp/><sp/>Kompletni<sp/>kontrola<sp/>vypoctu<sp/>+<sp/>zamena<sp/>q15-&gt;int<sp/>a<sp/>q30-&gt;long</highlight></codeline>
<codeline lineno="10"><highlight class="comment"></highlight></codeline>
<codeline lineno="11"><highlight class="comment">*************************************/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="12"><highlight class="normal"></highlight></codeline>
<codeline lineno="13"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;matrix.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="14"><highlight class="normal"></highlight></codeline>
<codeline lineno="15"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>Vsechny<sp/>meze<sp/>se<sp/>udavaji<sp/>ve<sp/>tvaru<sp/>(rozmer_matice<sp/>-<sp/>1),<sp/>abych<sp/>mel<sp/>ve<sp/>FOR<sp/>konstantni<sp/>horni<sp/>mez)<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="16"><highlight class="normal"></highlight></codeline>
<codeline lineno="17"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>Matrix<sp/>addition<sp/>in<sp/>q15:<sp/>m1<sp/>+<sp/>m2<sp/>=<sp/>result[rows,<sp/>columns]<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="18"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>madd(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m1,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m2,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*result,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rows,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>columns);</highlight></codeline>
<codeline lineno="19"><highlight class="normal"></highlight></codeline>
<codeline lineno="20"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>add<sp/>diagonal<sp/>matrix<sp/>m2<sp/>to<sp/>matrix<sp/>m1<sp/>-<sp/>both<sp/>in<sp/>format<sp/>q15,<sp/>minrowcol<sp/>=<sp/>min(rows,<sp/>columns)<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="21"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>maddD(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m1,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m2,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>minrowcol,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>columns);</highlight></codeline>
<codeline lineno="22"><highlight class="normal"></highlight></codeline>
<codeline lineno="23"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>Matrix<sp/>substraction<sp/>in<sp/>q15:<sp/>m1<sp/>-<sp/>m2<sp/>=<sp/>result[rows,<sp/>columns]<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="24"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>msub(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m1,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m2,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*result,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rows,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>columns);</highlight></codeline>
<codeline lineno="25"><highlight class="normal"></highlight></codeline>
<codeline lineno="26"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>Matrix<sp/>multiply<sp/>in<sp/>q15:<sp/>m1[rows,columnsx]*m2[columnsx,columns]<sp/>=<sp/>result[rows,columns]<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="27"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>mmult(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m1,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m2,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*result,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rows,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>columnsx,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="28"><highlight class="normal">columns);</highlight></codeline>
<codeline lineno="29"><highlight class="normal"></highlight></codeline>
<codeline lineno="30"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>Matrix<sp/>multiplication<sp/>in<sp/>q15:<sp/>m1[rows,columnsx]*(m2[columnsx,columns]transpose)<sp/>=<sp/>result[rows,columns]<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="31"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>mmultt(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m1,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m2,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*result,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rows,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>columnsx,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="32"><highlight class="normal">columns);</highlight></codeline>
<codeline lineno="33"><highlight class="normal"></highlight></codeline>
<codeline lineno="34"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>matrix<sp/>multiplication<sp/>in<sp/>q15:<sp/>sum<sp/>is<sp/>in<sp/>q15<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="35"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>mmult15(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m1,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m2,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*result,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rows,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>columnsx,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="36"><highlight class="normal">columns);</highlight></codeline>
<codeline lineno="37"><highlight class="normal"></highlight></codeline>
<codeline lineno="38"><highlight class="normal"></highlight></codeline>
<codeline lineno="39"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>Matrix<sp/>multiplication<sp/>in<sp/>q15<sp/>(sum<sp/>is<sp/>in<sp/>q15):<sp/>m1[rows,columnsx]*(m2[columns,columnsx]transpose)<sp/>=<sp/>result[rows,columns]<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="40"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>mmultt15(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m1,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m2,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*result,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rows,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>columnsx,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="41"><highlight class="normal">columns);</highlight></codeline>
<codeline lineno="42"><highlight class="normal"></highlight></codeline>
<codeline lineno="43"><highlight class="normal"></highlight></codeline>
<codeline lineno="44"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>Matrix<sp/>multiplication<sp/>-<sp/>Q15<sp/>*<sp/>Q30<sp/>format<sp/>-&gt;<sp/>RESULT<sp/>in<sp/>Q15<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="45"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>mmult1530(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m1,<sp/></highlight><highlight class="keywordtype">long</highlight><highlight class="normal"><sp/>*m2,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*result,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rows,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>columnsx,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="46"><highlight class="normal">columns);</highlight></codeline>
<codeline lineno="47"><highlight class="normal"></highlight></codeline>
<codeline lineno="48"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>Left<sp/>matrix<sp/>multiplication<sp/>with<sp/>DIAG<sp/>ones<sp/>matrix<sp/>in<sp/>q15:<sp/>DIAG[rows,columnsx]*m2[columnsx,columns]<sp/>=<sp/>result[rows,columns]</highlight></codeline>
<codeline lineno="49"><highlight class="comment">minrowcol=minimum(rows,<sp/>columnsx)<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="50"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>mmultDl(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m2,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*result,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rows,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>columnsx,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="51"><highlight class="normal">columns,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>minrowcol);</highlight></codeline>
<codeline lineno="52"><highlight class="normal"></highlight></codeline>
<codeline lineno="53"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>Left<sp/>matrix<sp/>multiplication<sp/>with<sp/>DIAG<sp/>matrix<sp/>in<sp/>q15:<sp/>DIAG[rows,columnsx]*m2[columnsx,columns]<sp/>=<sp/>result[rows,columns]</highlight></codeline>
<codeline lineno="54"><highlight class="comment">minrowcol=minimum(rows,<sp/>columnsx)<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="55"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>mmultDl15(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*DIAG,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m2,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*result,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rows,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>columnsx,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="56"><highlight class="normal">columns,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>minrowcol);</highlight></codeline>
<codeline lineno="57"><highlight class="normal"></highlight></codeline>
<codeline lineno="58"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>Right<sp/>matrix<sp/>multiplication<sp/>with<sp/>DIAG<sp/>ones<sp/>matrix<sp/>in<sp/>q15:<sp/>m1[rows,columnsx]*DIAG[columnsx,columns]<sp/>=<sp/>result[rows,columns]</highlight></codeline>
<codeline lineno="59"><highlight class="comment">minrowcol=minimum(columnsx,columns)<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="60"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>mmultDr(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m1,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*result,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rows,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>columnsx,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="61"><highlight class="normal">columns,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>minrowcol);</highlight></codeline>
<codeline lineno="62"><highlight class="normal"></highlight></codeline>
<codeline lineno="63"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>Right<sp/>matrix<sp/>multiplication<sp/>with<sp/>DIAG<sp/>matrix<sp/>in<sp/>q15:<sp/>m1[rows,columnsx]*DIAG[columnsx,columns]<sp/>=<sp/>result[rows,columns]</highlight></codeline>
<codeline lineno="64"><highlight class="comment">minrowcol=minimum(columnsx,columns)<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="65"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>mmultDr15(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m1,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*DIAG,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*result,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rows,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>columnsx,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="66"><highlight class="normal">columns,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>minrowcol);</highlight></codeline>
<codeline lineno="67"><highlight class="normal"></highlight></codeline>
<codeline lineno="68"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>Matrix<sp/>transposition<sp/>in<sp/>q15:<sp/>m1.&apos;<sp/>=<sp/>result[rows,<sp/>columns]<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="69"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>mtrans(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m1,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*result,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rows,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>columns);</highlight></codeline>
<codeline lineno="70"><highlight class="normal"></highlight></codeline>
<codeline lineno="71"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>Matrix<sp/>[2,2]<sp/>inversion<sp/>in<sp/>q15:<sp/>inv(m1)<sp/>=<sp/>result[rows,<sp/>columns]<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="72"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>minv2(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*matrix,<sp/></highlight><highlight class="keywordtype">long</highlight><highlight class="normal"><sp/>*result);</highlight></codeline>
<codeline lineno="73"><highlight class="normal"></highlight></codeline>
<codeline lineno="74"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>choice_P(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*result,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>columns);</highlight></codeline>
<codeline lineno="75"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>choice_x(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*result);</highlight></codeline>
<codeline lineno="76"><highlight class="normal"></highlight></codeline>
<codeline lineno="77"><highlight class="normal"></highlight></codeline>
<codeline lineno="78"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>matrix<sp/>addition<sp/>in<sp/>q15<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="79"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>madd(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m1,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m2,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*result,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rows,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>columns)</highlight></codeline>
<codeline lineno="80"><highlight class="normal">{</highlight></codeline>
<codeline lineno="81"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i,j;</highlight></codeline>
<codeline lineno="82"><highlight class="normal"></highlight></codeline>
<codeline lineno="83"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i=0;<sp/>i&lt;=rows;<sp/>i++)</highlight></codeline>
<codeline lineno="84"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(j=0;<sp/>j&lt;=columns;<sp/>j++)</highlight></codeline>
<codeline lineno="85"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>*result++<sp/>=<sp/>*m1++<sp/>+<sp/>*m2++;</highlight></codeline>
<codeline lineno="86"><highlight class="normal">}</highlight></codeline>
<codeline lineno="87"><highlight class="normal"></highlight></codeline>
<codeline lineno="88"><highlight class="normal"></highlight></codeline>
<codeline lineno="89"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>add<sp/>diagonal<sp/>matrix<sp/>m2<sp/>to<sp/>matrix<sp/>m1<sp/>-<sp/>both<sp/>in<sp/>format<sp/>q15,<sp/>minrowcol<sp/>=<sp/>min(rows,<sp/>columns)<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="90"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>maddD(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m1,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m2,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>minrowcol,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>columns)</highlight></codeline>
<codeline lineno="91"><highlight class="normal">{</highlight></codeline>
<codeline lineno="92"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
<codeline lineno="93"><highlight class="normal"></highlight></codeline>
<codeline lineno="94"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i=0;<sp/>i&lt;=minrowcol;<sp/>i++)</highlight></codeline>
<codeline lineno="95"><highlight class="normal"></highlight><highlight class="comment">/*<sp/><sp/><sp/><sp/>*(m1+i*(columns+1)+i)<sp/>+=<sp/>*(m2+i*(columns+1)+i);<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="96"><highlight class="normal"><sp/><sp/>{</highlight></codeline>
<codeline lineno="97"><highlight class="normal"><sp/><sp/><sp/><sp/>*m1<sp/>+=<sp/>*m2;</highlight></codeline>
<codeline lineno="98"><highlight class="normal"><sp/><sp/><sp/><sp/>m1+=(columns+2);</highlight></codeline>
<codeline lineno="99"><highlight class="normal"><sp/><sp/><sp/><sp/>m2+=(columns+2);</highlight></codeline>
<codeline lineno="100"><highlight class="normal"><sp/><sp/>}</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"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>Matrix<sp/>substraction<sp/>in<sp/>q15<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="105"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>msub(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m1,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m2,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*result,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rows,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>columns)</highlight></codeline>
<codeline lineno="106"><highlight class="normal">{</highlight></codeline>
<codeline lineno="107"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i,j;</highlight></codeline>
<codeline lineno="108"><highlight class="normal"></highlight></codeline>
<codeline lineno="109"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i=0;<sp/>i&lt;=rows;<sp/>i++)</highlight></codeline>
<codeline lineno="110"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(j=0;<sp/>j&lt;=columns;<sp/>j++)</highlight></codeline>
<codeline lineno="111"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>*result++<sp/>=<sp/>*m1++<sp/>-<sp/>*m2++;</highlight></codeline>
<codeline lineno="112"><highlight class="normal">}</highlight></codeline>
<codeline lineno="113"><highlight class="normal"></highlight></codeline>
<codeline lineno="114"><highlight class="normal"></highlight></codeline>
<codeline lineno="115"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>matrix<sp/>multiplication<sp/>in<sp/>q15<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="116"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>mmult(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m1,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m2,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*result,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rows,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>columnsx,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="117"><highlight class="normal">columns)</highlight></codeline>
<codeline lineno="118"><highlight class="normal">{</highlight></codeline>
<codeline lineno="119"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i,<sp/>j,<sp/>k;</highlight></codeline>
<codeline lineno="120"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">long</highlight><highlight class="normal"><sp/>tmp_sum=0;</highlight></codeline>
<codeline lineno="121"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m2pom;</highlight></codeline>
<codeline lineno="122"><highlight class="normal"></highlight></codeline>
<codeline lineno="123"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i=0;<sp/>i&lt;=rows;<sp/>i++)</highlight></codeline>
<codeline lineno="124"><highlight class="normal"><sp/><sp/>{</highlight></codeline>
<codeline lineno="125"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(j=0;<sp/>j&lt;=columns;<sp/>j++)</highlight></codeline>
<codeline lineno="126"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="127"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>m2pom=m2+j;</highlight></codeline>
<codeline lineno="128"><highlight class="normal"></highlight></codeline>
<codeline lineno="129"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(k=0;<sp/>k&lt;=columnsx;<sp/>k++)</highlight></codeline>
<codeline lineno="130"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="131"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmp_sum+=(long)(*m1++)**m2pom;</highlight></codeline>
<codeline lineno="132"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>m2pom+=columns+1;</highlight></codeline>
<codeline lineno="133"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="134"><highlight class="normal"></highlight></codeline>
<codeline lineno="135"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>saturation<sp/>effect</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="136"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>tmp_sum=tmp_sum&gt;&gt;15;</highlight></codeline>
<codeline lineno="137"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tmp_sum&gt;32767)<sp/>tmp_sum=32767;</highlight></codeline>
<codeline lineno="138"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tmp_sum&lt;-32768)<sp/>tmp_sum=-32768;</highlight></codeline>
<codeline lineno="139"><highlight class="normal"></highlight></codeline>
<codeline lineno="140"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>*result++=tmp_sum;</highlight></codeline>
<codeline lineno="141"><highlight class="normal"></highlight></codeline>
<codeline lineno="142"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>tmp_sum=0;</highlight></codeline>
<codeline lineno="143"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>m1-=(columnsx+1);</highlight></codeline>
<codeline lineno="144"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="145"><highlight class="normal"><sp/><sp/><sp/><sp/>m1+=(columnsx+1);</highlight></codeline>
<codeline lineno="146"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="147"><highlight class="normal">}</highlight></codeline>
<codeline lineno="148"><highlight class="normal"></highlight></codeline>
<codeline lineno="149"><highlight class="normal"></highlight></codeline>
<codeline lineno="150"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>Matrix<sp/>multiplication<sp/>in<sp/>q15:<sp/>m1[rows,columnsx]*(m2[columns,columnsx]transpose)<sp/>=<sp/>result[rows,columns]<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="151"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>mmultt(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m1,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m2,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*result,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rows,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>columnsx,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="152"><highlight class="normal">columns)</highlight></codeline>
<codeline lineno="153"><highlight class="normal">{</highlight></codeline>
<codeline lineno="154"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i,<sp/>j,<sp/>k;</highlight></codeline>
<codeline lineno="155"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">long</highlight><highlight class="normal"><sp/>tmp_sum=0;</highlight></codeline>
<codeline lineno="156"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m2pom=m2;</highlight></codeline>
<codeline lineno="157"><highlight class="normal"></highlight></codeline>
<codeline lineno="158"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i=0;<sp/>i&lt;=rows;<sp/>i++)</highlight></codeline>
<codeline lineno="159"><highlight class="normal"><sp/><sp/>{</highlight></codeline>
<codeline lineno="160"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(j=0;<sp/>j&lt;=columns;<sp/>j++)</highlight></codeline>
<codeline lineno="161"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="162"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(k=0;<sp/>k&lt;=columnsx;<sp/>k++)</highlight></codeline>
<codeline lineno="163"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmp_sum+=(</highlight><highlight class="keywordtype">long</highlight><highlight class="normal">)(*m1++)*(*m2pom++);</highlight></codeline>
<codeline lineno="164"><highlight class="normal"></highlight></codeline>
<codeline lineno="165"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>saturation<sp/>effect</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="166"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>tmp_sum=tmp_sum&gt;&gt;15;</highlight></codeline>
<codeline lineno="167"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tmp_sum&gt;32767)<sp/>tmp_sum=32767;</highlight></codeline>
<codeline lineno="168"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tmp_sum&lt;-32768)<sp/>tmp_sum=-32768;</highlight></codeline>
<codeline lineno="169"><highlight class="normal"></highlight></codeline>
<codeline lineno="170"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>*result++=tmp_sum;</highlight></codeline>
<codeline lineno="171"><highlight class="normal"></highlight></codeline>
<codeline lineno="172"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>tmp_sum=0;</highlight></codeline>
<codeline lineno="173"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>m1-=(columnsx+1);</highlight></codeline>
<codeline lineno="174"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="175"><highlight class="normal"><sp/><sp/><sp/><sp/>m2pom=m2;</highlight></codeline>
<codeline lineno="176"><highlight class="normal"><sp/><sp/><sp/><sp/>m1+=(columnsx+1);</highlight></codeline>
<codeline lineno="177"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="178"><highlight class="normal">}</highlight></codeline>
<codeline lineno="179"><highlight class="normal"></highlight></codeline>
<codeline lineno="180"><highlight class="normal"></highlight></codeline>
<codeline lineno="181"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>matrix<sp/>multiplication<sp/>in<sp/>q15:<sp/>sum<sp/>is<sp/>in<sp/>q15<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="182"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>mmult15(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m1,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m2,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*result,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rows,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>columnsx,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="183"><highlight class="normal">columns)</highlight></codeline>
<codeline lineno="184"><highlight class="normal">{</highlight></codeline>
<codeline lineno="185"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i,<sp/>j,<sp/>k;</highlight></codeline>
<codeline lineno="186"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">long</highlight><highlight class="normal"><sp/>tmp_sum=0;</highlight></codeline>
<codeline lineno="187"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m2pom;</highlight></codeline>
<codeline lineno="188"><highlight class="normal"></highlight></codeline>
<codeline lineno="189"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i=0;<sp/>i&lt;=rows;<sp/>i++)</highlight></codeline>
<codeline lineno="190"><highlight class="normal"><sp/><sp/>{</highlight></codeline>
<codeline lineno="191"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(j=0;<sp/>j&lt;=columns;<sp/>j++)</highlight></codeline>
<codeline lineno="192"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="193"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>m2pom=m2+j;</highlight></codeline>
<codeline lineno="194"><highlight class="normal"></highlight></codeline>
<codeline lineno="195"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(k=0;<sp/>k&lt;=columnsx;<sp/>k++)</highlight></codeline>
<codeline lineno="196"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="197"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmp_sum+=((long)(*m1++)**m2pom)&gt;&gt;15;</highlight></codeline>
<codeline lineno="198"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>m2pom+=columns+1;</highlight></codeline>
<codeline lineno="199"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="200"><highlight class="normal"></highlight></codeline>
<codeline lineno="201"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>saturation<sp/>effect</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="202"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tmp_sum&gt;32767)<sp/>tmp_sum=32767;</highlight></codeline>
<codeline lineno="203"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tmp_sum&lt;-32768)<sp/>tmp_sum=-32768;</highlight></codeline>
<codeline lineno="204"><highlight class="normal"></highlight></codeline>
<codeline lineno="205"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>*result++=tmp_sum;</highlight></codeline>
<codeline lineno="206"><highlight class="normal"></highlight></codeline>
<codeline lineno="207"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>tmp_sum=0;</highlight></codeline>
<codeline lineno="208"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>m1-=(columnsx+1);</highlight></codeline>
<codeline lineno="209"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="210"><highlight class="normal"><sp/><sp/><sp/><sp/>m1+=(columnsx+1);</highlight></codeline>
<codeline lineno="211"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="212"><highlight class="normal">}</highlight></codeline>
<codeline lineno="213"><highlight class="normal"></highlight></codeline>
<codeline lineno="214"><highlight class="normal"></highlight></codeline>
<codeline lineno="215"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>Matrix<sp/>multiplication<sp/>in<sp/>q15<sp/>(sum<sp/>is<sp/>in<sp/>q15):<sp/>m1[rows,columnsx]*(m2[columns,columnsx]transpose)<sp/>=<sp/>result[rows,columns]<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="216"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>mmultt15(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m1,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m2,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*result,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rows,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>columnsx,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="217"><highlight class="normal">columns)</highlight></codeline>
<codeline lineno="218"><highlight class="normal">{</highlight></codeline>
<codeline lineno="219"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i,<sp/>j,<sp/>k;</highlight></codeline>
<codeline lineno="220"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">long</highlight><highlight class="normal"><sp/>tmp_sum=0;</highlight></codeline>
<codeline lineno="221"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m2pom=m2;</highlight></codeline>
<codeline lineno="222"><highlight class="normal"></highlight></codeline>
<codeline lineno="223"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i=0;<sp/>i&lt;=rows;<sp/>i++)</highlight></codeline>
<codeline lineno="224"><highlight class="normal"><sp/><sp/>{</highlight></codeline>
<codeline lineno="225"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(j=0;<sp/>j&lt;=columns;<sp/>j++)</highlight></codeline>
<codeline lineno="226"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="227"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(k=0;<sp/>k&lt;=columnsx;<sp/>k++)</highlight></codeline>
<codeline lineno="228"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmp_sum+=((</highlight><highlight class="keywordtype">long</highlight><highlight class="normal">)(*m1++)*(*m2pom++))&gt;&gt;15;</highlight></codeline>
<codeline lineno="229"><highlight class="normal"></highlight></codeline>
<codeline lineno="230"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>saturation<sp/>effect</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="231"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tmp_sum&gt;32767)<sp/>tmp_sum=32767;</highlight></codeline>
<codeline lineno="232"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tmp_sum&lt;-32768)<sp/>tmp_sum=-32768;</highlight></codeline>
<codeline lineno="233"><highlight class="normal"></highlight></codeline>
<codeline lineno="234"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>*result++=tmp_sum;</highlight></codeline>
<codeline lineno="235"><highlight class="normal"></highlight></codeline>
<codeline lineno="236"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>tmp_sum=0;</highlight></codeline>
<codeline lineno="237"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>m1-=(columnsx+1);</highlight></codeline>
<codeline lineno="238"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="239"><highlight class="normal"><sp/><sp/><sp/><sp/>m2pom=m2;</highlight></codeline>
<codeline lineno="240"><highlight class="normal"><sp/><sp/><sp/><sp/>m1+=(columnsx+1);</highlight></codeline>
<codeline lineno="241"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="242"><highlight class="normal">}</highlight></codeline>
<codeline lineno="243"><highlight class="normal"></highlight></codeline>
<codeline lineno="244"><highlight class="normal"></highlight></codeline>
<codeline lineno="245"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>Matrix<sp/>multiplication<sp/>-<sp/>Q15<sp/>*<sp/>Q30<sp/>format<sp/>-&gt;<sp/>RESULT<sp/>in<sp/>Q15<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="246"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>mmult1530(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m1,<sp/></highlight><highlight class="keywordtype">long</highlight><highlight class="normal"><sp/>*m2,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*result,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rows,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>columnsx,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="247"><highlight class="normal">columns)</highlight></codeline>
<codeline lineno="248"><highlight class="normal">{</highlight></codeline>
<codeline lineno="249"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i,<sp/>j,<sp/>k;</highlight></codeline>
<codeline lineno="250"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">long</highlight><highlight class="normal"><sp/>tmp_sum=0;</highlight></codeline>
<codeline lineno="251"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">long</highlight><highlight class="normal"><sp/>*m2pom;</highlight></codeline>
<codeline lineno="252"><highlight class="normal"></highlight></codeline>
<codeline lineno="253"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i=0;<sp/>i&lt;=rows;<sp/>i++)</highlight></codeline>
<codeline lineno="254"><highlight class="normal"><sp/><sp/>{</highlight></codeline>
<codeline lineno="255"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(j=0;<sp/>j&lt;=columns;<sp/>j++)</highlight></codeline>
<codeline lineno="256"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="257"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>m2pom=m2+j;</highlight></codeline>
<codeline lineno="258"><highlight class="normal"></highlight></codeline>
<codeline lineno="259"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(k=0;<sp/>k&lt;=columnsx;<sp/>k++)</highlight></codeline>
<codeline lineno="260"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="261"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmp_sum+=(long)(*m1++)**m2pom;</highlight></codeline>
<codeline lineno="262"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>m2pom+=columns+1;</highlight></codeline>
<codeline lineno="263"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="264"><highlight class="normal"></highlight></codeline>
<codeline lineno="265"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>saturation<sp/>effect</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="266"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>tmp_sum=tmp_sum&gt;&gt;15;</highlight></codeline>
<codeline lineno="267"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tmp_sum&gt;32767)<sp/>tmp_sum=32767;</highlight></codeline>
<codeline lineno="268"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tmp_sum&lt;-32768)<sp/>tmp_sum=-32768;</highlight></codeline>
<codeline lineno="269"><highlight class="normal"></highlight></codeline>
<codeline lineno="270"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>*result++=tmp_sum;</highlight></codeline>
<codeline lineno="271"><highlight class="normal"></highlight></codeline>
<codeline lineno="272"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>tmp_sum=0;</highlight></codeline>
<codeline lineno="273"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>m1-=(columnsx+1);</highlight></codeline>
<codeline lineno="274"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="275"><highlight class="normal"><sp/><sp/><sp/><sp/>m1+=(columnsx+1);</highlight></codeline>
<codeline lineno="276"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="277"><highlight class="normal">}</highlight></codeline>
<codeline lineno="278"><highlight class="normal"><sp/></highlight></codeline>
<codeline lineno="279"><highlight class="normal"></highlight></codeline>
<codeline lineno="280"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>Left<sp/>matrix<sp/>multiplication<sp/>with<sp/>DIAG<sp/>ones<sp/>matrix<sp/>in<sp/>q15:<sp/>DIAG[rows,columnsx]*m2[columnsx,columns]<sp/>=<sp/>result[rows,columns]<sp/></highlight></codeline>
<codeline lineno="281"><highlight class="comment">minrowcol=minimum(rows,<sp/>columnsx)<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="282"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>mmultDl(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m2,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*result,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rows,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>columnsx,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="283"><highlight class="normal">columns,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>minrowcol)</highlight></codeline>
<codeline lineno="284"><highlight class="normal">{</highlight></codeline>
<codeline lineno="285"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i,j;</highlight></codeline>
<codeline lineno="286"><highlight class="normal"></highlight><highlight class="comment">/*<sp/><sp/>int<sp/>*res_tmp=result;<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="287"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="288"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>This<sp/>erase<sp/>sequence<sp/>have<sp/>to<sp/>be<sp/>enabled<sp/>in<sp/>case<sp/>that<sp/>result<sp/>matrix<sp/>has<sp/>more<sp/>terms<sp/>than<sp/>DIAG<sp/>matrix<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="289"><highlight class="normal"></highlight><highlight class="comment">/*<sp/><sp/>for<sp/>(i=0;i&lt;=rows;i++)<sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="290"><highlight class="comment"><sp/><sp/><sp/><sp/>for<sp/>(j=0;j&lt;=columns;j++)</highlight></codeline>
<codeline lineno="291"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/>*res_tmp++=0;</highlight></codeline>
<codeline lineno="292"><highlight class="comment">/*<sp/>END<sp/>OF<sp/>ERASE<sp/>SEQUENCE<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="293"><highlight class="normal"></highlight></codeline>
<codeline lineno="294"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i=0;i&lt;=minrowcol;i++)</highlight></codeline>
<codeline lineno="295"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(j=0;j&lt;=columns;j++)</highlight></codeline>
<codeline lineno="296"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>*result++=*m2++;</highlight></codeline>
<codeline lineno="297"><highlight class="normal">}</highlight></codeline>
<codeline lineno="298"><highlight class="normal"></highlight></codeline>
<codeline lineno="299"><highlight class="normal"></highlight></codeline>
<codeline lineno="300"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>Left<sp/>matrix<sp/>multiplication<sp/>with<sp/>DIAG<sp/>matrix<sp/>in<sp/>q15:<sp/>DIAG[rows,columnsx]*m2[columnsx,columns]<sp/>=<sp/>result[rows,columns]<sp/></highlight></codeline>
<codeline lineno="301"><highlight class="comment">minrowcol=minimum(rows,<sp/>columnsx)<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="302"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>mmultDl15(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*DIAG,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m2,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*result,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rows,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>columnsx,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="303"><highlight class="normal">columns,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>minrowcol)</highlight></codeline>
<codeline lineno="304"><highlight class="normal">{</highlight></codeline>
<codeline lineno="305"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i,j;</highlight></codeline>
<codeline lineno="306"><highlight class="normal"></highlight><highlight class="comment">/*<sp/><sp/>int<sp/>*res_tmp=result;<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="307"><highlight class="normal"></highlight></codeline>
<codeline lineno="308"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>This<sp/>erase<sp/>sequence<sp/>have<sp/>to<sp/>be<sp/>enabled<sp/>in<sp/>case<sp/>that<sp/>result<sp/>matrix<sp/>has<sp/>more<sp/>terms<sp/>than<sp/>DIAG<sp/>matrix<sp/>*/</highlight><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="309"><highlight class="normal"></highlight><highlight class="comment">/*<sp/><sp/>for<sp/>(i=0;i&lt;=rows;i++)<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="310"><highlight class="comment"><sp/><sp/><sp/><sp/>for<sp/>(j=0;j&lt;=columns;j++)</highlight></codeline>
<codeline lineno="311"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/>*res_tmp++=0;</highlight></codeline>
<codeline lineno="312"><highlight class="comment">/*<sp/>END<sp/>OF<sp/>ERASE<sp/>SEQUENCE<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="313"><highlight class="normal"></highlight></codeline>
<codeline lineno="314"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i=0;i&lt;=minrowcol;i++)</highlight></codeline>
<codeline lineno="315"><highlight class="normal"><sp/><sp/>{</highlight></codeline>
<codeline lineno="316"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(j=0;j&lt;=columns;j++)</highlight></codeline>
<codeline lineno="317"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>*result++=((</highlight><highlight class="keywordtype">long</highlight><highlight class="normal">)(*DIAG)*(*m2++))&gt;&gt;15;</highlight></codeline>
<codeline lineno="318"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="319"><highlight class="normal"><sp/><sp/><sp/><sp/>DIAG+=(columnsx+1);</highlight></codeline>
<codeline lineno="320"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="321"><highlight class="normal">}</highlight></codeline>
<codeline lineno="322"><highlight class="normal"></highlight></codeline>
<codeline lineno="323"><highlight class="normal"></highlight></codeline>
<codeline lineno="324"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>Right<sp/>matrix<sp/>multiplication<sp/>with<sp/>DIAG<sp/>ones<sp/>matrix<sp/>in<sp/>q15:<sp/>m1[rows,columnsx]*DIAG[columnsx,columns]<sp/>=<sp/>result[rows,columns]<sp/></highlight></codeline>
<codeline lineno="325"><highlight class="comment">minrowcol=minimum(columnsx,columns)<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="326"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>mmultDr(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m1,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*result,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rows,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>columnsx,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="327"><highlight class="normal">columns,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>minrowcol)</highlight></codeline>
<codeline lineno="328"><highlight class="normal">{</highlight></codeline>
<codeline lineno="329"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i,j;</highlight></codeline>
<codeline lineno="330"><highlight class="normal"></highlight><highlight class="comment">/*<sp/><sp/>int<sp/>*res_tmp=result;<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="331"><highlight class="normal"></highlight></codeline>
<codeline lineno="332"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>This<sp/>erase<sp/>sequence<sp/>have<sp/>to<sp/>be<sp/>enabled<sp/>in<sp/>case<sp/>that<sp/>result<sp/>matrix<sp/>has<sp/>more<sp/>terms<sp/>than<sp/>DIAG<sp/>matrix<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="333"><highlight class="normal"></highlight><highlight class="comment">/*<sp/><sp/>for<sp/>(i=0;i&lt;=rows;i++)</highlight></codeline>
<codeline lineno="334"><highlight class="comment"><sp/><sp/><sp/><sp/>for<sp/>(j=0;j&lt;=columns;j++)</highlight></codeline>
<codeline lineno="335"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/>*res_tmp++=0;</highlight></codeline>
<codeline lineno="336"><highlight class="comment">/*<sp/>END<sp/>OF<sp/>ERASE<sp/>SEQUENCE<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="337"><highlight class="normal"></highlight></codeline>
<codeline lineno="338"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i=0;i&lt;=rows;i++)</highlight></codeline>
<codeline lineno="339"><highlight class="normal"><sp/><sp/>{</highlight></codeline>
<codeline lineno="340"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(j=0;j&lt;=minrowcol;j++)</highlight></codeline>
<codeline lineno="341"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>*result++=*m1++;</highlight></codeline>
<codeline lineno="342"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="343"><highlight class="normal"><sp/><sp/><sp/><sp/>m1+=(columnsx-minrowcol);</highlight></codeline>
<codeline lineno="344"><highlight class="normal"><sp/><sp/><sp/><sp/>result+=(columns-minrowcol);</highlight></codeline>
<codeline lineno="345"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="346"><highlight class="normal">}<sp/><sp/></highlight></codeline>
<codeline lineno="347"><highlight class="normal"></highlight></codeline>
<codeline lineno="348"><highlight class="normal"></highlight></codeline>
<codeline lineno="349"><highlight class="normal"></highlight></codeline>
<codeline lineno="350"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>Right<sp/>matrix<sp/>multiplication<sp/>with<sp/>DIAG<sp/>matrix<sp/>in<sp/>q15:<sp/>m1[rows,columnsx]*DIAG[columnsx,columns]<sp/>=<sp/>result[rows,columns]<sp/></highlight></codeline>
<codeline lineno="351"><highlight class="comment">minrowcol=minimum(columnsx,columns)<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="352"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>mmultDr15(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m1,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*DIAG,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*result,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rows,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>columnsx,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="353"><highlight class="normal">columns,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>minrowcol)</highlight></codeline>
<codeline lineno="354"><highlight class="normal">{</highlight></codeline>
<codeline lineno="355"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i,j;</highlight></codeline>
<codeline lineno="356"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*DIAG_tmp=DIAG;</highlight></codeline>
<codeline lineno="357"><highlight class="normal"></highlight><highlight class="comment">/*<sp/><sp/>int<sp/>*res_tmp=result;<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="358"><highlight class="normal"></highlight></codeline>
<codeline lineno="359"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>This<sp/>erase<sp/>sequence<sp/>have<sp/>to<sp/>be<sp/>enabled<sp/>in<sp/>case<sp/>that<sp/>result<sp/>matrix<sp/>has<sp/>more<sp/>terms<sp/>than<sp/>DIAG<sp/>matrix<sp/>*/</highlight><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="360"><highlight class="normal"></highlight><highlight class="comment">/*<sp/><sp/>for<sp/>(i=0;i&lt;=rows;i++)<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="361"><highlight class="comment"><sp/><sp/><sp/><sp/>for<sp/>(j=0;j&lt;=columns;j++)</highlight></codeline>
<codeline lineno="362"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/>*res_tmp++=0;</highlight></codeline>
<codeline lineno="363"><highlight class="comment">/*<sp/>END<sp/>OF<sp/>ERASE<sp/>SEQUENCE<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="364"><highlight class="normal"></highlight></codeline>
<codeline lineno="365"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i=0;i&lt;=rows;i++)</highlight></codeline>
<codeline lineno="366"><highlight class="normal"><sp/><sp/>{</highlight></codeline>
<codeline lineno="367"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(j=0;j&lt;=minrowcol;j++)</highlight></codeline>
<codeline lineno="368"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="369"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>*result++=((long)(*m1++)**DIAG_tmp)&gt;&gt;15;</highlight></codeline>
<codeline lineno="370"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>DIAG_tmp+=columns+2;</highlight></codeline>
<codeline lineno="371"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="372"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="373"><highlight class="normal"><sp/><sp/><sp/><sp/>DIAG_tmp=DIAG;</highlight></codeline>
<codeline lineno="374"><highlight class="normal"><sp/><sp/><sp/><sp/>m1+=(columnsx-minrowcol);</highlight></codeline>
<codeline lineno="375"><highlight class="normal"><sp/><sp/><sp/><sp/>result+=(columns-minrowcol);</highlight></codeline>
<codeline lineno="376"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="377"><highlight class="normal">}<sp/><sp/></highlight></codeline>
<codeline lineno="378"><highlight class="normal"></highlight></codeline>
<codeline lineno="379"><highlight class="normal"></highlight></codeline>
<codeline lineno="380"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>matrix<sp/>transposition<sp/>-<sp/>neni<sp/>optimalizovana,<sp/>protoze<sp/>se<sp/>nepouziva<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="381"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>mtrans(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m1,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*result,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rows,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>columns)</highlight></codeline>
<codeline lineno="382"><highlight class="normal">{</highlight></codeline>
<codeline lineno="383"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i,<sp/>j;</highlight></codeline>
<codeline lineno="384"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="385"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i=0;<sp/>i&lt;=rows;<sp/>i++)</highlight></codeline>
<codeline lineno="386"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(j=0;<sp/>j&lt;=columns;<sp/>j++)</highlight></codeline>
<codeline lineno="387"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>*result++=*(m1+(columns+1)*j+i);</highlight></codeline>
<codeline lineno="388"><highlight class="normal">}</highlight></codeline>
<codeline lineno="389"><highlight class="normal"></highlight></codeline>
<codeline lineno="390"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>matrix<sp/>[2,2]<sp/>inversion<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="391"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>minv2(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*matrix,<sp/></highlight><highlight class="keywordtype">long</highlight><highlight class="normal"><sp/>*result)</highlight></codeline>
<codeline lineno="392"><highlight class="normal">{</highlight></codeline>
<codeline lineno="393"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>det;</highlight></codeline>
<codeline lineno="394"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
<codeline lineno="395"><highlight class="normal"></highlight></codeline>
<codeline lineno="396"><highlight class="normal"><sp/><sp/>det=((long)*matrix**(matrix+3)-(long)*(matrix+1)**(matrix+2))&gt;&gt;15;</highlight></codeline>
<codeline lineno="397"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(det==0)<sp/>det=1;</highlight></codeline>
<codeline lineno="398"><highlight class="normal"></highlight></codeline>
<codeline lineno="399"><highlight class="normal"><sp/><sp/>*result++=(((long)*(matrix+3))&lt;&lt;15)/det;</highlight></codeline>
<codeline lineno="400"><highlight class="normal"><sp/><sp/>*result++=(((long)*(matrix+1))&lt;&lt;15)/det;</highlight></codeline>
<codeline lineno="401"><highlight class="normal"><sp/><sp/>*result++=(((long)*(matrix+2))&lt;&lt;15)/det;</highlight></codeline>
<codeline lineno="402"><highlight class="normal"><sp/><sp/>*result++=(((long)*matrix)&lt;&lt;15)/det;</highlight></codeline>
<codeline lineno="403"><highlight class="normal">}</highlight></codeline>
<codeline lineno="404"><highlight class="normal"></highlight></codeline>
<codeline lineno="405"><highlight class="normal"></highlight></codeline>
<codeline lineno="406"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>choice_P(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*result,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>columns)</highlight></codeline>
<codeline lineno="407"><highlight class="normal">{</highlight></codeline>
<codeline lineno="408"><highlight class="normal"><sp/><sp/>*result++=*m;</highlight></codeline>
<codeline lineno="409"><highlight class="normal"><sp/><sp/>*result++=*(m+1);</highlight></codeline>
<codeline lineno="410"><highlight class="normal"><sp/><sp/>*result++=*(m+columns+1);</highlight></codeline>
<codeline lineno="411"><highlight class="normal"><sp/><sp/>*result++=*(m+columns+2);</highlight></codeline>
<codeline lineno="412"><highlight class="normal">}</highlight></codeline>
<codeline lineno="413"><highlight class="normal"></highlight></codeline>
<codeline lineno="414"><highlight class="normal"></highlight></codeline>
<codeline lineno="415"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>choice_x(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*m,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*result)</highlight></codeline>
<codeline lineno="416"><highlight class="normal">{</highlight></codeline>
<codeline lineno="417"><highlight class="normal"><sp/><sp/>*result++=*m++;</highlight></codeline>
<codeline lineno="418"><highlight class="normal"><sp/><sp/>*result=*m;</highlight></codeline>
<codeline lineno="419"><highlight class="normal">}</highlight></codeline>
<codeline lineno="420"><highlight class="normal"></highlight></codeline>
    </programlisting>
    <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/matrix.cpp"/>
  </compounddef>
</doxygen>
