aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/a03300.html
blob: f80d84bd8ccc58fabbf7b57d7c36cfd1b519a8f1 (plain)
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
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>NeL:  TemplateNL3D::CRadixSort&lt; T &gt; class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex">  <form class="search" action="search.php" method="get">
<a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a>  | <span class="search"><u>S</u>earch&nbsp;for&nbsp;<input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div>
<h1>NL3D::CRadixSort&lt; T &gt; Class Template Reference</h1><code>#include &lt;<a class="el" href="a06310.html">radix_sort.h</a>&gt;</code>
<p>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<h3>template&lt;class T&gt;<br>
 class NL3D::CRadixSort&lt; T &gt;</h3>

A class which sort elements T with radix sort algorithm. T must follow the following interface:<ul>
<li>uint32 getRadixKey() const;</li><li>have a correct operator=()</li></ul>
<p>
getRadixKey() return the unsigned key for this element.<p>
<dl compact><dt><b>Author:</b></dt><dd>Lionel Berenguier <p>
Nevrax France </dd></dl>
<dl compact><dt><b>Date:</b></dt><dd>2001 </dd></dl>

<p>

<p>
Definition at line <a class="el" href="a06310.html#l00049">49</a> of file <a class="el" href="a06310.html">radix_sort.h</a>.<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03300.html#NL3D_1_1CRadixSorta0">CRadixSort</a> (<a class="el" href="a04558.html#a15">uint</a> keyDepth=32, <a class="el" href="a04558.html#a15">uint</a> digitDepth=8)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>T *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03300.html#NL3D_1_1CRadixSorta1">reverse_sort</a> (T *array0, T *array1, <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a04223.html#a587">size</a>)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>T *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03300.html#NL3D_1_1CRadixSorta2">sort</a> (T *array0, T *array1, <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a04223.html#a587">size</a>)</td></tr>

<tr><td colspan=2><br><h2>Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>T *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03300.html#NL3D_1_1CRadixSortd0">doSort</a> (T *arraySrc, T *arrayDst, <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a04223.html#a587">size</a>, bool increasingOrder)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">radix sort algorithm  <a href="#NL3D_1_1CRadixSortd0"></a><br><br></td></tr>
<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03300.html#NL3D_1_1CRadixSortr0">_DigitDepth</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03300.html#NL3D_1_1CRadixSortr1">_DigitSize</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03300.html#NL3D_1_1CRadixSortr2">_KeyDepth</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector&lt; <a class="el" href="a03301.html">CSortDigit</a> &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03300.html#NL3D_1_1CRadixSortr3">_SortDigits</a></td></tr>

</table>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="NL3D_1_1CRadixSorta0" doxytag="NL3D::CRadixSort::CRadixSort" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" colspan="4">
template&lt;class T&gt; </td>
        </tr>
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a03300.html">NL3D::CRadixSort</a>&lt; T &gt;::<a class="el" href="a03300.html">CRadixSort</a> </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>keyDepth</em> = 32, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>digitDepth</em> = 8</td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [inline]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Constructor <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign=top><em>keyDepth</em>&nbsp;</td><td>default is 32 bits, but if as example you're sure that you just use 14 bits, you can set keyDepth=14. Clamped to 1,32. </td></tr>
    <tr><td valign=top><em>digitDepth</em>&nbsp;</td><td>default is 8 bits. The sort will do ceil(keyDepth/digitDepth) pass in Sort. But be aware that a <a class="el" href="a03300.html">CRadixSort</a> object has a size of (1&lt;&lt;digitDepth) * 8 bytes. (2K for digitDepth=8). Be aware too that values&gt;8 is not a really good idea because of cache, and random access... And this REALLY impact (eg: from 1 to 100 if you choose 16 instead than 8...) Clamped to 1,<a class="el" href="a04061.html#a0">min(16, keyDepth)</a>.</td></tr>
  </table>
</dl>

