Implementation related data and functions. More...
Namespaces | |
| namespace | Octagonal_Shapes |
| namespace | Pointset_Powersets |
| namespace | Termination |
Functions | |
| unsigned int | first_one (mp_limb_t w) |
Assuming w is nonzero, returns the index of the first set bit in w. | |
| unsigned int | last_one (mp_limb_t w) |
Assuming w is nonzero, returns the index of the last set bit in w. | |
Variables | |
| unsigned int | in_assert = 0 |
| Non zero during evaluation of PPL_ASSERT expression. | |
Implementation related data and functions.
| unsigned int Parma_Polyhedra_Library::Implementation::first_one | ( | mp_limb_t | w | ) | [inline] |
Assuming w is nonzero, returns the index of the first set bit in w.
Definition at line 213 of file Bit_Row.inlines.hh.
Referenced by Parma_Polyhedra_Library::Bit_Row::first(), and Parma_Polyhedra_Library::Bit_Row::next().
00213 { 00214 unsigned int r = 0; 00215 w = w & -w; 00216 #if PPL_SIZEOF_MP_LIMB_T == 8 00217 if ((w & 0xffffffff) == 0) { 00218 w >>= 32; 00219 r += 32; 00220 } 00221 #elif PPL_SIZEOF_MP_LIMB_T != 4 00222 #error "size of mp_limb_t not supported by first_one(mp_limb_t w)." 00223 #endif 00224 if ((w & 0xffff) == 0) { 00225 w >>= 16; 00226 r += 16; 00227 } 00228 if ((w & 0xff) == 0) { 00229 w >>= 8; 00230 r += 8; 00231 } 00232 if (w & 0xf0) 00233 r += 4; 00234 if (w & 0xcc) 00235 r += 2; 00236 if (w & 0xaa) 00237 r += 1; 00238 return r; 00239 }
| unsigned int Parma_Polyhedra_Library::Implementation::last_one | ( | mp_limb_t | w | ) | [inline] |
Assuming w is nonzero, returns the index of the last set bit in w.
Definition at line 280 of file Bit_Row.inlines.hh.
Referenced by Parma_Polyhedra_Library::Bit_Row::last(), and Parma_Polyhedra_Library::Bit_Row::prev().
00280 { 00281 PPL_ASSERT(w != 0); 00282 unsigned int r = 0; 00283 #if PPL_SIZEOF_MP_LIMB_T == 8 00284 if (w & 00285 #if PPL_SIZEOF_LONG == 8 00286 0xffffffff00000000 00287 #else 00288 0xffffffff00000000LL 00289 #endif 00290 ) { 00291 w >>= 32; 00292 r += 32; 00293 } 00294 #elif PPL_SIZEOF_MP_LIMB_T != 4 00295 #error "size of mp_limb_t not supported by last_one(mp_limb_t w)." 00296 #endif 00297 if (w & 0xffff0000) { 00298 w >>= 16; 00299 r += 16; 00300 } 00301 if (w & 0xff00) { 00302 w >>= 8; 00303 r += 8; 00304 } 00305 if (w & 0xf0) { 00306 w >>= 4; 00307 r += 4; 00308 } 00309 if (w & 0xc) { 00310 w >>= 2; 00311 r += 2; 00312 } 00313 if (w & 0x2) 00314 r += 1; 00315 return r; 00316 }
| unsigned int Parma_Polyhedra_Library::Implementation::in_assert = 0 |
Non zero during evaluation of PPL_ASSERT expression.
Definition at line 40 of file globals.cc.
Referenced by Parma_Polyhedra_Library::maybe_abandon().
1.6.3