File: bitvec_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 (259 lines) | stat: -rw-r--r-- 28,974 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>bitvec.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">bitvec.h</div>  </div>
</div>
<div class="contents">
<a href="bitvec_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">bitvec.h - Vector of bits.</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"></span>
<a name="l00007"></a>00007 <span class="comment">This file is part of the Open Babel project.</span>
<a name="l00008"></a>00008 <span class="comment">For more information, see &lt;http://openbabel.org/&gt;</span>
<a name="l00009"></a>00009 <span class="comment"></span>
<a name="l00010"></a>00010 <span class="comment">This program is free software; you can redistribute it and/or modify</span>
<a name="l00011"></a>00011 <span class="comment">it under the terms of the GNU General Public License as published by</span>
<a name="l00012"></a>00012 <span class="comment">the Free Software Foundation version 2 of the License.</span>
<a name="l00013"></a>00013 <span class="comment"></span>
<a name="l00014"></a>00014 <span class="comment">This program is distributed in the hope that it will be useful,</span>
<a name="l00015"></a>00015 <span class="comment">but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00016"></a>00016 <span class="comment">MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00017"></a>00017 <span class="comment">GNU General Public License for more details.</span>
<a name="l00018"></a>00018 <span class="comment">***********************************************************************/</span>
<a name="l00019"></a>00019 
<a name="l00020"></a>00020 <span class="preprocessor">#ifndef OB_BITVEC_H</span>
<a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#define OB_BITVEC_H</span>
<a name="l00022"></a>00022 <span class="preprocessor"></span>
<a name="l00023"></a>00023 <span class="preprocessor">#include &lt;openbabel/babelconfig.h&gt;</span>
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 <span class="preprocessor">#include &lt;vector&gt;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00027"></a>00027 
<a name="l00028"></a>00028 <span class="preprocessor">#ifndef USE_64BIT_INTEGER</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="comment">// For 32-bit architecture</span>
<a name="l00030"></a><a class="code" href="bitvec_8h.shtml#a9fe4f0c47a767fe2d6e2c365059a5a65">00030</a> <span class="preprocessor">#define SETWORD 32</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span><span class="comment">// SETWORD = 2 ^ WORDROLL</span>
<a name="l00032"></a><a class="code" href="bitvec_8h.shtml#a887ff76464a78f746a33cad3d7610766">00032</a> <span class="preprocessor">#define WORDROLL 5</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span><span class="comment">// WORDMASK = SETWORD - 1</span>
<a name="l00034"></a><a class="code" href="bitvec_8h.shtml#a076926595d98cea736e59225f32e2dd2">00034</a> <span class="preprocessor">#define WORDMASK 31</span>
<a name="l00035"></a>00035 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span><span class="comment">// For 64-bit architecture</span>
<a name="l00037"></a>00037 <span class="preprocessor">#define SETWORD 64</span>
<a name="l00038"></a>00038 <span class="preprocessor"></span><span class="comment">// SETWORD = 2 ^ WORDROLL</span>
<a name="l00039"></a>00039 <span class="preprocessor">#define WORDROLL 6</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span><span class="comment">// WORDMASK = SETWORD - 1</span>
<a name="l00041"></a>00041 <span class="preprocessor">#define WORDMASK 63</span>
<a name="l00042"></a>00042 <span class="preprocessor"></span><span class="preprocessor">#endif // 64 bit</span>
<a name="l00043"></a>00043 <span class="preprocessor"></span>
<a name="l00044"></a><a class="code" href="bitvec_8h.shtml#adb43d23e9968ccbacca3dad700e17b7d">00044</a> <span class="preprocessor">#define WORDSIZE_OF_BITSIZE( bit_size ) ( ( bit_size &gt;&gt; WORDROLL ) + (( bit_size &amp; WORDMASK ) ? 1 : 0) )</span>
<a name="l00045"></a>00045 <span class="preprocessor"></span>
<a name="l00046"></a>00046 <span class="preprocessor">#ifndef STARTWORDS</span>
<a name="l00047"></a><a class="code" href="bitvec_8h.shtml#ab0d0da65f8c1f9e86e1c16294dc572aa">00047</a> <span class="preprocessor"></span><span class="preprocessor">#define STARTWORDS 10</span>
<a name="l00048"></a>00048 <span class="preprocessor"></span><span class="preprocessor">#endif // STARTWORDS</span>
<a name="l00049"></a>00049 <span class="preprocessor"></span>
<a name="l00050"></a>00050 <span class="keyword">namespace </span>OpenBabel
<a name="l00051"></a>00051   {
<a name="l00053"></a>00053 
<a name="l00061"></a><a class="code" href="classOpenBabel_1_1OBBitVec.shtml">00061</a>   <span class="keyword">class </span>OBERROR <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a>
<a name="l00062"></a>00062     {
<a name="l00063"></a>00063     <span class="keyword">public</span>:
<a name="l00064"></a><a class="code" href="classOpenBabel_1_1OBBitVec.shtml#a732c7bffa6fdaeb8996f3a63450f422f">00064</a>           <span class="keyword">typedef</span> std::vector&lt;unsigned&gt; <a class="code" href="classOpenBabel_1_1OBBitVec.shtml#a732c7bffa6fdaeb8996f3a63450f422f">word_vector</a>;
<a name="l00065"></a>00065 
<a name="l00066"></a>00066         <span class="keyword">private</span>:
<a name="l00068"></a>00068       <span class="keywordtype">size_t</span> _size; <span class="comment">//was unsigned</span>
<a name="l00070"></a>00070 <span class="comment"></span>      <a class="code" href="classOpenBabel_1_1OBBitVec.shtml#a732c7bffa6fdaeb8996f3a63450f422f">word_vector</a>       _set;
<a name="l00071"></a>00071 
<a name="l00072"></a>00072     <span class="keyword">public</span>:
<a name="l00074"></a>00074 
<a name="l00077"></a><a class="code" href="classOpenBabel_1_1OBBitVec.shtml#af0100bd07b2642e38b29dc8e74ff765b">00077</a>       <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a>()
<a name="l00078"></a>00078           :_set(<a class="code" href="bitvec_8h.shtml#ab0d0da65f8c1f9e86e1c16294dc572aa">STARTWORDS</a>, 0)
<a name="l00079"></a>00079         { _size = _set.size(); }
<a name="l00081"></a>00081 
<a name="l00086"></a><a class="code" href="classOpenBabel_1_1OBBitVec.shtml#ac5a4c3682c88b8d666b5d7d33183fb55">00086</a>       <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a>(<span class="keywordtype">unsigned</span> size_in_bits)
<a name="l00087"></a>00087           :_set(<a class="code" href="bitvec_8h.shtml#adb43d23e9968ccbacca3dad700e17b7d">WORDSIZE_OF_BITSIZE</a>(size_in_bits), 0)
<a name="l00088"></a>00088         { _size = _set.size(); }
<a name="l00090"></a>00090 
<a name="l00094"></a><a class="code" href="classOpenBabel_1_1OBBitVec.shtml#a1a1bd9c96031c99d3209b04ef50b4d6c">00094</a>       <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a>(<span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> &amp; bv)
<a name="l00095"></a>00095           :_size(0)
<a name="l00096"></a>00096                 { (*this) = bv; }
<a name="l00098"></a>00098       <span class="keywordtype">void</span> SetBitOn(<span class="keywordtype">unsigned</span> bit_offset);
<a name="l00100"></a>00100       <span class="keywordtype">void</span> SetBitOff(<span class="keywordtype">unsigned</span> bit_offset);
<a name="l00102"></a>00102       <span class="keywordtype">void</span> SetRangeOn(<span class="keywordtype">unsigned</span> lo_bit_offset, <span class="keywordtype">unsigned</span> hi_bit_offset);
<a name="l00104"></a>00104       <span class="keywordtype">void</span> SetRangeOff(<span class="keywordtype">unsigned</span> lo_bit_offset, <span class="keywordtype">unsigned</span> hi_bit_offset);
<a name="l00106"></a>00106       <span class="keywordtype">void</span> Fold(<span class="keywordtype">unsigned</span> new_bit_size);
<a name="l00108"></a>00108 
<a name="l00112"></a><a class="code" href="classOpenBabel_1_1OBBitVec.shtml#ac00671a01df7cc0b2751cf01576cb48b">00112</a>       <span class="keywordtype">int</span> FirstBit(<span class="keywordtype">unsigned</span> bit_offset = 0)<span class="keyword"> const</span>
<a name="l00113"></a>00113 <span class="keyword">        </span>{
<a name="l00114"></a>00114           <span class="keywordflow">return</span> (BitIsSet(bit_offset) ? 0  : NextBit(bit_offset));
<a name="l00115"></a>00115         }
<a name="l00117"></a>00117       <span class="keywordtype">int</span> NextBit(<span class="keywordtype">int</span> last_bit_offset) <span class="keyword">const</span>;
<a name="l00119"></a><a class="code" href="classOpenBabel_1_1OBBitVec.shtml#a787ec2b13a14e73a2732a5eb0941c89a">00119</a>       <span class="keywordtype">int</span> <a class="code" href="classOpenBabel_1_1OBBitVec.shtml#a787ec2b13a14e73a2732a5eb0941c89a" title="Return the bit offset of the last bit (for iterating) i.e. -1.">EndBit</a>()<span class="keyword"> const </span>{  <span class="keywordflow">return</span> -1; }
<a name="l00121"></a><a class="code" href="classOpenBabel_1_1OBBitVec.shtml#aa28b8191c62589d996ac605c9cbe5829">00121</a>       <span class="keywordtype">size_t</span> <a class="code" href="classOpenBabel_1_1OBBitVec.shtml#aa28b8191c62589d996ac605c9cbe5829" title="Return the number of words ( NOT the number of bits ).">GetSize</a>()<span class="keyword"> const    </span>{ <span class="keywordflow">return</span>(_size);    }
<a name="l00123"></a>00123       <span class="keywordtype">unsigned</span> CountBits() <span class="keyword">const</span>;
<a name="l00124"></a>00124 
<a name="l00126"></a><a class="code" href="classOpenBabel_1_1OBBitVec.shtml#a6fcfd4a80bfd7dc324f815cd351bfbdf">00126</a>       <span class="keywordtype">bool</span> <a class="code" href="classOpenBabel_1_1OBBitVec.shtml#a6fcfd4a80bfd7dc324f815cd351bfbdf">Empty</a>()<span class="keyword"> const   </span>{ <span class="keywordflow">return</span>(IsEmpty()); }
<a name="l00128"></a>00128       <span class="keywordtype">bool</span> IsEmpty() <span class="keyword">const</span>;
<a name="l00130"></a>00130 
<a name="l00134"></a><a class="code" href="classOpenBabel_1_1OBBitVec.shtml#a7bc2d3a9e8b18736d47932ba327afd38">00134</a>       <span class="keywordtype">bool</span> Resize(<span class="keywordtype">unsigned</span> size_in_bits)
<a name="l00135"></a>00135                 {
<a name="l00136"></a>00136                 <span class="keywordflow">return</span> ResizeWords( <a class="code" href="bitvec_8h.shtml#adb43d23e9968ccbacca3dad700e17b7d">WORDSIZE_OF_BITSIZE</a>(size_in_bits) );
<a name="l00137"></a>00137                 }
<a name="l00139"></a>00139 
<a name="l00143"></a><a class="code" href="classOpenBabel_1_1OBBitVec.shtml#a6b57d4f315f27f863dfaba863f9d6c4c">00143</a>           <span class="keywordtype">bool</span> ResizeWords(<span class="keywordtype">unsigned</span> size_in_words)
<a name="l00144"></a>00144                 {
<a name="l00145"></a>00145                 <span class="keywordflow">if</span> (size_in_words &lt;= _size)
<a name="l00146"></a>00146                   <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00147"></a>00147                 _set.resize(size_in_words, 0); <span class="comment">// increase the vector with zeroed bits</span>
<a name="l00148"></a>00148                 _size = _set.size();
<a name="l00149"></a>00149                 <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00150"></a>00150                 }
<a name="l00152"></a>00152 
<a name="l00156"></a><a class="code" href="classOpenBabel_1_1OBBitVec.shtml#a9cbd85a20d3c22eed705e4215b5beff7">00156</a>       <span class="keywordtype">bool</span> BitIsSet(<span class="keywordtype">unsigned</span> bit_offset)<span class="keyword"> const</span>
<a name="l00157"></a>00157 <span class="keyword">        </span>{
<a name="l00158"></a>00158                   <span class="keywordtype">bool</span> rtn = <span class="keyword">false</span>;
<a name="l00159"></a>00159                   <span class="keywordtype">unsigned</span> word_offset = bit_offset &gt;&gt; <a class="code" href="bitvec_8h.shtml#a887ff76464a78f746a33cad3d7610766">WORDROLL</a>;
<a name="l00160"></a>00160                   <span class="keywordflow">if</span> (word_offset &lt; GetSize())
<a name="l00161"></a>00161                         {
<a name="l00162"></a>00162                           bit_offset &amp;= <a class="code" href="bitvec_8h.shtml#a076926595d98cea736e59225f32e2dd2">WORDMASK</a>;
<a name="l00163"></a>00163                           rtn = (( _set[word_offset] &gt;&gt; bit_offset ) &amp; 1);
<a name="l00164"></a>00164                         }
<a name="l00165"></a>00165           <span class="keywordflow">return</span> rtn;
<a name="l00166"></a>00166         }
<a name="l00168"></a><a class="code" href="classOpenBabel_1_1OBBitVec.shtml#ad06f035d55e669326f14cd7c6ff724cc">00168</a>       <span class="keywordtype">bool</span> BitIsOn(<span class="keywordtype">int</span> bit_offset)<span class="keyword"> const</span>
<a name="l00169"></a>00169 <span class="keyword">        </span>{ <span class="keywordflow">return</span> BitIsSet((<span class="keywordtype">unsigned</span>)bit_offset); }
<a name="l00170"></a>00170 
<a name="l00172"></a>00172           <span class="keywordtype">void</span> FromVecInt(<span class="keyword">const</span> std::vector&lt;int&gt; &amp; bit_offsets);
<a name="l00174"></a>00174           <span class="keywordtype">void</span> FromString(<span class="keyword">const</span> std::string &amp; line, <span class="keywordtype">int</span> bits);
<a name="l00176"></a>00176           <span class="keywordtype">void</span> ToVecInt(std::vector&lt;int&gt; &amp; bit_offsets) <span class="keyword">const</span>;
<a name="l00178"></a>00178       <span class="keywordtype">void</span> Clear();
<a name="l00180"></a>00180 
<a name="l00184"></a><a class="code" href="classOpenBabel_1_1OBBitVec.shtml#a00e05e1bb6f3185b1a40728679be5274">00184</a>       <span class="keywordtype">void</span> Negate()
<a name="l00185"></a>00185         {
<a name="l00186"></a>00186                   <span class="keywordflow">for</span> (word_vector::iterator wx = _set.begin(), wy = _set.end(); wx != wy; ++wx)
<a name="l00187"></a>00187                     * wx = ~(* wx);
<a name="l00188"></a>00188         }
<a name="l00190"></a>00190 
<a name="l00194"></a><a class="code" href="classOpenBabel_1_1OBBitVec.shtml#a56df5cb29ee1da7ea5626ab4c0f35882">00194</a>       <span class="keywordtype">void</span> GetWords(<a class="code" href="classOpenBabel_1_1OBBitVec.shtml#a732c7bffa6fdaeb8996f3a63450f422f">word_vector</a> &amp; vec)
<a name="l00195"></a>00195         {
<a name="l00196"></a>00196                 vec.insert(vec.end(), _set.begin(),_set.end());
<a name="l00197"></a>00197         }
<a name="l00198"></a>00198 
<a name="l00200"></a>00200       <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> &amp; operator= (<span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> &amp; bv);
<a name="l00202"></a>00202       <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> &amp; operator&amp;= (<span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> &amp; bv);
<a name="l00204"></a>00204       <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> &amp; operator|= (<span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> &amp; bv);
<a name="l00206"></a>00206 
<a name="l00208"></a><a class="code" href="classOpenBabel_1_1OBBitVec.shtml#a3f7949c8ca082670fa93310be6576854">00208</a>       <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> &amp; operator|= (<span class="keywordtype">int</span> bit_offset)
<a name="l00209"></a>00209         {
<a name="l00210"></a>00210           SetBitOn(bit_offset);
<a name="l00211"></a>00211           <span class="keywordflow">return</span>(*<span class="keyword">this</span>);
<a name="l00212"></a>00212         }
<a name="l00214"></a>00214       <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> &amp; operator^= (<span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> &amp; bv);
<a name="l00216"></a>00216       <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> &amp; operator-= (<span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> &amp; bv);
<a name="l00218"></a>00218       <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> &amp; operator+= (<span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> &amp; bv);
<a name="l00220"></a>00220 
<a name="l00224"></a><a class="code" href="classOpenBabel_1_1OBBitVec.shtml#a1f22ca998400b0babe0bee468189225b">00224</a>       <span class="keywordtype">bool</span> operator[] (<span class="keywordtype">int</span> bit_offset)<span class="keyword"> const</span>
<a name="l00225"></a>00225 <span class="keyword">        </span>{ <span class="keywordflow">return</span> BitIsSet(bit_offset); }
<a name="l00226"></a>00226 
<a name="l00228"></a>00228       <span class="keyword">friend</span> OBERROR <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> <a class="code" href="namespaceOpenBabel.shtml#a48ed8b37310a8d7153a64309f09901a0">operator| </a>(<span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> &amp; bv1, <span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> &amp; bv2);
<a name="l00230"></a>00230       <span class="keyword">friend</span> OBERROR <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> <a class="code" href="namespaceOpenBabel.shtml#a327b6158a69368530d30de5ce06cc7a5">operator&amp; </a>(<span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> &amp; bv1,<span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> &amp; bv2);
<a name="l00232"></a>00232       <span class="keyword">friend</span> OBERROR <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> <a class="code" href="namespaceOpenBabel.shtml#aa2cf1233a6c6ce53b79f94b7a60d2d2a">operator^ </a>(<span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> &amp; bv1,<span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> &amp; bv2);
<a name="l00234"></a>00234       <span class="keyword">friend</span> OBERROR <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> <a class="code" href="namespaceOpenBabel.shtml#aa2e0e5d4e59766809b5b61ab9b513a2e" title="Vector subtraction.">operator- </a>(<span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> &amp; bv1,<span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> &amp; bv2);
<a name="l00236"></a>00236       <span class="keyword">friend</span> OBERROR <span class="keywordtype">bool</span> <a class="code" href="namespaceOpenBabel.shtml#ac001b331f648fbbd8590576f59d4d2ab">operator== </a>(<span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> &amp; bv1,<span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> &amp; bv2);
<a name="l00238"></a>00238       <span class="keyword">friend</span> OBERROR <span class="keywordtype">bool</span> <a class="code" href="namespaceOpenBabel.shtml#a3ba5fcca1ecb1241049411be7017186d">operator&lt; </a>(<span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> &amp; bv1, <span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> &amp; bv2);
<a name="l00239"></a>00239 
<a name="l00241"></a>00241       <span class="keyword">friend</span> OBERROR std::istream&amp; <a class="code" href="namespaceOpenBabel.shtml#a54358a339fc06df028bb5fbe403b0032">operator&gt;&gt; </a>( std::istream &amp; is, <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> &amp; bv );
<a name="l00243"></a>00243       <span class="keyword">friend</span> OBERROR 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; os, <span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1OBBitVec.shtml" title="A speed-optimized vector of bits.">OBBitVec</a> &amp; bv ) ;
<a name="l00244"></a>00244     };
<a name="l00245"></a>00245 
<a name="l00247"></a>00247   OBERROR <span class="keywordtype">double</span> <a class="code" href="namespaceOpenBabel.shtml#aeb3b137500bda8573ee1aa5757011a66" title="The Tanimoto coefficient, which may be regarded as the proportion of the &quot;on-bits&quot; which are shared...">Tanimoto</a>(<span class="keyword">const</span> OBBitVec &amp; bv1, <span class="keyword">const</span> OBBitVec &amp; bv2);
<a name="l00248"></a>00248 
<a name="l00249"></a>00249   } <span class="comment">// end namespace OpenBabel</span>
<a name="l00250"></a>00250 
<a name="l00251"></a>00251 <span class="preprocessor">#endif // OB_BITVEC_H</span>
<a name="l00252"></a>00252 <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>