<p>
Definition at line <a class="el" href="a06310.html#l00062">62</a> of file <a class="el" href="a06310.html">radix_sort.h</a>.
<p>
References <a class="el" href="a06310.html#l00106">NL3D::CRadixSort&lt; T &gt;::_DigitDepth</a>, <a class="el" href="a06310.html#l00107">NL3D::CRadixSort&lt; T &gt;::_DigitSize</a>, <a class="el" href="a06310.html#l00105">NL3D::CRadixSort&lt; T &gt;::_KeyDepth</a>, <a class="el" href="a06310.html#l00109">NL3D::CRadixSort&lt; T &gt;::_SortDigits</a>, <a class="el" href="a05587.html#l00115">NLMISC::clamp()</a>, <a class="el" href="a05484.html#l00038">min</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
<div class="fragment"><pre>00063         {
00064                 <span class="comment">// setup</span>
00065                 <a class="code" href="a03300.html#NL3D_1_1CRadixSortr2">_KeyDepth</a>= keyDepth;
00066                 <a class="code" href="a05378.html#a374">NLMISC::clamp</a>(_KeyDepth, 1U, 32U);
00067                 <a class="code" href="a03300.html#NL3D_1_1CRadixSortr0">_DigitDepth</a>= digitDepth;
00068                 <a class="code" href="a05378.html#a374">NLMISC::clamp</a>(_DigitDepth, 1U, 16U);
00069                 <a class="code" href="a03300.html#NL3D_1_1CRadixSortr0">_DigitDepth</a>= <a class="code" href="a04061.html#a0">std::min</a>(_DigitDepth, _KeyDepth);
00070 
00071                 <span class="comment">// resize the array of digits.</span>
00072                 <a class="code" href="a03300.html#NL3D_1_1CRadixSortr1">_DigitSize</a>= 1&lt;&lt;<a class="code" href="a03300.html#NL3D_1_1CRadixSortr0">_DigitDepth</a>;
00073                 <a class="code" href="a03300.html#NL3D_1_1CRadixSortr3">_SortDigits</a>.resize(_DigitSize);
00074         }
</pre></div>    </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="NL3D_1_1CRadixSortd0" doxytag="NL3D::CRadixSort::doSort" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" colspan="4">
template&lt;class T&gt; </td>
        </tr>
        <tr>
          <td class="md" nowrap valign="top"> T* <a class="el" href="a03300.html">NL3D::CRadixSort</a>&lt; T &gt;::doSort </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">T *&nbsp;</td>
          <td class="mdname" nowrap> <em>arraySrc</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>T *&nbsp;</td>
          <td class="mdname" nowrap> <em>arrayDst</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>size</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>bool&nbsp;</td>
          <td class="mdname" nowrap> <em>increasingOrder</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [inline, private]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
radix sort algorithm 
<p>

