aboutsummaryrefslogtreecommitdiffstats
path: root/doc/html/LinearTransformation_8h_source.html
blob: d1df9ff9abd60312eb0d272d1adf1937423854b5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!-- HTML header for doxygen 1.8.3.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>Templates -- Meow: meowpp/math/LinearTransformation.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
<link href="custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">Templates -- Meow
   &#160;<span id="projectnumber">1.1.2</span>
   </div>
   <div id="projectbrief">不能,也不應該先編譯成obj-file的templates</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('LinearTransformation_8h_source.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">LinearTransformation.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="LinearTransformation_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef   math_LinearTransformation_H__</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define   math_LinearTransformation_H__</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="Transformation_8h.html">Transformation.h</a>&quot;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="Matrix_8h.html">Matrix.h</a>&quot;</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &lt;cstdlib&gt;</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;</div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="keyword">namespace </span>meow {</div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">class</span> Scalar&gt;</div>
<div class="line"><a name="l00020"></a><span class="lineno"><a class="code" href="classmeow_1_1LinearTransformation.html">   20</a></span>&#160;<span class="keyword">class </span><a class="code" href="classmeow_1_1LinearTransformation.html" title="A base class for implementing kinds of linear transformations.">LinearTransformation</a>: <span class="keyword">public</span> <a class="code" href="classmeow_1_1Transformation.html" title="A base class for implementing kinds of transformations.">Transformation</a>&lt;Scalar&gt; {</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;  <a class="code" href="classmeow_1_1Matrix.html">Matrix&lt;Scalar&gt;</a> matrix_;</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00027"></a><span class="lineno"><a class="code" href="classmeow_1_1LinearTransformation.html#a2c5d98a8bf1dc09c9284d40db9534a6e">   27</a></span>&#160;  <a class="code" href="classmeow_1_1LinearTransformation.html#a2c5d98a8bf1dc09c9284d40db9534a6e">LinearTransformation</a>(<span class="keywordtype">size_t</span> <a class="code" href="classmeow_1_1Transformation.html#a9c4d19fe8d95967596b06bc026bdf200" title="Return the number of rows of the input matrix.">inputRows</a>, <span class="keywordtype">size_t</span> <a class="code" href="classmeow_1_1Transformation.html#aae50028aba551ad3459335299794f8af" title="Return the number of rows of the output matrix.">outputRows</a>, <span class="keywordtype">size_t</span> psize):</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;  <a class="code" href="classmeow_1_1Transformation.html" title="A base class for implementing kinds of transformations.">Transformation</a>&lt;Scalar&gt;(inputRows, 1u, outputRows, 1u, psize),</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;  matrix_(outputRows, inputRows, Scalar(0.0)) {</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;  }</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div>
<div class="line"><a name="l00035"></a><span class="lineno"><a class="code" href="classmeow_1_1LinearTransformation.html#a799ed3fafc41010b87807b46e9b9c222">   35</a></span>&#160;  <a class="code" href="classmeow_1_1LinearTransformation.html#a2c5d98a8bf1dc09c9284d40db9534a6e">LinearTransformation</a>(<span class="keywordtype">size_t</span> <a class="code" href="classmeow_1_1Transformation.html#a9c4d19fe8d95967596b06bc026bdf200" title="Return the number of rows of the input matrix.">inputRows</a>, <span class="keywordtype">size_t</span> <a class="code" href="classmeow_1_1Transformation.html#aae50028aba551ad3459335299794f8af" title="Return the number of rows of the output matrix.">outputRows</a>, <span class="keywordtype">size_t</span> psize,</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;                       <a class="code" href="classmeow_1_1Matrix.html">Matrix&lt;Scalar&gt;</a> <span class="keyword">const</span>&amp; m):</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;  <a class="code" href="classmeow_1_1Transformation.html" title="A base class for implementing kinds of transformations.">Transformation</a>&lt;Scalar&gt;(inputRows, 1u, outputRows, 1u, psize),</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;  matrix_(m) {</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;  }</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="code" href="classmeow_1_1LinearTransformation.html#a4d73d74510c76bdbe176a8d498be185e">   46</a></span>&#160;  <a class="code" href="classmeow_1_1LinearTransformation.html#a2c5d98a8bf1dc09c9284d40db9534a6e">LinearTransformation</a>(<a class="code" href="classmeow_1_1LinearTransformation.html" title="A base class for implementing kinds of linear transformations.">LinearTransformation</a> <span class="keyword">const</span>&amp; b):</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;  <a class="code" href="classmeow_1_1Transformation.html" title="A base class for implementing kinds of transformations.">Transformation</a>&lt;Scalar&gt;(b),</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;  matrix_(b.matrix_) {</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;  }</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;  </div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="code" href="classmeow_1_1LinearTransformation.html#afb3ea3e2653152b7b5a8bbad952d3f0e">   56</a></span>&#160;  <a class="code" href="classmeow_1_1LinearTransformation.html" title="A base class for implementing kinds of linear transformations.">LinearTransformation</a>&amp; <a class="code" href="classmeow_1_1LinearTransformation.html#afb3ea3e2653152b7b5a8bbad952d3f0e" title="Copy settings, matrix from another LinearTransformation.">copyFrom</a>(<a class="code" href="classmeow_1_1LinearTransformation.html" title="A base class for implementing kinds of linear transformations.">LinearTransformation</a> <span class="keyword">const</span>&amp; b) {</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    <a class="code" href="classmeow_1_1Transformation.html#abe781169171fa3b8206a91e166779d74" title="Copy from the specified one.">Transformation&lt;Scalar&gt;::copyFrom</a>(b);</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    matrix_.<a class="code" href="classmeow_1_1Matrix.html#afb81446984f7c27458ccef86be2de413" title="copy">copyFrom</a>(b.matrix_);</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;  }</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;  </div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="code" href="classmeow_1_1LinearTransformation.html#a573c034e179570f7a1c41f0c1de54c87">   67</a></span>&#160;  <a class="code" href="classmeow_1_1LinearTransformation.html" title="A base class for implementing kinds of linear transformations.">LinearTransformation</a>&amp; <a class="code" href="classmeow_1_1LinearTransformation.html#a573c034e179570f7a1c41f0c1de54c87" title="Reference settings, matrix from another LinearTransformation.">referenceFrom</a>(<a class="code" href="classmeow_1_1LinearTransformation.html" title="A base class for implementing kinds of linear transformations.">LinearTransformation</a> <span class="keyword">const</span>&amp; b) {</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    <a class="code" href="classmeow_1_1Transformation.html#a9b6ec99d8363742f77c63a49ba9467b5" title="Ceference from the specified one.">Transformation&lt;Scalar&gt;::referenceFrom</a>(b);</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    matrix_.<a class="code" href="classmeow_1_1Matrix.html#a1dbef5b1a46df480f7fa3e118fd12bec" title="reference">referenceFrom</a>(b.matrix_);</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;  }</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;  </div>
<div class="line"><a name="l00079"></a><span class="lineno"><a class="code" href="classmeow_1_1LinearTransformation.html#a9227417bd74bb950e1c732e5948befc0">   79</a></span>&#160;  <a class="code" href="classmeow_1_1Matrix.html">Matrix&lt;Scalar&gt;</a> <span class="keyword">const</span>&amp; <a class="code" href="classmeow_1_1LinearTransformation.html#a9227417bd74bb950e1c732e5948befc0" title="Setup the matrix.">matrix</a>(<a class="code" href="classmeow_1_1Matrix.html">Matrix&lt;Scalar&gt;</a> <span class="keyword">const</span>&amp; m) {</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    matrix_.<a class="code" href="classmeow_1_1Matrix.html#afb81446984f7c27458ccef86be2de413" title="copy">copyFrom</a>(m);</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    <span class="keywordflow">return</span> matrix_;</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;  }</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00087"></a><span class="lineno"><a class="code" href="classmeow_1_1LinearTransformation.html#ad21d0eb275d3ac9ce780e4ccf2c78bcb">   87</a></span>&#160;  <span class="keyword">virtual</span> <a class="code" href="classmeow_1_1LinearTransformation.html#ad21d0eb275d3ac9ce780e4ccf2c78bcb">~LinearTransformation</a>() {</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;  }</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;  </div>
<div class="line"><a name="l00095"></a><span class="lineno"><a class="code" href="classmeow_1_1LinearTransformation.html#aeab1cf88fc67a1857504bd2fb18519f5">   95</a></span>&#160;  <span class="keyword">virtual</span> <a class="code" href="classmeow_1_1Matrix.html">Matrix&lt;Scalar&gt;</a> <span class="keyword">const</span>&amp; <a class="code" href="classmeow_1_1LinearTransformation.html#aeab1cf88fc67a1857504bd2fb18519f5" title="Return the matrix form of this transformation.">matrix</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    <span class="keywordflow">return</span> matrix_;</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;  }</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;  </div>
<div class="line"><a name="l00104"></a><span class="lineno"><a class="code" href="classmeow_1_1LinearTransformation.html#a60ead2898f321c5d77d099e1dc3e103c">  104</a></span>&#160;  <span class="keyword">virtual</span> <a class="code" href="classmeow_1_1Matrix.html">Matrix&lt;Scalar&gt;</a> <a class="code" href="classmeow_1_1LinearTransformation.html#a60ead2898f321c5d77d099e1dc3e103c" title="Return the inverse of the matrix form of this transformate.">matrixInv</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <span class="keywordflow">return</span> matrix_.<a class="code" href="classmeow_1_1Matrix.html#af6c3ae812c4290d29fb0932b655887dd" title="Return a matrix which is an inverse matrix of (*this)">inverse</a>();</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;  }</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;};</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;}</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;<span class="preprocessor">#endif // math_LinearTransformation_H__</span></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.3.1-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_92fecd8d02dd5e7a67429447fdf0f60f.html">meowpp</a></li><li class="navelem"><a class="el" href="dir_77e0ab67466b1e7d76f50725a5ab9910.html">math</a></li><li class="navelem"><a class="el" href="LinearTransformation_8h.html">LinearTransformation.h</a></li>
    <li class="footer">Generated on Sun Jun 1 2014 13:54:33 for Templates -- Meow by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.3.1 </li>
  </ul>
</div>
</body>
</html>