Main Page | Namespace List | Class Hierarchy | Compound List | File List | Namespace Members | Compound Members | File Members

std Namespace Reference


Compounds

struct  __select1st_hint
struct  _Identity
struct  identity
struct  select1st
struct  select2nd

Functions

template<class _ForwardIterator, class _Tp> void iota (_ForwardIterator __first, _ForwardIterator __last, _Tp __value)
template<class _Base, class _Integer> _Base power (_Base __x, _Integer __n)
template<class _ForwardIter, class _OutputIter, class _Distance> _OutputIter random_sample_n (_ForwardIter __first, _ForwardIter __last, _OutputIter __out, const _Distance __n)
template<class _ForwardIter, class _OutputIter, class _Distance, class _RandomNumberGenerator> _OutputIter random_sample_n (_ForwardIter __first, _ForwardIter __last, _OutputIter __out, const _Distance __n, _RandomNumberGenerator &__rand)
template<class _InputIter, class _RandomAccessIter, class _Distance> _RandomAccessIter __random_sample (_InputIter __first, _InputIter __last, _RandomAccessIter __out, const _Distance __n)
template<class _InputIter, class _RandomAccessIter, class _RandomNumberGenerator, class _Distance> _RandomAccessIter __random_sample (_InputIter __first, _InputIter __last, _RandomAccessIter __out, _RandomNumberGenerator &__rand, const _Distance __n)
template<class _InputIter, class _RandomAccessIter> _RandomAccessIter random_sample (_InputIter __first, _InputIter __last, _RandomAccessIter __out_first, _RandomAccessIter __out_last)
template<class _InputIter, class _RandomAccessIter, class _RandomNumberGenerator> _RandomAccessIter random_sample (_InputIter __first, _InputIter __last, _RandomAccessIter __out_first, _RandomAccessIter __out_last, _RandomNumberGenerator &__rand)
template<class _ForwardIter> bool is_sorted (_ForwardIter __first, _ForwardIter __last)
template<class _ForwardIter, class _StrictWeakOrdering> bool is_sorted (_ForwardIter __first, _ForwardIter __last, _StrictWeakOrdering __comp)


Function Documentation

template<class _InputIter, class _RandomAccessIter, class _RandomNumberGenerator, class _Distance>
_RandomAccessIter __random_sample _InputIter  __first,
_InputIter  __last,
_RandomAccessIter  __out,
_RandomNumberGenerator &  __rand,
const _Distance  __n
 

Definition at line 204 of file sgi_stl_compat.h.

00208 {
00209   _Distance __m = 0;
00210   _Distance __t = __n;
00211   for ( ; __first != __last && __m < __n; ++__m, ++__first)
00212     __out[__m] = *__first;
00213 
00214   while (__first != __last) {
00215     ++__t;
00216     _Distance __M = __rand(__t);
00217     if (__M < __n)
00218       __out[__M] = *__first;
00219     ++__first;
00220   }
00221 
00222   return __out + __m;
00223 }            

template<class _InputIter, class _RandomAccessIter, class _Distance>
_RandomAccessIter __random_sample _InputIter  __first,
_InputIter  __last,
_RandomAccessIter  __out,
const _Distance  __n
 

Definition at line 182 of file sgi_stl_compat.h.

Referenced by random_sample().

00185 {
00186   _Distance __m = 0;
00187   _Distance __t = __n;
00188   for ( ; __first != __last && __m < __n; ++__m, ++__first)
00189     __out[__m] = *__first;
00190 
00191   while (__first != __last) {
00192     ++__t;
00193     _Distance __M = __random_number(__t);
00194     if (__M < __n)
00195       __out[__M] = *__first;
00196     ++__first;
00197   }
00198 
00199   return __out + __m;
00200 }                      

template<class _ForwardIterator, class _Tp>
void iota _ForwardIterator  __first,
_ForwardIterator  __last,
_Tp  __value
 

Definition at line 109 of file sgi_stl_compat.h.

00110 {
00111   while (__first != __last)
00112     *__first++ = __value++;
00113 }       

template<class _ForwardIter, class _StrictWeakOrdering>
bool is_sorted _ForwardIter  __first,
_ForwardIter  __last,
_StrictWeakOrdering  __comp
 