<p>
Definition at line <a class="el" href="a06310.html#l00113">113</a> of file <a class="el" href="a06310.html">radix_sort.h</a>.
<p>
References <a class="el" href="a06310.html#l00106">NL3D::CRadixSort&lt; T &gt;::_DigitDepth</a>, <a class="el" href="a06310.html#l00107">NL3D::CRadixSort&lt; T &gt;::_DigitSize</a>, <a class="el" href="a06310.html#l00105">NL3D::CRadixSort&lt; T &gt;::_KeyDepth</a>, <a class="el" href="a06310.html#l00109">NL3D::CRadixSort&lt; T &gt;::_SortDigits</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05646.html#l00645">size</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00100">uint32</a>.
<p>
Referenced by <a class="el" href="a06310.html#l00090">NL3D::CRadixSort&lt; T &gt;::reverse_sort()</a>, and <a class="el" href="a06310.html#l00084">NL3D::CRadixSort&lt; T &gt;::sort()</a>.
<p>
<div class="fragment"><pre>00114         {
00115                 <span class="keywordflow">if</span>(<a class="code" href="a04223.html#a587">size</a>==0)
00116                         <span class="keywordflow">return</span> arraySrc;
00117 
00118                 <span class="comment">// for all digits.</span>
00119                 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a>        digit=0; digit&lt; <a class="code" href="a03300.html#NL3D_1_1CRadixSortr2">_KeyDepth</a>; digit+=<a class="code" href="a03300.html#NL3D_1_1CRadixSortr0">_DigitDepth</a> )
00120                 {
00121                         <a class="code" href="a04558.html#a14">sint</a>    i;
00122                         <span class="comment">// how many bits do we shift?</span>
00123                         <a class="code" href="a04558.html#a15">uint</a>    digitShift= digit;
00124                         <a class="code" href="a04558.html#a15">uint</a>    digitMask= <a class="code" href="a03300.html#NL3D_1_1CRadixSortr1">_DigitSize</a> - 1;
00125 
00126                         <span class="comment">// Init digit count.</span>
00127                         <span class="keywordflow">for</span>(i=0; i&lt;(<a class="code" href="a04558.html#a14">sint</a>)<a class="code" href="a03300.html#NL3D_1_1CRadixSortr1">_DigitSize</a>; i++)
00128                         {
00129                                 <a class="code" href="a03300.html#NL3D_1_1CRadixSortr3">_SortDigits</a>[i].Count= 0;
00130                         }
00131 
00132                         <span class="comment">// for all elements in array, count the usage of current digit.</span>
00133                         T       *srcPtr= arraySrc;
00134                         <span class="keywordflow">for</span>(i=0; i&lt;(<a class="code" href="a04558.html#a14">sint</a>)<a class="code" href="a04223.html#a587">size</a>; i++, srcPtr++)
00135                         {
00136                                 <span class="comment">// get the key for this element</span>
00137                                 <a class="code" href="a04558.html#a11">uint32</a>  key= srcPtr-&gt;getRadixKey();
00138                                 <span class="comment">// get the actual digit of interest</span>
00139                                 key&gt;&gt;= digitShift;
00140                                 key&amp;= digitMask;
00141                                 <span class="comment">// increment the use of this digit.</span>
00142                                 <a class="code" href="a03300.html#NL3D_1_1CRadixSortr3">_SortDigits</a>[key].Count++;
00143                         }
00144 
00145                         <span class="comment">// for all digit, init start Ptr.</span>
00146                         T       *dstPtr= arrayDst;
00147                         <span class="keywordflow">if</span>(increasingOrder)
00148                         {
00149                                 <span class="keywordflow">for</span>(i=0; i&lt;(<a class="code" href="a04558.html#a14">sint</a>)<a class="code" href="a03300.html#NL3D_1_1CRadixSortr1">_DigitSize</a>; i++)
00150                                 {
00151                                         <span class="comment">// setup the dest ptr for this digit.</span>
00152                                         <a class="code" href="a03300.html#NL3D_1_1CRadixSortr3">_SortDigits</a>[i].Ptr= dstPtr;
00153                                         <span class="comment">// increment the ptr of digit usage</span>
00154                                         dstPtr+= <a class="code" href="a03300.html#NL3D_1_1CRadixSortr3">_SortDigits</a>[i].Count;
00155                                 }
00156                         }
00157                         <span class="keywordflow">else</span>
00158                         {
00159                                 <span class="comment">// reverse order of copy for digits, so the biggest one will </span>
00160                                 <span class="comment">// copy in the beginning of the array</span>
00161                                 <span class="keywordflow">for</span>(i=<a class="code" href="a03300.html#NL3D_1_1CRadixSortr1">_DigitSize</a>-1; i&gt;=0; i--)
00162                                 {
00163                                         <span class="comment">// setup the dest ptr for this digit.</span>
00164                                         <a class="code" href="a03300.html#NL3D_1_1CRadixSortr3">_SortDigits</a>[i].Ptr= dstPtr;
00165                                         <span class="comment">// increment the ptr of digit usage</span>
00166                                         dstPtr+= <a class="code" href="a03300.html#NL3D_1_1CRadixSortr3">_SortDigits</a>[i].Count;
00167                                 }
00168                         }
00169 
00170                         <span class="comment">// for all elements, sort for this digit, by copying from src to dest.</span>
00171                         srcPtr= arraySrc;
00172                         <span class="keywordflow">for</span>(i=0; i&lt;(<a class="code" href="a04558.html#a14">sint</a>)<a class="code" href="a04223.html#a587">size</a>; i++, srcPtr++)
00173                         {
00174                                 <span class="comment">// get the key for this element</span>
00175                                 <a class="code" href="a04558.html#a11">uint32</a>  key= srcPtr-&gt;getRadixKey();
00176                                 <span class="comment">// get the actual digit of interest</span>
00177                                 key&gt;&gt;= digitShift;
00178                                 key&amp;= digitMask;
00179                                 <span class="comment">// copy to good digit dst, and increment dest ptr.</span>
00180                                 *(<a class="code" href="a03300.html#NL3D_1_1CRadixSortr3">_SortDigits</a>[key].Ptr++)= *srcPtr;
00181                         }
00182 
00183                         <span class="comment">// arraDst has now values of arraySrc sorted for the current digit.</span>
00184                         <span class="comment">// now, restart with next digit, so swap src / dst</span>
00185                         std::swap(arraySrc, arrayDst);
00186                 }
00187 
00188                 <span class="comment">// return the array correctly sorted. because of last swap, this is arraySrc</span>
00189                 <span class="keywordflow">return</span> arraySrc;
00190         }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CRadixSorta1" doxytag="NL3D::CRadixSort::reverse_sort" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" colspan="4">
template&lt;class T&gt; </td>
        </tr>
        <tr>
          <td class="md" nowrap valign="top"> T* <a class="el" href="a03300.html">NL3D::CRadixSort</a>&lt; T &gt;::reverse_sort </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">T *&nbsp;</td>
          <td class="mdname" nowrap> <em>array0</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>T *&nbsp;</td>
          <td class="mdname" nowrap> <em>array1</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>size</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [inline]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
