File: matrix3x3_8h_source.shtml

package info (click to toggle)
openbabel 2.3.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 75,308 kB
  • ctags: 41,952
  • sloc: cpp: 321,252; ansic: 89,228; python: 7,262; perl: 6,418; pascal: 793; sh: 194; xml: 97; ruby: 55; makefile: 47; java: 23
file content (320 lines) | stat: -rw-r--r-- 32,530 bytes parent folder | download | duplicates (3)
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>matrix3x3.h Source File</title>
<link href="/site.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="search/search.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
</head>

<body>

<!--#include file="header.html" -->
<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.shtml"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.shtml"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.shtml"><span>Modules</span></a></li>
      <li><a href="namespaces.shtml"><span>Namespaces</span></a></li>
      <li><a href="annotated.shtml"><span>Classes</span></a></li>
      <li class="current"><a href="files.shtml"><span>Files</span></a></li>
      <li><a href="examples.shtml"><span>Examples</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.shtml"><span>File&#160;List</span></a></li>
      <li><a href="globals.shtml"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">matrix3x3.h</div>  </div>
</div>
<div class="contents">
<a href="matrix3x3_8h.shtml">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/**********************************************************************</span>
<a name="l00002"></a>00002 <span class="comment">matrix3x3.cpp - Handle 3D Rotation matrix.</span>
<a name="l00003"></a>00003 <span class="comment"></span>
<a name="l00004"></a>00004 <span class="comment">Copyright (C) 1998-2001 by OpenEye Scientific Software, Inc.</span>
<a name="l00005"></a>00005 <span class="comment">Some portions Copyright (C) 2001-2006 by Geoffrey R. Hutchison</span>
<a name="l00006"></a>00006 <span class="comment">Some portions Copyright (C) 2006 by Benoit Jacob</span>
<a name="l00007"></a>00007 <span class="comment"></span>
<a name="l00008"></a>00008 <span class="comment">This file is part of the Open Babel project.</span>
<a name="l00009"></a>00009 <span class="comment">For more information, see &lt;http://openbabel.org/&gt;</span>
<a name="l00010"></a>00010 <span class="comment"></span>
<a name="l00011"></a>00011 <span class="comment">This program is free software; you can redistribute it and/or modify</span>
<a name="l00012"></a>00012 <span class="comment">it under the terms of the GNU General Public License as published by</span>
<a name="l00013"></a>00013 <span class="comment">the Free Software Foundation version 2 of the License.</span>
<a name="l00014"></a>00014 <span class="comment"></span>
<a name="l00015"></a>00015 <span class="comment">This program is distributed in the hope that it will be useful,</span>
<a name="l00016"></a>00016 <span class="comment">but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00017"></a>00017 <span class="comment">MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00018"></a>00018 <span class="comment">GNU General Public License for more details.</span>
<a name="l00019"></a>00019 <span class="comment">***********************************************************************/</span>
<a name="l00020"></a>00020 
<a name="l00021"></a>00021 <span class="preprocessor">#ifndef OB_MATRIX3x3_H</span>
<a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">#define OB_MATRIX3x3_H</span>
<a name="l00023"></a>00023 <span class="preprocessor"></span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;ostream&gt;</span>
<a name="l00025"></a>00025 
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;<a class="code" href="vector3_8h.shtml" title="Handle 3D coordinates.">openbabel/math/vector3.h</a>&gt;</span> <span class="comment">// includes rand.h, which includes &lt;math.h&gt;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &lt;<a class="code" href="oberror_8h.shtml" title="Handle error messages, warnings, notices, etc.">openbabel/oberror.h</a>&gt;</span>
<a name="l00028"></a>00028 
<a name="l00029"></a>00029 <span class="preprocessor">#ifndef RAD_TO_DEG</span>
<a name="l00030"></a><a class="code" href="matrix3x3_8h.shtml#a89e47af0449640d4f15191aba5ca24c6">00030</a> <span class="preprocessor"></span><span class="preprocessor">#define RAD_TO_DEG (180.0/M_PI)</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00032"></a>00032 <span class="preprocessor"></span>
<a name="l00033"></a>00033 <span class="preprocessor">#ifndef DEG_TO_RAD</span>
<a name="l00034"></a><a class="code" href="matrix3x3_8h.shtml#a212460e743fecb084d717bb2180c5a56">00034</a> <span class="preprocessor"></span><span class="preprocessor">#define DEG_TO_RAD (M_PI/180.0)</span>
<a name="l00035"></a>00035 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span>
<a name="l00037"></a>00037 <span class="keyword">namespace </span>OpenBabel
<a name="l00038"></a>00038 {
<a name="l00039"></a>00039   <span class="keyword">class </span>OBRandom; <span class="comment">// class introduction in rand.h</span>
<a name="l00040"></a>00040 
<a name="l00041"></a>00041   <span class="comment">// class introduction in matrix3x3.cpp</span>
<a name="l00042"></a><a class="code" href="classOpenBabel_1_1matrix3x3.shtml">00042</a>   <span class="keyword">class </span>OBAPI <a class="code" href="classOpenBabel_1_1matrix3x3.shtml" title="Represents a real 3x3 matrix.">matrix3x3</a>
<a name="l00043"></a>00043     {
<a name="l00045"></a>00045 
<a name="l00047"></a>00047       <span class="keywordtype">double</span> ele[3][3];
<a name="l00048"></a>00048 
<a name="l00049"></a>00049     <span class="keyword">public</span>:
<a name="l00051"></a><a class="code" href="classOpenBabel_1_1matrix3x3.shtml#a02fbfa24687cc574a29a8d1c0ff0a2db">00051</a>       <a class="code" href="classOpenBabel_1_1matrix3x3.shtml" title="Represents a real 3x3 matrix.">matrix3x3</a>(<span class="keywordtype">void</span>)
<a name="l00052"></a>00052         {
<a name="l00053"></a>00053           <span class="comment">// Loops are typically unrolled and/or vectorized</span>
<a name="l00054"></a>00054           <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; 3; ++i)
<a name="l00055"></a>00055             <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j = 0; j &lt; 3; ++j)
<a name="l00056"></a>00056               ele[i][j] = 0.0;
<a name="l00057"></a>00057         }
<a name="l00058"></a>00058 
<a name="l00060"></a><a class="code" href="classOpenBabel_1_1matrix3x3.shtml#ac0461afe3f76b83a10fe99fac330f702">00060</a>       <a class="code" href="classOpenBabel_1_1matrix3x3.shtml" title="Represents a real 3x3 matrix.">matrix3x3</a>(<span class="keywordtype">double</span> s)
<a name="l00061"></a>00061         {
<a name="l00062"></a>00062           <span class="comment">// Loops are typically unrolled and/or vectorized</span>
<a name="l00063"></a>00063           <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; 3; ++i)
<a name="l00064"></a>00064             <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j = 0; j &lt; 3; ++j)
<a name="l00065"></a>00065               ele[i][j] = 0.0;
<a name="l00066"></a>00066 
<a name="l00067"></a>00067           <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; 3; ++i)
<a name="l00068"></a>00068             ele[i][i] = s;
<a name="l00069"></a>00069         }
<a name="l00070"></a>00070 
<a name="l00072"></a><a class="code" href="classOpenBabel_1_1matrix3x3.shtml#a4736c0c51dc08725c39e02a84c2390ec">00072</a>       <a class="code" href="classOpenBabel_1_1matrix3x3.shtml" title="Represents a real 3x3 matrix.">matrix3x3</a>(<a class="code" href="classOpenBabel_1_1vector3.shtml" title="Represents a vector in 3-dimensional real space.">vector3</a> row1,<a class="code" href="classOpenBabel_1_1vector3.shtml" title="Represents a vector in 3-dimensional real space.">vector3</a> row2,<a class="code" href="classOpenBabel_1_1vector3.shtml" title="Represents a vector in 3-dimensional real space.">vector3</a> row3)
<a name="l00073"></a>00073         {
<a name="l00074"></a>00074           ele[0][0] = row1.<a class="code" href="classOpenBabel_1_1vector3.shtml#abef0821fe31ac502f2d11718aef50ae3" title="Access function to get the x-coordinate of the vector.">x</a>();
<a name="l00075"></a>00075           ele[0][1] = row1.<a class="code" href="classOpenBabel_1_1vector3.shtml#a60e843e6f8ec7cf8709da2954bd2c202" title="Access function to get the y-coordinate of the vector.">y</a>();
<a name="l00076"></a>00076           ele[0][2] = row1.<a class="code" href="classOpenBabel_1_1vector3.shtml#ac6512d9d5bc60ad02143f34ba62e010a" title="Access function to get the z-coordinate of the vector.">z</a>();
<a name="l00077"></a>00077           ele[1][0] = row2.<a class="code" href="classOpenBabel_1_1vector3.shtml#abef0821fe31ac502f2d11718aef50ae3" title="Access function to get the x-coordinate of the vector.">x</a>();
<a name="l00078"></a>00078           ele[1][1] = row2.<a class="code" href="classOpenBabel_1_1vector3.shtml#a60e843e6f8ec7cf8709da2954bd2c202" title="Access function to get the y-coordinate of the vector.">y</a>();
<a name="l00079"></a>00079           ele[1][2] = row2.<a class="code" href="classOpenBabel_1_1vector3.shtml#ac6512d9d5bc60ad02143f34ba62e010a" title="Access function to get the z-coordinate of the vector.">z</a>();
<a name="l00080"></a>00080           ele[2][0] = row3.<a class="code" href="classOpenBabel_1_1vector3.shtml#abef0821fe31ac502f2d11718aef50ae3" title="Access function to get the x-coordinate of the vector.">x</a>();
<a name="l00081"></a>00081           ele[2][1] = row3.<a class="code" href="classOpenBabel_1_1vector3.shtml#a60e843e6f8ec7cf8709da2954bd2c202" title="Access function to get the y-coordinate of the vector.">y</a>();
<a name="l00082"></a>00082           ele[2][2] = row3.<a class="code" href="classOpenBabel_1_1vector3.shtml#ac6512d9d5bc60ad02143f34ba62e010a" title="Access function to get the z-coordinate of the vector.">z</a>();
<a name="l00083"></a>00083         }
<a name="l00084"></a>00084 
<a name="l00086"></a>00086 
<a name="l00087"></a><a class="code" href="classOpenBabel_1_1matrix3x3.shtml#a0a0be9b2cd186a15d56efdaaefa9a994">00087</a>       <a class="code" href="classOpenBabel_1_1matrix3x3.shtml" title="Represents a real 3x3 matrix.">matrix3x3</a>(<span class="keywordtype">double</span> d[3][3])
<a name="l00088"></a>00088         {
<a name="l00089"></a>00089           <span class="comment">// Loops are typically unrolled and/or vectorized</span>
<a name="l00090"></a>00090           <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; 3; ++i)
<a name="l00091"></a>00091             <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j = 0; j &lt; 3; ++j)
<a name="l00092"></a>00092               ele[i][j] = d[i][j];
<a name="l00093"></a>00093 
<a name="l00094"></a>00094           <span class="comment">// We could also potentially use memcpy here</span>
<a name="l00095"></a>00095         }
<a name="l00096"></a>00096 
<a name="l00098"></a><a class="code" href="classOpenBabel_1_1matrix3x3.shtml#a6d3758cd834f7dd0f5c0816231349cb9">00098</a>       <a class="code" href="classOpenBabel_1_1matrix3x3.shtml#a6d3758cd834f7dd0f5c0816231349cb9" title="Destructor.">~matrix3x3</a>() {}
<a name="l00099"></a>00099 
<a name="l00101"></a>00101 
<a name="l00104"></a><a class="code" href="classOpenBabel_1_1matrix3x3.shtml#a3f648014bbd17f8090159d2d93cbe30c">00104</a>       <span class="keywordtype">void</span> GetArray(<span class="keywordtype">double</span> *m)
<a name="l00105"></a>00105         {
<a name="l00106"></a>00106           <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; 3; ++i)
<a name="l00107"></a>00107             <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j = 0; j &lt; 3; ++j)
<a name="l00108"></a>00108               m[3*i+j] = ele[i][j];
<a name="l00109"></a>00109         }
<a name="l00110"></a>00110 
<a name="l00113"></a><a class="code" href="classOpenBabel_1_1matrix3x3.shtml#aa6e296b71371e9b9b334dca8c7f3314a">00113</a>       <span class="keyword">const</span> <span class="keywordtype">double</span> &amp; operator() (<span class="keywordtype">int</span> row, <span class="keywordtype">int</span> column )<span class="keyword"> const</span>
<a name="l00114"></a>00114 <span class="keyword">      </span>{
<a name="l00115"></a>00115         <span class="keywordflow">return</span> ele[row][column];
<a name="l00116"></a>00116       }
<a name="l00117"></a>00117 
<a name="l00120"></a><a class="code" href="classOpenBabel_1_1matrix3x3.shtml#a59c4092616c1d0ffc2c3e022350ee02d">00120</a>       <span class="keywordtype">double</span> &amp; operator() (<span class="keywordtype">int</span> row, <span class="keywordtype">int</span> column )
<a name="l00121"></a>00121       {
<a name="l00122"></a>00122         <span class="keywordflow">return</span> ele[row][column];
<a name="l00123"></a>00123       }
<a name="l00124"></a>00124 
<a name="l00126"></a>00126       <a class="code" href="classOpenBabel_1_1matrix3x3.shtml" title="Represents a real 3x3 matrix.">matrix3x3</a> inverse(<span class="keywordtype">void</span>) const
<a name="l00127"></a>00127 <span class="preprocessor">#ifdef OB_OLD_MATH_CHECKS</span>
<a name="l00128"></a>00128 <span class="preprocessor"></span>  <span class="keywordflow">throw</span>(<a class="code" href="classOpenBabel_1_1OBError.shtml" title="Customizable error handling and logging -- store a message, including the method yielding the error...">OBError</a>)
<a name="l00129"></a>00129 <span class="preprocessor">#endif</span>
<a name="l00130"></a>00130 <span class="preprocessor"></span>      ;
<a name="l00131"></a>00131 
<a name="l00133"></a>00133       <a class="code" href="classOpenBabel_1_1matrix3x3.shtml" title="Represents a real 3x3 matrix.">matrix3x3</a> transpose(<span class="keywordtype">void</span>) <span class="keyword">const</span>;
<a name="l00134"></a>00134 
<a name="l00136"></a>00136       <span class="keywordtype">void</span> randomRotation(<a class="code" href="classOpenBabel_1_1OBRandom.shtml" title="Random number generator.">OBRandom</a> &amp;rnd);
<a name="l00137"></a>00137 
<a name="l00139"></a>00139       <span class="keywordtype">double</span> determinant() <span class="keyword">const</span>;
<a name="l00140"></a>00140 
<a name="l00142"></a>00142       <span class="keywordtype">bool</span> isSymmetric(<span class="keywordtype">void</span>) <span class="keyword">const</span>;
<a name="l00143"></a>00143 
<a name="l00145"></a>00145 
<a name="l00159"></a><a class="code" href="classOpenBabel_1_1matrix3x3.shtml#ae8249851867ad7b2795614ee2b4f0078">00159</a>       <span class="keywordtype">bool</span> isOrthogonal(<span class="keywordtype">void</span>)<span class="keyword"> const</span>
<a name="l00160"></a>00160 <span class="keyword">        </span>{
<a name="l00161"></a>00161           <span class="keywordflow">return</span> (*<span class="keyword">this</span> * transpose()).isUnitMatrix();
<a name="l00162"></a>00162         };
<a name="l00163"></a>00163 
<a name="l00165"></a>00165       <span class="keywordtype">bool</span> isDiagonal(<span class="keywordtype">void</span>) <span class="keyword">const</span>;
<a name="l00166"></a>00166 
<a name="l00168"></a>00168       <span class="keywordtype">bool</span> isUnitMatrix(<span class="keywordtype">void</span>) <span class="keyword">const</span>;
<a name="l00169"></a>00169 
<a name="l00171"></a>00171 
<a name="l00174"></a><a class="code" href="classOpenBabel_1_1matrix3x3.shtml#a0aba6c9a55fa03689378594bb58f1ff1">00174</a>       <span class="keywordtype">double</span> Get(<span class="keywordtype">int</span> row,<span class="keywordtype">int</span> column)<span class="keyword"> const</span>
<a name="l00175"></a>00175 <span class="keyword">        </span>{
<a name="l00176"></a>00176 <span class="preprocessor">#ifdef OB_OLD_MATH_CHECKS</span>
<a name="l00177"></a>00177 <span class="preprocessor"></span>          <span class="keywordflow">if</span> (row &gt;= 0 &amp;&amp; row &lt;= 2 &amp;&amp; column &gt;= 0 &amp;&amp; column &lt;= 2)
<a name="l00178"></a>00178             <span class="keywordflow">return</span>(ele[row][column]);
<a name="l00179"></a>00179           <span class="keywordflow">else</span>
<a name="l00180"></a>00180             <span class="keywordflow">return</span> 0.0f;
<a name="l00181"></a>00181 <span class="preprocessor">#else</span>
<a name="l00182"></a>00182 <span class="preprocessor"></span>          <span class="keywordflow">return</span>(ele[row][column]);
<a name="l00183"></a>00183 <span class="preprocessor">#endif</span>
<a name="l00184"></a>00184 <span class="preprocessor"></span>        }
<a name="l00185"></a>00185 
<a name="l00187"></a>00187 
<a name="l00190"></a><a class="code" href="classOpenBabel_1_1matrix3x3.shtml#aae7e56afba0365c34add2d93288995ca">00190</a>       <span class="keywordtype">void</span> Set(<span class="keywordtype">int</span> row,<span class="keywordtype">int</span> column, <span class="keywordtype">double</span> v)
<a name="l00191"></a>00191         {
<a name="l00192"></a>00192 <span class="preprocessor">#ifdef OB_OLD_MATH_CHECKS</span>
<a name="l00193"></a>00193 <span class="preprocessor"></span>          <span class="keywordflow">if</span> (row &gt;= 0 &amp;&amp; row &lt;= 2 &amp;&amp; column &gt;= 0 &amp;&amp; column &lt;= 2)
<a name="l00194"></a>00194             ele[row][column]= v;
<a name="l00195"></a>00195 <span class="preprocessor">#else</span>
<a name="l00196"></a>00196 <span class="preprocessor"></span>          ele[row][column]= v;
<a name="l00197"></a>00197 <span class="preprocessor">#endif</span>
<a name="l00198"></a>00198 <span class="preprocessor"></span>        }
<a name="l00199"></a>00199 
<a name="l00201"></a>00201 
<a name="l00203"></a>00203       <span class="keywordtype">void</span> SetColumn(<span class="keywordtype">int</span> column, <span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1vector3.shtml" title="Represents a vector in 3-dimensional real space.">vector3</a> &amp;v)
<a name="l00204"></a>00204 <span class="preprocessor">#ifdef OB_OLD_MATH_CHECKS</span>
<a name="l00205"></a>00205 <span class="preprocessor"></span>  <span class="keywordflow">throw</span>(<a class="code" href="classOpenBabel_1_1OBError.shtml" title="Customizable error handling and logging -- store a message, including the method yielding the error...">OBError</a>)
<a name="l00206"></a>00206 <span class="preprocessor">#endif</span>
<a name="l00207"></a>00207 <span class="preprocessor"></span>      ;
<a name="l00208"></a>00208 
<a name="l00210"></a>00210 
<a name="l00212"></a>00212       <span class="keywordtype">void</span> SetRow(<span class="keywordtype">int</span> row, <span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1vector3.shtml" title="Represents a vector in 3-dimensional real space.">vector3</a> &amp;v)
<a name="l00213"></a>00213 <span class="preprocessor">#ifdef OB_OLD_MATH_CHECKS</span>
<a name="l00214"></a>00214 <span class="preprocessor"></span>  <span class="keywordflow">throw</span>(<a class="code" href="classOpenBabel_1_1OBError.shtml" title="Customizable error handling and logging -- store a message, including the method yielding the error...">OBError</a>)
<a name="l00215"></a>00215 <span class="preprocessor">#endif</span>
<a name="l00216"></a>00216 <span class="preprocessor"></span>      ;
<a name="l00217"></a>00217 
<a name="l00219"></a>00219 
<a name="l00221"></a>00221       <a class="code" href="classOpenBabel_1_1vector3.shtml" title="Represents a vector in 3-dimensional real space.">vector3</a> GetColumn(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> col) <span class="keyword">const</span>
<a name="l00222"></a>00222 <span class="preprocessor">#ifdef OB_OLD_MATH_CHECKS</span>
<a name="l00223"></a>00223 <span class="preprocessor"></span>  <span class="keywordflow">throw</span>(<a class="code" href="classOpenBabel_1_1OBError.shtml" title="Customizable error handling and logging -- store a message, including the method yielding the error...">OBError</a>)
<a name="l00224"></a>00224 <span class="preprocessor">#endif</span>
<a name="l00225"></a>00225 <span class="preprocessor"></span>      ;
<a name="l00226"></a>00226 
<a name="l00228"></a>00228 
<a name="l00230"></a>00230       <a class="code" href="classOpenBabel_1_1vector3.shtml" title="Represents a vector in 3-dimensional real space.">vector3</a> GetRow(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> row) <span class="keyword">const</span>
<a name="l00231"></a>00231 <span class="preprocessor">#ifdef OB_OLD_MATH_CHECKS</span>
<a name="l00232"></a>00232 <span class="preprocessor"></span>  <span class="keywordflow">throw</span>(<a class="code" href="classOpenBabel_1_1OBError.shtml" title="Customizable error handling and logging -- store a message, including the method yielding the error...">OBError</a>)
<a name="l00233"></a>00233 <span class="preprocessor">#endif</span>
<a name="l00234"></a>00234 <span class="preprocessor"></span>      ;
<a name="l00235"></a>00235 
<a name="l00237"></a><a class="code" href="classOpenBabel_1_1matrix3x3.shtml#a4623ee2f3c5b2b7cc4c2efb081273f62">00237</a>       <a class="code" href="classOpenBabel_1_1matrix3x3.shtml" title="Represents a real 3x3 matrix.">matrix3x3</a> &amp;operator*=(<span class="keyword">const</span> <span class="keywordtype">double</span> &amp;c)
<a name="l00238"></a>00238       {
<a name="l00239"></a>00239         <span class="keywordflow">for</span>( <span class="keywordtype">int</span> i = 0; i &lt; 3; i++ )
<a name="l00240"></a>00240           <span class="keywordflow">for</span>( <span class="keywordtype">int</span> j = 0; j &lt; 3; j++ )
<a name="l00241"></a>00241             ele[i][j] *= c;
<a name="l00242"></a>00242         <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00243"></a>00243       }
<a name="l00244"></a>00244 
<a name="l00246"></a><a class="code" href="classOpenBabel_1_1matrix3x3.shtml#a56c27ea39208380495f812df6b865289">00246</a>       <a class="code" href="classOpenBabel_1_1matrix3x3.shtml" title="Represents a real 3x3 matrix.">matrix3x3</a> &amp;operator/=(<span class="keyword">const</span> <span class="keywordtype">double</span> &amp;c)
<a name="l00247"></a>00247       {
<a name="l00248"></a>00248         <span class="keywordflow">return</span>( (*<span class="keyword">this</span>) *= ( 1.0 / c ) );
<a name="l00249"></a>00249       }
<a name="l00250"></a>00250 
<a name="l00253"></a>00253       <span class="keywordtype">void</span> SetupRotMat(<span class="keywordtype">double</span> x, <span class="keywordtype">double</span> y, <span class="keywordtype">double</span> z);
<a name="l00254"></a>00254 
<a name="l00256"></a>00256       <span class="keywordtype">void</span> PlaneReflection(<span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1vector3.shtml" title="Represents a vector in 3-dimensional real space.">vector3</a> &amp;norm);
<a name="l00257"></a>00257 
<a name="l00260"></a>00260       <span class="keywordtype">void</span> RotAboutAxisByAngle(<span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1vector3.shtml" title="Represents a vector in 3-dimensional real space.">vector3</a> &amp;axis, <span class="keyword">const</span> <span class="keywordtype">double</span> angle);
<a name="l00261"></a>00261 
<a name="l00267"></a>00267       <span class="keywordtype">void</span> FillOrth(<span class="keywordtype">double</span> alpha, <span class="keywordtype">double</span> beta, <span class="keywordtype">double</span> gamma,
<a name="l00268"></a>00268                     <span class="keywordtype">double</span> a, <span class="keywordtype">double</span> b, <span class="keywordtype">double</span> c);
<a name="l00269"></a>00269 
<a name="l00271"></a>00271       <a class="code" href="classOpenBabel_1_1matrix3x3.shtml" title="Represents a real 3x3 matrix.">matrix3x3</a> findEigenvectorsIfSymmetric(<a class="code" href="classOpenBabel_1_1vector3.shtml" title="Represents a vector in 3-dimensional real space.">vector3</a> &amp;eigenvals) <span class="keyword">const</span>
<a name="l00272"></a>00272 <span class="preprocessor">#ifdef OB_OLD_MATH_CHECKS</span>
<a name="l00273"></a>00273 <span class="preprocessor"></span>  <span class="keywordflow">throw</span>(<a class="code" href="classOpenBabel_1_1OBError.shtml" title="Customizable error handling and logging -- store a message, including the method yielding the error...">OBError</a>)
<a name="l00274"></a>00274 <span class="preprocessor">#endif</span>
<a name="l00275"></a>00275 <span class="preprocessor"></span>      ;
<a name="l00276"></a>00276 
<a name="l00278"></a>00278       <span class="keyword">friend</span> OBAPI <a class="code" href="classOpenBabel_1_1vector3.shtml" title="Represents a vector in 3-dimensional real space.">vector3</a> <a class="code" href="namespaceOpenBabel.shtml#a56b20579149ab8b5807475d4302c33a2" title="Multiplication with a scalar.">operator *</a>(<span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1matrix3x3.shtml" title="Represents a real 3x3 matrix.">matrix3x3</a> &amp;,<span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1vector3.shtml" title="Represents a vector in 3-dimensional real space.">vector3</a> &amp;);
<a name="l00279"></a>00279 
<a name="l00281"></a>00281       <span class="keyword">friend</span> OBAPI <a class="code" href="classOpenBabel_1_1matrix3x3.shtml" title="Represents a real 3x3 matrix.">matrix3x3</a> <a class="code" href="namespaceOpenBabel.shtml#a56b20579149ab8b5807475d4302c33a2" title="Multiplication with a scalar.">operator *</a>(<span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1matrix3x3.shtml" title="Represents a real 3x3 matrix.">matrix3x3</a> &amp;,<span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1matrix3x3.shtml" title="Represents a real 3x3 matrix.">matrix3x3</a> &amp;);
<a name="l00282"></a>00282 
<a name="l00284"></a>00284       <span class="keyword">friend</span> OBAPI std::ostream&amp; <a class="code" href="namespaceOpenBabel.shtml#a70c653ee69fdbd27f77d430e4aed3cad" title="Prints a representation of the vector as a row vector of the form &quot;&lt;0.1,1,2&gt;&quot;.">operator&lt;&lt; </a>( std::ostream&amp;, <span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1matrix3x3.shtml" title="Represents a real 3x3 matrix.">matrix3x3</a> &amp; ) ;
<a name="l00285"></a>00285 
<a name="l00287"></a>00287       <span class="keyword">static</span> <span class="keywordtype">void</span> jacobi(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> n, <span class="keywordtype">double</span> *a, <span class="keywordtype">double</span> *d, <span class="keywordtype">double</span> *v);
<a name="l00288"></a>00288     };
<a name="l00289"></a>00289 
<a name="l00290"></a>00290 <span class="preprocessor">#ifndef SWIG</span>
<a name="l00291"></a>00291 <span class="preprocessor"></span>  OBAPI vector3 <a class="code" href="namespaceOpenBabel.shtml#af1a9769dcdfc9bb77a3747a3c89c3d03">center_coords</a>(<span class="keywordtype">double</span>*,<span class="keywordtype">int</span>);
<a name="l00292"></a>00292 <span class="preprocessor">#endif</span>
<a name="l00293"></a>00293 <span class="preprocessor"></span>}
<a name="l00294"></a>00294 
<a name="l00295"></a>00295 <span class="preprocessor">#endif // OB_MATRIX3x3_H</span>
<a name="l00296"></a>00296 <span class="preprocessor"></span>
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- end content -->

<!--#include file="footer.html" -->

<div id="footer">
<hr size="1">
<img src="http://openbabel.org/babel256.png" width="136" height="127" alt="" style="float: left;" />
<p>This file is part of the documentation for <a href="http://openbabel.org/wiki/">Open Babel</a>, version 2.3.</p>
<div class="bottom">
Documentation copyright &copy; 1998-2007, the <a href="http://openbabel.org/wiki/THANKS">Open Babel Developers</a>.<br>
Open Babel is hosted by: <a href="http://sourceforge.net">
<img src="http://sourceforge.net/sflogo.php?group_id=40728" 
width="88" height="31" border="0" alt="SourceForge Logo"></a><br>
Generated on Thu Oct 13 2011 16:08:06 by&nbsp;<a href="http://www.doxygen.org/"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.7.5.1.
</div>

</body>
</html>