Definition at line 264 of file sgi_stl_compat.h.

00266 {
00267   if (__first == __last)
00268     return true;
00269 
00270   _ForwardIter __next = __first;
00271   for (++__next; __next != __last; __first = __next, ++__next) {
00272     if (__comp(*__next, *__first))
00273       return false;
00274   }
00275 
00276   return true;
00277 }            

template<class _ForwardIter>
bool is_sorted _ForwardIter  __first,
_ForwardIter  __last
 

Definition at line 249 of file sgi_stl_compat.h.

00250 {
00251   if (__first == __last)
00252     return true;
00253 
00254   _ForwardIter __next = __first;
00255   for (++__next; __next != __last; __first = __next, ++__next) {
00256     if (*__next < *__first)
00257       return false;
00258   }
00259 
00260   return true;
00261 }

template<class _Base, class _Integer>
_Base power _Base  __x,
_Integer  __n
 

Definition at line 116 of file sgi_stl_compat.h.

Referenced by parquetfp::Annealer::anneal().

00117 {
00118   if (__n == 0) return 1;
00119   else {
00120     while ((__n & 1) == 0) {
00121       __n >>= 1;
00122       __x = __x * __x;
00123     }
00124 
00125     _Base __result = __x;
00126     __n >>= 1;
00127     while (__n != 0) {
00128       __x = __x * __x;
00129       if ((__n & 1) != 0)
00130         __result = __result * __x;
00131       __n >>= 1;
00132     }
00133     return __result;
00134   }
00135 }        

template<class _InputIter, class _RandomAccessIter, class _RandomNumberGenerator>
_RandomAccessIter random_sample _InputIter  __first,
_InputIter  __last,
_RandomAccessIter  __out_first,
_RandomAccessIter  __out_last,
_RandomNumberGenerator &  __rand
[inline]
 

Definition at line 238 of file sgi_stl_compat.h.

References __random_sample().

00241 {
00242   return __random_sample(__first, __last,
00243                          __out_first, __rand,
00244                          __out_last - __out_first);
00245 }    

Here is the call graph for this function:

template<class _InputIter, class _RandomAccessIter>
_RandomAccessIter random_sample _InputIter  __first,
_InputIter  __last,
_RandomAccessIter  __out_first,
_RandomAccessIter  __out_last
[inline]
 

Definition at line 227 of file sgi_stl_compat.h.

References __random_sample().

00229 {
00230   return __random_sample(__first, __last,
00231                          __out_first, __out_last - __out_first);
00232 }

Here is the call graph for this function:

template<class _ForwardIter, class _OutputIter, class _Distance, class _RandomNumberGenerator>
_OutputIter random_sample_n _ForwardIter  __first,
_ForwardIter  __last,
_OutputIter  __out,
const _Distance  __n,
_RandomNumberGenerator &  __rand
 

Definition at line 161 of file sgi_stl_compat.h.

00164 {
00165   _Distance __remaining = __last - __first;
00166   _Distance __m = std::min(__n, __remaining);
00167 
00168   while (__m > 0) {
00169     if (__rand(__remaining) < __m) {
00170       *__out = *__first;
00171       ++__out;
00172       --__m;
00173     }
00174 
00175     --__remaining;
00176     ++__first;
00177   }
00178   return __out;
00179 }       

template<class _ForwardIter, class _OutputIter, class _Distance>
_OutputIter random_sample_n _ForwardIter  __first,
_ForwardIter  __last,
_OutputIter  __out,
const _Distance  __n
 

Definition at line 140 of file sgi_stl_compat.h.

00142 {
00143   _Distance __remaining = __last - __first;
00144   _Distance __m = std::min(__n, __remaining);
00145 
00146   while (__m > 0) {
00147     if (__random_number(__remaining) < __m) {
00148       *__out = *__first;
00149       ++__out;
00150       --__m;
00151     }
00152 
00153     --__remaining;
00154     ++__first;
00155   }
00156   return __out;
00157 }


Generated on Mon Apr 25 01:18:53 2005 for Parquete by doxygen 1.3.2