same as <a class="el" href="a03300.html#NL3D_1_1CRadixSorta2">sort()</a>, but elements are reordered in decreasing order <dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a03300.html#NL3D_1_1CRadixSorta2">sort()</a></dd></dl>

<p>
Definition at line <a class="el" href="a06310.html#l00090">90</a> of file <a class="el" href="a06310.html">radix_sort.h</a>.
<p>
References <a class="el" href="a06310.html#l00113">NL3D::CRadixSort&lt; T &gt;::doSort()</a>, <a class="el" href="a05646.html#l00645">size</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
<div class="fragment"><pre>00090 {<span class="keywordflow">return</span> <a class="code" href="a03300.html#NL3D_1_1CRadixSortd0">doSort</a>(array0, array1, size, <span class="keyword">false</span>);}
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CRadixSorta2" doxytag="NL3D::CRadixSort::sort" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" colspan="4">
template&lt;class T&gt; </td>
        </tr>
        <tr>
          <td class="md" nowrap valign="top"> T* <a class="el" href="a03300.html">NL3D::CRadixSort</a>&lt; T &gt;::sort </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">T *&nbsp;</td>
          <td class="mdname" nowrap> <em>array0</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>T *&nbsp;</td>
          <td class="mdname" nowrap> <em>array1</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>size</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [inline]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Sort an array of T, in (keyDepth/digitSize)*O(size). Elements are reordered in increasing order. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign=top><em>array0</em>&nbsp;</td><td>ptr on elements to be sorted. </td></tr>
    <tr><td valign=top><em>array1</em>&nbsp;</td><td>an array of T which must be allocated with same size. </td></tr>
    <tr><td valign=top><em>size</em>&nbsp;</td><td>the number of elements. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>the array which have sorted elements. Actually return array0 if ceil(keyDepth/digitDepth) is pair, else return array1. The other array has elements in undefined order.</dd></dl>

