1 | <?xml version='1.0' encoding='UTF-8' standalone='no'?> |
---|
2 | <doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.5.6"> |
---|
3 | <compounddef id="ldmat__test_8cpp" kind="file"> |
---|
4 | <compoundname>ldmat_test.cpp</compoundname> |
---|
5 | <includes local="no">itpp/itbase.h</includes> |
---|
6 | <includes refid="libDC_8h" local="no">math/libDC.h</includes> |
---|
7 | <incdepgraph> |
---|
8 | <node id="828"> |
---|
9 | <label>work/git/mixpp/tests/ldmat_test.cpp</label> |
---|
10 | <link refid="ldmat_test.cpp"/> |
---|
11 | <childnode refid="829" relation="include"> |
---|
12 | </childnode> |
---|
13 | <childnode refid="830" relation="include"> |
---|
14 | </childnode> |
---|
15 | </node> |
---|
16 | <node id="829"> |
---|
17 | <label>itpp/itbase.h</label> |
---|
18 | </node> |
---|
19 | <node id="830"> |
---|
20 | <label>math/libDC.h</label> |
---|
21 | <link refid="libDC_8h"/> |
---|
22 | <childnode refid="829" relation="include"> |
---|
23 | </childnode> |
---|
24 | </node> |
---|
25 | </incdepgraph> |
---|
26 | <sectiondef kind="func"> |
---|
27 | <memberdef kind="function" id="ldmat__test_8cpp_1e66f6b31b5ad750f1fe042a706a4e3d4" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> |
---|
28 | <type>int</type> |
---|
29 | <definition>int main</definition> |
---|
30 | <argsstring>()</argsstring> |
---|
31 | <name>main</name> |
---|
32 | <briefdescription> |
---|
33 | </briefdescription> |
---|
34 | <detaileddescription> |
---|
35 | </detaileddescription> |
---|
36 | <inbodydescription> |
---|
37 | </inbodydescription> |
---|
38 | <location file="/home/smidl/work/git/mixpp/tests/ldmat_test.cpp" line="10" bodyfile="/home/smidl/work/git/mixpp/tests/ldmat_test.cpp" bodystart="10" bodyend="52"/> |
---|
39 | </memberdef> |
---|
40 | </sectiondef> |
---|
41 | <briefdescription> |
---|
42 | </briefdescription> |
---|
43 | <detaileddescription> |
---|
44 | </detaileddescription> |
---|
45 | <programlisting> |
---|
46 | <codeline lineno="1"><highlight class="preprocessor">#include<sp/><itpp/itbase.h></highlight><highlight class="normal"></highlight></codeline> |
---|
47 | <codeline lineno="2"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><<ref refid="libDC_8h" kindref="compound" tooltip="Matrices in decomposed forms (LDL&#39;, LU, UDU&#39;, etc).">math/libDC.h</ref>></highlight><highlight class="normal"></highlight></codeline> |
---|
48 | <codeline lineno="3"><highlight class="normal"></highlight></codeline> |
---|
49 | <codeline lineno="4"><highlight class="normal"></highlight><highlight class="keyword">using<sp/>namespace<sp/></highlight><highlight class="normal">itpp;</highlight></codeline> |
---|
50 | <codeline lineno="5"><highlight class="normal"></highlight></codeline> |
---|
51 | <codeline lineno="6"><highlight class="normal"></highlight><highlight class="comment">//These<sp/>lines<sp/>are<sp/>needed<sp/>for<sp/>use<sp/>of<sp/>cout<sp/>and<sp/>endl</highlight><highlight class="normal"></highlight></codeline> |
---|
52 | <codeline lineno="7"><highlight class="normal"></highlight><highlight class="keyword">using</highlight><highlight class="normal"><sp/>std::cout;</highlight></codeline> |
---|
53 | <codeline lineno="8"><highlight class="normal"></highlight><highlight class="keyword">using</highlight><highlight class="normal"><sp/>std::endl;</highlight></codeline> |
---|
54 | <codeline lineno="9"><highlight class="normal"></highlight></codeline> |
---|
55 | <codeline lineno="10"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="sim__var_8cpp_1e66f6b31b5ad750f1fe042a706a4e3d4" kindref="member" tooltip="Extended Kalman filter with unknown Q.">main</ref>()<sp/>{</highlight></codeline> |
---|
56 | <codeline lineno="11"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Kalman<sp/>filter</highlight><highlight class="normal"></highlight></codeline> |
---|
57 | <codeline lineno="12"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>A0<sp/>=<sp/>randu(3,3);</highlight></codeline> |
---|
58 | <codeline lineno="13"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>A<sp/>=<sp/>A0*A0.T();</highlight></codeline> |
---|
59 | <codeline lineno="14"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline> |
---|
60 | <codeline lineno="15"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//Test<sp/>constructor</highlight><highlight class="normal"></highlight></codeline> |
---|
61 | <codeline lineno="16"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classldmat" kindref="compound" tooltip="Matrix stored in LD form, (typically known as UD).">ldmat</ref><sp/>LD(A);</highlight></codeline> |
---|
62 | <codeline lineno="17"><highlight class="normal"><sp/><sp/><sp/>cout<sp/><<<sp/></highlight><highlight class="stringliteral">"Testing<sp/>constructors:"</highlight><highlight class="normal"><sp/><<<sp/>endl</highlight></codeline> |
---|
63 | <codeline lineno="18"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><<<sp/></highlight><highlight class="stringliteral">"A<sp/>=<sp/>"</highlight><highlight class="normal"><sp/><<<sp/>A<sp/><<<sp/>endl</highlight></codeline> |
---|
64 | <codeline lineno="19"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><<<sp/></highlight><highlight class="stringliteral">"LD.to_mat()<sp/>=<sp/>"</highlight><highlight class="normal"><sp/><<<sp/>LD.to_mat()<sp/><<<sp/>endl<sp/><<<sp/>endl;</highlight></codeline> |
---|
65 | <codeline lineno="20"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline> |
---|
66 | <codeline lineno="21"><highlight class="normal"><sp/><sp/><sp/></highlight><highlight class="comment">//Test<sp/>inversion</highlight><highlight class="normal"></highlight></codeline> |
---|
67 | <codeline lineno="22"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classldmat" kindref="compound" tooltip="Matrix stored in LD form, (typically known as UD).">ldmat</ref><sp/>iLD(3);</highlight></codeline> |
---|
68 | <codeline lineno="23"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>LD.inv(iLD);</highlight></codeline> |
---|
69 | <codeline lineno="24"><highlight class="normal"><sp/><sp/><sp/>cout<sp/><<<sp/></highlight><highlight class="stringliteral">"inv(A)<sp/>=<sp/>"</highlight><highlight class="normal"><sp/><<<sp/>inv(A)<sp/><<endl</highlight></codeline> |
---|
70 | <codeline lineno="25"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><<<sp/></highlight><highlight class="stringliteral">"inv(LD).to_mat()<sp/>=<sp/>"</highlight><highlight class="normal"><sp/><<<sp/>iLD.to_mat()<sp/><<endl<sp/><<endl;</highlight></codeline> |
---|
71 | <codeline lineno="26"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline> |
---|
72 | <codeline lineno="27"><highlight class="normal"><sp/><sp/><sp/></highlight><highlight class="comment">//Test<sp/>logdet</highlight><highlight class="normal"></highlight></codeline> |
---|
73 | <codeline lineno="28"><highlight class="normal"><sp/><sp/><sp/>cout<sp/><<<sp/></highlight><highlight class="stringliteral">"logdet(A)<sp/>=<sp/>"</highlight><highlight class="normal"><sp/><<<sp/>log(det(A))<sp/><<<sp/>endl</highlight></codeline> |
---|
74 | <codeline lineno="29"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><<<sp/></highlight><highlight class="stringliteral">"logdet(LD)<sp/>=<sp/>"</highlight><highlight class="normal"><sp/><<<sp/>LD.logdet()<sp/><<<sp/>endl<sp/><<endl;</highlight></codeline> |
---|
75 | <codeline lineno="30"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline> |
---|
76 | <codeline lineno="31"><highlight class="normal"><sp/><sp/><sp/></highlight><highlight class="comment">//Test<sp/>add</highlight><highlight class="normal"></highlight></codeline> |
---|
77 | <codeline lineno="32"><highlight class="normal"><sp/><sp/><sp/><ref refid="classldmat" kindref="compound" tooltip="Matrix stored in LD form, (typically known as UD).">ldmat</ref><sp/>LD2(LD);</highlight></codeline> |
---|
78 | <codeline lineno="33"><highlight class="normal"><sp/><sp/><sp/>LD2.add(LD);</highlight></codeline> |
---|
79 | <codeline lineno="34"><highlight class="normal"><sp/><sp/><sp/>cout<sp/><<<sp/></highlight><highlight class="stringliteral">"A+A<sp/>=<sp/>"</highlight><highlight class="normal"><sp/><<<sp/>A+A<sp/><<<sp/>endl</highlight></codeline> |
---|
80 | <codeline lineno="35"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><<<sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">"LD2.add(LD)<sp/>=<sp/>"</highlight><highlight class="normal"><sp/><<<sp/>LD2.to_mat()<sp/><<<sp/>endl<sp/><<endl;</highlight></codeline> |
---|
81 | <codeline lineno="36"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline> |
---|
82 | <codeline lineno="37"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>v=randu(3);</highlight></codeline> |
---|
83 | <codeline lineno="38"><highlight class="normal"><sp/><sp/><sp/></highlight><highlight class="comment">//Test<sp/>qform</highlight><highlight class="normal"></highlight></codeline> |
---|
84 | <codeline lineno="39"><highlight class="normal"><sp/><sp/><sp/>cout<sp/><<<sp/></highlight><highlight class="stringliteral">"vAv'<sp/>=<sp/>"</highlight><highlight class="normal"><sp/><<<sp/>v*(A*v)<sp/><<<sp/>endl</highlight></codeline> |
---|
85 | <codeline lineno="40"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><<<sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">"qform(LD,v)<sp/>=<sp/>"</highlight><highlight class="normal"><sp/><<<sp/>LD.qform(v)<sp/><<<sp/>endl<sp/><<endl;</highlight></codeline> |
---|
86 | <codeline lineno="41"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline> |
---|
87 | <codeline lineno="42"><highlight class="normal"><sp/><sp/><sp/></highlight><highlight class="comment">//Test<sp/>invqform</highlight><highlight class="normal"></highlight></codeline> |
---|
88 | <codeline lineno="43"><highlight class="normal"><sp/><sp/><sp/>cout<sp/><<<sp/></highlight><highlight class="stringliteral">"v<sp/>inv(A)v'<sp/>=<sp/>"</highlight><highlight class="normal"><sp/><<<sp/>v*(inv(A)*v)<sp/><<<sp/>endl</highlight></codeline> |
---|
89 | <codeline lineno="44"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><<<sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">"invqform(LD,v)<sp/>=<sp/>"</highlight><highlight class="normal"><sp/><<<sp/>LD.invqform(v)<sp/><<<sp/>endl<sp/><<endl;</highlight></codeline> |
---|
90 | <codeline lineno="45"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline> |
---|
91 | <codeline lineno="46"><highlight class="normal"><sp/><sp/><sp/></highlight><highlight class="comment">//Test<sp/>opupdate</highlight><highlight class="normal"></highlight></codeline> |
---|
92 | <codeline lineno="47"><highlight class="normal"><sp/><sp/><sp/>LD2=LD;</highlight></codeline> |
---|
93 | <codeline lineno="48"><highlight class="normal"><sp/><sp/><sp/>LD2.opupdt(v,1.0);</highlight></codeline> |
---|
94 | <codeline lineno="49"><highlight class="normal"><sp/><sp/><sp/>cout<sp/><<<sp/></highlight><highlight class="stringliteral">"A+vv'<sp/>=<sp/>"</highlight><highlight class="normal"><sp/><<<sp/>A+outer_product(v,v)<sp/><<<sp/>endl</highlight></codeline> |
---|
95 | <codeline lineno="50"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><<<sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">"opupdt(LD,v)<sp/>=<sp/>"</highlight><highlight class="normal"><sp/><<<sp/>LD2.to_mat()<sp/><<<sp/>endl<sp/><<endl;</highlight></codeline> |
---|
96 | <codeline lineno="51"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline> |
---|
97 | <codeline lineno="52"><highlight class="normal">}</highlight></codeline> |
---|
98 | </programlisting> |
---|
99 | <location file="/home/smidl/work/git/mixpp/tests/ldmat_test.cpp"/> |
---|
100 | </compounddef> |
---|
101 | </doxygen> |
---|