#include <new_table.hpp>
Definition at line 81 of file new_table.hpp.
typedef empty_format FT [inherited] |
Definition at line 196 of file type_props.hpp.
typedef empty_format FT [inherited] |
Definition at line 196 of file type_props.hpp.
new_table_rep | ( | const C & | init2, | |
nat | n2, | |||
const format< T > & | fm2 | |||
) | [inline] |
~new_table_rep | ( | ) | [inline] |
double complexity | ( | ) | const [inline] |
Definition at line 409 of file new_table.hpp.
00409 { 00410 double sum= 0.0; 00411 //mmout << "{"; 00412 for (nat i=0; i<n; i++) { 00413 for (nat j=0; j<n; j++) 00414 if ((a + ((i+j) & mask))->x1 == 0) { 00415 sum += ((double) j) * ((double) j); 00416 break; 00417 } 00418 //mmout << " " << l; 00419 } 00420 //mmout << " }"; 00421 return sum / n; 00422 }
bool contains | ( | const T & | x | ) | const [inline] |
Definition at line 303 of file new_table.hpp.
References new_table_rep< C, T, V >::find().
00303 { 00304 return find (x) < n; 00305 /* 00306 nat code= V::key_op::hash_op (x) | hibit_mask; 00307 nat addr= code & mask; 00308 while (true) { 00309 Triple* cur= a + addr; 00310 nat stamp= cur->x1; 00311 if (stamp == 0) return false; 00312 if (stamp == code && cur->x2 == x) return true; 00313 addr= (addr + 1) & mask; 00314 } 00315 */ 00316 }
Definition at line 269 of file new_table.hpp.
References mmx::hibit_mask, and Triple.
Referenced by new_table_rep< C, T, V >::contains(), new_table_rep< C, T, V >::get(), and new_table_rep< C, T, V >::reset().
empty_format format1 | ( | ) | const [inline, inherited] |
Definition at line 189 of file type_props.hpp.
Referenced by mmx::get_format1().
00189 { return empty_format (); }
empty_format format1 | ( | ) | const [inline, inherited] |
Definition at line 189 of file type_props.hpp.
Referenced by mmx::get_format1().
00189 { return empty_format (); }
empty_format format2 | ( | ) | const [inline, inherited] |
Definition at line 190 of file type_props.hpp.
Referenced by mmx::get_format2().
00190 { return empty_format (); }
empty_format format2 | ( | ) | const [inline, inherited] |
Definition at line 190 of file type_props.hpp.
Referenced by mmx::get_format2().
00190 { return empty_format (); }
empty_format format3 | ( | ) | const [inline, inherited] |
Definition at line 191 of file type_props.hpp.
00191 { return empty_format (); }
empty_format format3 | ( | ) | const [inline, inherited] |
Definition at line 191 of file type_props.hpp.
00191 { return empty_format (); }
Definition at line 341 of file new_table.hpp.
References new_table_rep< C, T, V >::find(), and new_table_rep< C, T, V >::lazy_initialize().
00341 { 00342 nat addr= find (x); 00343 if (addr < n) return (a + addr)->x3; 00344 lazy_initialize (); 00345 return *init; 00346 /* 00347 nat code= V::key_op::hash_op (x) | hibit_mask; 00348 nat addr= code & mask; 00349 while (true) { 00350 Triple* cur= a + addr; 00351 nat stamp= cur->x1; 00352 if (stamp == 0) { 00353 lazy_initialize (); 00354 return *init; 00355 } 00356 if (stamp == code && cur->x2 == x) return cur->x3; 00357 addr= (addr + 1) & mask; 00358 } 00359 */ 00360 }
Definition at line 319 of file new_table.hpp.
References new_table_rep< C, T, V >::find().
00319 { 00320 nat addr= find (x); 00321 if (addr >= n) return false; 00322 y= (a + addr)->x3; 00323 return true; 00324 /* 00325 nat code= V::key_op::hash_op (x) | hibit_mask; 00326 nat addr= code & mask; 00327 while (true) { 00328 Triple* cur= a + addr; 00329 nat stamp= cur->x1; 00330 if (stamp == 0) return false; 00331 if (stamp == code && cur->x2 == x) { 00332 y= cur->x3; 00333 return true; 00334 } 00335 addr= (addr + 1) & mask; 00336 } 00337 */ 00338 }
void lazy_initialize | ( | ) | const [inline] |
Definition at line 123 of file new_table.hpp.
References mmx::C.
Referenced by new_table_rep< C, T, V >::get(), new_table_rep< C, T, V >::set(), and new_table_rep< C, T, V >::simplify().
void remove | ( | nat | addr | ) | const [inline] |
Definition at line 282 of file new_table.hpp.
References mmx::mmx_delete_at(), and Triple.
00282 { 00283 Triple* cur= a + addr; 00284 nat old_addr= addr; 00285 Triple* old_cur= cur; 00286 while (true) { 00287 addr= (addr + 1) & mask; 00288 cur= a + addr; 00289 nat stamp= cur->x1; 00290 if (stamp == 0) break; 00291 nat item_addr= stamp & mask; 00292 if (((item_addr - old_addr - 1) % mask) > ((addr - old_addr) % mask)) { 00293 *old_cur= *cur; 00294 old_cur = cur; 00295 old_addr= addr; 00296 } 00297 } 00298 mmx_delete_at (old_cur); 00299 old_cur->x1= 0; 00300 }
void reset | ( | const T & | x | ) | [inline] |
Definition at line 392 of file new_table.hpp.
References new_table_rep< C, T, V >::find(), and new_table_rep< C, T, V >::resize().
void resize | ( | nat | n | ) | [inline] |
Definition at line 249 of file new_table.hpp.
References mmx::mmx_delete_at(), and Triple.
Referenced by new_table_rep< C, T, V >::reset(), new_table_rep< C, T, V >::set(), and new_table_rep< C, T, V >::simplify().
00249 { 00250 nat old_n= n; 00251 Triple* old_a= a; 00252 00253 n = n2; 00254 mask= n-1; 00255 a = mmx_new_uninitialized<Triple > (n); 00256 00257 for (nat i=0; i<old_n; i++) { 00258 Triple* cur= old_a + i; 00259 if (cur->x1 != 0) { 00260 set (cur->x2)= cur->x3; 00261 mmx_delete_at (cur); 00262 } 00263 } 00264 00265 mmx_delete_uninitialized<Triple > (old_a, old_n); 00266 }
empty_format rfm | ( | ) | const [inline, inherited] |
Definition at line 188 of file type_props.hpp.
empty_format rfm | ( | ) | const [inline, inherited] |
Definition at line 188 of file type_props.hpp.
T sample | ( | ) | const [inline, inherited] |
Definition at line 202 of file type_props.hpp.
00202 { return C(); }
C sample | ( | ) | const [inline, inherited] |
Definition at line 202 of file type_props.hpp.
Referenced by mmx::get_sample().
00202 { return C(); }
Definition at line 363 of file new_table.hpp.
References mmx::hibit_mask, new_table_rep< C, T, V >::lazy_initialize(), mmx::mmx_new_at(), new_table_rep< C, T, V >::resize(), Triple, and triple< C1, C2, C3 >::x1.
00363 { 00364 if ((size<<1) >= n) { 00365 //mmout << "size= " << size << ", n= " << n << "\n"; 00366 resize (n<<1); 00367 //mmout << "Resized\n"; 00368 } 00369 00370 nat code= V::key_op::hash_op (x) | hibit_mask; 00371 nat addr= code & mask; 00372 Triple* cur; 00373 nat stamp; 00374 while (true) { 00375 cur= a + addr; 00376 stamp= cur->x1; 00377 if (stamp == 0) break; 00378 if (stamp == code && cur->x2 == x) return cur->x3; 00379 addr= (addr + 1) & mask; 00380 } 00381 00382 lazy_initialize (); 00383 mmx_new_at (cur); 00384 cur->x1= code; 00385 cur->x2= x; 00386 cur->x3= *init; 00387 size++; 00388 return cur->x3; 00389 }
void simplify | ( | ) | [inline] |
Definition at line 400 of file new_table.hpp.
References new_table_rep< C, T, V >::lazy_initialize(), and new_table_rep< C, T, V >::resize().
Definition at line 201 of file type_props.hpp.
Definition at line 201 of file type_props.hpp.
Definition at line 264 of file type_props.hpp.
00264 { return this->tfm (); }
Definition at line 271 of file type_props.hpp.
00271 { return this->tfm (); }
Definition at line 232 of file new_table.hpp.
Definition at line 226 of file new_table.hpp.
Definition at line 244 of file new_table.hpp.
friend class new_entries_iterator_rep< C, T, V > [friend] |
Definition at line 143 of file new_table.hpp.
friend class new_table_iterator_rep< C, T, V > [friend] |
Definition at line 144 of file new_table.hpp.
Definition at line 764 of file new_table.hpp.
Definition at line 238 of file new_table.hpp.