224 #ifndef UTIL_GTL_SPARSETABLE_H_
225 #define UTIL_GTL_SPARSETABLE_H_
234 #ifdef HAVE_SYS_TYPES_H
235 #include <sys/types.h>
237 #ifdef HAVE_INTTYPES_H
238 #include <inttypes.h>
250 #ifndef HAVE_U_INT16_T
251 # if defined HAVE_UINT16_T
253 # elif defined HAVE___UINT16
263 _START_GOOGLE_NAMESPACE_
268 using GOOGLE_NAMESPACE::integral_constant;
269 using GOOGLE_NAMESPACE::has_trivial_copy;
270 using GOOGLE_NAMESPACE::has_trivial_destructor;
271 using GOOGLE_NAMESPACE::is_same;
299 template <
class tabletype>
331 template <
class tabletype>
363 assert(pos <= table->size());
377 tmp += i;
return tmp; }
379 tmp -= i;
return tmp; }
413 template <
class tabletype>
424 typedef typename tabletype::const_pointer
pointer;
446 assert(pos <= table->size());
460 tmp += i;
return tmp; }
462 tmp -= i;
return tmp; }
520 #define TWOD_BEGIN_ nonempty_begin
521 #define TWOD_END_ nonempty_end
522 #define TWOD_ITER_ nonempty_iterator
523 #define TWOD_CONST_ITER_ const_nonempty_iterator
525 template <
class containertype>
532 typedef typename containertype::value_type
_tmp_vt;
541 typename containertype::iterator end,
542 typename containertype::iterator curr)
551 typename containertype::iterator end,
552 typename containertype::iterator curr,
553 typename containertype::value_type::TWOD_ITER_ col)
616 template <
class containertype>
623 typedef typename containertype::value_type
_tmp_vt;
627 typedef typename _tmp_vt::const_pointer
pointer;
630 typename containertype::const_iterator end,
631 typename containertype::const_iterator curr)
639 typename containertype::const_iterator end,
640 typename containertype::const_iterator curr,
641 typename containertype::value_type::TWOD_CONST_ITER_ col)
703 template <
class containertype>
710 typedef typename containertype::value_type
_tmp_vt;
717 typename containertype::iterator end,
718 typename containertype::iterator curr)
726 typename containertype::iterator end,
727 typename containertype::iterator curr,
728 typename containertype::value_type::TWOD_ITER_ col)
776 #undef TWOD_CONST_ITER_
802 template <
class T, u_
int16_t GROUP_SIZE,
class Alloc>
813 typedef typename value_alloc_type::pointer
pointer;
884 if (retval == NULL) {
888 fprintf(stderr,
"sparsehash FATAL ERROR: failed to allocate %lu groups\n",
889 static_cast<unsigned long>(n));
907 static const char bits_in[256] = {
908 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4,
909 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
910 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
911 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
912 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
913 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
914 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
915 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
916 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
917 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
918 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
919 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
920 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
921 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
922 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
923 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8,
942 for ( ; pos > 8; pos -= 8 )
959 const size_type group_size = (GROUP_SIZE-1) / 8 + 1;
960 for (
size_type i = 0; i < group_size; i++) {
962 if (pop_count > offset) {
963 unsigned char last_bm = *bm;
964 for (; offset > 0; offset--) {
965 last_bm &= (last_bm-1);
970 last_bm = (last_bm & -last_bm) - 1;
1005 if ( &x ==
this )
return *
this;
1022 for (
int i = 0; i <
sizeof(
bitmap) /
sizeof(*
bitmap); ++i )
1099 std::uninitialized_copy(
group,
group + offset, p);
1116 typedef base::integral_constant<bool,
1117 (base::has_trivial_copy<value_type>::value &&
1118 base::has_trivial_destructor<value_type>::value &&
1122 realloc_and_memmove_ok;
1123 set_aux(offset, realloc_and_memmove_ok());
1166 std::uninitialized_copy(
group,
group + offset, p);
1185 typedef base::integral_constant<bool,
1186 (base::has_trivial_copy<value_type>::value &&
1187 base::has_trivial_destructor<value_type>::value &&
1191 realloc_and_memmove_ok;
1192 erase_aux(offset, realloc_and_memmove_ok());
1206 for ( ; start_it != end_it; ++start_it )
1296 fprintf(stderr,
"realloc_or_die is only supported for "
1297 "libc_allocator_with_realloc\n");
1316 pointer retval = this->reallocate(ptr, n);
1317 if (retval == NULL) {
1318 fprintf(stderr,
"sparsehash: FATAL ERROR: failed to reallocate "
1319 "%lu elements for ptr %p", static_cast<unsigned long>(n), (
void*) ptr);
1347 template <
class T, u_
int16_t GROUP_SIZE,
class Alloc>
1361 typedef typename Alloc::template rebind<
1372 typedef typename value_alloc_type::pointer
pointer;
1454 return num == 0 ? 0 : ((num-1) / GROUP_SIZE) + 1;
1458 return static_cast<u_int16_t>(i % GROUP_SIZE);
1461 return i / GROUP_SIZE;
1489 for ( group =
groups.begin(); group !=
groups.end(); ++group ) {
1521 for ( group =
groups.begin(); group !=
groups.end(); ++group )
1597 groups[current_row].nonempty_begin());
1598 return ((current_row * GROUP_SIZE) +
1599 groups[current_row].offset_to_pos(current_col));
1629 for ( ; start_it != end_it; ++start_it )
1651 template <
typename OUTPUT,
typename IntType>
1653 if ( value < 0xFFFFFFFFULL ) {
1665 template <
typename INPUT,
typename IntType>
1670 if ( first4 < 0xFFFFFFFFULL ) {
1689 for ( group =
groups.begin(); group !=
groups.end(); ++group )
1690 if ( group->write_metadata(fp) == false )
return false;
1708 for ( group =
groups.begin(); group !=
groups.end(); ++group )
1709 if ( group->read_metadata(fp) == false )
return false;
1720 if ( !fwrite(&*it,
sizeof(*it), 1, fp) )
return false;
1729 if ( !fread(reinterpret_cast<void*>(&(*it)),
sizeof(*it), 1, fp) )
1744 template <
typename ValueSerializer,
typename OUTPUT>
1750 if ( !serializer(fp, *it) )
return false;
1756 template <
typename ValueSerializer,
typename INPUT>
1763 if ( !serializer(fp, &*it) )
return false;
1812 template <
class T, u_
int16_t GROUP_SIZE,
class Alloc>
1818 _END_GOOGLE_NAMESPACE_
1820 #endif // UTIL_GTL_SPARSETABLE_H_
sparsegroup< value_type, GROUP_SIZE, allocator_type > group_type
Definition: sparsetable.h:1444
containertype::iterator row_begin
Definition: sparsetable.h:736
T value_type
Definition: sparsetable.h:809
static size_type offset_to_pos(const unsigned char *bm, size_type offset)
Definition: sparsetable.h:956
bool operator<(const sparsetable &x) const
Definition: sparsetable.h:1777
group_vector_type::reference GroupsReference
Definition: sparsetable.h:1447
bool write_data(OUTPUT *fp, const void *data, size_t length)
Definition: hashtable-common.h:158
destructive_two_d_iterator< std::vector< sparsegroup< value_type, GROUP_SIZE, value_alloc_type >, vector_alloc > > destructive_iterator
Definition: sparsetable.h:1400
const_table_iterator(const iterator &from)
Definition: sparsetable.h:433
integral_constant< bool, true > true_type
Definition: template_util.h:87
pointer operator->() const
Definition: sparsetable.h:441
destructive_two_d_iterator()
Definition: sparsetable.h:732
Alloc::template rebind< T >::other value_alloc_type
Definition: sparsetable.h:1360
bool operator==(const sparsetable &x) const
Definition: sparsetable.h:1771
iterator begin()
Definition: sparsetable.h:1403
iterator begin()
Definition: sparsetable.h:834
_tmp_vt::pointer pointer
Definition: sparsetable.h:714
void erase(size_type i)
Definition: sparsetable.h:1615
value_alloc_type::size_type size_type
Definition: sparsetable.h:1368
reference operator*() const
Definition: sparsetable.h:440
void check() const
Definition: sparsetable.h:444
_tmp_vt::value_type value_type
Definition: sparsetable.h:711
size_type table_size
Definition: sparsetable.h:1802
static size_type num_groups(size_type num)
Definition: sparsetable.h:1453
element_adaptor operator[](size_type i)
Definition: sparsetable.h:1074
reference operator*() const
Definition: sparsetable.h:658
const_iterator operator+(difference_type i) const
Definition: sparsetable.h:459
reference operator*() const
Definition: sparsetable.h:563
bool operator<(const const_iterator &it) const
Definition: sparsetable.h:475
Settings settings
Definition: sparsetable.h:1342
Definition: sparsetable.h:526
tabletype::value_type value_type
Definition: sparsetable.h:420
Definition: hashtable-common.h:200
const_reference unsafe_get(size_type i) const
Definition: sparsetable.h:1056
const_iterator end() const
Definition: sparsetable.h:837
bool write_nopointer_data(FILE *fp) const
Definition: sparsetable.h:1717
alloc_impl(const libc_allocator_with_realloc< A > &a)
Definition: sparsetable.h:1312
size_type size() const
Definition: sparsetable.h:1505
iterator & operator++()
Definition: sparsetable.h:756
const_iterator operator-(difference_type i) const
Definition: sparsetable.h:461
bool operator>=(const sparsetable &x) const
Definition: sparsetable.h:1783
static bool write_32_or_64(OUTPUT *fp, IntType value)
Definition: sparsetable.h:1652
const_iterator & operator--()
Definition: sparsetable.h:454
two_d_iterator()
Definition: sparsetable.h:558
reverse_nonempty_iterator nonempty_rbegin()
Definition: sparsetable.h:852
bool operator!=(const iterator &it) const
Definition: sparsetable.h:770
const Name offset("offset")
Miscellaneous parameters.
Definition: nest_names.h:211
iterator operator++(int)
Definition: sparsetable.h:595
reference operator*() const
Definition: sparsetable.h:753
destructive_two_d_iterator(typename containertype::iterator begin, typename containertype::iterator end, typename containertype::iterator curr, typename containertype::value_type::TWOD_ITER_ col)
Definition: sparsetable.h:725
table_element_adaptor< sparsetable< T, GROUP_SIZE, Alloc > > element_adaptor
Definition: sparsetable.h:1378
_tmp_vt::const_reference reference
Definition: sparsetable.h:626
tabletype::reference reference
Definition: sparsetable.h:304
void resize(size_type new_size)
Definition: sparsetable.h:1512
bool read_data(INPUT *fp, void *data, size_t length)
Definition: hashtable-common.h:153
bool read_nopointer_data(FILE *fp)
Definition: sparsetable.h:1726
pointer allocate_group(size_type n)
Definition: sparsetable.h:882
const_iterator & operator++()
Definition: sparsetable.h:453
void bmclear(size_type i)
Definition: sparsetable.h:880
void free_group()
Definition: sparsetable.h:895
bool operator==(const iterator &it) const
Definition: sparsetable.h:689
table_iterator iterator
Definition: sparsetable.h:334
nonempty_iterator nonempty_begin()
Definition: sparsetable.h:1413
void advance_past_end()
Definition: sparsetable.h:661
const tabletype * table
Definition: sparsetable.h:485
iterator end()
Definition: sparsetable.h:1405
bool operator!=(const sparsetable &x) const
Definition: sparsetable.h:1780
nonempty_iterator nonempty_end()
Definition: sparsetable.h:846
const_reverse_iterator rbegin() const
Definition: sparsetable.h:839
GroupsReference which_group(size_type i)
Definition: sparsetable.h:1463
Settings(const alloc_impl< value_alloc_type > &a, u_int16_t n=0)
Definition: sparsetable.h:1332
std::random_access_iterator_tag iterator_category
Definition: sparsetable.h:419
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition: sparsetable.h:823
value_alloc_type::difference_type difference_type
Definition: sparsetable.h:1369
nonempty_iterator nonempty_end()
Definition: sparsetable.h:1419
table_iterator(tabletype *tbl, size_type p)
Definition: sparsetable.h:344
void clear()
Definition: sparsetable.h:1487
bool empty() const
Definition: sparsetable.h:1039
void advance_past_end()
Definition: sparsetable.h:740
GroupsConstReference which_group(size_type i) const
Definition: sparsetable.h:1466
reference mutating_get(size_type i)
Definition: sparsetable.h:1557
bool operator<=(const sparsetable &x) const
Definition: sparsetable.h:1781
_tmp_vt::difference_type difference_type
Definition: sparsetable.h:712
_tmp_vt::difference_type difference_type
Definition: sparsetable.h:534
Definition: sparsetable.h:704
iterator & operator++()
Definition: sparsetable.h:670
void clear()
Definition: sparsetable.h:1029
iterator & operator--()
Definition: sparsetable.h:371
sparsegroup & operator=(const sparsegroup &x)
Definition: sparsetable.h:1004
reverse_nonempty_iterator nonempty_rend()
Definition: sparsetable.h:858
bool write_nopointer_data(OUTPUT *fp) const
Definition: sparsetable.h:1254
std::reverse_iterator< const_nonempty_iterator > const_reverse_nonempty_iterator
Definition: sparsetable.h:1394
iterator & operator+=(size_type t)
Definition: sparsetable.h:368
bool operator>(const iterator &it) const
Definition: sparsetable.h:398
iterator operator--(int)
Definition: sparsetable.h:596
iterator operator--(int)
Definition: sparsetable.h:374
table_iterator< tabletype > iterator
Definition: sparsetable.h:416
pointer operator->()
Definition: sparsetable.h:358
_tmp_vt::reference reference
Definition: sparsetable.h:713
bool operator<(const sparsegroup &x) const
Definition: sparsetable.h:1275
const_table_iterator()
Definition: sparsetable.h:430
sparsegroup(allocator_type &a)
Definition: sparsetable.h:988
bool operator!=(const iterator &it) const
Definition: sparsetable.h:606
reverse_nonempty_iterator nonempty_rend()
Definition: sparsetable.h:1431
const Name a("a")
Specific to Brette & Gerstner 2005 (aeif_cond-*)
Definition: nest_names.h:41
containertype::value_type::TWOD_CONST_ITER_ col_current
Definition: sparsetable.h:654
Settings(const Settings &s)
Definition: sparsetable.h:1798
reverse_nonempty_iterator nonempty_rbegin()
Definition: sparsetable.h:1425
pointer operator->() const
Definition: sparsetable.h:754
bool operator==(const const_iterator &it) const
Definition: sparsetable.h:472
__int16 int16_t
Definition: sparsetable.h:254
containertype::const_iterator row_begin
Definition: sparsetable.h:653
bool operator<(const iterator &it) const
Definition: sparsetable.h:392
allocator_type::size_type size_type
Definition: sparsetable.h:1793
_tmp_vt::value_type value_type
Definition: sparsetable.h:624
Definition: libc_allocator_with_realloc.h:43
std::reverse_iterator< iterator > reverse_iterator
Definition: sparsetable.h:824
containertype::const_iterator row_end
Definition: sparsetable.h:653
bool read_metadata(INPUT *fp)
Definition: sparsetable.h:1228
const_two_d_iterator iterator
Definition: sparsetable.h:619
Definition: sparsetable.h:1285
u_int16_t size_type
Definition: sparsetable.h:821
size_type pos
Definition: sparsetable.h:403
iterator operator++(int)
Definition: sparsetable.h:372
Alloc::template rebind< sparsegroup< T, GROUP_SIZE, value_alloc_type > >::other vector_alloc
Definition: sparsetable.h:1362
group_vector_type::iterator GroupsIterator
Definition: sparsetable.h:1449
value_alloc_type::pointer pointer
Definition: sparsetable.h:813
bool operator>=(const const_iterator &it) const
Definition: sparsetable.h:482
static size_type modbit(size_type i)
Definition: sparsetable.h:877
bool empty() const
Definition: sparsetable.h:1507
table_iterator< T > operator+(typename table_iterator< T >::difference_type i, table_iterator< T > it)
Definition: sparsetable.h:408
containertype::iterator row_begin
Definition: sparsetable.h:611
const_reference operator[](size_type i) const
Definition: sparsetable.h:1566
void erase(iterator pos)
Definition: sparsetable.h:1199
bool test(size_type i) const
Definition: sparsetable.h:1134
const_table_iterator const_iterator
Definition: sparsetable.h:417
void check() const
Definition: sparsetable.h:361
unsigned char bitmap[(GROUP_SIZE-1)/8+1]
Definition: sparsetable.h:1343
tabletype::size_type size_type
Definition: sparsetable.h:339
const_nonempty_iterator nonempty_begin() const
Definition: sparsetable.h:1416
reverse_iterator rend()
Definition: sparsetable.h:840
value_alloc_type::pointer pointer
Definition: sparsetable.h:1372
bool operator!=(const iterator &it) const
Definition: sparsetable.h:396
tabletype::const_pointer pointer
Definition: sparsetable.h:424
destructive_two_d_iterator(typename containertype::iterator begin, typename containertype::iterator end, typename containertype::iterator curr)
Definition: sparsetable.h:716
size_type max_size() const
Definition: sparsetable.h:1038
const_table_iterator< sparsegroup< T, GROUP_SIZE, Alloc > > const_iterator
Definition: sparsetable.h:818
Alloc allocator_type
Definition: sparsetable.h:810
Alloc::template rebind< T >::other value_alloc_type
Definition: sparsetable.h:805
const Name y("y")
Definition: topology_names.h:52
reference set(size_type i, const_reference val)
Definition: sparsetable.h:1605
_tmp_vt::pointer pointer
Definition: sparsetable.h:536
size_type pos
Definition: sparsetable.h:486
const_reference operator[](size_type i) const
Definition: sparsetable.h:1070
Definition: sparsetable.h:1791
element_adaptor operator[](size_type i)
Definition: sparsetable.h:1570
static size_type bits_in_char(unsigned char c)
Definition: sparsetable.h:904
value_alloc_type::reference reference
Definition: sparsetable.h:811
Alloc allocator_type
Definition: sparsetable.h:1367
static bool read_32_or_64(INPUT *fp, IntType *value)
Definition: sparsetable.h:1666
pointer operator&()
Definition: sparsetable.h:314
bool write_bigendian_number(OUTPUT *fp, IntType value, size_t length)
Definition: hashtable-common.h:182
table_element_adaptor< sparsegroup< T, GROUP_SIZE, Alloc > > element_adaptor
Definition: sparsetable.h:820
sparsegroup(const sparsegroup &x)
Definition: sparsetable.h:992
table_iterator< sparsegroup< T, GROUP_SIZE, Alloc > > iterator
Definition: sparsetable.h:816
table_iterator()
Definition: sparsetable.h:347
const Name other("other")
Node type.
Definition: nest_names.h:216
bool unserialize(ValueSerializer serializer, INPUT *fp)
Definition: sparsetable.h:1757
sparsetable(size_type sz=0, Alloc alloc=Alloc())
Definition: sparsetable.h:1472
sparsehash_internal::pod_serializer< value_type > NopointerSerializer
Definition: sparsetable.h:1741
size_type pos
Definition: sparsetable.h:318
iterator & operator--()
Definition: sparsetable.h:676
void set_aux(size_type offset, base::false_type)
Definition: sparsetable.h:1096
std::reverse_iterator< const_nonempty_iterator > const_reverse_nonempty_iterator
Definition: sparsetable.h:831
_tmp_vt::difference_type difference_type
Definition: sparsetable.h:625
tabletype::difference_type difference_type
Definition: sparsetable.h:338
size_type num_nonempty() const
Definition: sparsetable.h:1509
libc_allocator_with_realloc< A >::size_type size_type
Definition: sparsetable.h:1310
value_alloc_type::const_reference const_reference
Definition: sparsetable.h:812
void swap(sparsegroup< T, GROUP_SIZE, Alloc > &x, sparsegroup< T, GROUP_SIZE, Alloc > &y)
Definition: sparsetable.h:1348
std::reverse_iterator< nonempty_iterator > reverse_nonempty_iterator
Definition: sparsetable.h:830
void erase(size_type i)
Definition: sparsetable.h:1178
tabletype::size_type size_type
Definition: sparsetable.h:303
void bmset(size_type i)
Definition: sparsetable.h:879
tabletype::size_type size_type
Definition: sparsetable.h:422
iterator operator++(int)
Definition: sparsetable.h:762
containertype::value_type _tmp_vt
Definition: sparsetable.h:710
const_two_d_iterator(typename containertype::const_iterator begin, typename containertype::const_iterator end, typename containertype::const_iterator curr)
Definition: sparsetable.h:629
size_type pos_to_offset(size_type pos) const
Definition: sparsetable.h:947
const_iterator begin() const
Definition: sparsetable.h:835
void erase(iterator start_it, iterator end_it)
Definition: sparsetable.h:1203
const_iterator & operator-=(size_type t)
Definition: sparsetable.h:452
iterator operator+(difference_type i) const
Definition: sparsetable.h:376
iterator & operator--()
Definition: sparsetable.h:585
containertype::iterator row_end
Definition: sparsetable.h:611
two_d_iterator iterator
Definition: sparsetable.h:528
const_two_d_iterator(typename containertype::const_iterator begin, typename containertype::const_iterator end, typename containertype::const_iterator curr, typename containertype::value_type::TWOD_CONST_ITER_ col)
Definition: sparsetable.h:638
bool test(iterator pos) const
Definition: sparsetable.h:1533
const_nonempty_iterator nonempty_end() const
Definition: sparsetable.h:1422
iterator & operator-=(size_type t)
Definition: sparsetable.h:369
Definition: sparsetable.h:803
static size_type charbit(size_type i)
Definition: sparsetable.h:876
destructive_iterator destructive_begin()
Definition: sparsetable.h:1437
const_reverse_nonempty_iterator nonempty_rbegin() const
Definition: sparsetable.h:1428
value_alloc_type::reference reference
Definition: sparsetable.h:1370
containertype::iterator row_current
Definition: sparsetable.h:611
pointer realloc_or_die(pointer ptr, size_type n)
Definition: sparsetable.h:1315
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition: sparsetable.h:1379
bool operator==(const sparsegroup &x) const
Definition: sparsetable.h:1269
size_type size() const
Definition: sparsetable.h:1037
table_iterator< sparsetable< T, GROUP_SIZE, Alloc > > iterator
Definition: sparsetable.h:1374
bool test(iterator pos) const
Definition: sparsetable.h:1137
value_alloc_type::const_pointer const_pointer
Definition: sparsetable.h:1373
const_reference unsafe_get(size_type i) const
Definition: sparsetable.h:1550
u_int16_t pos_in_group(size_type i) const
Definition: sparsetable.h:1457
std::random_access_iterator_tag iterator_category
Definition: sparsetable.h:336
pointer group
Definition: sparsetable.h:1341
table_element_adaptor & operator=(const value_type &val)
Definition: sparsetable.h:309
group_vector_type::const_iterator GroupsConstIterator
Definition: sparsetable.h:1450
reference operator[](difference_type n) const
Definition: sparsetable.h:384
group_vector_type::const_reference GroupsConstReference
Definition: sparsetable.h:1448
const Name x("x")
current scaling factor of the synaptic weight [0...1] (Tsodyks2_connection)
Definition: nest_names.h:356
const_iterator & operator+=(size_type t)
Definition: sparsetable.h:451
reverse_iterator rend()
Definition: sparsetable.h:1409
void swap(sparsegroup &x)
Definition: sparsetable.h:1020
Definition: sparsetable.h:414
iterator operator++(int)
Definition: sparsetable.h:686
size_type get_pos(const const_nonempty_iterator it) const
Definition: sparsetable.h:1594
containertype::iterator row_current
Definition: sparsetable.h:736
size_type group_num(size_type i) const
Definition: sparsetable.h:1460
bool write_metadata(OUTPUT *fp) const
Definition: sparsetable.h:1683
bool read_bigendian_number(INPUT *fp, IntType *value, size_t length)
Definition: hashtable-common.h:168
std::reverse_iterator< iterator > reverse_iterator
Definition: sparsetable.h:1380
bool write_metadata(OUTPUT *fp) const
Definition: sparsetable.h:1216
bool operator>(const sparsegroup &x) const
Definition: sparsetable.h:1280
pointer operator->() const
Definition: sparsetable.h:659
const_iterator operator--(int)
Definition: sparsetable.h:457
std::bidirectional_iterator_tag iterator_category
Definition: sparsetable.h:530
~sparsegroup()
Definition: sparsetable.h:999
const_nonempty_iterator nonempty_end() const
Definition: sparsetable.h:849
const_two_d_iterator()
Definition: sparsetable.h:645
iterator & operator++()
Definition: sparsetable.h:370
A::pointer pointer
Definition: sparsetable.h:1287
const_iterator operator++(int)
Definition: sparsetable.h:455
value_alloc_type::const_reference const_reference
Definition: sparsetable.h:1371
int16_t difference_type
Definition: sparsetable.h:822
const_reverse_nonempty_iterator nonempty_rbegin() const
Definition: sparsetable.h:855
reverse_iterator rbegin()
Definition: sparsetable.h:1407
tabletype::pointer pointer
Definition: sparsetable.h:305
bool operator>(const sparsetable &x) const
Definition: sparsetable.h:1782
bool operator==(const iterator &it) const
Definition: sparsetable.h:389
static const u_int16_t DEFAULT_SPARSEGROUP_SIZE
Definition: sparsetable.h:279
void erase(iterator start_it, iterator end_it)
Definition: sparsetable.h:1626
tabletype::difference_type difference_type
Definition: sparsetable.h:421
bool test(size_type i) const
Definition: sparsetable.h:1529
difference_type operator-(const_iterator it) const
Definition: sparsetable.h:463
uint16_t u_int16_t
Definition: sparsetable.h:252
bool operator==(const iterator &it) const
Definition: sparsetable.h:764
containertype::value_type _tmp_vt
Definition: sparsetable.h:532
size_type num_buckets
Definition: sparsetable.h:1803
alloc_impl(const A &a)
Definition: sparsetable.h:1291
reference set(size_type i, const_reference val)
Definition: sparsetable.h:1110
void erase_aux(size_type offset, base::false_type)
Definition: sparsetable.h:1163
iterator end()
Definition: sparsetable.h:836
table_element_adaptor< tabletype > reference
Definition: sparsetable.h:340
const_nonempty_iterator nonempty_begin() const
Definition: sparsetable.h:845
bool operator<=(const const_iterator &it) const
Definition: sparsetable.h:480
containertype::const_iterator row_current
Definition: sparsetable.h:653
iterator operator-(difference_type i) const
Definition: sparsetable.h:378
pointer operator->() const
Definition: sparsetable.h:564
containertype::value_type::TWOD_ITER_ col_current
Definition: sparsetable.h:737
void erase(iterator pos)
Definition: sparsetable.h:1622
bool operator==(const iterator &it) const
Definition: sparsetable.h:600
const Name n("n")
Number of synaptic release sites (int >=0) (Tsodyks2_connection)
Definition: nest_names.h:202
const_reverse_nonempty_iterator nonempty_rend() const
Definition: sparsetable.h:1434
pointer realloc_or_die(pointer, size_type)
Definition: sparsetable.h:1295
static size_type pos_to_offset(const unsigned char *bm, size_type pos)
Definition: sparsetable.h:937
destructive_two_d_iterator iterator
Definition: sparsetable.h:706
nonempty_iterator nonempty_begin()
Definition: sparsetable.h:844
value_alloc_type::const_pointer const_pointer
Definition: sparsetable.h:814
const_two_d_iterator(const two_d_iterator< containertype > &it)
Definition: sparsetable.h:649
reverse_iterator rbegin()
Definition: sparsetable.h:838
Settings(const allocator_type &a, size_type sz=0, size_type n=0)
Definition: sparsetable.h:1795
Definition: sparsetable.h:617
libc_allocator_with_realloc< A >::pointer pointer
Definition: sparsetable.h:1309
unsigned long MagicNumberType
Definition: sparsetable.h:1640
bool operator!=(const sparsegroup &x) const
Definition: sparsetable.h:1278
const_pointer const_nonempty_iterator
Definition: sparsetable.h:829
int bmtest(size_type i) const
Definition: sparsetable.h:878
static const MagicNumberType MAGIC_NUMBER
Definition: sparsetable.h:1641
nonempty_iterator get_iter(size_type i)
Definition: sparsetable.h:1584
tabletype * table
Definition: sparsetable.h:402
reference mutating_get(size_type i)
Definition: sparsetable.h:1062
size_type num_nonempty() const
Definition: sparsetable.h:1041
tabletype::value_type value_type
Definition: sparsetable.h:337
void swap(sparsetable &x)
Definition: sparsetable.h:1480
bool read_metadata(INPUT *fp)
Definition: sparsetable.h:1695
u_int16_t num_buckets
Definition: sparsetable.h:1337
const Name A("A")
Definition: nest_names.h:40
size_type offset_to_pos(size_type offset) const
Definition: sparsetable.h:981
table_element_adaptor< tabletype > * pointer
Definition: sparsetable.h:341
const_nonempty_iterator get_iter(size_type i) const
Definition: sparsetable.h:1575
_tmp_vt::reference reference
Definition: sparsetable.h:535
tabletype * table
Definition: sparsetable.h:317
std::reverse_iterator< nonempty_iterator > reverse_nonempty_iterator
Definition: sparsetable.h:1393
Settings(const Settings &s)
Definition: sparsetable.h:1334
bool operator!=(const const_iterator &it) const
Definition: sparsetable.h:479
const_table_iterator(const tabletype *tbl, size_type p)
Definition: sparsetable.h:427
bool serialize(ValueSerializer serializer, OUTPUT *fp)
Definition: sparsetable.h:1745
bool operator>=(const sparsegroup &x) const
Definition: sparsetable.h:1281
bool read_nopointer_data(INPUT *fp)
Definition: sparsetable.h:1242
bool operator!=(const iterator &it) const
Definition: sparsetable.h:695
const_reverse_iterator rend() const
Definition: sparsetable.h:841
two_d_iterator(typename containertype::iterator begin, typename containertype::iterator end, typename containertype::iterator curr)
Definition: sparsetable.h:540
Definition: sparsetable.h:1358
table_element_adaptor(tabletype *tbl, size_type p)
Definition: sparsetable.h:307
bool operator>=(const iterator &it) const
Definition: sparsetable.h:399
_tmp_vt::const_pointer pointer
Definition: sparsetable.h:627
bool test(const_iterator pos) const
Definition: sparsetable.h:1536
Definition: sparsetable.h:1330
two_d_iterator(typename containertype::iterator begin, typename containertype::iterator end, typename containertype::iterator curr, typename containertype::value_type::TWOD_ITER_ col)
Definition: sparsetable.h:550
difference_type operator-(iterator it) const
Definition: sparsetable.h:380
const_reverse_iterator rbegin() const
Definition: sparsetable.h:1408
void set_aux(size_type offset, base::true_type)
Definition: sparsetable.h:1086
Settings settings
Definition: sparsetable.h:1808
void erase_aux(size_type offset, base::true_type)
Definition: sparsetable.h:1149
const Name p("p")
current release probability (Tsodyks2_connection)
Definition: nest_names.h:218
size_type max_size() const
Definition: sparsetable.h:1506
bool operator<=(const sparsegroup &x) const
Definition: sparsetable.h:1279
reference operator*()
Definition: sparsetable.h:355
T value_type
Definition: sparsetable.h:1366
const Name c("c")
Specific to Izhikevich 2003.
Definition: nest_names.h:62
const_table_iterator< sparsetable< T, GROUP_SIZE, Alloc > > const_iterator
Definition: sparsetable.h:1376
destructive_iterator destructive_end()
Definition: sparsetable.h:1440
void advance_past_end()
Definition: sparsetable.h:569
containertype::iterator row_end
Definition: sparsetable.h:736
allocator_type get_allocator() const
Definition: sparsetable.h:1496
const_iterator end() const
Definition: sparsetable.h:1406
tabletype::value_type value_type
Definition: sparsetable.h:302
tabletype::const_reference reference
Definition: sparsetable.h:423
A::size_type size_type
Definition: sparsetable.h:1288
const_reference default_value() const
Definition: sparsetable.h:868
containertype::value_type _tmp_vt
Definition: sparsetable.h:623
reference operator[](difference_type n) const
Definition: sparsetable.h:467
iterator operator--(int)
Definition: sparsetable.h:687
containertype::value_type::TWOD_ITER_ col_current
Definition: sparsetable.h:612
two_d_iterator< std::vector< sparsegroup< value_type, GROUP_SIZE, value_alloc_type >, vector_alloc > > nonempty_iterator
Definition: sparsetable.h:1387
std::vector< group_type, vector_alloc > group_vector_type
Definition: sparsetable.h:1445
_tmp_vt::value_type value_type
Definition: sparsetable.h:533
iterator & operator++()
Definition: sparsetable.h:579
bool operator<=(const iterator &it) const
Definition: sparsetable.h:397
bool operator>(const const_iterator &it) const
Definition: sparsetable.h:481
const_two_d_iterator< std::vector< sparsegroup< value_type, GROUP_SIZE, value_alloc_type >, vector_alloc > > const_nonempty_iterator
Definition: sparsetable.h:1392
std::bidirectional_iterator_tag iterator_category
Definition: sparsetable.h:621
pointer nonempty_iterator
Definition: sparsetable.h:828
std::input_iterator_tag iterator_category
Definition: sparsetable.h:708
group_vector_type groups
Definition: sparsetable.h:1807
Definition: sparsetable.h:300
Definition: sparsetable.h:332
integral_constant< bool, false > false_type
Definition: template_util.h:88
const_iterator begin() const
Definition: sparsetable.h:1404
const_reverse_iterator rend() const
Definition: sparsetable.h:1410
const_reverse_nonempty_iterator nonempty_rend() const
Definition: sparsetable.h:861