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="sumitpp_8cpp" kind="file"> |
---|
4 | <compoundname>sumitpp.cpp</compoundname> |
---|
5 | <includes local="no">itpp/itcomm.h</includes> |
---|
6 | <includes local="no">itpp/itmex.h</includes> |
---|
7 | <includes local="no">../../bdm/estim/arx.h</includes> |
---|
8 | <incdepgraph> |
---|
9 | <node id="535"> |
---|
10 | <label>work/git/mixpp/matlab/mex/sumitpp.cpp</label> |
---|
11 | <link refid="sumitpp.cpp"/> |
---|
12 | <childnode refid="536" relation="include"> |
---|
13 | </childnode> |
---|
14 | <childnode refid="537" relation="include"> |
---|
15 | </childnode> |
---|
16 | <childnode refid="538" relation="include"> |
---|
17 | </childnode> |
---|
18 | </node> |
---|
19 | <node id="537"> |
---|
20 | <label>itpp/itmex.h</label> |
---|
21 | </node> |
---|
22 | <node id="536"> |
---|
23 | <label>itpp/itcomm.h</label> |
---|
24 | </node> |
---|
25 | <node id="538"> |
---|
26 | <label>../../bdm/estim/arx.h</label> |
---|
27 | </node> |
---|
28 | </incdepgraph> |
---|
29 | <sectiondef kind="func"> |
---|
30 | <memberdef kind="function" id="sumitpp_8cpp_182033299688d607730e08333ff7471f8" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> |
---|
31 | <type>void</type> |
---|
32 | <definition>void mexFunction</definition> |
---|
33 | <argsstring>(int n_output, mxArray *output[], int n_input, const mxArray *input[])</argsstring> |
---|
34 | <name>mexFunction</name> |
---|
35 | <param> |
---|
36 | <type>int</type> |
---|
37 | <declname>n_output</declname> |
---|
38 | </param> |
---|
39 | <param> |
---|
40 | <type>mxArray *</type> |
---|
41 | <declname>output</declname> |
---|
42 | <array>[]</array> |
---|
43 | </param> |
---|
44 | <param> |
---|
45 | <type>int</type> |
---|
46 | <declname>n_input</declname> |
---|
47 | </param> |
---|
48 | <param> |
---|
49 | <type>const mxArray *</type> |
---|
50 | <declname>input</declname> |
---|
51 | <array>[]</array> |
---|
52 | </param> |
---|
53 | <briefdescription> |
---|
54 | </briefdescription> |
---|
55 | <detaileddescription> |
---|
56 | </detaileddescription> |
---|
57 | <inbodydescription> |
---|
58 | </inbodydescription> |
---|
59 | <location file="/home/smidl/work/git/mixpp/matlab/mex/sumitpp.cpp" line="8" bodyfile="/home/smidl/work/git/mixpp/matlab/mex/sumitpp.cpp" bodystart="8" bodyend="28"/> |
---|
60 | </memberdef> |
---|
61 | </sectiondef> |
---|
62 | <briefdescription> |
---|
63 | </briefdescription> |
---|
64 | <detaileddescription> |
---|
65 | </detaileddescription> |
---|
66 | <programlisting> |
---|
67 | <codeline lineno="1"><highlight class="preprocessor">#include<sp/><itpp/itcomm.h></highlight><highlight class="normal"></highlight></codeline> |
---|
68 | <codeline lineno="2"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><itpp/itmex.h></highlight><highlight class="normal"></highlight></codeline> |
---|
69 | <codeline lineno="3"><highlight class="normal"></highlight></codeline> |
---|
70 | <codeline lineno="4"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><../../bdm/estim/arx.h></highlight><highlight class="normal"></highlight></codeline> |
---|
71 | <codeline lineno="5"><highlight class="normal"></highlight></codeline> |
---|
72 | <codeline lineno="6"><highlight class="normal"></highlight><highlight class="keyword">using<sp/>namespace<sp/></highlight><highlight class="normal">itpp;</highlight></codeline> |
---|
73 | <codeline lineno="7"><highlight class="normal"></highlight></codeline> |
---|
74 | <codeline lineno="8"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>mexFunction<sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n_output,<sp/>mxArray<sp/>*output[],<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n_input,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>mxArray<sp/>*input[]<sp/>)<sp/>{</highlight></codeline> |
---|
75 | <codeline lineno="9"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Check<sp/>the<sp/>number<sp/>of<sp/>inputs<sp/>and<sp/>output<sp/>arguments</highlight><highlight class="normal"></highlight></codeline> |
---|
76 | <codeline lineno="10"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>n_output!=1<sp/>)<sp/>mexErrMsgTxt<sp/>(<sp/></highlight><highlight class="stringliteral">"Wrong<sp/>number<sp/>of<sp/>output<sp/>variables!"</highlight><highlight class="normal"><sp/>);</highlight></codeline> |
---|
77 | <codeline lineno="11"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>n_input!=1<sp/>)<sp/>mexErrMsgTxt<sp/>(<sp/></highlight><highlight class="stringliteral">"Wrong<sp/>number<sp/>of<sp/>input<sp/>variables!"</highlight><highlight class="normal"><sp/>);</highlight></codeline> |
---|
78 | <codeline lineno="12"><highlight class="normal"></highlight></codeline> |
---|
79 | <codeline lineno="13"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Convert<sp/>input<sp/>variables<sp/>to<sp/>IT++<sp/>format</highlight><highlight class="normal"></highlight></codeline> |
---|
80 | <codeline lineno="14"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>Data<sp/>=<sp/>mxArray2mat<sp/>(<sp/>input[0]<sp/>);</highlight></codeline> |
---|
81 | <codeline lineno="15"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>mn;</highlight></codeline> |
---|
82 | <codeline lineno="16"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>------------------<sp/>Start<sp/>of<sp/>routine<sp/>---------------------------</highlight><highlight class="normal"></highlight></codeline> |
---|
83 | <codeline lineno="17"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline> |
---|
84 | <codeline lineno="18"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mn<sp/>=<sp/>sum(Data);</highlight></codeline> |
---|
85 | <codeline lineno="19"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline> |
---|
86 | <codeline lineno="20"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline> |
---|
87 | <codeline lineno="21"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>------------------<sp/>End<sp/>of<sp/>routine<sp/>-----------------------------</highlight><highlight class="normal"></highlight></codeline> |
---|
88 | <codeline lineno="22"><highlight class="normal"></highlight></codeline> |
---|
89 | <codeline lineno="23"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Create<sp/>output<sp/>vectors</highlight><highlight class="normal"></highlight></codeline> |
---|
90 | <codeline lineno="24"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0]<sp/>=<sp/>mxCreateDoubleMatrix<sp/>(<sp/>1,mn.length(),<sp/>mxREAL<sp/>);</highlight></codeline> |
---|
91 | <codeline lineno="25"><highlight class="normal"></highlight></codeline> |
---|
92 | <codeline lineno="26"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Convert<sp/>the<sp/>IT++<sp/>format<sp/>to<sp/>Matlab<sp/>format<sp/>for<sp/>output</highlight><highlight class="normal"></highlight></codeline> |
---|
93 | <codeline lineno="27"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec2mxArray<sp/>(<sp/>mn,<sp/>output[0]<sp/>);</highlight></codeline> |
---|
94 | <codeline lineno="28"><highlight class="normal">}</highlight></codeline> |
---|
95 | </programlisting> |
---|
96 | <location file="/home/smidl/work/git/mixpp/matlab/mex/sumitpp.cpp"/> |
---|
97 | </compounddef> |
---|
98 | </doxygen> |
---|