<p>
Definition at line <a class="el" href="a06310.html#l00084">84</a> of file <a class="el" href="a06310.html">radix_sort.h</a>.
<p>
References <a class="el" href="a06310.html#l00113">NL3D::CRadixSort&lt; T &gt;::doSort()</a>, <a class="el" href="a05646.html#l00645">size</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
<div class="fragment"><pre>00084 {<span class="keywordflow">return</span> <a class="code" href="a03300.html#NL3D_1_1CRadixSortd0">doSort</a>(array0, array1, size, <span class="keyword">true</span>);}
</pre></div>    </td>
  </tr>
</table>
<hr><h2>Field Documentation</h2>
<a class="anchor" name="NL3D_1_1CRadixSortr0" doxytag="NL3D::CRadixSort::_DigitDepth" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" colspan="4">
template&lt;class T&gt; </td>
        </tr>
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a03300.html">NL3D::CRadixSort</a>&lt; T &gt;::<a class="el" href="a03300.html#NL3D_1_1CRadixSortr0">_DigitDepth</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a06310.html#l00106">106</a> of file <a class="el" href="a06310.html">radix_sort.h</a>.
<p>
Referenced by <a class="el" href="a06310.html#l00062">NL3D::CRadixSort&lt; T &gt;::CRadixSort()</a>, and <a class="el" href="a06310.html#l00113">NL3D::CRadixSort&lt; T &gt;::doSort()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CRadixSortr1" doxytag="NL3D::CRadixSort::_DigitSize" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" colspan="4">
template&lt;class T&gt; </td>
        </tr>
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a03300.html">NL3D::CRadixSort</a>&lt; T &gt;::<a class="el" href="a03300.html#NL3D_1_1CRadixSortr1">_DigitSize</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a06310.html#l00107">107</a> of file <a class="el" href="a06310.html">radix_sort.h</a>.
<p>
Referenced by <a class="el" href="a06310.html#l00062">NL3D::CRadixSort&lt; T &gt;::CRadixSort()</a>, and <a class="el" href="a06310.html#l00113">NL3D::CRadixSort&lt; T &gt;::doSort()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CRadixSortr2" doxytag="NL3D::CRadixSort::_KeyDepth" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" colspan="4">
template&lt;class T&gt; </td>
        </tr>
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a03300.html">NL3D::CRadixSort</a>&lt; T &gt;::<a class="el" href="a03300.html#NL3D_1_1CRadixSortr2">_KeyDepth</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a06310.html#l00105">105</a> of file <a class="el" href="a06310.html">radix_sort.h</a>.
<p>
Referenced by <a class="el" href="a06310.html#l00062">NL3D::CRadixSort&lt; T &gt;::CRadixSort()</a>, and <a class="el" href="a06310.html#l00113">NL3D::CRadixSort&lt; T &gt;::doSort()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CRadixSortr3" doxytag="NL3D::CRadixSort::_SortDigits" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" colspan="4">
template&lt;class T&gt; </td>
        </tr>
        <tr>
          <td class="md" nowrap valign="top"> std::vector&lt;<a class="el" href="a03301.html">CSortDigit</a>&gt; <a class="el" href="a03300.html">NL3D::CRadixSort</a>&lt; T &gt;::<a class="el" href="a03300.html#NL3D_1_1CRadixSortr3">_SortDigits</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a06310.html#l00109">109</a> of file <a class="el" href="a06310.html">radix_sort.h</a>.
<p>
Referenced by <a class="el" href="a06310.html#l00062">NL3D::CRadixSort&lt; T &gt;::CRadixSort()</a>, and <a class="el" href="a06310.html#l00113">NL3D::CRadixSort&lt; T &gt;::doSort()</a>.    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="a06310.html">radix_sort.h</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 07:36:07 2004 for NeL by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 > 
</a>1.3.6 </small></address>
</body>
</html>