re PR libstdc++/37144 (A bug in include/ext/pb_ds/detail/pat_trie_/constructors_destructor_fn_imps.hpp)

2011-05-23  Benjamin Kosnik  <bkoz@redhat.com>

	PR libstdc++/37144
	PR libstdc++/28457
	Interface changes for ext/pb_ds.
	PB_DS_BASE_C_DEC to unique PB_DS_*_BASE macros.
	* include/ext/pb_ds/assoc_container.hpp (container_base): Remove.
	(basic_hash_table, basic_branch, list_update): Derive from
	container_base_dispatch.
	* include/ext/pb_ds/list_update_policy.hpp (null_lu_metadata): Remove.
	(move_to_front_lu_policy): To lu_move_to_front_policy.
	(counter_lu_policy): To lu_counter_policy.
	* include/ext/pb_ds/tree_policy.hpp (null_tree_node_update): Remove.
	* include/ext/pb_ds/tag_and_trait.hpp (container_base_dispatch): Adjust
	template parameters, declare here.
	(null_mapped_type) Remove.
	(null_type): Just use this for template tricks everywhere.
	* include/ext/pb_ds/hash_policy.hpp (null_hash_fn, null_probe_fn):
	Remove.
	* include/ext/pb_ds/trie_policy.hpp (null_trie_node_update): Remove.
	(string_trie_e_access_traits): To trie_string_access_traits.
	* include/ext/pb_ds/priority_queue.hpp: Use container_base_dispatch.

	File changes.
	* include/Makefile.am (pb_headers): Removed and changed file names.
	* include/Makefile.in: Regenerated.
	* include/ext/pb_ds/detail/basic_types.hpp: Remove.
	* include/ext/pb_ds/detail/bin_search_tree_/
	  cond_dtor_entry_dealtor.hpp: Remove.
	* include/ext/pb_ds/detail/bin_search_tree_/
	  cond_key_dtor_entry_dealtor.hpp: Remove.
	* include/ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp: Move..
	* include/ext/pb_ds/detail/binary_heap_/
	  point_const_iterator.hpp: ..here.
	* include/ext/pb_ds/detail/basic_tree_policy: Move to...
	* include/ext/pb_ds/detail/branch_policy: This.
	* include/ext/pb_ds/detail/branch_policy/
	  basic_tree_policy_base.hpp: Move...
	* include/ext/pb_ds/detail/branch_policy/branch_policy.hpp: ...here.
	* include/ext/pb_ds/detail/branch_policy/null_node_metadata.hpp: Add.
	* include/ext/pb_ds/detail/branch_policy/traits.hpp: Add.
	* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
	null_metadata.hpp: Remove.
	* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
	const_point_iterator.hpp: Move...
	* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
	point_const_iterator.hpp: ...here.
	* include/ext/pb_ds/detail/list_update_policy/
	counter_lu_metadata.hpp: Move..
	* include/ext/pb_ds/detail/list_update_policy/
	lu_counter_metadata.hpp: ...here.
	* include/ext/pb_ds/detail/list_update_policy/
	counter_lu_policy_imp.hpp: Remove.
	* include/ext/pb_ds/detail/list_update_policy/
	mtf_lu_policy_imp.hpp: Remove.
	* include/ext/pb_ds/detail/trie_policy/
	string_trie_e_access_traits_imp.hpp: Move...
	* include/ext/pb_ds/detail/trie_policy/
	sample_trie_access_traits.hpp: ...here.
	* include/ext/pb_ds/detail/trie_policy/
	sample_trie_e_access_traits.hpp: Move...
	* include/ext/pb_ds/detail/trie_policy/
	trie_string_access_traits_imp.hpp: ...here.
	* include/ext/pb_ds/detail/trie_policy/null_node_update_imp.hpp: Remove.
	* include/ext/pb_ds/detail/tree_policy/null_node_update_imp.hpp: Remove.
	* include/ext/pb_ds/detail/ov_tree_map_/cond_dtor.hpp: Remove.
	* include/ext/pb_ds/detail/pat_trie_/pat_trie_base.hpp: New, fold all
	types found in the following files into pat_trie_base.
	* include/ext/pb_ds/detail/pat_trie_/const_child_iterator.hpp: Folded.
	* include/ext/pb_ds/detail/pat_trie_/
	  cond_dtor_entry_dealtor.hpp: Folded.
	* include/ext/pb_ds/detail/pat_trie_/child_iterator.hpp: Folded.
	* include/ext/pb_ds/detail/pat_trie_/split_join_branch_bag.hpp: Folded.
	* include/ext/pb_ds/detail/pat_trie_/head.hpp: Folded.
	* include/ext/pb_ds/detail/pat_trie_/leaf.hpp: Folded.
	* include/ext/pb_ds/detail/pat_trie_/node_base.hpp: Folded.
	* include/ext/pb_ds/detail/pat_trie_/node_metadata_base.hpp: Folded.
	* include/ext/pb_ds/detail/pat_trie_/internal_node.hpp: Folded.
	* include/ext/pb_ds/detail/pat_trie_/node_iterators.hpp: Folded.
	* include/ext/pb_ds/detail/pat_trie_/point_iterators.hpp: Folded.
	* include/ext/pb_ds/detail/pat_trie_/synth_e_access_traits.hpp: Move...
	* include/ext/pb_ds/detail/pat_trie_/synth_access_traits.hpp: ...here.
	* include/ext/pb_ds/detail/unordered_iterator/
	const_point_iterator.hpp: Move...
	* include/ext/pb_ds/detail/unordered_iterator/
	point_const_iterator.hpp: ...here.


	Adjust for above changes.
	* include/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp: Same.
	* include/ext/pb_ds/detail/resize_policy/sample_resize_policy.hpp: Same.
	* include/ext/pb_ds/detail/resize_policy/
	  sample_resize_trigger.hpp: Same.
	* include/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/binomial_heap_base_/insert_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/binomial_heap_base_/
	  binomial_heap_base_.hpp: Same.
	* include/ext/pb_ds/detail/binomial_heap_base_/
	  constructors_destructor_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/binomial_heap_base_/debug_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/binomial_heap_base_/
	  split_join_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/container_base_dispatch.hpp: Same. Adjust
	  for template parameter ordering change.
	* include/ext/pb_ds/detail/cc_hash_table_map_/
	  erase_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/
	  constructor_destructor_no_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/cmp_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/
	  insert_no_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/find_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/
	  policy_access_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/
	  resize_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/
	  constructor_destructor_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/
	  insert_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/debug_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/
	  entry_list_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/trace_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/
	  find_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/
	  debug_no_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/
	  constructor_destructor_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/
	  cond_key_dtor_entry_dealtor.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/insert_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/
	  debug_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/
	  erase_no_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/
	  iterators_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/
	  resize_no_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/cc_hash_table_map_/
	  standard_policies.hpp: Same.
	* include/ext/pb_ds/detail/tree_trace_base.hpp: Same.
	* include/ext/pb_ds/detail/unordered_iterator/iterator.hpp: Same.
	* include/ext/pb_ds/detail/unordered_iterator/const_iterator.hpp: Same.
	* include/ext/pb_ds/detail/unordered_iterator/point_iterator.hpp: Same.
	* include/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/pat_trie_/policy_access_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/pat_trie_/insert_join_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/pat_trie_/
	  constructors_destructor_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp: Same.
	* include/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/pat_trie_/traits.hpp: Same.
	* include/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/bin_search_tree_/find_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/bin_search_tree_/
	  policy_access_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/bin_search_tree_/r_erase_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/bin_search_tree_/
	  constructors_destructor_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/bin_search_tree_/debug_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/bin_search_tree_/traits.hpp: Same.
	* include/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/bin_search_tree_/rotate_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/bin_search_tree_/erase_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp: Same.
	* include/ext/pb_ds/detail/bin_search_tree_/insert_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/bin_search_tree_/node_iterators.hpp: Same.
	* include/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp: Same.
	* include/ext/pb_ds/detail/bin_search_tree_/
	  split_join_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/bin_search_tree_/iterators_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/list_update_policy/
	  sample_update_policy.hpp: Same.
	* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
	  trace_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
	  erase_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/
	  erase_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/
	  constructor_destructor_no_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/
	  insert_no_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/find_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/
	  policy_access_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/
	  resize_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/
	  constructor_destructor_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/
	  insert_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/debug_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/
	  iterator_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/
	  find_no_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/trace_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/erase_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/
	  find_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/
	  debug_no_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/resize_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/
	  constructor_destructor_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/insert_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/
	  debug_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/
	  erase_no_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/
	  resize_no_store_hash_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/gp_hash_table_map_/
	  standard_policies.hpp: Same.
	* include/ext/pb_ds/detail/standard_policies.hpp: Same.
	* include/ext/pb_ds/detail/types_traits.hpp: Same.
	* include/ext/pb_ds/detail/binary_heap_/find_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/binary_heap_/policy_access_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/binary_heap_/const_iterator.hpp: Same.
	* include/ext/pb_ds/detail/binary_heap_/entry_cmp.hpp: Same.
	* include/ext/pb_ds/detail/binary_heap_/
	  constructors_destructor_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/binary_heap_/debug_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/binary_heap_/trace_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/binary_heap_/erase_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/binary_heap_/entry_pred.hpp: Same.
	* include/ext/pb_ds/detail/binary_heap_/insert_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp: Same.
	* include/ext/pb_ds/detail/binary_heap_/resize_policy.hpp: Same.
	* include/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/binary_heap_/iterators_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/tree_policy/order_statistics_imp.hpp: Same.
	* include/ext/pb_ds/detail/tree_policy/node_metadata_selector.hpp: Same.
	* include/ext/pb_ds/detail/tree_policy/
	  sample_tree_node_update.hpp: Same.
	* include/ext/pb_ds/detail/trie_policy/order_statistics_imp.hpp: Same.
	* include/ext/pb_ds/detail/trie_policy/
	  sample_trie_node_update.hpp: Same.
	* include/ext/pb_ds/detail/trie_policy/trie_policy_base.hpp: Same.
	* include/ext/pb_ds/detail/trie_policy/
	  prefix_search_node_update_imp.hpp: Same.
	* include/ext/pb_ds/detail/trie_policy/node_metadata_selector.hpp: Same.
	* include/ext/pb_ds/detail/cond_dealtor.hpp: Same.
	* include/ext/pb_ds/detail/priority_queue_base_dispatch.hpp: Same.
	  Adjust for template parameter change, fold into
	  container_base_dispatch.
	* include/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/pairing_heap_/find_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/pairing_heap_/
	  constructors_destructor_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp: Same.
	* include/ext/pb_ds/detail/pairing_heap_/split_join_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/binomial_heap_/
	  constructors_destructor_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/binomial_heap_/debug_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/binomial_heap_/binomial_heap_.hpp: Same.
	* include/ext/pb_ds/detail/constructors_destructor_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/type_utils.hpp: Same.
	* include/ext/pb_ds/detail/eq_fn/hash_eq_fn.hpp: Same.
	* include/ext/pb_ds/detail/eq_fn/eq_by_less.hpp: Same.
	* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
	  policy_access_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
	  left_child_next_sibling_heap_.hpp: Same.
	* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
	  const_iterator.hpp: Same.
	* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
	  insert_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
	  constructors_destructor_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
	  debug_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
	  node.hpp: Same.
	* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
	  info_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
	  iterators_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/thin_heap_/trace_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/thin_heap_/thin_heap_.hpp: Same.
	* include/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/thin_heap_/
	  constructors_destructor_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/thin_heap_/split_join_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/ov_tree_map_/policy_access_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp: Same.
	* include/ext/pb_ds/detail/ov_tree_map_/
	  constructors_destructor_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp: Same.
	* include/ext/pb_ds/detail/ov_tree_map_/split_join_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/ov_tree_map_/traits.hpp: Same.
	* include/ext/pb_ds/detail/ov_tree_map_/iterators_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/debug_map_base.hpp: Same.
	* include/ext/pb_ds/detail/hash_fn/ranged_probe_fn.hpp: Same.
	* include/ext/pb_ds/detail/hash_fn/sample_probe_fn.hpp: Same.
	* include/ext/pb_ds/detail/hash_fn/sample_ranged_probe_fn.hpp: Same.
	* include/ext/pb_ds/detail/hash_fn/sample_range_hashing.hpp: Same.
	* include/ext/pb_ds/detail/hash_fn/probe_fn_base.hpp: Same.
	* include/ext/pb_ds/detail/hash_fn/ranged_hash_fn.hpp: Same.
	* include/ext/pb_ds/detail/hash_fn/sample_ranged_hash_fn.hpp: Same.
	* include/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/splay_tree_/
	  constructors_destructor_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/splay_tree_/node.hpp: Same.
	* include/ext/pb_ds/detail/splay_tree_/split_join_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/splay_tree_/info_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/splay_tree_/splay_tree_.hpp: Same.
	* include/ext/pb_ds/detail/splay_tree_/traits.hpp: Same.
	* include/ext/pb_ds/detail/list_update_map_/trace_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/list_update_map_/erase_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/list_update_map_/
	  entry_metadata_base.hpp: Same.
	* include/ext/pb_ds/detail/list_update_map_/find_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp: Same.
	* include/ext/pb_ds/detail/list_update_map_/
	  constructor_destructor_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/list_update_map_/insert_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/list_update_map_/debug_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/list_update_map_/iterators_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/rc_binomial_heap_/trace_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/rc_binomial_heap_/erase_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/rc_binomial_heap_/
	  rc_binomial_heap_.hpp: Same.
	* include/ext/pb_ds/detail/rc_binomial_heap_/insert_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/rc_binomial_heap_/
	  constructors_destructor_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/rc_binomial_heap_/debug_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp: Same.
	* include/ext/pb_ds/detail/rc_binomial_heap_/
	  split_join_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/rb_tree_map_/find_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/rb_tree_map_/
	  constructors_destructor_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp: Same.
	* include/ext/pb_ds/detail/rb_tree_map_/node.hpp: Same.
	* include/ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp: Same.
	* include/ext/pb_ds/detail/rb_tree_map_/traits.hpp: Same.


	Documentation changes.
	* include/ext/pb_ds/*: Add doxygen markup.
	* doc/doxygen/user.cfg.in: Add details for extracting comments
	from pb_ds.
	* scripts/run_doxygen: Fixup __gnu_pb_ds::detail.
	* scripts/make_graph.py: Move to svg output. Re-format generated tables.

	* doc/Makefile.am (stamp-html-copy): New rule.
	(stamp-html): Use it to copy non-generated files into html docs.
	* doc/Makefile.in: Regenerated.

	* doc/html/ext/pb_ds/sample_trie_e_access_traits.html: Move...
	* doc/html/ext/pb_ds/trie_string_access_traits.html: ...here.
	* doc/html/ext/pb_ds/string_trie_e_access_traits.html: Move..
	* doc/html/ext/pb_ds/sample_trie_access_traits.html: ...here.

	* doc/html/ext/pb_ds/tree_text_lor_find_timing_test_local.png,
	hash_random_int_erase_mem_usage_test_local.png,
	multimap_text_insert_mem_usage_test_small_s2p_hash_local.png,
	tree_text_insert_timing_test_pat_trie_local.png ,
	multimap_text_insert_mem_usage_test_small_s2p_tree_local.png ,
	priority_queue_text_modify_down_timing_test_local.png,
	gp_hash_random_int_subscript_timing_test_find_local.png,
	text_find_timing_test_hash_local.png,
	multimap_text_insert_timing_test_small_s2p_hash_local.png,
	multimap_text_insert_timing_test_small_s2p_tree_local.png,
	multimap_text_insert_mem_usage_test_large_s2p_hash_local.png,
	multimap_text_insert_mem_usage_test_large_s2p_tree_local.png,
	multimap_text_insert_timing_test_large_s2p_hash_local.png,
	hash_zlob_random_int_find_timing_test_local.png,
	multimap_text_insert_timing_test_large_s2p_tree_local.png,
	binary_priority_queue_random_int_push_timing_test_local.png,
	priority_queue_text_pop_mem_usage_test_local.png,
	priority_queue_text_modify_down_timing_test_pairing_thin_local.png,
	tree_split_join_timing_test_local.png,
	multimap_text_find_timing_test_small_s2p_hash_local.png,
	ccgp_hash_random_int_subscript_timing_test_insert_local.png,
	priority_queue_random_int_push_pop_timing_test_local.png,
	multimap_text_find_timing_test_small_s2p_tree_local.png,
	gp_hash_random_int_subscript_timing_test_insert_local.png,
	priority_queue_text_push_timing_test_local.png,
	cc_hash_random_int_subscript_timing_test_find_local.png,
	tree_text_insert_timing_test_vector_tree_local.png,
	multimap_text_find_timing_test_large_s2p_hash_local.png,
	pairing_priority_queue_text_push_timing_test_local.png,
	tree_order_statistics_timing_test_local.png,
	priority_queue_text_push_pop_timing_test_local.png,
	text_find_timing_test_tree_like_local.png,
	multimap_text_find_timing_test_large_s2p_tree_local.png,
	priority_queue_text_modify_up_timing_test_pairing_thin_local.png,
	cc_hash_random_int_subscript_timing_test_insert_local.png,
	priority_queue_text_modify_up_timing_test_local.png,
	random_int_find_find_timing_test_tree_local.png,
	priority_queue_random_int_push_timing_test_local.png,
	tree_text_insert_timing_test_node_tree_local.png,
	pairing_priority_queue_text_push_pop_timing_test_local.png,
	gp_hash_random_int_find_timing_test_local.png,
	cc_hash_random_int_find_timing_test_local.png,
	priority_queue_text_join_timing_test_local.png: Update local pngs.


	Testsuite changes.
	* testsuite/ext/pb_ds/regression/tree_no_data_map_rand_debug.cc: New.
	* testsuite/ext/pb_ds/regression/tree_data_map_rand_debug.cc: New.
	* testsuite/ext/pb_ds/regression/priority_queue_rand_debug.cc: New.
	* testsuite/ext/pb_ds/regression/trie_no_data_map_rand_debug.cc: New.
	* testsuite/ext/pb_ds/regression/trie_data_map_rand_debug.cc: New.
	* testsuite/ext/pb_ds/regression/list_update_no_data_map_rand_debug.cc:
	New.
	* testsuite/ext/pb_ds/regression/list_update_data_map_rand_debug.cc:
	New.
	* testsuite/ext/pb_ds/regression/hash_no_data_map_rand_debug.cc: New.
	* testsuite/ext/pb_ds/regression/hash_data_map_rand_debug.cc: New.

	* testsuite/ext/pb_ds/regression/list_update_data_map_rand.cc: Fix typo.

	* testsuite/ext/pb_ds/example/basic_set.cc: Update.
	* testsuite/ext/pb_ds/example/ranged_hash.cc: Same.
	* testsuite/ext/pb_ds/example/tree_order_statistics.cc: Same.
	* testsuite/ext/pb_ds/example/trie_prefix_search.cc: Same.
	* testsuite/ext/pb_ds/example/trie_dna.cc: Same.
	* testsuite/ext/pb_ds/example/tree_intervals.cc: Same.
	* testsuite/ext/pb_ds/example/basic_multimap.cc: Same.
	* testsuite/performance/ext/pb_ds/hash_random_int_erase_mem_usage.cc:
	  Same.
	* testsuite/performance/ext/pb_ds/tree_split_join_timing.cc: Same.
	* testsuite/performance/ext/pb_ds/tree_order_statistics_timing.cc: Same.
	* testsuite/data/make_graph_test_infos.xml: Same.
	* testsuite/util/regression/common_type.hpp: Same.
	* testsuite/util/regression/trait/assoc/native_type_trait.hpp: Same.
	* testsuite/util/regression/trait/assoc/trait.hpp: Same.
	* testsuite/util/regression/trait/assoc/type_trait.hpp: Same.
	* testsuite/util/regression/rand/priority_queue/
	  rand_regression_test.hpp: Same.
	* testsuite/util/regression/rand/priority_queue/
	  container_rand_regression_test.tcc: Same.
	* testsuite/util/regression/rand/assoc/rand_regression_test.hpp: Same.
	* testsuite/util/regression/rand/assoc/container_rand_regression_test.h
	* testsuite/util/regression/rand/assoc/
	  container_rand_regression_test.tcc: Same.
	* testsuite/util/native_type/native_priority_queue.hpp: Same.
	* testsuite/util/native_type/native_multimap.hpp: Same.
	* testsuite/util/native_type/native_hash_multimap.hpp: Same.
	* testsuite/util/native_type/native_set.hpp: Same.
	* testsuite/util/native_type/native_map.hpp: Same.
	* testsuite/util/native_type/native_hash_set.hpp: Same.
	* testsuite/util/native_type/native_hash_map.hpp: Same.
	* testsuite/util/testsuite_containers.h
	* testsuite/util/common_type/priority_queue/common_type.hpp: Same.
	* testsuite/util/common_type/assoc/common_type.hpp: Same.
	* testsuite/util/common_type/assoc/string_form.hpp: Same.
	* testsuite/util/common_type/assoc/template_policy.hpp: Same.
	* testsuite/util/common_type/assoc/detail/
	  trigger_policy_string_form.hpp: Same.
	* testsuite/util/common_type/assoc/detail/ds_string_form.hpp: Same.
	* testsuite/util/common_type/assoc/detail/
	  size_policy_string_form.hpp: Same.
	* testsuite/util/common_type/assoc/detail/
	  probe_fn_string_form.hpp: Same.
	* testsuite/util/common_type/assoc/detail/
	  tree_supports_order_statistics.hpp: Same.
	* testsuite/util/common_type/assoc/detail/
	  trie_supports_prefix_search.hpp: Same.
	* testsuite/util/common_type/assoc/detail/
	  list_update_policy_string_form.hpp: Same.
	* testsuite/util/common_type/assoc/detail/
	  trie_supports_order_statistics.hpp: Same.
	* testsuite/util/common_type/assoc/native_set.hpp: Same.
	* testsuite/util/performance/assoc/timing/common_type.hpp: Same.
	* testsuite/util/performance/assoc/timing/multimap_find_test.hpp: Same.
	* testsuite/util/performance/assoc/multimap_common_type.hpp: Same.

From-SVN: r174100
This commit is contained in:
Benjamin Kosnik 2011-05-24 02:38:19 +00:00 committed by Benjamin Kosnik
parent ab015ce4cc
commit a345e45d14
360 changed files with 9174 additions and 10122 deletions

View File

@ -1,3 +1,512 @@
2011-05-23 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/37144
PR libstdc++/28457
Interface changes for ext/pb_ds.
PB_DS_BASE_C_DEC to unique PB_DS_*_BASE macros.
* include/ext/pb_ds/assoc_container.hpp (container_base): Remove.
(basic_hash_table, basic_branch, list_update): Derive from
container_base_dispatch.
* include/ext/pb_ds/list_update_policy.hpp (null_lu_metadata): Remove.
(move_to_front_lu_policy): To lu_move_to_front_policy.
(counter_lu_policy): To lu_counter_policy.
* include/ext/pb_ds/tree_policy.hpp (null_tree_node_update): Remove.
* include/ext/pb_ds/tag_and_trait.hpp (container_base_dispatch): Adjust
template parameters, declare here.
(null_mapped_type) Remove.
(null_type): Just use this for template tricks everywhere.
* include/ext/pb_ds/hash_policy.hpp (null_hash_fn, null_probe_fn):
Remove.
* include/ext/pb_ds/trie_policy.hpp (null_trie_node_update): Remove.
(string_trie_e_access_traits): To trie_string_access_traits.
* include/ext/pb_ds/priority_queue.hpp: Use container_base_dispatch.
File changes.
* include/Makefile.am (pb_headers): Removed and changed file names.
* include/Makefile.in: Regenerated.
* include/ext/pb_ds/detail/basic_types.hpp: Remove.
* include/ext/pb_ds/detail/bin_search_tree_/
cond_dtor_entry_dealtor.hpp: Remove.
* include/ext/pb_ds/detail/bin_search_tree_/
cond_key_dtor_entry_dealtor.hpp: Remove.
* include/ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp: Move..
* include/ext/pb_ds/detail/binary_heap_/
point_const_iterator.hpp: ..here.
* include/ext/pb_ds/detail/basic_tree_policy: Move to...
* include/ext/pb_ds/detail/branch_policy: This.
* include/ext/pb_ds/detail/branch_policy/
basic_tree_policy_base.hpp: Move...
* include/ext/pb_ds/detail/branch_policy/branch_policy.hpp: ...here.
* include/ext/pb_ds/detail/branch_policy/null_node_metadata.hpp: Add.
* include/ext/pb_ds/detail/branch_policy/traits.hpp: Add.
* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
null_metadata.hpp: Remove.
* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
const_point_iterator.hpp: Move...
* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
point_const_iterator.hpp: ...here.
* include/ext/pb_ds/detail/list_update_policy/
counter_lu_metadata.hpp: Move..
* include/ext/pb_ds/detail/list_update_policy/
lu_counter_metadata.hpp: ...here.
* include/ext/pb_ds/detail/list_update_policy/
counter_lu_policy_imp.hpp: Remove.
* include/ext/pb_ds/detail/list_update_policy/
mtf_lu_policy_imp.hpp: Remove.
* include/ext/pb_ds/detail/trie_policy/
string_trie_e_access_traits_imp.hpp: Move...
* include/ext/pb_ds/detail/trie_policy/
sample_trie_access_traits.hpp: ...here.
* include/ext/pb_ds/detail/trie_policy/
sample_trie_e_access_traits.hpp: Move...
* include/ext/pb_ds/detail/trie_policy/
trie_string_access_traits_imp.hpp: ...here.
* include/ext/pb_ds/detail/trie_policy/null_node_update_imp.hpp: Remove.
* include/ext/pb_ds/detail/tree_policy/null_node_update_imp.hpp: Remove.
* include/ext/pb_ds/detail/ov_tree_map_/cond_dtor.hpp: Remove.
* include/ext/pb_ds/detail/pat_trie_/pat_trie_base.hpp: New, fold all
types found in the following files into pat_trie_base.
* include/ext/pb_ds/detail/pat_trie_/const_child_iterator.hpp: Folded.
* include/ext/pb_ds/detail/pat_trie_/
cond_dtor_entry_dealtor.hpp: Folded.
* include/ext/pb_ds/detail/pat_trie_/child_iterator.hpp: Folded.
* include/ext/pb_ds/detail/pat_trie_/split_join_branch_bag.hpp: Folded.
* include/ext/pb_ds/detail/pat_trie_/head.hpp: Folded.
* include/ext/pb_ds/detail/pat_trie_/leaf.hpp: Folded.
* include/ext/pb_ds/detail/pat_trie_/node_base.hpp: Folded.
* include/ext/pb_ds/detail/pat_trie_/node_metadata_base.hpp: Folded.
* include/ext/pb_ds/detail/pat_trie_/internal_node.hpp: Folded.
* include/ext/pb_ds/detail/pat_trie_/node_iterators.hpp: Folded.
* include/ext/pb_ds/detail/pat_trie_/point_iterators.hpp: Folded.
* include/ext/pb_ds/detail/pat_trie_/synth_e_access_traits.hpp: Move...
* include/ext/pb_ds/detail/pat_trie_/synth_access_traits.hpp: ...here.
* include/ext/pb_ds/detail/unordered_iterator/
const_point_iterator.hpp: Move...
* include/ext/pb_ds/detail/unordered_iterator/
point_const_iterator.hpp: ...here.
Adjust for above changes.
* include/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp: Same.
* include/ext/pb_ds/detail/resize_policy/sample_resize_policy.hpp: Same.
* include/ext/pb_ds/detail/resize_policy/
sample_resize_trigger.hpp: Same.
* include/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/binomial_heap_base_/insert_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/binomial_heap_base_/
binomial_heap_base_.hpp: Same.
* include/ext/pb_ds/detail/binomial_heap_base_/
constructors_destructor_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/binomial_heap_base_/debug_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/binomial_heap_base_/
split_join_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/container_base_dispatch.hpp: Same. Adjust
for template parameter ordering change.
* include/ext/pb_ds/detail/cc_hash_table_map_/
erase_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/
constructor_destructor_no_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/cmp_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/
insert_no_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/find_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/
policy_access_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/
resize_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/
constructor_destructor_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/
insert_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/debug_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/
entry_list_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/trace_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/
find_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/
debug_no_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/
constructor_destructor_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/
cond_key_dtor_entry_dealtor.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/insert_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/
debug_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/
erase_no_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/
iterators_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/
resize_no_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/cc_hash_table_map_/
standard_policies.hpp: Same.
* include/ext/pb_ds/detail/tree_trace_base.hpp: Same.
* include/ext/pb_ds/detail/unordered_iterator/iterator.hpp: Same.
* include/ext/pb_ds/detail/unordered_iterator/const_iterator.hpp: Same.
* include/ext/pb_ds/detail/unordered_iterator/point_iterator.hpp: Same.
* include/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/pat_trie_/policy_access_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/pat_trie_/insert_join_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/pat_trie_/
constructors_destructor_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp: Same.
* include/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/pat_trie_/traits.hpp: Same.
* include/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/bin_search_tree_/find_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/bin_search_tree_/
policy_access_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/bin_search_tree_/r_erase_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/bin_search_tree_/
constructors_destructor_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/bin_search_tree_/debug_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/bin_search_tree_/traits.hpp: Same.
* include/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/bin_search_tree_/rotate_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/bin_search_tree_/erase_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp: Same.
* include/ext/pb_ds/detail/bin_search_tree_/insert_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/bin_search_tree_/node_iterators.hpp: Same.
* include/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp: Same.
* include/ext/pb_ds/detail/bin_search_tree_/
split_join_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/bin_search_tree_/iterators_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/list_update_policy/
sample_update_policy.hpp: Same.
* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
trace_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
erase_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/
erase_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/
constructor_destructor_no_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/
insert_no_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/find_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/
policy_access_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/
resize_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/
constructor_destructor_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/
insert_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/debug_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/
iterator_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/
find_no_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/trace_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/erase_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/
find_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/
debug_no_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/resize_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/
constructor_destructor_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/insert_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/
debug_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/
erase_no_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/
resize_no_store_hash_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/
standard_policies.hpp: Same.
* include/ext/pb_ds/detail/standard_policies.hpp: Same.
* include/ext/pb_ds/detail/types_traits.hpp: Same.
* include/ext/pb_ds/detail/binary_heap_/find_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/binary_heap_/policy_access_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/binary_heap_/const_iterator.hpp: Same.
* include/ext/pb_ds/detail/binary_heap_/entry_cmp.hpp: Same.
* include/ext/pb_ds/detail/binary_heap_/
constructors_destructor_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/binary_heap_/debug_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/binary_heap_/trace_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/binary_heap_/erase_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/binary_heap_/entry_pred.hpp: Same.
* include/ext/pb_ds/detail/binary_heap_/insert_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp: Same.
* include/ext/pb_ds/detail/binary_heap_/resize_policy.hpp: Same.
* include/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/binary_heap_/iterators_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/tree_policy/order_statistics_imp.hpp: Same.
* include/ext/pb_ds/detail/tree_policy/node_metadata_selector.hpp: Same.
* include/ext/pb_ds/detail/tree_policy/
sample_tree_node_update.hpp: Same.
* include/ext/pb_ds/detail/trie_policy/order_statistics_imp.hpp: Same.
* include/ext/pb_ds/detail/trie_policy/
sample_trie_node_update.hpp: Same.
* include/ext/pb_ds/detail/trie_policy/trie_policy_base.hpp: Same.
* include/ext/pb_ds/detail/trie_policy/
prefix_search_node_update_imp.hpp: Same.
* include/ext/pb_ds/detail/trie_policy/node_metadata_selector.hpp: Same.
* include/ext/pb_ds/detail/cond_dealtor.hpp: Same.
* include/ext/pb_ds/detail/priority_queue_base_dispatch.hpp: Same.
Adjust for template parameter change, fold into
container_base_dispatch.
* include/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/pairing_heap_/find_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/pairing_heap_/
constructors_destructor_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp: Same.
* include/ext/pb_ds/detail/pairing_heap_/split_join_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/binomial_heap_/
constructors_destructor_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/binomial_heap_/debug_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/binomial_heap_/binomial_heap_.hpp: Same.
* include/ext/pb_ds/detail/constructors_destructor_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/type_utils.hpp: Same.
* include/ext/pb_ds/detail/eq_fn/hash_eq_fn.hpp: Same.
* include/ext/pb_ds/detail/eq_fn/eq_by_less.hpp: Same.
* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
policy_access_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
left_child_next_sibling_heap_.hpp: Same.
* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
const_iterator.hpp: Same.
* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
insert_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
constructors_destructor_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
debug_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
node.hpp: Same.
* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
info_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
iterators_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/thin_heap_/trace_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/thin_heap_/thin_heap_.hpp: Same.
* include/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/thin_heap_/
constructors_destructor_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/thin_heap_/split_join_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/ov_tree_map_/policy_access_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp: Same.
* include/ext/pb_ds/detail/ov_tree_map_/
constructors_destructor_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp: Same.
* include/ext/pb_ds/detail/ov_tree_map_/split_join_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/ov_tree_map_/traits.hpp: Same.
* include/ext/pb_ds/detail/ov_tree_map_/iterators_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/debug_map_base.hpp: Same.
* include/ext/pb_ds/detail/hash_fn/ranged_probe_fn.hpp: Same.
* include/ext/pb_ds/detail/hash_fn/sample_probe_fn.hpp: Same.
* include/ext/pb_ds/detail/hash_fn/sample_ranged_probe_fn.hpp: Same.
* include/ext/pb_ds/detail/hash_fn/sample_range_hashing.hpp: Same.
* include/ext/pb_ds/detail/hash_fn/probe_fn_base.hpp: Same.
* include/ext/pb_ds/detail/hash_fn/ranged_hash_fn.hpp: Same.
* include/ext/pb_ds/detail/hash_fn/sample_ranged_hash_fn.hpp: Same.
* include/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/splay_tree_/
constructors_destructor_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/splay_tree_/node.hpp: Same.
* include/ext/pb_ds/detail/splay_tree_/split_join_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/splay_tree_/info_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/splay_tree_/splay_tree_.hpp: Same.
* include/ext/pb_ds/detail/splay_tree_/traits.hpp: Same.
* include/ext/pb_ds/detail/list_update_map_/trace_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/list_update_map_/erase_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/list_update_map_/
entry_metadata_base.hpp: Same.
* include/ext/pb_ds/detail/list_update_map_/find_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp: Same.
* include/ext/pb_ds/detail/list_update_map_/
constructor_destructor_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/list_update_map_/insert_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/list_update_map_/debug_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/list_update_map_/iterators_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/rc_binomial_heap_/trace_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/rc_binomial_heap_/erase_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/rc_binomial_heap_/
rc_binomial_heap_.hpp: Same.
* include/ext/pb_ds/detail/rc_binomial_heap_/insert_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/rc_binomial_heap_/
constructors_destructor_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/rc_binomial_heap_/debug_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp: Same.
* include/ext/pb_ds/detail/rc_binomial_heap_/
split_join_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/rb_tree_map_/find_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/rb_tree_map_/
constructors_destructor_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp: Same.
* include/ext/pb_ds/detail/rb_tree_map_/node.hpp: Same.
* include/ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp: Same.
* include/ext/pb_ds/detail/rb_tree_map_/traits.hpp: Same.
Documentation changes.
* include/ext/pb_ds/*: Add doxygen markup.
* doc/doxygen/user.cfg.in: Add details for extracting comments
from pb_ds.
* scripts/run_doxygen: Fixup __gnu_pb_ds::detail.
* scripts/make_graph.py: Move to svg output. Re-format generated tables.
* doc/Makefile.am (stamp-html-copy): New rule.
(stamp-html): Use it to copy non-generated files into html docs.
* doc/Makefile.in: Regenerated.
* doc/html/ext/pb_ds/sample_trie_e_access_traits.html: Move...
* doc/html/ext/pb_ds/trie_string_access_traits.html: ...here.
* doc/html/ext/pb_ds/string_trie_e_access_traits.html: Move..
* doc/html/ext/pb_ds/sample_trie_access_traits.html: ...here.
* doc/html/ext/pb_ds/tree_text_lor_find_timing_test_local.png,
hash_random_int_erase_mem_usage_test_local.png,
multimap_text_insert_mem_usage_test_small_s2p_hash_local.png,
tree_text_insert_timing_test_pat_trie_local.png ,
multimap_text_insert_mem_usage_test_small_s2p_tree_local.png ,
priority_queue_text_modify_down_timing_test_local.png,
gp_hash_random_int_subscript_timing_test_find_local.png,
text_find_timing_test_hash_local.png,
multimap_text_insert_timing_test_small_s2p_hash_local.png,
multimap_text_insert_timing_test_small_s2p_tree_local.png,
multimap_text_insert_mem_usage_test_large_s2p_hash_local.png,
multimap_text_insert_mem_usage_test_large_s2p_tree_local.png,
multimap_text_insert_timing_test_large_s2p_hash_local.png,
hash_zlob_random_int_find_timing_test_local.png,
multimap_text_insert_timing_test_large_s2p_tree_local.png,
binary_priority_queue_random_int_push_timing_test_local.png,
priority_queue_text_pop_mem_usage_test_local.png,
priority_queue_text_modify_down_timing_test_pairing_thin_local.png,
tree_split_join_timing_test_local.png,
multimap_text_find_timing_test_small_s2p_hash_local.png,
ccgp_hash_random_int_subscript_timing_test_insert_local.png,
priority_queue_random_int_push_pop_timing_test_local.png,
multimap_text_find_timing_test_small_s2p_tree_local.png,
gp_hash_random_int_subscript_timing_test_insert_local.png,
priority_queue_text_push_timing_test_local.png,
cc_hash_random_int_subscript_timing_test_find_local.png,
tree_text_insert_timing_test_vector_tree_local.png,
multimap_text_find_timing_test_large_s2p_hash_local.png,
pairing_priority_queue_text_push_timing_test_local.png,
tree_order_statistics_timing_test_local.png,
priority_queue_text_push_pop_timing_test_local.png,
text_find_timing_test_tree_like_local.png,
multimap_text_find_timing_test_large_s2p_tree_local.png,
priority_queue_text_modify_up_timing_test_pairing_thin_local.png,
cc_hash_random_int_subscript_timing_test_insert_local.png,
priority_queue_text_modify_up_timing_test_local.png,
random_int_find_find_timing_test_tree_local.png,
priority_queue_random_int_push_timing_test_local.png,
tree_text_insert_timing_test_node_tree_local.png,
pairing_priority_queue_text_push_pop_timing_test_local.png,
gp_hash_random_int_find_timing_test_local.png,
cc_hash_random_int_find_timing_test_local.png,
priority_queue_text_join_timing_test_local.png: Update local pngs.
Testsuite changes.
* testsuite/ext/pb_ds/regression/tree_no_data_map_rand_debug.cc: New.
* testsuite/ext/pb_ds/regression/tree_data_map_rand_debug.cc: New.
* testsuite/ext/pb_ds/regression/priority_queue_rand_debug.cc: New.
* testsuite/ext/pb_ds/regression/trie_no_data_map_rand_debug.cc: New.
* testsuite/ext/pb_ds/regression/trie_data_map_rand_debug.cc: New.
* testsuite/ext/pb_ds/regression/list_update_no_data_map_rand_debug.cc:
New.
* testsuite/ext/pb_ds/regression/list_update_data_map_rand_debug.cc:
New.
* testsuite/ext/pb_ds/regression/hash_no_data_map_rand_debug.cc: New.
* testsuite/ext/pb_ds/regression/hash_data_map_rand_debug.cc: New.
* testsuite/ext/pb_ds/regression/list_update_data_map_rand.cc: Fix typo.
* testsuite/ext/pb_ds/example/basic_set.cc: Update.
* testsuite/ext/pb_ds/example/ranged_hash.cc: Same.
* testsuite/ext/pb_ds/example/tree_order_statistics.cc: Same.
* testsuite/ext/pb_ds/example/trie_prefix_search.cc: Same.
* testsuite/ext/pb_ds/example/trie_dna.cc: Same.
* testsuite/ext/pb_ds/example/tree_intervals.cc: Same.
* testsuite/ext/pb_ds/example/basic_multimap.cc: Same.
* testsuite/performance/ext/pb_ds/hash_random_int_erase_mem_usage.cc:
Same.
* testsuite/performance/ext/pb_ds/tree_split_join_timing.cc: Same.
* testsuite/performance/ext/pb_ds/tree_order_statistics_timing.cc: Same.
* testsuite/data/make_graph_test_infos.xml: Same.
* testsuite/util/regression/common_type.hpp: Same.
* testsuite/util/regression/trait/assoc/native_type_trait.hpp: Same.
* testsuite/util/regression/trait/assoc/trait.hpp: Same.
* testsuite/util/regression/trait/assoc/type_trait.hpp: Same.
* testsuite/util/regression/rand/priority_queue/
rand_regression_test.hpp: Same.
* testsuite/util/regression/rand/priority_queue/
container_rand_regression_test.tcc: Same.
* testsuite/util/regression/rand/assoc/rand_regression_test.hpp: Same.
* testsuite/util/regression/rand/assoc/container_rand_regression_test.h
* testsuite/util/regression/rand/assoc/
container_rand_regression_test.tcc: Same.
* testsuite/util/native_type/native_priority_queue.hpp: Same.
* testsuite/util/native_type/native_multimap.hpp: Same.
* testsuite/util/native_type/native_hash_multimap.hpp: Same.
* testsuite/util/native_type/native_set.hpp: Same.
* testsuite/util/native_type/native_map.hpp: Same.
* testsuite/util/native_type/native_hash_set.hpp: Same.
* testsuite/util/native_type/native_hash_map.hpp: Same.
* testsuite/util/testsuite_containers.h
* testsuite/util/common_type/priority_queue/common_type.hpp: Same.
* testsuite/util/common_type/assoc/common_type.hpp: Same.
* testsuite/util/common_type/assoc/string_form.hpp: Same.
* testsuite/util/common_type/assoc/template_policy.hpp: Same.
* testsuite/util/common_type/assoc/detail/
trigger_policy_string_form.hpp: Same.
* testsuite/util/common_type/assoc/detail/ds_string_form.hpp: Same.
* testsuite/util/common_type/assoc/detail/
size_policy_string_form.hpp: Same.
* testsuite/util/common_type/assoc/detail/
probe_fn_string_form.hpp: Same.
* testsuite/util/common_type/assoc/detail/
tree_supports_order_statistics.hpp: Same.
* testsuite/util/common_type/assoc/detail/
trie_supports_prefix_search.hpp: Same.
* testsuite/util/common_type/assoc/detail/
list_update_policy_string_form.hpp: Same.
* testsuite/util/common_type/assoc/detail/
trie_supports_order_statistics.hpp: Same.
* testsuite/util/common_type/assoc/native_set.hpp: Same.
* testsuite/util/performance/assoc/timing/common_type.hpp: Same.
* testsuite/util/performance/assoc/timing/multimap_find_test.hpp: Same.
* testsuite/util/performance/assoc/multimap_common_type.hpp: Same.
2011-05-23 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/streambuf_iterator.h: Use noexcept per the FDIS.

View File

@ -136,9 +136,17 @@ doc-install-xml: doc-xml
# HTML
htmldir="$(DESTDIR)@docdir@"
stamp-html: stamp-html-docbook stamp-html-doxygen
stamp-html: stamp-html-copy stamp-html-doxygen
$(STAMP) stamp-html
copydir=${docbook_outdir}/html/manual/ext/
stamp-html-copy: stamp-html-docbook
cp -r ${top_srcdir}/doc/html/ext ${docbook_outdir}/html/manual/ext
cd ${docbook_outdir}/html/manual/ext
rm -rf ${docbook_outdir}/html/manual/ext/.svn
rm -rf ${docbook_outdir}/html/manual/ext/pb_ds/.svn
$(STAMP) stamp-html-copy
doc-html: stamp-html
doc-install-html: doc-html

View File

@ -324,6 +324,7 @@ AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
# XML
xmldir = "$(DESTDIR)@docdir@"
copydir = ${docbook_outdir}/html/manual/ext/
# EPUB
# Assumes ruby installed
@ -649,8 +650,14 @@ doc-install-xml: doc-xml
test -z ${xmldir} || $(mkinstalldirs) ${xmldir}
$(INSTALL_DATA) ${manual_xml} ${xmldir}
$(INSTALL_DATA) ${api_xml} ${xmldir}
stamp-html: stamp-html-docbook stamp-html-doxygen
stamp-html: stamp-html-copy stamp-html-doxygen
$(STAMP) stamp-html
stamp-html-copy: stamp-html-docbook
cp -r ${top_srcdir}/doc/html/ext ${docbook_outdir}/html/manual/ext
cd ${docbook_outdir}/html/manual/ext
rm -rf ${docbook_outdir}/html/manual/ext/.svn
rm -rf ${docbook_outdir}/html/manual/ext/pb_ds/.svn
$(STAMP) stamp-html-copy
doc-html: stamp-html

View File

@ -1,4 +1,4 @@
# Doxyfile 1.7.2
# Doxyfile 1.7.4
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
@ -33,6 +33,19 @@ PROJECT_NAME = libstdc++
PROJECT_NUMBER =
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer
# a quick idea about the purpose of the project. Keep the description short.
PROJECT_BRIEF =
# With the PROJECT_LOGO tag one can specify an logo or icon that is
# included in the documentation. The maximum height of the logo should not
# exceed 55 pixels and the maximum width should not exceed 200 pixels.
# Doxygen will copy the logo to the output directory.
PROJECT_LOGO =
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
# If a relative path is entered, it will be relative to the location
@ -57,7 +70,7 @@ CREATE_SUBDIRS = NO
# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
OUTPUT_LANGUAGE = English
@ -179,10 +192,9 @@ TAB_SIZE = 4
# will result in a user-defined paragraph with heading "Side Effects:".
# You can put \n's in the value part of an alias to insert newlines.
ALIASES = doctodo="@todo\nNeeds documentation! See http://gcc.gnu.org/onlinedocs/libstdc++/manual/documentation_style.html"
ALIASES += headername{1}="Instead, include <\1>."
ALIASES += headername{2}="Instead, include <\1> or <\2>."
ALIASES = "doctodo=@todo\nNeeds documentation! See http://gcc.gnu.org/onlinedocs/libstdc++/manual/documentation_style.html" \
"headername{1}=Instead, include <\1>." \
"headername{2}=Instead, include <\1> or <\2>."
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
# sources only. Doxygen will then generate output that is more tailored for C.
@ -266,6 +278,13 @@ DISTRIBUTE_GROUP_DOC = YES
SUBGROUPING = YES
# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
# unions are shown inside the group in which they are included (e.g. using
# @ingroup) instead of on a separate page (for HTML and Man pages) or
# section (for LaTeX and RTF).
INLINE_GROUPED_CLASSES = NO
# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
# is documented as struct, union, or enum with the name of the typedef. So
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
@ -282,7 +301,7 @@ TYPEDEF_HIDES_STRUCT = NO
# For small to medium size projects (<1000 input files) the default value is
# probably good enough. For larger projects a too small cache size can cause
# doxygen to be busy swapping symbols to and from disk most of the time
# causing a significant performance penality.
# causing a significant performance penalty.
# If the system has enough physical memory increasing the cache will improve the
# performance by keeping more symbols in memory. Note that the value works on
# a logarithmic scale so increasing the size by one will roughly double the
@ -441,6 +460,15 @@ SORT_GROUP_NAMES = YES
SORT_BY_SCOPE_NAME = YES
# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
# do proper type resolution of all parameters of a function it will reject a
# match between the prototype and the implementation of a member function even
# if there is only one candidate or it is obvious which candidate to choose
# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
# will still accept a match between prototype and implementation in such cases.
STRICT_PROTO_MATCHING = NO
# The GENERATE_TODOLIST tag can be used to enable (YES) or
# disable (NO) the todo list. This list is created by putting \todo
# commands in the documentation.
@ -585,142 +613,165 @@ WARN_LOGFILE =
# with spaces.
INPUT = @srcdir@/doc/doxygen/doxygroups.cc \
@srcdir@/libsupc++/cxxabi.h \
@srcdir@/libsupc++/exception \
@srcdir@/libsupc++/initializer_list \
@srcdir@/libsupc++/new \
@srcdir@/libsupc++/typeinfo \
include/algorithm \
include/array \
include/atomic \
include/bitset \
include/chrono \
include/complex \
include/condition_variable \
include/deque \
include/forward_list \
include/fstream \
include/functional \
include/future \
include/iomanip \
include/ios \
include/iosfwd \
include/iostream \
include/istream \
include/iterator \
include/limits \
include/list \
include/locale \
include/map \
include/memory \
include/mutex \
include/numeric \
include/ostream \
include/queue \
include/random \
include/ratio \
include/regex \
include/set \
include/sstream \
include/stack \
include/stdexcept \
include/streambuf \
include/string \
include/system_error \
include/thread \
include/tuple \
include/typeindex \
include/type_traits \
include/unordered_map \
include/unordered_set \
include/utility \
include/valarray \
include/vector \
include/cassert \
include/ccomplex \
include/cctype \
include/cerrno \
include/cfenv \
include/cfloat \
include/cinttypes \
include/ciso646 \
include/climits \
include/clocale \
include/cmath \
include/csetjmp \
include/csignal \
include/cstdarg \
include/cstdbool \
include/cstddef \
include/cstdint \
include/cstdio \
include/cstdlib \
include/cstring \
include/ctgmath \
include/ctime \
include/cwchar \
include/cwctype \
include/backward/hash_map \
include/backward/hash_set \
include/backward/strstream \
include/debug/bitset \
include/debug/deque \
include/debug/forward_list \
include/debug/list \
include/debug/map \
include/debug/set \
include/debug/string \
include/debug/unordered_map \
include/debug/unordered_set \
include/debug/vector \
include/profile/bitset \
include/profile/deque \
include/profile/forward_list \
include/profile/list \
include/profile/map \
include/profile/set \
include/profile/unordered_map \
include/profile/unordered_set \
include/profile/vector \
include/ext/algorithm \
include/ext/functional \
include/ext/iterator \
include/ext/memory \
include/ext/numeric \
include/ext/rb_tree \
include/ext/rope \
include/ext/slist \
include/parallel/algorithm \
include/parallel/numeric \
include/tr1/ccomplex \
include/tr1/cctype \
include/tr1/cfenv \
include/tr1/cfloat \
include/tr1/cinttypes \
include/tr1/climits \
include/tr1/cmath \
include/tr1/complex \
include/tr1/cstdarg \
include/tr1/cstdbool \
include/tr1/cstdint \
include/tr1/cstdio \
include/tr1/cstdlib \
include/tr1/ctgmath \
include/tr1/ctime \
include/tr1/cwchar \
include/tr1/cwctype \
include/decimal/decimal \
include/ \
include/@host_alias@/bits \
include/backward \
include/bits \
include/debug \
include/parallel \
include/profile \
include/profile/impl \
include/ext \
include/ext/pb_ds \
include/ext/pb_ds/detail
@srcdir@/libsupc++/cxxabi.h \
@srcdir@/libsupc++/exception \
@srcdir@/libsupc++/initializer_list \
@srcdir@/libsupc++/new \
@srcdir@/libsupc++/typeinfo \
include/algorithm \
include/array \
include/atomic \
include/bitset \
include/chrono \
include/complex \
include/condition_variable \
include/deque \
include/forward_list \
include/fstream \
include/functional \
include/future \
include/iomanip \
include/ios \
include/iosfwd \
include/iostream \
include/istream \
include/iterator \
include/limits \
include/list \
include/locale \
include/map \
include/memory \
include/mutex \
include/numeric \
include/ostream \
include/queue \
include/random \
include/ratio \
include/regex \
include/set \
include/sstream \
include/stack \
include/stdexcept \
include/streambuf \
include/string \
include/system_error \
include/thread \
include/tuple \
include/typeindex \
include/type_traits \
include/unordered_map \
include/unordered_set \
include/utility \
include/valarray \
include/vector \
include/cassert \
include/ccomplex \
include/cctype \
include/cerrno \
include/cfenv \
include/cfloat \
include/cinttypes \
include/ciso646 \
include/climits \
include/clocale \
include/cmath \
include/csetjmp \
include/csignal \
include/cstdarg \
include/cstdbool \
include/cstddef \
include/cstdint \
include/cstdio \
include/cstdlib \
include/cstring \
include/ctgmath \
include/ctime \
include/cwchar \
include/cwctype \
include/ \
include/bits \
include/@host_alias@/bits \
include/backward \
include/backward/hash_map \
include/backward/hash_set \
include/backward/strstream \
include/debug \
include/debug/bitset \
include/debug/deque \
include/debug/forward_list \
include/debug/list \
include/debug/map \
include/debug/set \
include/debug/string \
include/debug/unordered_map \
include/debug/unordered_set \
include/debug/vector \
include/profile \
include/profile/impl \
include/profile/bitset \
include/profile/deque \
include/profile/forward_list \
include/profile/list \
include/profile/map \
include/profile/set \
include/profile/unordered_map \
include/profile/unordered_set \
include/profile/vector \
include/ext/algorithm \
include/ext/functional \
include/ext/iterator \
include/ext/memory \
include/ext/numeric \
include/ext/rb_tree \
include/ext/rope \
include/ext/slist \
include/parallel \
include/parallel/algorithm \
include/parallel/numeric \
include/tr1/ccomplex \
include/tr1/cctype \
include/tr1/cfenv \
include/tr1/cfloat \
include/tr1/cinttypes \
include/tr1/climits \
include/tr1/cmath \
include/tr1/complex \
include/tr1/cstdarg \
include/tr1/cstdbool \
include/tr1/cstdint \
include/tr1/cstdio \
include/tr1/cstdlib \
include/tr1/ctgmath \
include/tr1/ctime \
include/tr1/cwchar \
include/tr1/cwctype \
include/decimal/decimal \
include/ext \
include/ext/pb_ds \
include/ext/pb_ds/detail \
include/ext/pb_ds/detail/binary_heap_ \
include/ext/pb_ds/detail/binomial_heap_ \
include/ext/pb_ds/detail/binomial_heap_base_ \
include/ext/pb_ds/detail/bin_search_tree_ \
include/ext/pb_ds/detail/branch_policy \
include/ext/pb_ds/detail/cc_hash_table_map_ \
include/ext/pb_ds/detail/eq_fn \
include/ext/pb_ds/detail/gp_hash_table_map_ \
include/ext/pb_ds/detail/hash_fn \
include/ext/pb_ds/detail/left_child_next_sibling_heap_ \
include/ext/pb_ds/detail/list_update_map_ \
include/ext/pb_ds/detail/list_update_policy \
include/ext/pb_ds/detail/ov_tree_map_ \
include/ext/pb_ds/detail/pairing_heap_ \
include/ext/pb_ds/detail/pat_trie_ \
include/ext/pb_ds/detail/rb_tree_map_ \
include/ext/pb_ds/detail/rc_binomial_heap_ \
include/ext/pb_ds/detail/resize_policy \
include/ext/pb_ds/detail/splay_tree_ \
include/ext/pb_ds/detail/thin_heap_ \
include/ext/pb_ds/detail/tree_policy \
include/ext/pb_ds/detail/trie_policy \
include/ext/pb_ds/detail/unordered_iterator
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
@ -736,11 +787,11 @@ INPUT_ENCODING = UTF-8
# blank the following patterns are tested:
# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
# *.f90 *.f *.vhd *.vhdl
# *.f90 *.f *.for *.vhd *.vhdl
FILE_PATTERNS = *.h \
*.hpp \
*.tcc
*.hpp \
*.tcc
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO.
@ -755,7 +806,7 @@ RECURSIVE = NO
EXCLUDE = Makefile
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
# directories that are symbolic links (a Unix filesystem feature) are excluded
# directories that are symbolic links (a Unix file system feature) are excluded
# from the input.
EXCLUDE_SYMLINKS = NO
@ -766,9 +817,10 @@ EXCLUDE_SYMLINKS = NO
# against the file with absolute path, so to exclude all test directories
# for example use the pattern */test/*
EXCLUDE_PATTERNS = stamp-* doxygroups.cc \
*.gch \
*/.svn/*
EXCLUDE_PATTERNS = stamp-* \
doxygroups.cc \
*.gch \
*/.svn/*
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
@ -821,8 +873,8 @@ INPUT_FILTER =
# filter if there is a match.
# The filters are a list of the form:
# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
# is applied to all files.
# info on how filters are used. If FILTER_PATTERNS is empty or if
# non of the patterns match the file name, INPUT_FILTER is applied.
FILTER_PATTERNS =
@ -832,6 +884,14 @@ FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
# and it is also possible to disable source filtering for a specific pattern
# using *.ext= (so without naming a filter). This option only has effect when
# FILTER_SOURCE_FILES is enabled.
FILTER_SOURCE_PATTERNS =
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
@ -934,7 +994,13 @@ HTML_FILE_EXTENSION = .html
# The HTML_HEADER tag can be used to specify a personal HTML header for
# each generated HTML page. If it is left blank doxygen will generate a
# standard header.
# standard header. Note that when using a custom header you are responsible
# for the proper inclusion of any scripts and style sheets that doxygen
# needs, which is dependent on the configuration options used.
# It is adviced to generate a default header using "doxygen -w html
# header.html footer.html stylesheet.css YourConfigFile" and then modify
# that header. Note that the header is subject to change so you typically
# have to redo this when upgrading to a newer version of doxygen or when changing the value of configuration settings such as GENERATE_TREEVIEW!
HTML_HEADER =
@ -953,6 +1019,15 @@ HTML_FOOTER =
HTML_STYLESHEET =
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the HTML output directory. Note
# that these files will be copied to the base HTML output directory. Use the
# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
# files. In the HTML_STYLESHEET file, use the file name only. Also note that
# the files will be copied as-is; there are no commands or markers available.
HTML_EXTRA_FILES =
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
# Doxygen will adjust the colors in the stylesheet and background images
# according to this color. Hue is specified as an angle on a colorwheel,
@ -1155,9 +1230,10 @@ ECLIPSE_DOC_ID = org.doxygen.Project
DISABLE_INDEX = YES
# This tag can be used to set the number of enum values (range [0,1..20])
# that doxygen will group on one line in the generated HTML documentation.
# Note that a value of 0 will completely suppress the enum values from appearing in the overview section.
# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
# (range [0,1..20]) that doxygen will group on one line in the generated HTML
# documentation. Note that a value of 0 will completely suppress the enum
# values from appearing in the overview section.
ENUM_VALUES_PER_LINE = 4
@ -1216,7 +1292,8 @@ USE_MATHJAX = NO
# HTML output directory using the MATHJAX_RELPATH option. The destination
# directory should contain the MathJax.js script. For instance, if the mathjax
# directory is located at the same level as the HTML output directory, then
# MATHJAX_RELPATH should be ../mathjax. The default value points to the mathjax.org site, so you can quickly see the result without installing
# MATHJAX_RELPATH should be ../mathjax. The default value points to the
# mathjax.org site, so you can quickly see the result without installing
# MathJax, but it is strongly recommended to install a local copy of MathJax
# before deployment.
@ -1295,6 +1372,13 @@ EXTRA_PACKAGES = amsmath
LATEX_HEADER =
# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
# the generated latex document. The footer should contain everything after
# the last chapter. If it is left blank doxygen will generate a
# standard footer. Notice: only use this tag if you know what you are doing!
LATEX_FOOTER =
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
# is prepared for conversion to pdf (using ps2pdf). The pdf file will
# contain links (just like the HTML output) instead of page references
@ -1504,7 +1588,7 @@ MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = NO
# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
# in the INCLUDE_PATH (see below) will be search if a #include is found.
# pointed to by INCLUDE_PATH will be searched when a #include is found.
SEARCH_INCLUDES = YES
@ -1512,7 +1596,7 @@ SEARCH_INCLUDES = YES
# contain include files that are not input files but should be processed by
# the preprocessor.
INCLUDE_PATH =
INCLUDE_PATH = include
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
@ -1530,57 +1614,59 @@ INCLUDE_FILE_PATTERNS =
# instead of the = operator.
PREDEFINED = __cplusplus \
__GTHREADS \
_GLIBCXX_HAS_GTHREADS \
__GXX_EXPERIMENTAL_CXX0X__ \
_GLIBCXX_INCLUDE_AS_CXX0X \
"_GLIBCXX_PURE= " \
"_GLIBCXX_CONST= " \
"_GLIBCXX_NORETURN= " \
"_GLIBCXX_NOTHROW= " \
"_GLIBCXX_STD_C= " \
"_GLIBCXX_STD_A= " \
__GTHREADS \
_GLIBCXX_HAS_GTHREADS \
__GXX_EXPERIMENTAL_CXX0X__ \
_GLIBCXX_INCLUDE_AS_CXX0X \
"_GLIBCXX_PURE= " \
"_GLIBCXX_CONST= " \
"_GLIBCXX_NORETURN= " \
"_GLIBCXX_NOTHROW= " \
"_GLIBCXX_STD_C= " \
"_GLIBCXX_STD_A= " \
"_GLIBCXX_VISIBILITY(V)= " \
"_GLIBCXX_BEGIN_NAMESPACE_VERSION= " \
"_GLIBCXX_BEGIN_NAMESPACE_ALGO= " \
"_GLIBCXX_BEGIN_NAMESPACE_CONTAINER= " \
"_GLIBCXX_BEGIN_NAMESPACE_LDBL= " \
"_GLIBCXX_END_NAMESPACE_VERSION= " \
"_GLIBCXX_END_NAMESPACE_ALGO= " \
"_GLIBCXX_END_NAMESPACE_CONTAINER= " \
"_GLIBCXX_END_NAMESPACE_LDBL= " \
"_GLIBCXX_TEMPLATE_ARGS=... " \
_GLIBCXX_DEPRECATED \
_GLIBCXX_CONSTEXPR=constexpr \
_GLIBCXX_USE_CONSTEXPR=constexpr \
_GLIBCXX_USE_WCHAR_T \
_GLIBCXX_USE_LONG_LONG \
_GLIBCXX_USE_C99_STDINT_TR1 \
_GLIBCXX_ATOMIC_BUILTINS_1 \
_GLIBCXX_ATOMIC_BUILTINS_2 \
_GLIBCXX_ATOMIC_BUILTINS_4 \
_GLIBCXX_ATOMIC_BUILTINS_8 \
_GLIBCXX_USE_SCHED_YIELD \
_GLIBCXX_USE_NANOSLEEP \
__GXX_RTTI \
__glibcxx_function_requires=// \
__glibcxx_class_requires=// \
__glibcxx_class_requires2=// \
__glibcxx_class_requires3=// \
__glibcxx_class_requires4=//
"_GLIBCXX_BEGIN_NAMESPACE_VERSION= " \
"_GLIBCXX_BEGIN_NAMESPACE_ALGO= " \
"_GLIBCXX_BEGIN_NAMESPACE_CONTAINER= " \
"_GLIBCXX_BEGIN_NAMESPACE_LDBL= " \
"_GLIBCXX_END_NAMESPACE_VERSION= " \
"_GLIBCXX_END_NAMESPACE_ALGO= " \
"_GLIBCXX_END_NAMESPACE_CONTAINER= " \
"_GLIBCXX_END_NAMESPACE_LDBL= " \
"_GLIBCXX_TEMPLATE_ARGS=... " \
_GLIBCXX_DEPRECATED \
_GLIBCXX_CONSTEXPR=constexpr \
_GLIBCXX_USE_CONSTEXPR=constexpr \
_GLIBCXX_USE_WCHAR_T \
_GLIBCXX_USE_LONG_LONG \
_GLIBCXX_USE_C99_STDINT_TR1 \
_GLIBCXX_ATOMIC_BUILTINS_1 \
_GLIBCXX_ATOMIC_BUILTINS_2 \
_GLIBCXX_ATOMIC_BUILTINS_4 \
_GLIBCXX_ATOMIC_BUILTINS_8 \
_GLIBCXX_USE_SCHED_YIELD \
_GLIBCXX_USE_NANOSLEEP \
PB_DS_DATA_TRUE_INDICATOR \
__EXCEPTIONS \
__GXX_RTTI \
__glibcxx_function_requires=// \
__glibcxx_class_requires=// \
__glibcxx_class_requires2=// \
__glibcxx_class_requires3=// \
__glibcxx_class_requires4=//
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
# The macro definition that is found in the sources will be used.
# Use the PREDEFINED tag if you want to use a different macro definition.
# Use the PREDEFINED tag if you want to use a different macro definition that
# overrules the definition found in the source code.
EXPAND_AS_DEFINED =
# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
# doxygen's preprocessor will remove all function-like macros that are alone
# on a line, have an all uppercase name, and do not end with a semicolon. Such
# function macros are typically used for boiler-plate code, and will confuse
# the parser if not removed.
# doxygen's preprocessor will remove all references to function-like macros
# that are alone on a line, have an all uppercase name, and do not end with a
# semicolon, because these will confuse the parser if not removed.
SKIP_FUNCTION_MACROS = YES
@ -1671,11 +1757,10 @@ HAVE_DOT = YES
DOT_NUM_THREADS = 0
# By default doxygen will write a font called FreeSans.ttf to the output
# directory and reference it in all dot files that doxygen generates. This
# font does not include all possible unicode characters however, so when you need
# these (or just want a differently looking font) you can specify the font name
# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
# By default doxygen will write a font called Helvetica to the output
# directory and reference it in all dot files that doxygen generates.
# When you want a differently looking font you can specify the font name
# using DOT_FONTNAME. You need to make sure dot is able to find the font,
# which can be done by putting it in a standard location or by setting the
# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
# containing the font.
@ -1767,7 +1852,7 @@ GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
# generated by dot. Possible values are png, jpg, or gif.
# generated by dot. Possible values are svg, png, jpg, or gif.
# If left blank png will be used.
DOT_IMAGE_FORMAT = png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -201,7 +201,7 @@ pb_subdirs = \
${pb_builddir}/detail/pairing_heap_ \
${pb_builddir}/detail/splay_tree_ \
${pb_builddir}/detail/list_update_map_ \
${pb_builddir}/detail/basic_tree_policy \
${pb_builddir}/detail/branch_policy \
${pb_builddir}/detail/trie_policy \
${pb_builddir}/detail/gp_hash_table_map_ \
${pb_builddir}/detail/tree_policy \
@ -236,13 +236,12 @@ pb_headers1 = \
${pb_srcdir}/tag_and_trait.hpp \
${pb_srcdir}/tree_policy.hpp \
${pb_srcdir}/trie_policy.hpp \
${pb_srcdir}/detail/basic_tree_policy/basic_tree_policy_base.hpp \
${pb_srcdir}/detail/basic_tree_policy/null_node_metadata.hpp \
${pb_srcdir}/detail/basic_tree_policy/traits.hpp \
${pb_srcdir}/detail/basic_types.hpp \
${pb_srcdir}/detail/branch_policy/branch_policy.hpp \
${pb_srcdir}/detail/branch_policy/null_node_metadata.hpp \
${pb_srcdir}/detail/branch_policy/traits.hpp \
${pb_srcdir}/detail/binary_heap_/binary_heap_.hpp \
${pb_srcdir}/detail/binary_heap_/const_iterator.hpp \
${pb_srcdir}/detail/binary_heap_/const_point_iterator.hpp \
${pb_srcdir}/detail/binary_heap_/point_const_iterator.hpp \
${pb_srcdir}/detail/binary_heap_/constructors_destructor_fn_imps.hpp \
${pb_srcdir}/detail/binary_heap_/debug_fn_imps.hpp \
${pb_srcdir}/detail/binary_heap_/entry_cmp.hpp \
@ -266,9 +265,7 @@ pb_headers1 = \
${pb_srcdir}/detail/binomial_heap_/binomial_heap_.hpp \
${pb_srcdir}/detail/binomial_heap_/constructors_destructor_fn_imps.hpp \
${pb_srcdir}/detail/binomial_heap_/debug_fn_imps.hpp \
${pb_srcdir}/detail/bin_search_tree_/bin_search_tree_.hpp \
${pb_srcdir}/detail/bin_search_tree_/cond_dtor_entry_dealtor.hpp \
${pb_srcdir}/detail/bin_search_tree_/cond_key_dtor_entry_dealtor.hpp
${pb_srcdir}/detail/bin_search_tree_/bin_search_tree_.hpp
pb_headers2 = \
${pb_srcdir}/detail/bin_search_tree_/constructors_destructor_fn_imps.hpp \
@ -359,7 +356,7 @@ pb_headers4 = \
${pb_srcdir}/detail/hash_fn/sample_ranged_probe_fn.hpp \
${pb_srcdir}/detail/hash_fn/sample_range_hashing.hpp \
${pb_srcdir}/detail/left_child_next_sibling_heap_/const_iterator.hpp \
${pb_srcdir}/detail/left_child_next_sibling_heap_/const_point_iterator.hpp \
${pb_srcdir}/detail/left_child_next_sibling_heap_/point_const_iterator.hpp \
${pb_srcdir}/detail/left_child_next_sibling_heap_/constructors_destructor_fn_imps.hpp \
${pb_srcdir}/detail/left_child_next_sibling_heap_/debug_fn_imps.hpp \
${pb_srcdir}/detail/left_child_next_sibling_heap_/erase_fn_imps.hpp \
@ -368,7 +365,6 @@ pb_headers4 = \
${pb_srcdir}/detail/left_child_next_sibling_heap_/iterators_fn_imps.hpp \
${pb_srcdir}/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp \
${pb_srcdir}/detail/left_child_next_sibling_heap_/node.hpp \
${pb_srcdir}/detail/left_child_next_sibling_heap_/null_metadata.hpp \
${pb_srcdir}/detail/left_child_next_sibling_heap_/policy_access_fn_imps.hpp \
${pb_srcdir}/detail/left_child_next_sibling_heap_/trace_fn_imps.hpp \
${pb_srcdir}/detail/list_update_map_/constructor_destructor_fn_imps.hpp \
@ -381,12 +377,9 @@ pb_headers4 = \
${pb_srcdir}/detail/list_update_map_/iterators_fn_imps.hpp \
${pb_srcdir}/detail/list_update_map_/lu_map_.hpp \
${pb_srcdir}/detail/list_update_map_/trace_fn_imps.hpp \
${pb_srcdir}/detail/list_update_policy/counter_lu_metadata.hpp \
${pb_srcdir}/detail/list_update_policy/counter_lu_policy_imp.hpp \
${pb_srcdir}/detail/list_update_policy/mtf_lu_policy_imp.hpp \
${pb_srcdir}/detail/list_update_policy/lu_counter_metadata.hpp \
${pb_srcdir}/detail/list_update_policy/sample_update_policy.hpp \
${pb_srcdir}/detail/debug_map_base.hpp \
${pb_srcdir}/detail/ov_tree_map_/cond_dtor.hpp \
${pb_srcdir}/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp \
${pb_srcdir}/detail/ov_tree_map_/debug_fn_imps.hpp \
${pb_srcdir}/detail/ov_tree_map_/erase_fn_imps.hpp \
@ -407,30 +400,20 @@ pb_headers5 = \
${pb_srcdir}/detail/pairing_heap_/insert_fn_imps.hpp \
${pb_srcdir}/detail/pairing_heap_/pairing_heap_.hpp \
${pb_srcdir}/detail/pairing_heap_/split_join_fn_imps.hpp \
${pb_srcdir}/detail/pat_trie_/child_iterator.hpp \
${pb_srcdir}/detail/pat_trie_/cond_dtor_entry_dealtor.hpp \
${pb_srcdir}/detail/pat_trie_/const_child_iterator.hpp \
${pb_srcdir}/detail/pat_trie_/constructors_destructor_fn_imps.hpp \
${pb_srcdir}/detail/pat_trie_/debug_fn_imps.hpp \
${pb_srcdir}/detail/pat_trie_/erase_fn_imps.hpp \
${pb_srcdir}/detail/pat_trie_/find_fn_imps.hpp \
${pb_srcdir}/detail/pat_trie_/head.hpp \
${pb_srcdir}/detail/pat_trie_/info_fn_imps.hpp \
${pb_srcdir}/detail/pat_trie_/insert_join_fn_imps.hpp \
${pb_srcdir}/detail/pat_trie_/internal_node.hpp \
${pb_srcdir}/detail/pat_trie_/iterators_fn_imps.hpp \
${pb_srcdir}/detail/pat_trie_/leaf.hpp \
${pb_srcdir}/detail/pat_trie_/node_base.hpp \
${pb_srcdir}/detail/pat_trie_/node_iterators.hpp \
${pb_srcdir}/detail/pat_trie_/node_metadata_base.hpp \
${pb_srcdir}/detail/pat_trie_/pat_trie_.hpp \
${pb_srcdir}/detail/pat_trie_/point_iterators.hpp \
${pb_srcdir}/detail/pat_trie_/pat_trie_base.hpp \
${pb_srcdir}/detail/pat_trie_/policy_access_fn_imps.hpp \
${pb_srcdir}/detail/pat_trie_/r_erase_fn_imps.hpp \
${pb_srcdir}/detail/pat_trie_/rotate_fn_imps.hpp \
${pb_srcdir}/detail/pat_trie_/split_fn_imps.hpp \
${pb_srcdir}/detail/pat_trie_/split_join_branch_bag.hpp \
${pb_srcdir}/detail/pat_trie_/synth_e_access_traits.hpp \
${pb_srcdir}/detail/pat_trie_/synth_access_traits.hpp \
${pb_srcdir}/detail/pat_trie_/trace_fn_imps.hpp \
${pb_srcdir}/detail/pat_trie_/traits.hpp \
${pb_srcdir}/detail/pat_trie_/update_fn_imps.hpp \
@ -487,22 +470,20 @@ pb_headers7 = \
${pb_srcdir}/detail/thin_heap_/thin_heap_.hpp \
${pb_srcdir}/detail/thin_heap_/trace_fn_imps.hpp \
${pb_srcdir}/detail/tree_policy/node_metadata_selector.hpp \
${pb_srcdir}/detail/tree_policy/null_node_update_imp.hpp \
${pb_srcdir}/detail/tree_policy/order_statistics_imp.hpp \
${pb_srcdir}/detail/tree_policy/sample_tree_node_update.hpp \
${pb_srcdir}/detail/tree_trace_base.hpp \
${pb_srcdir}/detail/trie_policy/node_metadata_selector.hpp \
${pb_srcdir}/detail/trie_policy/null_node_update_imp.hpp \
${pb_srcdir}/detail/trie_policy/order_statistics_imp.hpp \
${pb_srcdir}/detail/trie_policy/prefix_search_node_update_imp.hpp \
${pb_srcdir}/detail/trie_policy/sample_trie_e_access_traits.hpp \
${pb_srcdir}/detail/trie_policy/sample_trie_access_traits.hpp \
${pb_srcdir}/detail/trie_policy/sample_trie_node_update.hpp \
${pb_srcdir}/detail/trie_policy/string_trie_e_access_traits_imp.hpp \
${pb_srcdir}/detail/trie_policy/trie_string_access_traits_imp.hpp \
${pb_srcdir}/detail/trie_policy/trie_policy_base.hpp \
${pb_srcdir}/detail/types_traits.hpp \
${pb_srcdir}/detail/type_utils.hpp \
${pb_srcdir}/detail/unordered_iterator/const_iterator.hpp \
${pb_srcdir}/detail/unordered_iterator/const_point_iterator.hpp \
${pb_srcdir}/detail/unordered_iterator/point_const_iterator.hpp \
${pb_srcdir}/detail/unordered_iterator/iterator.hpp \
${pb_srcdir}/detail/unordered_iterator/point_iterator.hpp

View File

@ -451,7 +451,7 @@ pb_subdirs = \
${pb_builddir}/detail/pairing_heap_ \
${pb_builddir}/detail/splay_tree_ \
${pb_builddir}/detail/list_update_map_ \
${pb_builddir}/detail/basic_tree_policy \
${pb_builddir}/detail/branch_policy \
${pb_builddir}/detail/trie_policy \
${pb_builddir}/detail/gp_hash_table_map_ \
${pb_builddir}/detail/tree_policy \
@ -486,13 +486,12 @@ pb_headers1 = \
${pb_srcdir}/tag_and_trait.hpp \
${pb_srcdir}/tree_policy.hpp \
${pb_srcdir}/trie_policy.hpp \
${pb_srcdir}/detail/basic_tree_policy/basic_tree_policy_base.hpp \
${pb_srcdir}/detail/basic_tree_policy/null_node_metadata.hpp \
${pb_srcdir}/detail/basic_tree_policy/traits.hpp \
${pb_srcdir}/detail/basic_types.hpp \
${pb_srcdir}/detail/branch_policy/branch_policy.hpp \
${pb_srcdir}/detail/branch_policy/null_node_metadata.hpp \
${pb_srcdir}/detail/branch_policy/traits.hpp \
${pb_srcdir}/detail/binary_heap_/binary_heap_.hpp \
${pb_srcdir}/detail/binary_heap_/const_iterator.hpp \
${pb_srcdir}/detail/binary_heap_/const_point_iterator.hpp \
${pb_srcdir}/detail/binary_heap_/point_const_iterator.hpp \
${pb_srcdir}/detail/binary_heap_/constructors_destructor_fn_imps.hpp \
${pb_srcdir}/detail/binary_heap_/debug_fn_imps.hpp \
${pb_srcdir}/detail/binary_heap_/entry_cmp.hpp \
@ -516,9 +515,7 @@ pb_headers1 = \
${pb_srcdir}/detail/binomial_heap_/binomial_heap_.hpp \
${pb_srcdir}/detail/binomial_heap_/constructors_destructor_fn_imps.hpp \
${pb_srcdir}/detail/binomial_heap_/debug_fn_imps.hpp \
${pb_srcdir}/detail/bin_search_tree_/bin_search_tree_.hpp \
${pb_srcdir}/detail/bin_search_tree_/cond_dtor_entry_dealtor.hpp \
${pb_srcdir}/detail/bin_search_tree_/cond_key_dtor_entry_dealtor.hpp
${pb_srcdir}/detail/bin_search_tree_/bin_search_tree_.hpp
pb_headers2 = \
${pb_srcdir}/detail/bin_search_tree_/constructors_destructor_fn_imps.hpp \
@ -609,7 +606,7 @@ pb_headers4 = \
${pb_srcdir}/detail/hash_fn/sample_ranged_probe_fn.hpp \
${pb_srcdir}/detail/hash_fn/sample_range_hashing.hpp \
${pb_srcdir}/detail/left_child_next_sibling_heap_/const_iterator.hpp \
${pb_srcdir}/detail/left_child_next_sibling_heap_/const_point_iterator.hpp \
${pb_srcdir}/detail/left_child_next_sibling_heap_/point_const_iterator.hpp \
${pb_srcdir}/detail/left_child_next_sibling_heap_/constructors_destructor_fn_imps.hpp \
${pb_srcdir}/detail/left_child_next_sibling_heap_/debug_fn_imps.hpp \
${pb_srcdir}/detail/left_child_next_sibling_heap_/erase_fn_imps.hpp \
@ -618,7 +615,6 @@ pb_headers4 = \
${pb_srcdir}/detail/left_child_next_sibling_heap_/iterators_fn_imps.hpp \
${pb_srcdir}/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp \
${pb_srcdir}/detail/left_child_next_sibling_heap_/node.hpp \
${pb_srcdir}/detail/left_child_next_sibling_heap_/null_metadata.hpp \
${pb_srcdir}/detail/left_child_next_sibling_heap_/policy_access_fn_imps.hpp \
${pb_srcdir}/detail/left_child_next_sibling_heap_/trace_fn_imps.hpp \
${pb_srcdir}/detail/list_update_map_/constructor_destructor_fn_imps.hpp \
@ -631,12 +627,9 @@ pb_headers4 = \
${pb_srcdir}/detail/list_update_map_/iterators_fn_imps.hpp \
${pb_srcdir}/detail/list_update_map_/lu_map_.hpp \
${pb_srcdir}/detail/list_update_map_/trace_fn_imps.hpp \
${pb_srcdir}/detail/list_update_policy/counter_lu_metadata.hpp \
${pb_srcdir}/detail/list_update_policy/counter_lu_policy_imp.hpp \
${pb_srcdir}/detail/list_update_policy/mtf_lu_policy_imp.hpp \
${pb_srcdir}/detail/list_update_policy/lu_counter_metadata.hpp \
${pb_srcdir}/detail/list_update_policy/sample_update_policy.hpp \
${pb_srcdir}/detail/debug_map_base.hpp \
${pb_srcdir}/detail/ov_tree_map_/cond_dtor.hpp \
${pb_srcdir}/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp \
${pb_srcdir}/detail/ov_tree_map_/debug_fn_imps.hpp \
${pb_srcdir}/detail/ov_tree_map_/erase_fn_imps.hpp \
@ -657,30 +650,20 @@ pb_headers5 = \
${pb_srcdir}/detail/pairing_heap_/insert_fn_imps.hpp \
${pb_srcdir}/detail/pairing_heap_/pairing_heap_.hpp \
${pb_srcdir}/detail/pairing_heap_/split_join_fn_imps.hpp \
${pb_srcdir}/detail/pat_trie_/child_iterator.hpp \
${pb_srcdir}/detail/pat_trie_/cond_dtor_entry_dealtor.hpp \
${pb_srcdir}/detail/pat_trie_/const_child_iterator.hpp \
${pb_srcdir}/detail/pat_trie_/constructors_destructor_fn_imps.hpp \
${pb_srcdir}/detail/pat_trie_/debug_fn_imps.hpp \
${pb_srcdir}/detail/pat_trie_/erase_fn_imps.hpp \
${pb_srcdir}/detail/pat_trie_/find_fn_imps.hpp \
${pb_srcdir}/detail/pat_trie_/head.hpp \
${pb_srcdir}/detail/pat_trie_/info_fn_imps.hpp \
${pb_srcdir}/detail/pat_trie_/insert_join_fn_imps.hpp \
${pb_srcdir}/detail/pat_trie_/internal_node.hpp \
${pb_srcdir}/detail/pat_trie_/iterators_fn_imps.hpp \
${pb_srcdir}/detail/pat_trie_/leaf.hpp \
${pb_srcdir}/detail/pat_trie_/node_base.hpp \
${pb_srcdir}/detail/pat_trie_/node_iterators.hpp \
${pb_srcdir}/detail/pat_trie_/node_metadata_base.hpp \
${pb_srcdir}/detail/pat_trie_/pat_trie_.hpp \
${pb_srcdir}/detail/pat_trie_/point_iterators.hpp \
${pb_srcdir}/detail/pat_trie_/pat_trie_base.hpp \
${pb_srcdir}/detail/pat_trie_/policy_access_fn_imps.hpp \
${pb_srcdir}/detail/pat_trie_/r_erase_fn_imps.hpp \
${pb_srcdir}/detail/pat_trie_/rotate_fn_imps.hpp \
${pb_srcdir}/detail/pat_trie_/split_fn_imps.hpp \
${pb_srcdir}/detail/pat_trie_/split_join_branch_bag.hpp \
${pb_srcdir}/detail/pat_trie_/synth_e_access_traits.hpp \
${pb_srcdir}/detail/pat_trie_/synth_access_traits.hpp \
${pb_srcdir}/detail/pat_trie_/trace_fn_imps.hpp \
${pb_srcdir}/detail/pat_trie_/traits.hpp \
${pb_srcdir}/detail/pat_trie_/update_fn_imps.hpp \
@ -737,22 +720,20 @@ pb_headers7 = \
${pb_srcdir}/detail/thin_heap_/thin_heap_.hpp \
${pb_srcdir}/detail/thin_heap_/trace_fn_imps.hpp \
${pb_srcdir}/detail/tree_policy/node_metadata_selector.hpp \
${pb_srcdir}/detail/tree_policy/null_node_update_imp.hpp \
${pb_srcdir}/detail/tree_policy/order_statistics_imp.hpp \
${pb_srcdir}/detail/tree_policy/sample_tree_node_update.hpp \
${pb_srcdir}/detail/tree_trace_base.hpp \
${pb_srcdir}/detail/trie_policy/node_metadata_selector.hpp \
${pb_srcdir}/detail/trie_policy/null_node_update_imp.hpp \
${pb_srcdir}/detail/trie_policy/order_statistics_imp.hpp \
${pb_srcdir}/detail/trie_policy/prefix_search_node_update_imp.hpp \
${pb_srcdir}/detail/trie_policy/sample_trie_e_access_traits.hpp \
${pb_srcdir}/detail/trie_policy/sample_trie_access_traits.hpp \
${pb_srcdir}/detail/trie_policy/sample_trie_node_update.hpp \
${pb_srcdir}/detail/trie_policy/string_trie_e_access_traits_imp.hpp \
${pb_srcdir}/detail/trie_policy/trie_string_access_traits_imp.hpp \
${pb_srcdir}/detail/trie_policy/trie_policy_base.hpp \
${pb_srcdir}/detail/types_traits.hpp \
${pb_srcdir}/detail/type_utils.hpp \
${pb_srcdir}/detail/unordered_iterator/const_iterator.hpp \
${pb_srcdir}/detail/unordered_iterator/const_point_iterator.hpp \
${pb_srcdir}/detail/unordered_iterator/point_const_iterator.hpp \
${pb_srcdir}/detail/unordered_iterator/iterator.hpp \
${pb_srcdir}/detail/unordered_iterator/point_iterator.hpp

View File

@ -1,6 +1,6 @@
// -*- C++ -*-
// Copyright (C) 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
// Copyright (C) 2005, 2006, 2009, 2010, 2011 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@ -46,90 +46,20 @@
#include <ext/pb_ds/tag_and_trait.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/detail/container_base_dispatch.hpp>
#include <ext/pb_ds/detail/basic_tree_policy/traits.hpp>
#include <ext/pb_ds/detail/branch_policy/traits.hpp>
namespace __gnu_pbds
{
/** @defgroup pbds Policy-Based Data Structures
* @ingroup extensions
*
* This is a library of policy-based elementary data structures:
* associative containers and priority queues. It is designed for
* high-performance, flexibility, semantic safety, and conformance
* to the corresponding containers in std (except for some points
* where it differs by design).
*
* For details, see:
* http://gcc.gnu.org/onlinedocs/libstdc++/ext/pb_ds/index.html
*
/**
* @addtogroup pbds
* @{
*/
#define PB_DS_BASE_C_DEC \
detail::container_base_dispatch<Key, Mapped, Tag, Policy_Tl, Allocator>::type
/// An abstract basic associative container.
template<typename Key,
typename Mapped,
typename Tag,
typename Policy_Tl,
typename Allocator>
class container_base : public PB_DS_BASE_C_DEC
{
private:
typedef typename PB_DS_BASE_C_DEC base_type;
public:
typedef Tag container_category;
typedef Allocator allocator_type;
typedef typename allocator_type::size_type size_type;
typedef typename allocator_type::difference_type difference_type;
// key_type
typedef typename allocator_type::template rebind<Key>::other::value_type key_type;
typedef typename allocator_type::template rebind<key_type>::other key_rebind;
typedef typename key_rebind::reference key_reference;
typedef typename key_rebind::const_reference const_key_reference;
typedef typename key_rebind::pointer key_pointer;
typedef typename key_rebind::const_pointer const_key_pointer;
// mapped_type
typedef Mapped mapped_type;
typedef typename allocator_type::template rebind<mapped_type>::other mapped_rebind;
typedef typename mapped_rebind::reference mapped_reference;
typedef typename mapped_rebind::const_reference const_mapped_reference;
typedef typename mapped_rebind::pointer mapped_pointer;
typedef typename mapped_rebind::const_pointer const_mapped_pointer;
// value_type
typedef typename base_type::value_type value_type;
typedef typename allocator_type::template rebind<value_type>::other value_rebind;
typedef typename value_rebind::reference reference;
typedef typename value_rebind::const_reference const_reference;
typedef typename value_rebind::pointer pointer;
typedef typename value_rebind::const_pointer const_pointer;
// iterators
typedef typename base_type::iterator iterator;
typedef typename base_type::const_iterator const_iterator;
typedef typename base_type::point_iterator point_iterator;
typedef typename base_type::const_point_iterator const_point_iterator;
virtual
~container_base() { }
protected:
#define PB_DS_CLASS_NAME container_base
#include <ext/pb_ds/detail/constructors_destructor_fn_imps.hpp>
#undef PB_DS_CLASS_NAME
};
#undef PB_DS_BASE_C_DEC
#define PB_DS_BASE_C_DEC \
container_base<Key, Mapped, Tag, typename __gnu_cxx::typelist::append< \
typename __gnu_cxx::typelist::create4<Hash_Fn, Eq_Fn, Resize_Policy, detail::integral_constant<int, Store_Hash> >::type, Policy_TL>::type, Allocator>
#define PB_DS_HASH_BASE \
detail::container_base_dispatch<Key, Mapped, _Alloc, Tag, \
typename __gnu_cxx::typelist::append< \
typename __gnu_cxx::typelist::create4<Hash_Fn, Eq_Fn, Resize_Policy, \
detail::integral_constant<int, Store_Hash> >::type, Policy_Tl>::type>::type
/// An abstract basic hash-based associative container.
template<typename Key,
@ -139,12 +69,12 @@ namespace __gnu_pbds
typename Resize_Policy,
bool Store_Hash,
typename Tag,
typename Policy_TL,
typename Allocator>
class basic_hash_table : public PB_DS_BASE_C_DEC
typename Policy_Tl,
typename _Alloc>
class basic_hash_table : public PB_DS_HASH_BASE
{
private:
typedef PB_DS_BASE_C_DEC base_type;
typedef typename PB_DS_HASH_BASE base_type;
public:
virtual
@ -156,17 +86,17 @@ namespace __gnu_pbds
#undef PB_DS_CLASS_NAME
private:
basic_hash_table&
basic_hash_table&
operator=(const base_type&);
};
#undef PB_DS_BASE_C_DEC
#undef PB_DS_HASH_BASE
#define PB_DS_BASE_C_DEC \
#define PB_DS_CC_HASH_BASE \
basic_hash_table<Key, Mapped, Hash_Fn, Eq_Fn, Resize_Policy, Store_Hash, \
cc_hash_tag, \
typename __gnu_cxx::typelist::create1<Comb_Hash_Fn>::type, Allocator>
typename __gnu_cxx::typelist::create1<Comb_Hash_Fn>::type, _Alloc>
/// A concrete collision-chaining hash-based associative container.
template<typename Key,
@ -176,24 +106,25 @@ namespace __gnu_pbds
typename Comb_Hash_Fn = detail::default_comb_hash_fn::type,
typename Resize_Policy = typename detail::default_resize_policy<Comb_Hash_Fn>::type,
bool Store_Hash = detail::default_store_hash,
typename Allocator = std::allocator<char> >
class cc_hash_table : public PB_DS_BASE_C_DEC
typename _Alloc = std::allocator<char> >
class cc_hash_table : public PB_DS_CC_HASH_BASE
{
private:
typedef PB_DS_BASE_C_DEC base_type;
typedef PB_DS_CC_HASH_BASE base_type;
public:
typedef Hash_Fn hash_fn;
typedef Eq_Fn eq_fn;
typedef Resize_Policy resize_policy;
typedef Comb_Hash_Fn comb_hash_fn;
typedef cc_hash_tag container_category;
typedef Hash_Fn hash_fn;
typedef Eq_Fn eq_fn;
typedef Resize_Policy resize_policy;
typedef Comb_Hash_Fn comb_hash_fn;
// Default constructor.
cc_hash_table() { }
// Constructor taking some policy objects. r_hash_fn will be
// copied by the Hash_Fn object of the container object.
cc_hash_table(const hash_fn& h)
cc_hash_table(const hash_fn& h)
: base_type(h) { }
// Constructor taking some policy objects. r_hash_fn will be
@ -217,8 +148,8 @@ namespace __gnu_pbds
// r_comb_hash_fn will be copied by the comb_hash_fn object of the
// container object, and r_resize_policy will be copied by the
// resize_policy object of the container object.
cc_hash_table(const hash_fn& h, const eq_fn& e, const comb_hash_fn& ch,
const resize_policy& rp)
cc_hash_table(const hash_fn& h, const eq_fn& e, const comb_hash_fn& ch,
const resize_policy& rp)
: base_type(h, e, ch, rp) { }
// Constructor taking __iterators to a range of value_types. The
@ -269,7 +200,7 @@ namespace __gnu_pbds
// object of the container object, and r_resize_policy will be
// copied by the resize_policy object of the container object.
template<typename It>
cc_hash_table(It first, It last, const hash_fn& h, const eq_fn& e,
cc_hash_table(It first, It last, const hash_fn& h, const eq_fn& e,
const comb_hash_fn& ch, const resize_policy& rp)
: base_type(h, e, ch, rp)
{ this->copy_from_range(first, last); }
@ -281,7 +212,7 @@ namespace __gnu_pbds
virtual
~cc_hash_table() { }
cc_hash_table&
cc_hash_table&
operator=(const cc_hash_table& other)
{
if (this != &other)
@ -297,13 +228,13 @@ namespace __gnu_pbds
{ base_type::swap(other); }
};
#undef PB_DS_BASE_C_DEC
#undef PB_DS_CC_HASH_BASE
#define PB_DS_BASE_C_DEC \
#define PB_DS_GP_HASH_BASE \
basic_hash_table<Key, Mapped, Hash_Fn, Eq_Fn, Resize_Policy, Store_Hash, \
gp_hash_tag, \
typename __gnu_cxx::typelist::create2<Comb_Probe_Fn, Probe_Fn>::type, Allocator>
typename __gnu_cxx::typelist::create2<Comb_Probe_Fn, Probe_Fn>::type, _Alloc>
/// A concrete general-probing hash-based associative container.
template<typename Key,
@ -314,18 +245,19 @@ namespace __gnu_pbds
typename Probe_Fn = typename detail::default_probe_fn<Comb_Probe_Fn>::type,
typename Resize_Policy = typename detail::default_resize_policy<Comb_Probe_Fn>::type,
bool Store_Hash = detail::default_store_hash,
typename Allocator = std::allocator<char> >
class gp_hash_table : public PB_DS_BASE_C_DEC
typename _Alloc = std::allocator<char> >
class gp_hash_table : public PB_DS_GP_HASH_BASE
{
private:
typedef PB_DS_BASE_C_DEC base_type;
typedef PB_DS_GP_HASH_BASE base_type;
public:
typedef Hash_Fn hash_fn;
typedef Eq_Fn eq_fn;
typedef Comb_Probe_Fn comb_probe_fn;
typedef Probe_Fn probe_fn;
typedef Resize_Policy resize_policy;
typedef gp_hash_tag container_category;
typedef Hash_Fn hash_fn;
typedef Eq_Fn eq_fn;
typedef Comb_Probe_Fn comb_probe_fn;
typedef Probe_Fn probe_fn;
typedef Resize_Policy resize_policy;
// Default constructor.
gp_hash_table() { }
@ -356,7 +288,7 @@ namespace __gnu_pbds
// r_comb_probe_fn will be copied by the comb_probe_fn object of
// the container object, and r_probe_fn will be copied by the
// probe_fn object of the container object.
gp_hash_table(const hash_fn& h, const eq_fn& e, const comb_probe_fn& cp,
gp_hash_table(const hash_fn& h, const eq_fn& e, const comb_probe_fn& cp,
const probe_fn& p)
: base_type(h, e, cp, p) { }
@ -367,7 +299,7 @@ namespace __gnu_pbds
// the container object, r_probe_fn will be copied by the probe_fn
// object of the container object, and r_resize_policy will be
// copied by the Resize_Policy object of the container object.
gp_hash_table(const hash_fn& h, const eq_fn& e, const comb_probe_fn& cp,
gp_hash_table(const hash_fn& h, const eq_fn& e, const comb_probe_fn& cp,
const probe_fn& p, const resize_policy& rp)
: base_type(h, e, cp, p, rp) { }
@ -406,7 +338,7 @@ namespace __gnu_pbds
// object, and r_comb_probe_fn will be copied by the comb_probe_fn
// object of the container object.
template<typename It>
gp_hash_table(It first, It last, const hash_fn& h, const eq_fn& e,
gp_hash_table(It first, It last, const hash_fn& h, const eq_fn& e,
const comb_probe_fn& cp)
: base_type(h, e, cp)
{ base_type::copy_from_range(first, last); }
@ -420,7 +352,7 @@ namespace __gnu_pbds
// object of the container object, and r_probe_fn will be copied
// by the probe_fn object of the container object.
template<typename It>
gp_hash_table(It first, It last, const hash_fn& h, const eq_fn& e,
gp_hash_table(It first, It last, const hash_fn& h, const eq_fn& e,
const comb_probe_fn& cp, const probe_fn& p)
: base_type(h, e, cp, p)
{ base_type::copy_from_range(first, last); }
@ -436,8 +368,8 @@ namespace __gnu_pbds
// r_resize_policy will be copied by the resize_policy object of
// the container object.
template<typename It>
gp_hash_table(It first, It last, const hash_fn& h, const eq_fn& e,
const comb_probe_fn& cp, const probe_fn& p,
gp_hash_table(It first, It last, const hash_fn& h, const eq_fn& e,
const comb_probe_fn& cp, const probe_fn& p,
const resize_policy& rp)
: base_type(h, e, cp, p, rp)
{ base_type::copy_from_range(first, last); }
@ -449,7 +381,7 @@ namespace __gnu_pbds
virtual
~gp_hash_table() { }
gp_hash_table&
gp_hash_table&
operator=(const gp_hash_table& other)
{
if (this != &other)
@ -465,56 +397,58 @@ namespace __gnu_pbds
{ base_type::swap(other); }
};
#undef PB_DS_BASE_C_DEC
#undef PB_DS_GP_HASH_BASE
#define PB_DS_BASE_C_DEC \
container_base<Key, Mapped, Tag, Policy_Tl, Allocator>
#define PB_DS_BRANCH_BASE \
detail::container_base_dispatch<Key, Mapped, _Alloc, Tag, Policy_Tl>::type
/// An abstract basic tree-like (tree, trie) associative container.
template<typename Key, typename Mapped, typename Tag,
typename Node_Update, typename Policy_Tl, typename Allocator>
class basic_tree : public PB_DS_BASE_C_DEC
template<typename Key, typename Mapped, typename Tag,
typename Node_Update, typename Policy_Tl, typename _Alloc>
class basic_branch : public PB_DS_BRANCH_BASE
{
private:
typedef PB_DS_BASE_C_DEC base_type;
typedef typename PB_DS_BRANCH_BASE base_type;
public:
typedef Node_Update node_update;
typedef Node_Update node_update;
virtual
~basic_tree() { }
~basic_branch() { }
protected:
#define PB_DS_CLASS_NAME basic_tree
#define PB_DS_CLASS_NAME basic_branch
#include <ext/pb_ds/detail/constructors_destructor_fn_imps.hpp>
#undef PB_DS_CLASS_NAME
};
#undef PB_DS_BASE_C_DEC
#undef PB_DS_BRANCH_BASE
#define PB_DS_TREE_NODE_AND_IT_TRAITS_C_DEC \
detail::tree_traits<Key, Mapped,Cmp_Fn,Node_Update,Tag, Allocator>
#define PB_DS_TREE_NODE_AND_IT_TRAITS \
detail::tree_traits<Key, Mapped,Cmp_Fn,Node_Update,Tag,_Alloc>
#define PB_DS_BASE_C_DEC \
basic_tree<Key,Mapped,Tag,typename PB_DS_TREE_NODE_AND_IT_TRAITS_C_DEC::node_update, \
typename __gnu_cxx::typelist::create2<Cmp_Fn, PB_DS_TREE_NODE_AND_IT_TRAITS_C_DEC >::type, Allocator>
#define PB_DS_TREE_BASE \
basic_branch<Key,Mapped, Tag, \
typename PB_DS_TREE_NODE_AND_IT_TRAITS::node_update, \
typename __gnu_cxx::typelist::create2<Cmp_Fn, \
PB_DS_TREE_NODE_AND_IT_TRAITS>::type, _Alloc>
/// A concrete basic tree-based associative container.
/// A basic tree-based associative container.
template<typename Key, typename Mapped, typename Cmp_Fn = std::less<Key>,
typename Tag = rb_tree_tag,
template<typename Const_Node_Iterator, typename Node_Iterator, typename Cmp_Fn_, typename Allocator_>
class Node_Update = __gnu_pbds::null_tree_node_update,
typename Allocator = std::allocator<char> >
class tree : public PB_DS_BASE_C_DEC
template<typename Node_CItr, typename Node_Itr,
typename Cmp_Fn_, typename _Alloc_>
class Node_Update = null_node_update,
typename _Alloc = std::allocator<char> >
class tree : public PB_DS_TREE_BASE
{
private:
typedef PB_DS_BASE_C_DEC base_type;
typedef PB_DS_TREE_BASE base_type;
public:
// Comparison functor type.
typedef Cmp_Fn cmp_fn;
typedef Cmp_Fn cmp_fn;
tree() { }
@ -545,7 +479,7 @@ namespace __gnu_pbds
virtual
~tree() { }
tree&
tree&
operator=(const tree& other)
{
if (this != &other)
@ -561,43 +495,46 @@ namespace __gnu_pbds
{ base_type::swap(other); }
};
#undef PB_DS_BASE_C_DEC
#undef PB_DS_TREE_NODE_AND_IT_TRAITS_C_DEC
#undef PB_DS_TREE_BASE
#undef PB_DS_TREE_NODE_AND_IT_TRAITS
#define PB_DS_TRIE_NODE_AND_ITS_TRAITS \
detail::trie_traits<Key,Mapped,E_Access_Traits,Node_Update,Tag,Allocator>
#define PB_DS_TRIE_NODE_AND_IT_TRAITS \
detail::trie_traits<Key,Mapped,_ATraits,Node_Update,Tag,_Alloc>
#define PB_DS_BASE_C_DEC \
basic_tree<Key,Mapped,Tag, typename PB_DS_TRIE_NODE_AND_ITS_TRAITS::node_update, \
typename __gnu_cxx::typelist::create2<E_Access_Traits, PB_DS_TRIE_NODE_AND_ITS_TRAITS >::type, Allocator>
#define PB_DS_TRIE_BASE \
basic_branch<Key,Mapped,Tag, \
typename PB_DS_TRIE_NODE_AND_IT_TRAITS::node_update, \
typename __gnu_cxx::typelist::create2<_ATraits, \
PB_DS_TRIE_NODE_AND_IT_TRAITS >::type, _Alloc>
/// A concrete basic trie-based associative container.
/// A basic trie-based associative container.
template<typename Key,
typename Mapped,
typename E_Access_Traits = typename detail::default_trie_e_access_traits<Key>::type,
typename _ATraits = \
typename detail::default_trie_access_traits<Key>::type,
typename Tag = pat_trie_tag,
template<typename Const_Node_Iterator,
typename Node_Iterator,
typename E_Access_Traits_,
typename Allocator_>
class Node_Update = null_trie_node_update,
typename Allocator = std::allocator<char> >
class trie : public PB_DS_BASE_C_DEC
template<typename Node_CItr,
typename Node_Itr,
typename _ATraits_,
typename _Alloc_>
class Node_Update = null_node_update,
typename _Alloc = std::allocator<char> >
class trie : public PB_DS_TRIE_BASE
{
private:
typedef PB_DS_BASE_C_DEC base_type;
typedef PB_DS_TRIE_BASE base_type;
public:
// Element access traits type.
typedef E_Access_Traits e_access_traits;
typedef _ATraits access_traits;
trie() { }
// Constructor taking some policy objects. r_e_access_traits will
// be copied by the E_Access_Traits object of the container
// Constructor taking some policy objects. r_access_traits will
// be copied by the _ATraits object of the container
// object.
trie(const e_access_traits& t)
trie(const access_traits& t)
: base_type(t) { }
// Constructor taking __iterators to a range of value_types. The
@ -611,7 +548,7 @@ namespace __gnu_pbds
// some policy objects. The value_types between first_it and
// last_it will be inserted into the container object.
template<typename It>
trie(It first, It last, const e_access_traits& t)
trie(It first, It last, const access_traits& t)
: base_type(t)
{ base_type::copy_from_range(first, last); }
@ -621,7 +558,7 @@ namespace __gnu_pbds
virtual
~trie() { }
trie&
trie&
operator=(const trie& other)
{
if (this != &other)
@ -637,29 +574,29 @@ namespace __gnu_pbds
{ base_type::swap(other); }
};
#undef PB_DS_BASE_C_DEC
#undef PB_DS_TRIE_NODE_AND_ITS_TRAITS
#undef PB_DS_TRIE_BASE
#undef PB_DS_TRIE_NODE_AND_IT_TRAITS
#define PB_DS_BASE_C_DEC \
container_base<Key, Mapped, list_update_tag, \
typename __gnu_cxx::typelist::create2<Eq_Fn, Update_Policy>::type, Allocator>
#define PB_DS_LU_BASE \
detail::container_base_dispatch<Key, Mapped, _Alloc, list_update_tag, \
typename __gnu_cxx::typelist::create2<Eq_Fn, Update_Policy>::type>::type
/// A list-update based associative container.
template<typename Key,
typename Mapped,
class Eq_Fn = typename detail::default_eq_fn<Key>::type,
class Update_Policy = detail::default_update_policy::type,
class Allocator = std::allocator<char> >
class list_update : public PB_DS_BASE_C_DEC
class _Alloc = std::allocator<char> >
class list_update : public PB_DS_LU_BASE
{
private:
typedef PB_DS_BASE_C_DEC base_type;
typedef typename PB_DS_LU_BASE base_type;
public:
typedef Eq_Fn eq_fn;
typedef Update_Policy update_policy;
typedef Allocator allocator;
typedef list_update_tag container_category;
typedef Eq_Fn eq_fn;
typedef Update_Policy update_policy;
list_update() { }
@ -676,7 +613,7 @@ namespace __gnu_pbds
virtual
~list_update() { }
list_update&
list_update&
operator=(const list_update& other)
{
if (this !=& other)
@ -692,9 +629,9 @@ namespace __gnu_pbds
{ base_type::swap(other); }
};
#undef PB_DS_BASE_C_DEC
#undef PB_DS_LU_BASE
// @} group pbds
} // namespace __gnu_pbds
#endif
#endif

View File

@ -1,211 +0,0 @@
// -*- C++ -*-
// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the terms
// of the GNU General Public License as published by the Free Software
// Foundation; either version 3, or (at your option) any later
// version.
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
// Permission to use, copy, modify, sell, and distribute this software
// is hereby granted without fee, provided that the above copyright
// notice appears in all copies, and that both that copyright notice
// and this permission notice appear in supporting documentation. None
// of the above authors, nor IBM Haifa Research Laboratories, make any
// representation about the suitability of this software for any
// purpose. It is provided "as is" without express or implied
// warranty.
/**
* @file basic_types.hpp
* Contains basic types used by containers.
*/
#ifndef PB_DS_BASIC_TYPES_HPP
#define PB_DS_BASIC_TYPES_HPP
#include <algorithm>
#include <utility>
#include <ext/pb_ds/tag_and_trait.hpp>
#include <ext/pb_ds/detail/type_utils.hpp>
namespace __gnu_pbds
{
namespace detail
{
template<typename Key, typename Mapped, typename Allocator, bool Store_Hash>
struct value_type_base;
/**
* Specialization of value_type_base for the case where the hash value
* is not stored alongside each value.
**/
template<typename Key, typename Mapped, typename Allocator>
struct value_type_base<Key, Mapped, Allocator, false>
{
typedef typename Allocator::template rebind<Mapped>::other mapped_type_allocator;
typedef typename mapped_type_allocator::value_type mapped_type;
typedef typename mapped_type_allocator::pointer mapped_pointer;
typedef typename mapped_type_allocator::const_pointer const_mapped_pointer;
typedef typename mapped_type_allocator::reference mapped_reference;
typedef typename mapped_type_allocator::const_reference const_mapped_reference;
typedef typename Allocator::template rebind<std::pair<const Key, Mapped> >::other value_type_allocator;
typedef typename value_type_allocator::value_type value_type;
typedef typename value_type_allocator::pointer pointer;
typedef typename value_type_allocator::const_pointer const_pointer;
typedef typename value_type_allocator::reference reference;
typedef typename value_type_allocator::const_reference const_reference;
struct stored_value_type
{
value_type m_value;
};
};
/**
* Specialization of value_type_base for the case where the hash value
* is stored alongside each value.
**/
template<typename Key, typename Mapped, typename Allocator>
struct value_type_base<Key, Mapped, Allocator, true>
{
typedef typename Allocator::template rebind<Mapped>::other mapped_type_allocator;
typedef typename mapped_type_allocator::value_type mapped_type;
typedef typename mapped_type_allocator::pointer mapped_pointer;
typedef typename mapped_type_allocator::const_pointer const_mapped_pointer;
typedef typename mapped_type_allocator::reference mapped_reference;
typedef typename mapped_type_allocator::const_reference const_mapped_reference;
typedef typename Allocator::template rebind<std::pair<const Key, Mapped> >::other value_type_allocator;
typedef typename value_type_allocator::value_type value_type;
typedef typename value_type_allocator::pointer pointer;
typedef typename value_type_allocator::const_pointer const_pointer;
typedef typename value_type_allocator::reference reference;
typedef typename value_type_allocator::const_reference const_reference;
struct stored_value_type
{
value_type m_value;
typename Allocator::size_type m_hash;
};
};
#define PB_DS_CLASS_T_DEC \
template<typename Key, typename Allocator>
#define PB_DS_CLASS_C_DEC \
value_type_base<Key, null_mapped_type, Allocator, false>
/**
* Specialization of value_type_base for the case where the hash value
* is not stored alongside each value.
**/
template<typename Key, typename Allocator>
struct value_type_base<Key, null_mapped_type, Allocator, false>
{
typedef typename Allocator::template rebind<null_mapped_type>::other mapped_type_allocator;
typedef typename mapped_type_allocator::value_type mapped_type;
typedef typename mapped_type_allocator::pointer mapped_pointer;
typedef typename mapped_type_allocator::const_pointer const_mapped_pointer;
typedef typename mapped_type_allocator::reference mapped_reference;
typedef typename mapped_type_allocator::const_reference const_mapped_reference;
typedef Key value_type;
typedef typename Allocator::template rebind<value_type>::other value_type_allocator;
typedef typename value_type_allocator::pointer pointer;
typedef typename value_type_allocator::const_pointer const_pointer;
typedef typename value_type_allocator::reference reference;
typedef typename value_type_allocator::const_reference const_reference;
struct stored_value_type
{
value_type m_value;
};
static null_mapped_type s_null_mapped;
};
PB_DS_CLASS_T_DEC
null_mapped_type PB_DS_CLASS_C_DEC::s_null_mapped;
#undef PB_DS_CLASS_T_DEC
#undef PB_DS_CLASS_C_DEC
#define PB_DS_CLASS_T_DEC \
template<typename Key, typename Allocator>
#define PB_DS_CLASS_C_DEC \
value_type_base<Key, null_mapped_type, Allocator, true>
/**
* Specialization of value_type_base for the case where the hash value
* is stored alongside each value.
**/
template<typename Key, typename Allocator>
struct value_type_base<Key, null_mapped_type, Allocator, true>
{
typedef typename Allocator::template rebind<null_mapped_type>::other mapped_type_allocator;
typedef typename mapped_type_allocator::value_type mapped_type;
typedef typename mapped_type_allocator::pointer mapped_pointer;
typedef typename mapped_type_allocator::const_pointer const_mapped_pointer;
typedef typename mapped_type_allocator::reference mapped_reference;
typedef typename mapped_type_allocator::const_reference const_mapped_reference;
typedef Key value_type;
typedef typename Allocator::template rebind<value_type>::other value_type_allocator;
typedef typename value_type_allocator::pointer pointer;
typedef typename value_type_allocator::const_pointer const_pointer;
typedef typename value_type_allocator::reference reference;
typedef typename value_type_allocator::const_reference const_reference;
struct stored_value_type
{
value_type m_value;
typename Allocator::size_type m_hash;
};
static null_mapped_type s_null_mapped;
};
PB_DS_CLASS_T_DEC
null_mapped_type PB_DS_CLASS_C_DEC::s_null_mapped;
#undef PB_DS_CLASS_T_DEC
#undef PB_DS_CLASS_C_DEC
template<typename Key, typename Mapped>
struct no_throw_copies
{
typedef integral_constant<int, is_simple<Key>::value && is_simple<Mapped>::value> indicator;
};
template<typename Key>
struct no_throw_copies<Key, null_mapped_type>
{
typedef integral_constant<int, is_simple<Key>::value> indicator;
};
} // namespace detail
} // namespace __gnu_pbds
#endif

View File

@ -34,22 +34,20 @@
// warranty.
/**
* @file bin_search_tree_.hpp
* Contains an implementation class for bin_search_tree_.
*/
/*
* This implementation uses an idea from the SGI STL (using a @a header node
* which is needed for efficient iteration).
* @file bin_search_tree_/bin_search_tree_.hpp
* Contains an implementation class for binary search tree.
*/
#include <ext/pb_ds/exception.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/eq_fn/eq_by_less.hpp>
#include <ext/pb_ds/detail/types_traits.hpp>
#include <ext/pb_ds/detail/debug_map_base.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/cond_dealtor.hpp>
#include <ext/pb_ds/detail/type_utils.hpp>
#include <ext/pb_ds/detail/tree_trace_base.hpp>
#ifdef _GLIBCXX_DEBUG
#include <ext/pb_ds/detail/debug_map_base.hpp>
#endif
#include <utility>
#include <functional>
#include <debug/debug.h>
@ -58,201 +56,129 @@ namespace __gnu_pbds
{
namespace detail
{
#define PB_DS_CLASS_T_DEC \
template<typename Key, typename Mapped, class Cmp_Fn, \
class Node_And_It_Traits, class Allocator>
#ifdef PB_DS_DATA_TRUE_INDICATOR
#define PB_DS_CLASS_NAME \
bin_search_tree_data_
#endif
#define PB_DS_BIN_TREE_NAME bin_search_tree_map
#endif
#ifdef PB_DS_DATA_FALSE_INDICATOR
#define PB_DS_CLASS_NAME \
bin_search_tree_no_data_
#endif
#define PB_DS_BIN_TREE_NAME bin_search_tree_set
#endif
#define PB_DS_CLASS_C_DEC \
PB_DS_CLASS_NAME< \
Key, \
Mapped, \
Cmp_Fn, \
Node_And_It_Traits, \
Allocator>
#define PB_DS_CLASS_T_DEC \
template<typename Key, typename Mapped, typename Cmp_Fn, \
typename Node_And_It_Traits, typename _Alloc>
#define PB_DS_TYPES_TRAITS_C_DEC \
types_traits< \
Key, \
Mapped, \
Allocator, \
false>
#define PB_DS_CLASS_C_DEC \
PB_DS_BIN_TREE_NAME<Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc>
#define PB_DS_BIN_TREE_TRAITS_BASE \
types_traits<Key, Mapped, _Alloc, false>
#ifdef _GLIBCXX_DEBUG
#define PB_DS_DEBUG_MAP_BASE_C_DEC \
#define PB_DS_DEBUG_MAP_BASE_C_DEC \
debug_map_base<Key, eq_by_less<Key, Cmp_Fn>, \
typename Allocator::template rebind<Key>::other::const_reference>
#endif
#ifdef PB_DS_DATA_TRUE_INDICATOR
#define PB_DS_V2F(X) (X).first
#define PB_DS_V2S(X) (X).second
#define PB_DS_EP2VP(X)& ((X)->m_value)
#endif
#ifdef PB_DS_DATA_FALSE_INDICATOR
#define PB_DS_V2F(X) (X)
#define PB_DS_V2S(X) Mapped_Data()
#define PB_DS_EP2VP(X)& ((X)->m_value.first)
#endif
typename _Alloc::template rebind<Key>::other::const_reference>
#endif
#ifdef PB_DS_TREE_TRACE
#define PB_DS_TREE_TRACE_BASE_C_DEC \
tree_trace_base< \
typename Node_And_It_Traits::const_node_iterator, \
typename Node_And_It_Traits::node_iterator, \
Cmp_Fn, \
true, \
Allocator>
#endif
#define PB_DS_TREE_TRACE_BASE_C_DEC \
tree_trace_base<typename Node_And_It_Traits::node_const_iterator, \
typename Node_And_It_Traits::node_iterator, \
Cmp_Fn, true, _Alloc>
#endif
/**
* class description = "8i|\|4ree $34rc|-| 7r33 74813.">
**/
template<typename Key,
typename Mapped,
class Cmp_Fn,
class Node_And_It_Traits,
class Allocator>
class PB_DS_CLASS_NAME :
/*
* @brief Binary search tree (BST).
*
* This implementation uses an idea from the SGI STL (using a @a
* header node which is needed for efficient iteration).
*/
template<typename Key, typename Mapped, typename Cmp_Fn,
typename Node_And_It_Traits, typename _Alloc>
class PB_DS_BIN_TREE_NAME :
#ifdef _GLIBCXX_DEBUG
public PB_DS_DEBUG_MAP_BASE_C_DEC,
#endif
#endif
#ifdef PB_DS_TREE_TRACE
public PB_DS_TREE_TRACE_BASE_C_DEC,
#endif
#endif
public Cmp_Fn,
public PB_DS_TYPES_TRAITS_C_DEC,
public PB_DS_BIN_TREE_TRAITS_BASE,
public Node_And_It_Traits::node_update
{
typedef Node_And_It_Traits traits_type;
protected:
typedef PB_DS_BIN_TREE_TRAITS_BASE traits_base;
typedef
typename Allocator::template rebind<
typename Node_And_It_Traits::node>::other
typename _Alloc::template rebind<typename traits_type::node>::other
node_allocator;
typedef typename node_allocator::value_type node;
typedef typename node_allocator::value_type node;
typedef typename node_allocator::pointer node_pointer;
typedef typename node_allocator::pointer node_pointer;
typedef PB_DS_TYPES_TRAITS_C_DEC traits_base;
typedef
typename Node_And_It_Traits::null_node_update_pointer
typedef typename traits_type::null_node_update_pointer
null_node_update_pointer;
private:
typedef cond_dealtor< node, Allocator> cond_dealtor_t;
typedef cond_dealtor<node, _Alloc> cond_dealtor_t;
#ifdef _GLIBCXX_DEBUG
typedef PB_DS_DEBUG_MAP_BASE_C_DEC debug_base;
#endif
typedef PB_DS_DEBUG_MAP_BASE_C_DEC debug_base;
#endif
public:
typedef typename Allocator::size_type size_type;
typedef typename Allocator::difference_type difference_type;
typedef typename PB_DS_TYPES_TRAITS_C_DEC::key_type key_type;
typedef typename PB_DS_TYPES_TRAITS_C_DEC::key_pointer key_pointer;
typedef
typename PB_DS_TYPES_TRAITS_C_DEC::const_key_pointer
const_key_pointer;
typedef typename PB_DS_TYPES_TRAITS_C_DEC::key_reference key_reference;
typedef
typename PB_DS_TYPES_TRAITS_C_DEC::const_key_reference
const_key_reference;
typedef typename _Alloc::size_type size_type;
typedef typename _Alloc::difference_type difference_type;
typedef typename traits_base::key_type key_type;
typedef typename traits_base::key_pointer key_pointer;
typedef typename traits_base::key_const_pointer key_const_pointer;
typedef typename traits_base::key_reference key_reference;
typedef typename traits_base::key_const_reference key_const_reference;
#ifdef PB_DS_DATA_TRUE_INDICATOR
typedef typename PB_DS_TYPES_TRAITS_C_DEC::mapped_type mapped_type;
typedef typename traits_base::mapped_type mapped_type;
typedef typename traits_base::mapped_pointer mapped_pointer;
typedef typename traits_base::mapped_const_pointer mapped_const_pointer;
typedef typename traits_base::mapped_reference mapped_reference;
typedef typename traits_base::mapped_const_reference mapped_const_reference;
#endif
typedef
typename PB_DS_TYPES_TRAITS_C_DEC::mapped_pointer
mapped_pointer;
typedef typename traits_base::value_type value_type;
typedef typename traits_base::pointer pointer;
typedef typename traits_base::const_pointer const_pointer;
typedef typename traits_base::reference reference;
typedef typename traits_base::const_reference const_reference;
typedef typename traits_type::point_const_iterator point_const_iterator;
typedef
typename PB_DS_TYPES_TRAITS_C_DEC::const_mapped_pointer
const_mapped_pointer;
typedef point_const_iterator const_iterator;
typedef typename traits_type::point_iterator point_iterator;
typedef point_iterator iterator;
typedef
typename PB_DS_TYPES_TRAITS_C_DEC::mapped_reference
mapped_reference;
typedef typename traits_type::const_reverse_iterator const_reverse_iterator;
typedef
typename PB_DS_TYPES_TRAITS_C_DEC::const_mapped_reference
const_mapped_reference;
#endif
typedef typename traits_type::reverse_iterator reverse_iterator;
typedef typename traits_type::node_const_iterator node_const_iterator;
typedef typename traits_type::node_iterator node_iterator;
typedef typename traits_type::node_update node_update;
typedef typename PB_DS_TYPES_TRAITS_C_DEC::value_type value_type;
typedef Cmp_Fn cmp_fn;
typedef _Alloc allocator_type;
typedef typename PB_DS_TYPES_TRAITS_C_DEC::pointer pointer;
PB_DS_BIN_TREE_NAME();
typedef typename PB_DS_TYPES_TRAITS_C_DEC::const_pointer const_pointer;
PB_DS_BIN_TREE_NAME(const Cmp_Fn&);
typedef typename PB_DS_TYPES_TRAITS_C_DEC::reference reference;
PB_DS_BIN_TREE_NAME(const Cmp_Fn&, const node_update&);
typedef
typename PB_DS_TYPES_TRAITS_C_DEC::const_reference
const_reference;
typedef
typename Node_And_It_Traits::const_point_iterator
const_point_iterator;
typedef const_point_iterator const_iterator;
typedef typename Node_And_It_Traits::point_iterator point_iterator;
typedef point_iterator iterator;
typedef
typename Node_And_It_Traits::const_reverse_iterator
const_reverse_iterator;
typedef typename Node_And_It_Traits::reverse_iterator reverse_iterator;
typedef
typename Node_And_It_Traits::const_node_iterator
const_node_iterator;
typedef typename Node_And_It_Traits::node_iterator node_iterator;
typedef Cmp_Fn cmp_fn;
typedef Allocator allocator_type;
typedef typename Node_And_It_Traits::node_update node_update;
public:
PB_DS_CLASS_NAME();
PB_DS_CLASS_NAME(const Cmp_Fn& r_cmp_fn);
PB_DS_CLASS_NAME(const Cmp_Fn& r_cmp_fn, const node_update& r_update);
PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC& other);
PB_DS_BIN_TREE_NAME(const PB_DS_CLASS_C_DEC&);
void
swap(PB_DS_CLASS_C_DEC& other);
swap(PB_DS_CLASS_C_DEC&);
~PB_DS_CLASS_NAME();
~PB_DS_BIN_TREE_NAME();
inline bool
empty() const;
@ -263,29 +189,29 @@ namespace __gnu_pbds
inline size_type
max_size() const;
Cmp_Fn&
Cmp_Fn&
get_cmp_fn();
const Cmp_Fn&
const Cmp_Fn&
get_cmp_fn() const;
inline point_iterator
lower_bound(const_key_reference r_key);
lower_bound(key_const_reference);
inline const_point_iterator
lower_bound(const_key_reference r_key) const;
inline point_const_iterator
lower_bound(key_const_reference) const;
inline point_iterator
upper_bound(const_key_reference r_key);
upper_bound(key_const_reference);
inline const_point_iterator
upper_bound(const_key_reference r_key) const;
inline point_const_iterator
upper_bound(key_const_reference) const;
inline point_iterator
find(const_key_reference r_key);
find(key_const_reference);
inline const_point_iterator
find(const_key_reference r_key) const;
inline point_const_iterator
find(key_const_reference) const;
inline iterator
begin();
@ -311,13 +237,13 @@ namespace __gnu_pbds
inline const_reverse_iterator
rend() const;
inline const_node_iterator
inline node_const_iterator
node_begin() const;
inline node_iterator
node_begin();
inline const_node_iterator
inline node_const_iterator
node_end() const;
inline node_iterator
@ -327,148 +253,139 @@ namespace __gnu_pbds
clear();
protected:
void
value_swap(PB_DS_CLASS_C_DEC& other);
value_swap(PB_DS_CLASS_C_DEC&);
void
initialize_min_max();
inline iterator
insert_imp_empty(const_reference r_value);
insert_imp_empty(const_reference);
inline iterator
insert_leaf_new(const_reference r_value, node_pointer p_nd, bool left_nd);
insert_leaf_new(const_reference, node_pointer, bool);
inline node_pointer
get_new_node_for_leaf_insert(const_reference r_val, false_type);
get_new_node_for_leaf_insert(const_reference, false_type);
inline node_pointer
get_new_node_for_leaf_insert(const_reference r_val, true_type);
get_new_node_for_leaf_insert(const_reference, true_type);
inline void
actual_erase_node(node_pointer p_nd);
actual_erase_node(node_pointer);
inline std::pair<node_pointer, bool>
erase(node_pointer p_nd);
erase(node_pointer);
inline void
update_min_max_for_erased_node(node_pointer p_nd);
update_min_max_for_erased_node(node_pointer);
static void
clear_imp(node_pointer p_nd);
clear_imp(node_pointer);
inline std::pair<
point_iterator,
bool>
insert_leaf(const_reference r_value);
inline std::pair<point_iterator, bool>
insert_leaf(const_reference);
inline void
rotate_left(node_pointer p_x);
rotate_left(node_pointer);
inline void
rotate_right(node_pointer p_y);
rotate_right(node_pointer);
inline void
rotate_parent(node_pointer p_nd);
rotate_parent(node_pointer);
inline void
apply_update(node_pointer p_nd, null_node_update_pointer);
apply_update(node_pointer, null_node_update_pointer);
template<typename Node_Update_>
inline void
apply_update(node_pointer p_nd, Node_Update_* p_update);
inline void
apply_update(node_pointer, Node_Update_*);
inline void
update_to_top(node_pointer p_nd, null_node_update_pointer);
update_to_top(node_pointer, null_node_update_pointer);
template<typename Node_Update_>
inline void
update_to_top(node_pointer p_nd, Node_Update_* p_update);
inline void
update_to_top(node_pointer, Node_Update_*);
bool
join_prep(PB_DS_CLASS_C_DEC& other);
join_prep(PB_DS_CLASS_C_DEC&);
void
join_finish(PB_DS_CLASS_C_DEC& other);
join_finish(PB_DS_CLASS_C_DEC&);
bool
split_prep(const_key_reference r_key, PB_DS_CLASS_C_DEC& other);
split_prep(key_const_reference, PB_DS_CLASS_C_DEC&);
void
split_finish(PB_DS_CLASS_C_DEC& other);
split_finish(PB_DS_CLASS_C_DEC&);
size_type
recursive_count(node_pointer p_nd) const;
recursive_count(node_pointer) const;
#ifdef _GLIBCXX_DEBUG
void
assert_valid(const char* file, int line) const;
assert_valid(const char*, int) const;
void
structure_only_assert_valid(const char* file, int line) const;
structure_only_assert_valid(const char*, int) const;
void
assert_node_consistent(const node_pointer p_nd,
const char* file, int line) const;
#endif
assert_node_consistent(const node_pointer, const char*, int) const;
#endif
private:
#ifdef _GLIBCXX_DEBUG
void
assert_iterators(const char* file, int line) const;
assert_iterators(const char*, int) const;
void
assert_consistent_with_debug_base(const char* file, int line) const;
assert_consistent_with_debug_base(const char*, int) const;
void
assert_node_consistent_with_left(const node_pointer p_nd,
const char* file, int line) const;
assert_node_consistent_with_left(const node_pointer,
const char*, int) const;
void
assert_node_consistent_with_right(const node_pointer p_nd,
const char* file, int line) const;
assert_node_consistent_with_right(const node_pointer,
const char*, int) const;
void
assert_consistent_with_debug_base(const node_pointer p_nd,
const char* file, int line) const;
assert_consistent_with_debug_base(const node_pointer,
const char*, int) const;
void
assert_min(const char* file, int line) const;
assert_min(const char*, int) const;
void
assert_min_imp(const node_pointer p_nd,
const char* file, int line) const;
assert_min_imp(const node_pointer, const char*, int) const;
void
assert_max(const char* file, int line) const;
assert_max(const char*, int) const;
void
assert_max_imp(const node_pointer p_nd,
const char* file, int line) const;
assert_max_imp(const node_pointer, const char*, int) const;
void
assert_size(const char* file, int line) const;
assert_size(const char*, int) const;
typedef std::pair< const_pointer, const_pointer> node_consistent_t;
typedef std::pair<const_pointer, const_pointer> node_consistent_t;
node_consistent_t
assert_node_consistent_(const node_pointer p_nd,
const char* file, int line) const;
#endif
assert_node_consistent_(const node_pointer, const char*, int) const;
#endif
void
initialize();
node_pointer
recursive_copy_node(const node_pointer p_nd);
recursive_copy_node(const node_pointer);
protected:
node_pointer m_p_head;
size_type m_size;
static node_allocator s_node_allocator;
node_pointer m_p_head;
size_type m_size;
static node_allocator s_node_allocator;
};
#define PB_DS_STRUCT_ONLY_ASSERT_VALID(X) \
@ -492,17 +409,12 @@ namespace __gnu_pbds
#undef PB_DS_STRUCT_ONLY_ASSERT_VALID
#undef PB_DS_CLASS_C_DEC
#undef PB_DS_CLASS_T_DEC
#undef PB_DS_CLASS_NAME
#undef PB_DS_TYPES_TRAITS_C_DEC
#undef PB_DS_BIN_TREE_NAME
#undef PB_DS_BIN_TREE_TRAITS_BASE
#undef PB_DS_DEBUG_MAP_BASE_C_DEC
#ifdef PB_DS_TREE_TRACE
#undef PB_DS_TREE_TRACE_BASE_C_DEC
#endif
#undef PB_DS_V2F
#undef PB_DS_EP2VP
#undef PB_DS_V2S
#endif
} // namespace detail
} // namespace __gnu_pbds

View File

@ -1,70 +0,0 @@
// -*- C++ -*-
// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the terms
// of the GNU General Public License as published by the Free Software
// Foundation; either version 3, or (at your option) any later
// version.
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
// Permission to use, copy, modify, sell, and distribute this software
// is hereby granted without fee, provided that the above copyright
// notice appears in all copies, and that both that copyright notice
// and this permission notice appear in supporting documentation. None
// of the above authors, nor IBM Haifa Research Laboratories, make any
// representation about the suitability of this software for any
// purpose. It is provided "as is" without express or implied
// warranty.
/**
* @file cond_dtor_entry_dealtor.hpp
* Contains a binary tree container conditional deallocator
*/
class bin_search_tree_cond_dtor_entry_dealtor_
{
public:
inline
bin_search_tree_cond_dtor_entry_dealtor_(node_pointer p_nd) : m_p_nd(p_nd),
m_no_action_dtor(false)
{ }
inline void
set_no_action_dtor()
{
m_no_action_dtor = true;
}
inline
~bin_search_tree_cond_dtor_entry_dealtor_()
{
if (m_no_action_dtor)
return;
typename Allocator::template rebind<Node>::other().
deallocate(m_p_nd, 1);
}
protected:
node_pointer m_p_nd;
bool m_no_action_dtor;
};

View File

@ -1,81 +0,0 @@
// -*- C++ -*-
// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the terms
// of the GNU General Public License as published by the Free Software
// Foundation; either version 3, or (at your option) any later
// version.
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
// Permission to use, copy, modify, sell, and distribute this software
// is hereby granted without fee, provided that the above copyright
// notice appears in all copies, and that both that copyright notice
// and this permission notice appear in supporting documentation. None
// of the above authors, nor IBM Haifa Research Laboratories, make any
// representation about the suitability of this software for any
// purpose. It is provided "as is" without express or implied
// warranty.
/**
* @file cond_key_dtor_entry_dealtor.hpp
* Contains a binary tree container conditional deallocator
*/
class bin_seach_tree_cond_key_dtor_entry_dealtor_
{
public:
inline
bin_seach_tree_cond_key_dtor_entry_dealtor_(node_pointer p_nd) : m_p_nd(p_nd),
m_no_action_dtor(false),
m_key_destruct(false)
{ }
inline void
set_no_action_dtor()
{
m_no_action_dtor = true;
}
inline void
set_key_destruct()
{
m_key_destruct = true;
}
inline
~bin_seach_tree_cond_key_dtor_entry_dealtor_()
{
if (m_no_action_dtor)
return;
if (m_key_destruct)
m_p_nd->m_value.first.~Key();
bin_tree_base::s_alloc.deallocate(m_p_nd, 1);
}
protected:
node_pointer m_p_nd;
bool m_no_action_dtor;
bool m_key_destruct;
};

View File

@ -35,7 +35,7 @@
// warranty.
/**
* @file constructors_destructor_fn_imps.hpp
* @file bin_search_tree_/constructors_destructor_fn_imps.hpp
* Contains an implementation class for bin_search_tree_.
*/
@ -45,7 +45,7 @@ PB_DS_CLASS_C_DEC::s_node_allocator;
PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC::
PB_DS_CLASS_NAME() : m_p_head(s_node_allocator.allocate(1)), m_size(0)
PB_DS_BIN_TREE_NAME() : m_p_head(s_node_allocator.allocate(1)), m_size(0)
{
initialize();
PB_DS_STRUCT_ONLY_ASSERT_VALID((*this))
@ -53,7 +53,7 @@ PB_DS_CLASS_NAME() : m_p_head(s_node_allocator.allocate(1)), m_size(0)
PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC::
PB_DS_CLASS_NAME(const Cmp_Fn& r_cmp_fn) :
PB_DS_BIN_TREE_NAME(const Cmp_Fn& r_cmp_fn) :
Cmp_Fn(r_cmp_fn), m_p_head(s_node_allocator.allocate(1)), m_size(0)
{
initialize();
@ -62,7 +62,7 @@ PB_DS_CLASS_NAME(const Cmp_Fn& r_cmp_fn) :
PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC::
PB_DS_CLASS_NAME(const Cmp_Fn& r_cmp_fn, const node_update& r_node_update) :
PB_DS_BIN_TREE_NAME(const Cmp_Fn& r_cmp_fn, const node_update& r_node_update) :
Cmp_Fn(r_cmp_fn),
node_update(r_node_update),
m_p_head(s_node_allocator.allocate(1)),
@ -74,7 +74,7 @@ PB_DS_CLASS_NAME(const Cmp_Fn& r_cmp_fn, const node_update& r_node_update) :
PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC::
PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC& other) :
PB_DS_BIN_TREE_NAME(const PB_DS_CLASS_C_DEC& other) :
#ifdef _GLIBCXX_DEBUG
debug_base(other),
#endif
@ -132,7 +132,7 @@ value_swap(PB_DS_CLASS_C_DEC& other)
PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC::
~PB_DS_CLASS_NAME()
~PB_DS_BIN_TREE_NAME()
{
clear();
s_node_allocator.deallocate(m_p_head, 1);

View File

@ -34,7 +34,7 @@
// warranty.
/**
* @file debug_fn_imps.hpp
* @file bin_search_tree_/debug_fn_imps.hpp
* Contains an implementation class for bin_search_tree_.
*/
@ -272,8 +272,6 @@ PB_DS_CLASS_T_DEC
void
PB_DS_CLASS_C_DEC::
assert_size(const char* __file, int __line) const
{
PB_DS_DEBUG_VERIFY(recursive_count(m_p_head->m_p_parent) == m_size);
}
{ PB_DS_DEBUG_VERIFY(recursive_count(m_p_head->m_p_parent) == m_size); }
#endif

View File

@ -34,7 +34,7 @@
// warranty.
/**
* @file erase_fn_imps.hpp
* @file bin_search_tree_/erase_fn_imps.hpp
* Contains an implementation class for bin_search_tree_.
*/
@ -45,11 +45,8 @@ actual_erase_node(node_pointer p_z)
{
_GLIBCXX_DEBUG_ASSERT(m_size > 0);
--m_size;
_GLIBCXX_DEBUG_ONLY(erase_existing(PB_DS_V2F(p_z->m_value));)
_GLIBCXX_DEBUG_ONLY(debug_base::erase_existing(PB_DS_V2F(p_z->m_value));)
p_z->~node();
s_node_allocator.deallocate(p_z, 1);
}
@ -61,24 +58,19 @@ update_min_max_for_erased_node(node_pointer p_z)
if (m_size == 1)
{
m_p_head->m_p_left = m_p_head->m_p_right = m_p_head;
return;
}
if (m_p_head->m_p_left == p_z)
{
iterator it(p_z);
++it;
m_p_head->m_p_left = it.m_p_nd;
}
else if (m_p_head->m_p_right == p_z)
{
iterator it(p_z);
--it;
m_p_head->m_p_right = it.m_p_nd;
}
}
@ -89,15 +81,10 @@ PB_DS_CLASS_C_DEC::
clear()
{
PB_DS_STRUCT_ONLY_ASSERT_VALID((*this))
clear_imp(m_p_head->m_p_parent);
m_size = 0;
initialize();
_GLIBCXX_DEBUG_ONLY(debug_base::clear();)
PB_DS_STRUCT_ONLY_ASSERT_VALID((*this))
}
@ -110,11 +97,7 @@ clear_imp(node_pointer p_nd)
return;
clear_imp(p_nd->m_p_left);
clear_imp(p_nd->m_p_right);
p_nd->~node();
s_node_allocator.deallocate(p_nd, 1);
}

View File

@ -34,107 +34,92 @@
// warranty.
/**
* @file find_fn_imps.hpp
* @file bin_search_tree_/find_fn_imps.hpp
* Contains an implementation class for bin_search_tree_.
*/
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::const_point_iterator
inline typename PB_DS_CLASS_C_DEC::point_const_iterator
PB_DS_CLASS_C_DEC::
lower_bound(const_key_reference r_key) const
lower_bound(key_const_reference r_key) const
{
node_pointer p_pot = m_p_head;
node_pointer p_nd = m_p_head->m_p_parent;
while (p_nd != 0)
if (Cmp_Fn::operator()(
PB_DS_V2F(p_nd->m_value),
r_key))
if (Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value), r_key))
p_nd = p_nd->m_p_right;
else
{
p_pot = p_nd;
p_nd = p_nd->m_p_left;
}
return (iterator(p_pot));
return iterator(p_pot);
}
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::point_iterator
PB_DS_CLASS_C_DEC::
lower_bound(const_key_reference r_key)
lower_bound(key_const_reference r_key)
{
node_pointer p_pot = m_p_head;
node_pointer p_nd = m_p_head->m_p_parent;
while (p_nd != 0)
if (Cmp_Fn::operator()(
PB_DS_V2F(p_nd->m_value),
r_key))
if (Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value), r_key))
p_nd = p_nd->m_p_right;
else
{
p_pot = p_nd;
p_nd = p_nd->m_p_left;
}
return (iterator(p_pot));
return iterator(p_pot);
}
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::const_point_iterator
inline typename PB_DS_CLASS_C_DEC::point_const_iterator
PB_DS_CLASS_C_DEC::
upper_bound(const_key_reference r_key) const
upper_bound(key_const_reference r_key) const
{
node_pointer p_pot = m_p_head;
node_pointer p_nd = m_p_head->m_p_parent;
while (p_nd != 0)
if (Cmp_Fn::operator()(r_key,
PB_DS_V2F(p_nd->m_value)))
if (Cmp_Fn::operator()(r_key, PB_DS_V2F(p_nd->m_value)))
{
p_pot = p_nd,
p_nd = p_nd->m_p_left;
p_pot = p_nd;
p_nd = p_nd->m_p_left;
}
else
p_nd = p_nd->m_p_right;
return (const_iterator(p_pot));
return const_iterator(p_pot);
}
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::point_iterator
PB_DS_CLASS_C_DEC::
upper_bound(const_key_reference r_key)
upper_bound(key_const_reference r_key)
{
node_pointer p_pot = m_p_head;
node_pointer p_nd = m_p_head->m_p_parent;
while (p_nd != 0)
if (Cmp_Fn::operator()(r_key,
PB_DS_V2F(p_nd->m_value)))
if (Cmp_Fn::operator()(r_key, PB_DS_V2F(p_nd->m_value)))
{
p_pot = p_nd,
p_nd = p_nd->m_p_left;
p_pot = p_nd;
p_nd = p_nd->m_p_left;
}
else
p_nd = p_nd->m_p_right;
return (point_iterator(p_pot));
return point_iterator(p_pot);
}
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::point_iterator
PB_DS_CLASS_C_DEC::
find(const_key_reference r_key)
find(key_const_reference r_key)
{
PB_DS_STRUCT_ONLY_ASSERT_VALID((*this))
node_pointer p_pot = m_p_head;
node_pointer p_nd = m_p_head->m_p_parent;
@ -142,25 +127,27 @@ find(const_key_reference r_key)
if (!Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value), r_key))
{
p_pot = p_nd;
p_nd = p_nd->m_p_left;
}
else
p_nd = p_nd->m_p_right;
return point_iterator((p_pot != m_p_head
&& Cmp_Fn::operator()(r_key,
PB_DS_V2F(p_pot->m_value)))
? m_p_head : p_pot);
node_pointer ret = p_pot;
if (p_pot != m_p_head)
{
const bool __cmp = Cmp_Fn::operator()(r_key, PB_DS_V2F(p_pot->m_value));
if (__cmp)
ret = m_p_head;
}
return point_iterator(ret);
}
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::const_point_iterator
inline typename PB_DS_CLASS_C_DEC::point_const_iterator
PB_DS_CLASS_C_DEC::
find(const_key_reference r_key) const
find(key_const_reference r_key) const
{
PB_DS_STRUCT_ONLY_ASSERT_VALID((*this))
node_pointer p_pot = m_p_head;
node_pointer p_nd = m_p_head->m_p_parent;
@ -168,15 +155,17 @@ find(const_key_reference r_key) const
if (!Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value), r_key))
{
p_pot = p_nd;
p_nd = p_nd->m_p_left;
}
else
p_nd = p_nd->m_p_right;
return const_point_iterator((p_pot != m_p_head
&& Cmp_Fn::operator()(r_key,
PB_DS_V2F(p_pot->m_value)))
? m_p_head : p_pot);
node_pointer ret = p_pot;
if (p_pot != m_p_head)
{
const bool __cmp = Cmp_Fn::operator()(r_key, PB_DS_V2F(p_pot->m_value));
if (__cmp)
ret = m_p_head;
}
return point_const_iterator(ret);
}

View File

@ -34,7 +34,7 @@
// warranty.
/**
* @file info_fn_imps.hpp
* @file bin_search_tree_/info_fn_imps.hpp
* Contains an implementation class for bin_search_tree_.
*/

View File

@ -34,7 +34,7 @@
// warranty.
/**
* @file insert_fn_imps.hpp
* @file bin_search_tree_/insert_fn_imps.hpp
* Contains an implementation class for bin_search_tree_.
*/
@ -101,38 +101,30 @@ insert_leaf_new(const_reference r_value, node_pointer p_nd, bool left_nd)
if (left_nd)
{
_GLIBCXX_DEBUG_ASSERT(p_nd->m_p_left == 0);
_GLIBCXX_DEBUG_ASSERT(Cmp_Fn::operator()(
PB_DS_V2F(r_value),
PB_DS_V2F(p_nd->m_value)));
_GLIBCXX_DEBUG_ASSERT(Cmp_Fn::operator()(PB_DS_V2F(r_value),
PB_DS_V2F(p_nd->m_value)));
p_nd->m_p_left = p_new_nd;
if (m_p_head->m_p_left == p_nd)
m_p_head->m_p_left = p_new_nd;
}
else
{
_GLIBCXX_DEBUG_ASSERT(p_nd->m_p_right == 0);
_GLIBCXX_DEBUG_ASSERT(Cmp_Fn::operator()(
PB_DS_V2F(p_nd->m_value),
PB_DS_V2F(r_value)));
_GLIBCXX_DEBUG_ASSERT(Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value),
PB_DS_V2F(r_value)));
p_nd->m_p_right = p_new_nd;
if (m_p_head->m_p_right == p_nd)
m_p_head->m_p_right = p_new_nd;
}
p_new_nd->m_p_parent = p_nd;
p_new_nd->m_p_left = p_new_nd->m_p_right = 0;
PB_DS_ASSERT_NODE_CONSISTENT(p_nd)
update_to_top(p_new_nd, (node_update* )this);
_GLIBCXX_DEBUG_ONLY(debug_base::insert_new(PB_DS_V2F(r_value));)
return iterator(p_new_nd);
}
@ -148,13 +140,10 @@ insert_imp_empty(const_reference r_value)
m_p_head->m_p_parent = p_new_node;
p_new_node->m_p_parent = m_p_head;
p_new_node->m_p_left = p_new_node->m_p_right = 0;
_GLIBCXX_DEBUG_ONLY(debug_base::insert_new(PB_DS_V2F(r_value));)
update_to_top(m_p_head->m_p_parent, (node_update*)this);
return iterator(p_new_node);
}
@ -164,18 +153,14 @@ PB_DS_CLASS_C_DEC::
get_new_node_for_leaf_insert(const_reference r_val, false_type)
{
node_pointer p_new_nd = s_node_allocator.allocate(1);
cond_dealtor_t cond(p_new_nd);
new (const_cast<void* >(static_cast<const void* >(&p_new_nd->m_value)))
typename node::value_type(r_val);
cond.set_no_action();
p_new_nd->m_p_left = p_new_nd->m_p_right = 0;
++m_size;
return p_new_nd;
}
@ -190,9 +175,6 @@ get_new_node_for_leaf_insert(const_reference r_val, true_type)
typename node::value_type(r_val);
p_new_nd->m_p_left = p_new_nd->m_p_right = 0;
++m_size;
return p_new_nd;
}

View File

@ -34,7 +34,7 @@
// warranty.
/**
* @file iterators_fn_imps.hpp
* @file bin_search_tree_/iterators_fn_imps.hpp
* Contains an implementation class for bin_search_tree_.
*/
@ -103,11 +103,11 @@ rend() const
}
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::const_node_iterator
inline typename PB_DS_CLASS_C_DEC::node_const_iterator
PB_DS_CLASS_C_DEC::
node_begin() const
{
return (const_node_iterator(m_p_head->m_p_parent));
return (node_const_iterator(m_p_head->m_p_parent));
}
PB_DS_CLASS_T_DEC
@ -119,11 +119,11 @@ node_begin()
}
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::const_node_iterator
inline typename PB_DS_CLASS_C_DEC::node_const_iterator
PB_DS_CLASS_C_DEC::
node_end() const
{
return (const_node_iterator(0));
return (node_const_iterator(0));
}
PB_DS_CLASS_T_DEC

View File

@ -34,7 +34,7 @@
// warranty.
/**
* @file node_iterators.hpp
* @file bin_search_tree_/node_iterators.hpp
* Contains an implementation class for bin_search_tree_.
*/
@ -47,31 +47,27 @@ namespace __gnu_pbds
{
namespace detail
{
#define PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC \
bin_search_tree_const_node_it_< \
Node, \
Const_Iterator, \
Iterator, \
Allocator>
_Alloc>
// Const node iterator.
/// Const node iterator.
template<typename Node,
class Const_Iterator,
class Iterator,
class Allocator>
typename _Alloc>
class bin_search_tree_const_node_it_
{
private:
private:
typedef
typename Allocator::template rebind<
typename _Alloc::template rebind<
Node>::other::pointer
node_pointer;
public:
// Category.
typedef trivial_iterator_tag iterator_category;
@ -92,11 +88,9 @@ namespace __gnu_pbds
// Const metadata reference type.
typedef
typename Allocator::template rebind<
typename _Alloc::template rebind<
metadata_type>::other::const_reference
const_metadata_reference;
public:
metadata_const_reference;
// Default constructor.
/*
@ -105,7 +99,8 @@ namespace __gnu_pbds
*/
inline
bin_search_tree_const_node_it_(const node_pointer p_nd = 0) : m_p_nd(const_cast<node_pointer>(p_nd))
bin_search_tree_const_node_it_(const node_pointer p_nd = 0)
: m_p_nd(const_cast<node_pointer>(p_nd))
{ }
// Access.
@ -116,7 +111,7 @@ namespace __gnu_pbds
}
// Metadata access.
inline const_metadata_reference
inline metadata_const_reference
get_metadata() const
{
return (m_p_nd->get_metadata());
@ -150,7 +145,6 @@ namespace __gnu_pbds
return (m_p_nd != other.m_p_nd);
}
public:
node_pointer m_p_nd;
};
@ -159,26 +153,23 @@ namespace __gnu_pbds
Node, \
Const_Iterator, \
Iterator, \
Allocator>
_Alloc>
// Node iterator.
/// Node iterator.
template<typename Node,
class Const_Iterator,
class Iterator,
class Allocator>
class bin_search_tree_node_it_ :
public PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC
typename _Alloc>
class bin_search_tree_node_it_
: public PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC
{
private:
typedef
typename Allocator::template rebind<
typename _Alloc::template rebind<
Node>::other::pointer
node_pointer;
public:
// __Iterator's value type.
typedef Iterator value_type;
@ -188,8 +179,6 @@ namespace __gnu_pbds
// __Iterator's __const reference type.
typedef Iterator const_reference;
public:
// Default constructor.
/*
inline
@ -197,8 +186,8 @@ namespace __gnu_pbds
*/
inline
bin_search_tree_node_it_(const node_pointer p_nd = 0) : PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC(
const_cast<node_pointer>(p_nd))
bin_search_tree_node_it_(const node_pointer p_nd = 0)
: PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC(const_cast<node_pointer>(p_nd))
{ }
// Access.
@ -227,7 +216,6 @@ namespace __gnu_pbds
};
#undef PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC
#undef PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC
} // namespace detail

View File

@ -34,7 +34,7 @@
// warranty.
/**
* @file point_iterators.hpp
* @file bin_search_tree_/point_iterators.hpp
* Contains an implementation class for bin_search_tree_.
*/
@ -58,7 +58,7 @@ namespace __gnu_pbds
Reference, \
Const_Reference, \
Is_Forward_Iterator, \
Allocator>
_Alloc>
#define PB_DS_TREE_CONST_ODIR_IT_C_DEC \
bin_search_tree_const_it_< \
@ -69,7 +69,7 @@ namespace __gnu_pbds
Reference, \
Const_Reference, \
!Is_Forward_Iterator, \
Allocator>
_Alloc>
#define PB_DS_TREE_IT_C_DEC \
bin_search_tree_it_< \
@ -80,7 +80,7 @@ namespace __gnu_pbds
Reference, \
Const_Reference, \
Is_Forward_Iterator, \
Allocator>
_Alloc>
#define PB_DS_TREE_ODIR_IT_C_DEC \
bin_search_tree_it_< \
@ -91,9 +91,9 @@ namespace __gnu_pbds
Reference, \
Const_Reference, \
!Is_Forward_Iterator, \
Allocator>
_Alloc>
// Const iterator.
/// Const iterator.
template<typename Node_Pointer,
typename Value_Type,
typename Pointer,
@ -101,27 +101,17 @@ namespace __gnu_pbds
typename Reference,
typename Const_Reference,
bool Is_Forward_Iterator,
class Allocator>
typename _Alloc>
class bin_search_tree_const_it_
{
public:
typedef std::bidirectional_iterator_tag iterator_category;
typedef typename Allocator::difference_type difference_type;
typedef Value_Type value_type;
typedef Pointer pointer;
typedef Const_Pointer const_pointer;
typedef Reference reference;
typedef Const_Reference const_reference;
public:
typedef std::bidirectional_iterator_tag iterator_category;
typedef typename _Alloc::difference_type difference_type;
typedef Value_Type value_type;
typedef Pointer pointer;
typedef Const_Pointer const_pointer;
typedef Reference reference;
typedef Const_Reference const_reference;
inline
bin_search_tree_const_it_(const Node_Pointer p_nd = 0)
@ -280,7 +270,7 @@ namespace __gnu_pbds
Node_Pointer m_p_nd;
};
// Iterator.
/// Iterator.
template<typename Node_Pointer,
typename Value_Type,
typename Pointer,
@ -288,14 +278,10 @@ namespace __gnu_pbds
typename Reference,
typename Const_Reference,
bool Is_Forward_Iterator,
class Allocator>
class bin_search_tree_it_ :
public PB_DS_TREE_CONST_IT_C_DEC
typename _Alloc>
class bin_search_tree_it_ : public PB_DS_TREE_CONST_IT_C_DEC
{
public:
inline
bin_search_tree_it_(const Node_Pointer p_nd = 0)
: PB_DS_TREE_CONST_IT_C_DEC((Node_Pointer)p_nd)

View File

@ -34,7 +34,7 @@
// warranty.
/**
* @file policy_access_fn_imps.hpp
* @file bin_search_tree_/policy_access_fn_imps.hpp
* Contains an implementation class for bin_search_tree_.
*/
@ -42,15 +42,11 @@ PB_DS_CLASS_T_DEC
Cmp_Fn&
PB_DS_CLASS_C_DEC::
get_cmp_fn()
{
return (*this);
}
{ return (*this); }
PB_DS_CLASS_T_DEC
const Cmp_Fn&
PB_DS_CLASS_C_DEC::
get_cmp_fn() const
{
return (*this);
}
{ return (*this); }

View File

@ -34,7 +34,7 @@
// warranty.
/**
* @file r_erase_fn_imps.hpp
* @file bin_search_tree_/r_erase_fn_imps.hpp
* Contains an implementation class for bin_search_tree_.
*/
@ -45,11 +45,8 @@ actual_erase_node(node_pointer p_z)
{
_GLIBCXX_DEBUG_ASSERT(m_size > 0);
--m_size;
_GLIBCXX_DEBUG_ONLY(erase_existing(PB_DS_V2F(p_z->m_value));)
p_z->~node();
s_node_allocator.deallocate(p_z, 1);
}
@ -61,24 +58,19 @@ update_min_max_for_erased_node(node_pointer p_z)
if (m_size == 1)
{
m_p_head->m_p_left = m_p_head->m_p_right = m_p_head;
return;
}
if (m_p_head->m_p_left == p_z)
{
iterator it(p_z);
++it;
m_p_head->m_p_left = it.m_p_nd;
}
else if (m_p_head->m_p_right == p_z)
{
iterator it(p_z);
--it;
m_p_head->m_p_right = it.m_p_nd;
}
}
@ -89,15 +81,10 @@ PB_DS_CLASS_C_DEC::
clear()
{
PB_DS_STRUCT_ONLY_ASSERT_VALID((*this))
clear_imp(m_p_head->m_p_parent);
clear_imp(m_p_head->m_p_parent);
m_size = 0;
initialize();
_GLIBCXX_DEBUG_ONLY(debug_base::clear();)
PB_DS_STRUCT_ONLY_ASSERT_VALID((*this))
}
@ -110,11 +97,7 @@ clear_imp(node_pointer p_nd)
return;
clear_imp(p_nd->m_p_left);
clear_imp(p_nd->m_p_right);
p_nd->~Node();
s_node_allocator.deallocate(p_nd, 1);
}

View File

@ -34,7 +34,7 @@
// warranty.
/**
* @file rotate_fn_imps.hpp
* @file bin_search_tree_/rotate_fn_imps.hpp
* Contains imps for rotating nodes.
*/
@ -130,7 +130,7 @@ PB_DS_CLASS_C_DEC::
apply_update(node_pointer p_nd, Node_Update_* /*p_update*/)
{
node_update::operator()(node_iterator(p_nd),
const_node_iterator(static_cast<node_pointer>(0)));
node_const_iterator(static_cast<node_pointer>(0)));
}
PB_DS_CLASS_T_DEC

View File

@ -34,7 +34,7 @@
// warranty.
/**
* @file split_join_fn_imps.hpp
* @file bin_search_tree_/split_join_fn_imps.hpp
* Contains an implementation class for bin_search_tree_.
*/
@ -85,7 +85,7 @@ join_finish(PB_DS_CLASS_C_DEC& other)
PB_DS_CLASS_T_DEC
bool
PB_DS_CLASS_C_DEC::
split_prep(const_key_reference r_key, PB_DS_CLASS_C_DEC& other)
split_prep(key_const_reference r_key, PB_DS_CLASS_C_DEC& other)
{
PB_DS_ASSERT_VALID((*this))
PB_DS_ASSERT_VALID(other)

View File

@ -34,7 +34,7 @@
// warranty.
/**
* @file traits.hpp
* @file bin_search_tree_/traits.hpp
* Contains an implementation for bin_search_tree_.
*/
@ -48,34 +48,28 @@ namespace __gnu_pbds
{
namespace detail
{
/// Binary search tree traits, primary template.
template<typename Key,
typename Mapped,
class Cmp_Fn,
template<typename Const_Node_Iterator,
class Node_Iterator,
template<typename Node_CItr,
class Node_Itr,
class Cmp_Fn,
class Allocator>
typename _Alloc>
class Node_Update,
class Node,
class Allocator>
typename _Alloc>
struct bin_search_tree_traits
{
private:
typedef
types_traits<
Key,
Mapped,
Allocator,
false>
type_traits;
typedef types_traits<Key, Mapped, _Alloc, false> type_traits;
public:
typedef Node node;
typedef
bin_search_tree_const_it_<
typename Allocator::template rebind<
typename _Alloc::template rebind<
node>::other::pointer,
typename type_traits::value_type,
typename type_traits::pointer,
@ -83,12 +77,12 @@ namespace __gnu_pbds
typename type_traits::reference,
typename type_traits::const_reference,
true,
Allocator>
const_point_iterator;
_Alloc>
point_const_iterator;
typedef
bin_search_tree_it_<
typename Allocator::template rebind<
typename _Alloc::template rebind<
node>::other::pointer,
typename type_traits::value_type,
typename type_traits::pointer,
@ -96,12 +90,12 @@ namespace __gnu_pbds
typename type_traits::reference,
typename type_traits::const_reference,
true,
Allocator>
_Alloc>
point_iterator;
typedef
bin_search_tree_const_it_<
typename Allocator::template rebind<
typename _Alloc::template rebind<
node>::other::pointer,
typename type_traits::value_type,
typename type_traits::pointer,
@ -109,12 +103,12 @@ namespace __gnu_pbds
typename type_traits::reference,
typename type_traits::const_reference,
false,
Allocator>
_Alloc>
const_reverse_iterator;
typedef
bin_search_tree_it_<
typename Allocator::template rebind<
typename _Alloc::template rebind<
node>::other::pointer,
typename type_traits::value_type,
typename type_traits::pointer,
@ -122,74 +116,69 @@ namespace __gnu_pbds
typename type_traits::reference,
typename type_traits::const_reference,
false,
Allocator>
_Alloc>
reverse_iterator;
typedef
bin_search_tree_const_node_it_<
Node,
const_point_iterator,
point_const_iterator,
point_iterator,
Allocator>
const_node_iterator;
_Alloc>
node_const_iterator;
typedef
bin_search_tree_node_it_<
Node,
const_point_iterator,
point_const_iterator,
point_iterator,
Allocator>
_Alloc>
node_iterator;
typedef
Node_Update<
const_node_iterator,
node_const_iterator,
node_iterator,
Cmp_Fn,
Allocator>
_Alloc>
node_update;
typedef
__gnu_pbds::null_tree_node_update<
const_node_iterator,
__gnu_pbds::null_node_update<
node_const_iterator,
node_iterator,
Cmp_Fn,
Allocator>*
_Alloc>*
null_node_update_pointer;
};
/// Specialization.
template<typename Key,
class Cmp_Fn,
template<typename Const_Node_Iterator,
class Node_Iterator,
template<typename Node_CItr,
class Node_Itr,
class Cmp_Fn,
class Allocator>
typename _Alloc>
class Node_Update,
class Node,
class Allocator>
typename _Alloc>
struct bin_search_tree_traits<
Key,
null_mapped_type,
null_type,
Cmp_Fn,
Node_Update,
Node,
Allocator>
_Alloc>
{
private:
typedef
types_traits<
Key,
null_mapped_type,
Allocator,
false>
type_traits;
typedef types_traits<Key, null_type, _Alloc, false> type_traits;
public:
typedef Node node;
typedef
bin_search_tree_const_it_<
typename Allocator::template rebind<
typename _Alloc::template rebind<
node>::other::pointer,
typename type_traits::value_type,
typename type_traits::pointer,
@ -197,14 +186,14 @@ namespace __gnu_pbds
typename type_traits::reference,
typename type_traits::const_reference,
true,
Allocator>
const_point_iterator;
_Alloc>
point_const_iterator;
typedef const_point_iterator point_iterator;
typedef point_const_iterator point_iterator;
typedef
bin_search_tree_const_it_<
typename Allocator::template rebind<
typename _Alloc::template rebind<
node>::other::pointer,
typename type_traits::value_type,
typename type_traits::pointer,
@ -212,7 +201,7 @@ namespace __gnu_pbds
typename type_traits::reference,
typename type_traits::const_reference,
false,
Allocator>
_Alloc>
const_reverse_iterator;
typedef const_reverse_iterator reverse_iterator;
@ -220,27 +209,23 @@ namespace __gnu_pbds
typedef
bin_search_tree_const_node_it_<
Node,
const_point_iterator,
point_const_iterator,
point_iterator,
Allocator>
const_node_iterator;
_Alloc>
node_const_iterator;
typedef const_node_iterator node_iterator;
typedef node_const_iterator node_iterator;
typedef
Node_Update<
const_node_iterator,
node_iterator,
Cmp_Fn,
Allocator>
Node_Update<node_const_iterator, node_iterator, Cmp_Fn, _Alloc>
node_update;
typedef
__gnu_pbds::null_tree_node_update<
const_node_iterator,
__gnu_pbds::null_node_update<
node_const_iterator,
node_iterator,
Cmp_Fn,
Allocator>*
_Alloc>*
null_node_update_pointer;
};

View File

@ -34,17 +34,13 @@
// warranty.
/**
* @file binary_heap_.hpp
* @file binary_heap_/binary_heap_.hpp
* Contains an implementation class for a binary heap.
*/
#ifndef PB_DS_BINARY_HEAP_HPP
#define PB_DS_BINARY_HEAP_HPP
/*
* Based on CLRS.
*/
#include <queue>
#include <algorithm>
#include <ext/pb_ds/detail/cond_dealtor.hpp>
@ -53,7 +49,7 @@
#include <ext/pb_ds/detail/binary_heap_/entry_cmp.hpp>
#include <ext/pb_ds/detail/binary_heap_/entry_pred.hpp>
#include <ext/pb_ds/detail/binary_heap_/resize_policy.hpp>
#include <ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp>
#include <ext/pb_ds/detail/binary_heap_/point_const_iterator.hpp>
#include <ext/pb_ds/detail/binary_heap_/const_iterator.hpp>
#ifdef PB_DS_BINARY_HEAP_TRACE_
#include <iostream>
@ -66,126 +62,85 @@ namespace __gnu_pbds
namespace detail
{
#define PB_DS_CLASS_T_DEC \
template<typename Value_Type, class Cmp_Fn, class Allocator>
template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
#define PB_DS_CLASS_C_DEC \
binary_heap_<Value_Type, Cmp_Fn, Allocator>
binary_heap<Value_Type, Cmp_Fn, _Alloc>
#define PB_DS_ENTRY_CMP_DEC \
entry_cmp<Value_Type, Cmp_Fn, is_simple<Value_Type>::value, Allocator>::type
entry_cmp<Value_Type, Cmp_Fn, _Alloc, is_simple<Value_Type>::value>::type
#define PB_DS_RESIZE_POLICY_DEC \
__gnu_pbds::detail::resize_policy<typename Allocator::size_type>
__gnu_pbds::detail::resize_policy<typename _Alloc::size_type>
/**
* class description = "Base class for some types of h3ap$">
**/
template<typename Value_Type, class Cmp_Fn, class Allocator>
class binary_heap_ : public PB_DS_ENTRY_CMP_DEC,
public PB_DS_RESIZE_POLICY_DEC
* @brief Binary heaps composed of resize and compare policies.
*
* Based on CLRS.
*/
template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
class binary_heap
: public PB_DS_ENTRY_CMP_DEC, public PB_DS_RESIZE_POLICY_DEC
{
public:
typedef Value_Type value_type;
typedef Cmp_Fn cmp_fn;
typedef _Alloc allocator_type;
typedef typename _Alloc::size_type size_type;
typedef typename _Alloc::difference_type difference_type;
typedef typename PB_DS_ENTRY_CMP_DEC entry_cmp;
typedef PB_DS_RESIZE_POLICY_DEC resize_policy;
typedef cond_dealtor<value_type, _Alloc> cond_dealtor_t;
private:
enum
{
simple_value = is_simple<Value_Type>::value
simple_value = is_simple<value_type>::value
};
typedef integral_constant<int, simple_value> no_throw_copies_t;
typedef integral_constant<int, simple_value> no_throw_copies_t;
typedef
typename Allocator::template rebind<
Value_Type>::other
value_allocator;
typedef
typename __conditional_type<
simple_value,
Value_Type,
typename value_allocator::pointer>::__type
entry;
typedef
typename Allocator::template rebind<
entry>::other
entry_allocator;
typedef typename entry_allocator::pointer entry_pointer;
typedef typename PB_DS_ENTRY_CMP_DEC entry_cmp;
typedef PB_DS_RESIZE_POLICY_DEC resize_policy;
typedef
cond_dealtor<
Value_Type,
Allocator>
cond_dealtor_t;
typedef typename _Alloc::template rebind<value_type> __rebind_v;
typedef typename __rebind_v::other value_allocator;
public:
typedef typename value_allocator::pointer pointer;
typedef typename value_allocator::const_pointer const_pointer;
typedef typename value_allocator::reference reference;
typedef typename value_allocator::const_reference const_reference;
typedef typename Allocator::size_type size_type;
typedef typename __conditional_type<simple_value,
value_type, pointer>::__type
entry;
typedef typename Allocator::difference_type difference_type;
typedef typename _Alloc::template rebind<entry>::other
entry_allocator;
typedef Value_Type value_type;
typedef typename entry_allocator::pointer entry_pointer;
typedef
typename Allocator::template rebind<
value_type>::other::pointer
pointer;
typedef binary_heap_point_const_iterator_<value_type, entry,
simple_value, _Alloc>
point_const_iterator;
typedef
typename Allocator::template rebind<
value_type>::other::const_pointer
const_pointer;
typedef point_const_iterator point_iterator;
typedef
typename Allocator::template rebind<
value_type>::other::reference
reference;
typedef binary_heap_const_iterator_<value_type, entry,
simple_value, _Alloc>
const_iterator;
typedef
typename Allocator::template rebind<
value_type>::other::const_reference
const_reference;
typedef const_iterator iterator;
typedef
binary_heap_const_point_iterator_<
value_type,
entry,
simple_value,
Allocator>
const_point_iterator;
typedef const_point_iterator point_iterator;
binary_heap();
typedef
binary_heap_const_iterator_<
value_type,
entry,
simple_value,
Allocator>
const_iterator;
binary_heap(const cmp_fn&);
typedef const_iterator iterator;
typedef Cmp_Fn cmp_fn;
typedef Allocator allocator_type;
public:
binary_heap_();
binary_heap_(const Cmp_Fn& r_cmp_fn);
binary_heap_(const PB_DS_CLASS_C_DEC& other);
binary_heap(const binary_heap&);
void
swap(PB_DS_CLASS_C_DEC& other);
swap(binary_heap&);
~binary_heap_();
~binary_heap();
inline bool
empty() const;
@ -196,17 +151,17 @@ namespace __gnu_pbds
inline size_type
max_size() const;
Cmp_Fn&
Cmp_Fn&
get_cmp_fn();
const Cmp_Fn&
const Cmp_Fn&
get_cmp_fn() const;
inline point_iterator
push(const_reference r_val);
push(const_reference);
void
modify(point_iterator it, const_reference r_new_val);
modify(point_iterator, const_reference);
inline const_reference
top() const;
@ -215,17 +170,17 @@ namespace __gnu_pbds
pop();
inline void
erase(point_iterator it);
erase(point_iterator);
template<typename Pred>
typename PB_DS_CLASS_C_DEC::size_type
erase_if(Pred pred);
size_type
erase_if(Pred);
inline static void
erase_at(entry_pointer a_entries, size_type size, false_type);
inline void
erase_at(entry_pointer, size_type, false_type);
inline static void
erase_at(entry_pointer a_entries, size_type size, true_type);
inline void
erase_at(entry_pointer, size_type, true_type);
inline iterator
begin();
@ -243,48 +198,43 @@ namespace __gnu_pbds
clear();
template<typename Pred>
void
split(Pred pred, PB_DS_CLASS_C_DEC& other);
void
split(Pred, binary_heap&);
void
join(PB_DS_CLASS_C_DEC& other);
join(binary_heap&);
#ifdef PB_DS_BINARY_HEAP_TRACE_
void
trace() const;
#endif
#endif
protected:
template<typename It>
void
copy_from_range(It first_it, It last_it);
void
copy_from_range(It, It);
private:
void
value_swap(PB_DS_CLASS_C_DEC& other);
value_swap(binary_heap&);
inline void
insert_value(const_reference r_val, false_type);
insert_value(const_reference, false_type);
inline void
insert_value(value_type val, true_type);
inline void
insert_entry(entry e);
insert_value(value_type, true_type);
inline void
resize_for_insert_if_needed();
inline void
swap_value_imp(entry_pointer p_e, value_type new_val, true_type);
swap_value_imp(entry_pointer, value_type, true_type);
inline void
swap_value_imp(entry_pointer p_e, const_reference r_new_val, false_type);
swap_value_imp(entry_pointer, const_reference, false_type);
void
fix(entry_pointer p_e);
fix(entry_pointer);
inline const_reference
top_imp(true_type) const;
@ -293,48 +243,91 @@ namespace __gnu_pbds
top_imp(false_type) const;
inline static size_type
left_child(size_type i);
left_child(size_type);
inline static size_type
right_child(size_type i);
right_child(size_type);
inline static size_type
parent(size_type i);
parent(size_type);
inline void
resize_for_erase_if_needed();
template<typename Pred>
size_type
partition(Pred pred);
partition(Pred);
void
make_heap()
{
const entry_cmp& m_cmp = static_cast<entry_cmp&>(*this);
entry_pointer end = m_a_entries + m_size;
std::make_heap(m_a_entries, end, m_cmp);
_GLIBCXX_DEBUG_ASSERT(is_heap());
}
void
push_heap()
{
if (!is_heap())
make_heap();
else
{
const entry_cmp& m_cmp = static_cast<entry_cmp&>(*this);
entry_pointer end = m_a_entries + m_size;
std::push_heap(m_a_entries, end, m_cmp);
}
}
void
pop_heap()
{
const entry_cmp& m_cmp = static_cast<entry_cmp&>(*this);
entry_pointer end = m_a_entries + m_size;
std::pop_heap(m_a_entries, end, m_cmp);
}
bool
is_heap()
{
const entry_cmp& m_cmp = static_cast<entry_cmp&>(*this);
entry_pointer end = m_a_entries + m_size;
bool p = std::__is_heap(m_a_entries, end, m_cmp);
return p;
}
#ifdef _GLIBCXX_DEBUG
void
assert_valid(const char* file, int line) const;
#endif
assert_valid(const char*, int) const;
#endif
#ifdef PB_DS_BINARY_HEAP_TRACE_
void
trace_entry(const entry& r_e, false_type) const;
trace_entry(const entry&, false_type) const;
void
trace_entry(const entry& r_e, true_type) const;
#endif
trace_entry(const entry&, true_type) const;
#endif
private:
static entry_allocator s_entry_allocator;
static entry_allocator s_entry_allocator;
static value_allocator s_value_allocator;
static no_throw_copies_t s_no_throw_copies_ind;
static value_allocator s_value_allocator;
static no_throw_copies_t s_no_throw_copies_ind;
size_type m_size;
size_type m_actual_size;
entry_pointer m_a_entries;
size_type m_size;
size_type m_actual_size;
entry_pointer m_a_entries;
};
#define PB_DS_ASSERT_VALID(X) \
_GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);)
#define PB_DS_DEBUG_VERIFY(_Cond) \
_GLIBCXX_DEBUG_VERIFY_AT(_Cond, \
_M_message(#_Cond" assertion from %1;:%2;") \
._M_string(__FILE__)._M_integer(__LINE__) \
,__file,__line)
#include <ext/pb_ds/detail/binary_heap_/insert_fn_imps.hpp>
#include <ext/pb_ds/detail/binary_heap_/constructors_destructor_fn_imps.hpp>
#include <ext/pb_ds/detail/binary_heap_/iterators_fn_imps.hpp>
@ -354,4 +347,4 @@ namespace __gnu_pbds
} // namespace detail
} // namespace __gnu_pbds
#endif
#endif

View File

@ -34,7 +34,7 @@
// warranty.
/**
* @file const_iterator.hpp
* @file binary_heap_/const_iterator.hpp
* Contains an iterator class returned by the table's const find and insert
* methods.
*/
@ -42,57 +42,48 @@
#ifndef PB_DS_BINARY_HEAP_CONST_ITERATOR_HPP
#define PB_DS_BINARY_HEAP_CONST_ITERATOR_HPP
#include <ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp>
#include <ext/pb_ds/detail/binary_heap_/point_const_iterator.hpp>
#include <debug/debug.h>
namespace __gnu_pbds
{
namespace detail
{
#define PB_DS_BIN_HEAP_CIT_BASE \
binary_heap_point_const_iterator_<Value_Type, Entry, Simple, _Alloc>
#define PB_DS_CLASS_C_DEC \
binary_heap_const_iterator_<Value_Type, Entry, Simple, Allocator>
#define PB_DS_BASE_C_DEC \
binary_heap_const_point_iterator_<Value_Type, Entry, Simple, Allocator>
// Const point-type iterator.
/// Const point-type iterator.
template<typename Value_Type,
typename Entry,
bool Simple,
class Allocator>
class binary_heap_const_iterator_ : public PB_DS_BASE_C_DEC
typename _Alloc>
class binary_heap_const_iterator_ : public PB_DS_BIN_HEAP_CIT_BASE
{
private:
typedef typename PB_DS_BASE_C_DEC::entry_pointer entry_pointer;
typedef PB_DS_BASE_C_DEC base_type;
typedef PB_DS_BIN_HEAP_CIT_BASE base_type;
typedef typename base_type::entry_pointer entry_pointer;
public:
// Category.
typedef std::forward_iterator_tag iterator_category;
typedef std::forward_iterator_tag iterator_category;
// Difference type.
typedef typename Allocator::difference_type difference_type;
typedef typename _Alloc::difference_type difference_type;
// Iterator's value type.
typedef typename base_type::value_type value_type;
typedef typename base_type::value_type value_type;
// Iterator's pointer type.
typedef typename base_type::pointer pointer;
typedef typename base_type::pointer pointer;
// Iterator's const pointer type.
typedef typename base_type::const_pointer const_pointer;
typedef typename base_type::const_pointer const_pointer;
// Iterator's reference type.
typedef typename base_type::reference reference;
typedef typename base_type::reference reference;
// Iterator's const reference type.
typedef typename base_type::const_reference const_reference;
public:
typedef typename base_type::const_reference const_reference;
inline
binary_heap_const_iterator_(entry_pointer p_e) : base_type(p_e)
@ -105,24 +96,21 @@ namespace __gnu_pbds
// Copy constructor.
inline
binary_heap_const_iterator_(const PB_DS_CLASS_C_DEC& other) : base_type(other)
binary_heap_const_iterator_(const binary_heap_const_iterator_& other)
: base_type(other)
{ }
// Compares content to a different iterator object.
inline bool
operator==(const PB_DS_CLASS_C_DEC& other) const
{
return base_type::m_p_e == other.m_p_e;
}
operator==(const binary_heap_const_iterator_& other) const
{ return base_type::m_p_e == other.m_p_e; }
// Compares content (negatively) to a different iterator object.
inline bool
operator!=(const PB_DS_CLASS_C_DEC& other) const
{
return base_type::m_p_e != other.m_p_e;
}
operator!=(const binary_heap_const_iterator_& other) const
{ return base_type::m_p_e != other.m_p_e; }
inline PB_DS_CLASS_C_DEC&
inline binary_heap_const_iterator_&
operator++()
{
_GLIBCXX_DEBUG_ASSERT(base_type::m_p_e != 0);
@ -130,10 +118,10 @@ namespace __gnu_pbds
return *this;
}
inline PB_DS_CLASS_C_DEC
inline binary_heap_const_iterator_
operator++(int)
{
PB_DS_CLASS_C_DEC ret_it(base_type::m_p_e);
binary_heap_const_iterator_ ret_it(base_type::m_p_e);
operator++();
return ret_it;
}
@ -144,8 +132,7 @@ namespace __gnu_pbds
{ ++base_type::m_p_e; }
};
#undef PB_DS_CLASS_C_DEC
#undef PB_DS_BASE_C_DEC
#undef PB_DS_BIN_HEAP_CIT_BASE
} // namespace detail
} // namespace __gnu_pbds

View File

@ -35,7 +35,7 @@
// warranty.
/**
* @file constructors_destructor_fn_imps.hpp
* @file binary_heap_/constructors_destructor_fn_imps.hpp
* Contains an implementation class for binary_heap_.
*/
@ -62,55 +62,37 @@ copy_from_range(It first_it, It last_it)
insert_value(*first_it, s_no_throw_copies_ind);
++first_it;
}
std::make_heap(m_a_entries, m_a_entries + m_size, static_cast<entry_cmp& >(*this));
PB_DS_ASSERT_VALID((*this))
make_heap();
PB_DS_ASSERT_VALID((*this))
}
PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC::
binary_heap_() :
m_size(0),
m_actual_size(resize_policy::min_size),
binary_heap()
: m_size(0), m_actual_size(resize_policy::min_size),
m_a_entries(s_entry_allocator.allocate(m_actual_size))
{
PB_DS_ASSERT_VALID((*this))
}
{ PB_DS_ASSERT_VALID((*this)) }
PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC::
binary_heap_(const Cmp_Fn& r_cmp_fn) :
entry_cmp(r_cmp_fn),
m_size(0),
m_actual_size(resize_policy::min_size),
binary_heap(const Cmp_Fn& r_cmp_fn)
: entry_cmp(r_cmp_fn), m_size(0), m_actual_size(resize_policy::min_size),
m_a_entries(s_entry_allocator.allocate(m_actual_size))
{
PB_DS_ASSERT_VALID((*this))
}
{ PB_DS_ASSERT_VALID((*this)) }
PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC::
binary_heap_(const PB_DS_CLASS_C_DEC& other) :
entry_cmp(other),
resize_policy(other),
m_size(0),
binary_heap(const PB_DS_CLASS_C_DEC& other)
: entry_cmp(other), resize_policy(other), m_size(0),
m_actual_size(other.m_actual_size),
m_a_entries(s_entry_allocator.allocate(m_actual_size))
{
PB_DS_ASSERT_VALID(other)
_GLIBCXX_DEBUG_ASSERT(m_a_entries != other.m_a_entries);
const_iterator first_it = other.begin();
const_iterator last_it = other.end();
__try
{
while (first_it != last_it)
{
insert_value(*first_it, s_no_throw_copies_ind);
++first_it;
}
copy_from_range(other.begin(), other.end());
}
__catch(...)
{
@ -131,9 +113,8 @@ swap(PB_DS_CLASS_C_DEC& other)
PB_DS_ASSERT_VALID((*this))
PB_DS_ASSERT_VALID(other)
_GLIBCXX_DEBUG_ASSERT(m_a_entries != other.m_a_entries);
value_swap(other);
std::swap((entry_cmp& )(*this), (entry_cmp& )other);
std::swap((entry_cmp&)(*this), (entry_cmp&)other);
PB_DS_ASSERT_VALID((*this))
PB_DS_ASSERT_VALID(other)
}
@ -151,10 +132,9 @@ value_swap(PB_DS_CLASS_C_DEC& other)
PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC::
~binary_heap_()
~binary_heap()
{
for (size_type i = 0; i < m_size; ++i)
erase_at(m_a_entries, i, s_no_throw_copies_ind);
s_entry_allocator.deallocate(m_a_entries, m_actual_size);
}

View File

@ -34,7 +34,7 @@
// warranty.
/**
* @file debug_fn_imps.hpp
* @file binary_heap_/debug_fn_imps.hpp
* Contains an implementation class for a binary_heap.
*/
@ -47,7 +47,7 @@ assert_valid(const char* __file, int __line) const
{
#ifdef PB_DS_REGRESSION
s_entry_allocator.check_allocated(m_a_entries, m_actual_size);
#endif
#endif
resize_policy::assert_valid(__file, __line);
PB_DS_DEBUG_VERIFY(m_size <= m_actual_size);
@ -55,7 +55,7 @@ assert_valid(const char* __file, int __line) const
{
#ifdef PB_DS_REGRESSION
s_value_allocator.check_allocated(m_a_entries[i], 1);
#endif
#endif
if (left_child(i) < m_size)
PB_DS_DEBUG_VERIFY(!entry_cmp::operator()(m_a_entries[i], m_a_entries[left_child(i)]));
@ -69,4 +69,4 @@ assert_valid(const char* __file, int __line) const
}
}
#endif
#endif

View File

@ -1,6 +1,6 @@
// -*- C++ -*-
// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
// Copyright (C) 2005, 2006, 2009, 2011 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@ -34,7 +34,7 @@
// warranty.
/**
* @file entry_cmp.hpp
* @file binary_heap_/entry_cmp.hpp
* Contains an implementation class for a binary_heap.
*/
@ -45,48 +45,40 @@ namespace __gnu_pbds
{
namespace detail
{
/// Entry compare, primary template.
template<typename _VTp, typename Cmp_Fn, typename _Alloc, bool No_Throw>
struct entry_cmp;
template<typename Value_Type,
class Cmp_Fn,
bool No_Throw,
class Allocator>
struct entry_cmp
{
typedef Cmp_Fn type;
};
template<typename Value_Type, class Cmp_Fn, class Allocator>
struct entry_cmp<
Value_Type,
Cmp_Fn,
false,
Allocator>
{
public:
typedef
typename Allocator::template rebind<
Value_Type>::other::const_pointer
entry;
struct type : public Cmp_Fn
/// Specialization, true.
template<typename _VTp, typename Cmp_Fn, typename _Alloc>
struct entry_cmp<_VTp, Cmp_Fn, _Alloc, true>
{
public:
inline
type()
{ }
inline
type(const Cmp_Fn& other) : Cmp_Fn(other)
{ }
inline bool
operator()(entry p_lhs, entry p_rhs) const
{
return Cmp_Fn::operator()(*p_lhs, * p_rhs);
}
/// Compare.
typedef Cmp_Fn type;
};
};
/// Specialization, false.
template<typename _VTp, typename Cmp_Fn, typename _Alloc>
struct entry_cmp<_VTp, Cmp_Fn, _Alloc, false>
{
private:
typedef typename _Alloc::template rebind<_VTp> __rebind_v;
public:
typedef typename __rebind_v::other::const_pointer entry;
/// Compare plus entry.
struct type : public Cmp_Fn
{
type() { }
type(const Cmp_Fn& other) : Cmp_Fn(other) { }
bool
operator()(entry lhs, entry rhs) const
{ return Cmp_Fn::operator()(*lhs, *rhs); }
};
};
} // namespace detail
} // namespace __gnu_pbds

View File

@ -1,6 +1,6 @@
// -*- C++ -*-
// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
// Copyright (C) 2005, 2006, 2009, 2011 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@ -34,7 +34,7 @@
// warranty.
/**
* @file entry_pred.hpp
* @file binary_heap_/entry_pred.hpp
* Contains an implementation class for a binary_heap.
*/
@ -45,48 +45,40 @@ namespace __gnu_pbds
{
namespace detail
{
/// Entry predicate primary class template.
template<typename _VTp, typename Pred, typename _Alloc, bool No_Throw>
struct entry_pred;
template<typename Value_Type,
class Pred,
bool No_Throw,
class Allocator>
struct entry_pred
{
typedef Pred type;
};
template<typename Value_Type, class Pred, class Allocator>
struct entry_pred<
Value_Type,
Pred,
false,
Allocator>
{
public:
typedef
typename Allocator::template rebind<
Value_Type>::other::const_pointer
entry;
struct type : public Pred
/// Specialization, true.
template<typename _VTp, typename Pred, typename _Alloc>
struct entry_pred<_VTp, Pred, _Alloc, true>
{
public:
inline
type()
{ }
inline
type(const Pred& other) : Pred(other)
{ }
inline bool
operator()(entry p_v) const
{
return Pred::operator()(*p_v);
}
typedef Pred type;
};
};
/// Specialization, false.
template<typename _VTp, typename Pred, typename _Alloc>
struct entry_pred<_VTp, Pred, _Alloc, false>
{
private:
typedef typename _Alloc::template rebind<_VTp> __rebind_v;
public:
typedef typename __rebind_v::other::const_pointer entry;
struct type : public Pred
{
inline
type() { }
inline
type(const Pred& other) : Pred(other) { }
inline bool
operator()(entry p_v) const
{ return Pred::operator()(*p_v); }
};
};
} // namespace detail
} // namespace __gnu_pbds

View File

@ -35,7 +35,7 @@
// warranty.
/**
* @file erase_fn_imps.hpp
* @file binary_heap_/erase_fn_imps.hpp
* Contains an implementation class for a binary_heap.
*/
@ -49,23 +49,17 @@ clear()
__try
{
const size_type actual_size = resize_policy::get_new_size_for_arbitrary(0);
entry_pointer a_entries = s_entry_allocator.allocate(actual_size);
resize_policy::notify_arbitrary(actual_size);
const size_type new_size = resize_policy::get_new_size_for_arbitrary(0);
entry_pointer new_entries = s_entry_allocator.allocate(new_size);
resize_policy::notify_arbitrary(new_size);
s_entry_allocator.deallocate(m_a_entries, m_actual_size);
m_actual_size = actual_size;
m_a_entries = a_entries;
m_actual_size = new_size;
m_a_entries = new_entries;
}
__catch(...)
{ }
m_size = 0;
PB_DS_ASSERT_VALID((*this))
}
@ -92,13 +86,9 @@ pop()
PB_DS_ASSERT_VALID((*this))
_GLIBCXX_DEBUG_ASSERT(!empty());
erase_at(m_a_entries, 0, s_no_throw_copies_ind);
std::pop_heap(m_a_entries, m_a_entries + m_size,
static_cast<entry_cmp& >(*this));
pop_heap();
erase_at(m_a_entries, m_size - 1, s_no_throw_copies_ind);
resize_for_erase_if_needed();
_GLIBCXX_DEBUG_ASSERT(m_size > 0);
--m_size;
@ -113,43 +103,32 @@ erase_if(Pred pred)
{
PB_DS_ASSERT_VALID((*this))
typedef typename entry_pred<value_type, Pred, simple_value, Allocator>::type
typedef typename entry_pred<value_type, Pred, _Alloc, simple_value>::type
pred_t;
const size_type left = partition(pred_t(pred));
_GLIBCXX_DEBUG_ASSERT(m_size >= left);
const size_type ersd = m_size - left;
for (size_type i = left; i < m_size; ++i)
erase_at(m_a_entries, i, s_no_throw_copies_ind);
__try
{
const size_type actual_size =
const size_type new_size =
resize_policy::get_new_size_for_arbitrary(left);
entry_pointer a_entries = s_entry_allocator.allocate(actual_size);
std::copy(m_a_entries, m_a_entries + left, a_entries);
entry_pointer new_entries = s_entry_allocator.allocate(new_size);
std::copy(m_a_entries, m_a_entries + left, new_entries);
s_entry_allocator.deallocate(m_a_entries, m_actual_size);
m_actual_size = actual_size;
m_actual_size = new_size;
resize_policy::notify_arbitrary(m_actual_size);
}
__catch(...)
{ };
m_size = left;
std::make_heap(m_a_entries, m_a_entries + m_size,
static_cast<entry_cmp& >(*this));
make_heap();
PB_DS_ASSERT_VALID((*this))
return ersd;
}
@ -162,16 +141,12 @@ erase(point_iterator it)
_GLIBCXX_DEBUG_ASSERT(!empty());
const size_type fix_pos = it.m_p_e - m_a_entries;
std::swap(*it.m_p_e, m_a_entries[m_size - 1]);
erase_at(m_a_entries, m_size - 1, s_no_throw_copies_ind);
resize_for_erase_if_needed();
_GLIBCXX_DEBUG_ASSERT(m_size > 0);
--m_size;
_GLIBCXX_DEBUG_ASSERT(fix_pos <= m_size);
if (fix_pos != m_size)
@ -190,21 +165,15 @@ resize_for_erase_if_needed()
__try
{
const size_type new_actual_size =
resize_policy::get_new_size_for_shrink();
entry_pointer a_new_entries = s_entry_allocator.allocate(new_actual_size);
const size_type new_size = resize_policy::get_new_size_for_shrink();
entry_pointer new_entries = s_entry_allocator.allocate(new_size);
resize_policy::notify_shrink_resize();
_GLIBCXX_DEBUG_ASSERT(m_size > 0);
std::copy(m_a_entries, m_a_entries + m_size - 1, a_new_entries);
std::copy(m_a_entries, m_a_entries + m_size - 1, new_entries);
s_entry_allocator.deallocate(m_a_entries, m_actual_size);
m_actual_size = new_actual_size;
m_a_entries = a_new_entries;
m_actual_size = new_size;
m_a_entries = new_entries;
}
__catch(...)
{ }
@ -230,9 +199,7 @@ partition(Pred pred)
else
{
_GLIBCXX_DEBUG_ASSERT(left < right);
std::swap(m_a_entries[left], m_a_entries[right]);
++left;
--right;
}

View File

@ -34,7 +34,7 @@
// warranty.
/**
* @file find_fn_imps.hpp
* @file binary_heap_/find_fn_imps.hpp
* Contains an implementation class for a binary_heap.
*/
@ -45,7 +45,6 @@ top() const
{
PB_DS_ASSERT_VALID((*this))
_GLIBCXX_DEBUG_ASSERT(!empty());
return top_imp(s_no_throw_copies_ind);
}
@ -53,39 +52,28 @@ PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::const_reference
PB_DS_CLASS_C_DEC::
top_imp(true_type) const
{
return* m_a_entries;
}
{ return *m_a_entries; }
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::const_reference
PB_DS_CLASS_C_DEC::
top_imp(false_type) const
{
return** m_a_entries;
}
{ return **m_a_entries; }
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::size_type
PB_DS_CLASS_C_DEC::
left_child(size_type i)
{
return i* 2 + 1;
}
{ return i * 2 + 1; }
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::size_type
PB_DS_CLASS_C_DEC::
right_child(size_type i)
{
return i* 2 + 2;
}
{ return i * 2 + 2; }
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::size_type
PB_DS_CLASS_C_DEC::
parent(size_type i)
{
return (i - 1) / 2;
}
{ return (i - 1) / 2; }

View File

@ -34,7 +34,7 @@
// warranty.
/**
* @file info_fn_imps.hpp
* @file binary_heap_/info_fn_imps.hpp
* Contains an implementation class for a binary_heap.
*/
@ -42,23 +42,17 @@ PB_DS_CLASS_T_DEC
inline bool
PB_DS_CLASS_C_DEC::
empty() const
{
return (m_size == 0);
}
{ return m_size == 0; }
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::size_type
PB_DS_CLASS_C_DEC::
size() const
{
return (m_size);
}
{ return m_size; }
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::size_type
PB_DS_CLASS_C_DEC::
max_size() const
{
return (s_entry_allocator.max_size());
}
{ return s_entry_allocator.max_size(); }

View File

@ -34,7 +34,7 @@
// warranty.
/**
* @file insert_fn_imps.hpp
* @file binary_heap_/insert_fn_imps.hpp
* Contains an implementation class for a binary_heap.
*/
@ -45,8 +45,7 @@ push(const_reference r_val)
{
PB_DS_ASSERT_VALID((*this))
insert_value(r_val, s_no_throw_copies_ind);
std::push_heap(m_a_entries, m_a_entries + m_size,
static_cast<entry_cmp&>(*this));
push_heap();
PB_DS_ASSERT_VALID((*this))
return point_iterator(m_a_entries);
}
@ -57,7 +56,6 @@ PB_DS_CLASS_C_DEC::
insert_value(value_type val, true_type)
{
resize_for_insert_if_needed();
m_a_entries[m_size++] = val;
}
@ -74,15 +72,6 @@ insert_value(const_reference r_val, false_type)
m_a_entries[m_size++] = p_new;
}
PB_DS_CLASS_T_DEC
inline void
PB_DS_CLASS_C_DEC::
insert_entry(entry e)
{
resize_for_insert_if_needed();
m_a_entries[m_size++] = e;
}
PB_DS_CLASS_T_DEC
inline void
PB_DS_CLASS_C_DEC::
@ -94,13 +83,15 @@ resize_for_insert_if_needed()
return;
}
const size_type new_actual_size = resize_policy::get_new_size_for_grow();
entry_pointer a_new_entries = s_entry_allocator.allocate(new_actual_size);
const size_type new_size = resize_policy::get_new_size_for_grow();
entry_pointer new_entries = s_entry_allocator.allocate(new_size);
resize_policy::notify_grow_resize();
std::copy(m_a_entries, m_a_entries + m_size, a_new_entries);
std::copy(m_a_entries, m_a_entries + m_size, new_entries);
s_entry_allocator.deallocate(m_a_entries, m_actual_size);
m_actual_size = new_actual_size;
m_a_entries = a_new_entries;
m_actual_size = new_size;
m_a_entries = new_entries;
make_heap();
}
PB_DS_CLASS_T_DEC
@ -112,6 +103,7 @@ modify(point_iterator it, const_reference r_new_val)
swap_value_imp(it.m_p_e, r_new_val, s_no_throw_copies_ind);
fix(it.m_p_e);
PB_DS_ASSERT_VALID((*this))
_GLIBCXX_DEBUG_ASSERT(is_heap());
}
PB_DS_CLASS_T_DEC
@ -123,13 +115,13 @@ fix(entry_pointer p_e)
if (i > 0 && entry_cmp::operator()(m_a_entries[parent(i)], m_a_entries[i]))
{
size_type parent_i = parent(i);
while (i > 0
while (i > 0
&& entry_cmp::operator()(m_a_entries[parent_i], m_a_entries[i]))
{
{
std::swap(m_a_entries[i], m_a_entries[parent_i]);
i = parent_i;
parent_i = parent(i);
}
}
PB_DS_ASSERT_VALID((*this))
return;
@ -137,29 +129,30 @@ fix(entry_pointer p_e)
while (i < m_size)
{
const size_type left_child_i = left_child(i);
const size_type right_child_i = right_child(i);
_GLIBCXX_DEBUG_ASSERT(right_child_i > left_child_i);
const bool smaller_than_left_child = left_child_i < m_size &&
entry_cmp::operator()(m_a_entries[i], m_a_entries[left_child_i]);
const size_type lchild_i = left_child(i);
const size_type rchild_i = right_child(i);
_GLIBCXX_DEBUG_ASSERT(rchild_i > lchild_i);
const bool smaller_than_right_child = right_child_i < m_size &&
entry_cmp::operator()(m_a_entries[i], m_a_entries[right_child_i]);
const bool smaller_than_lchild = lchild_i < m_size &&
entry_cmp::operator()(m_a_entries[i], m_a_entries[lchild_i]);
const bool swap_with_r_child = smaller_than_right_child && (!smaller_than_left_child || entry_cmp::operator()(m_a_entries[left_child_i], m_a_entries[right_child_i]));
const bool smaller_than_rchild = rchild_i < m_size &&
entry_cmp::operator()(m_a_entries[i], m_a_entries[rchild_i]);
const bool swap_with_l_child = !swap_with_r_child && smaller_than_left_child;
const bool swap_with_rchild = smaller_than_rchild && (!smaller_than_lchild || entry_cmp::operator()(m_a_entries[lchild_i], m_a_entries[rchild_i]));
if (swap_with_l_child)
{
std::swap(m_a_entries[i], m_a_entries[left_child_i]);
i = left_child_i;
}
else if (swap_with_r_child)
{
std::swap(m_a_entries[i], m_a_entries[right_child_i]);
i = right_child_i;
}
const bool swap_with_lchild = !swap_with_rchild && smaller_than_lchild;
if (swap_with_lchild)
{
std::swap(m_a_entries[i], m_a_entries[lchild_i]);
i = lchild_i;
}
else if (swap_with_rchild)
{
std::swap(m_a_entries[i], m_a_entries[rchild_i]);
i = rchild_i;
}
else
i = m_size;
}
@ -169,9 +162,7 @@ PB_DS_CLASS_T_DEC
inline void
PB_DS_CLASS_C_DEC::
swap_value_imp(entry_pointer p_e, value_type new_val, true_type)
{
* p_e = new_val;
}
{ *p_e = new_val; }
PB_DS_CLASS_T_DEC
inline void

View File

@ -34,7 +34,7 @@
// warranty.
/**
* @file iterators_fn_imps.hpp
* @file binary_heap_/iterators_fn_imps.hpp
* Contains an implementation class for a binary_heap.
*/
@ -42,31 +42,23 @@ PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::iterator
PB_DS_CLASS_C_DEC::
begin()
{
return (iterator(m_a_entries));
}
{ return iterator(m_a_entries); }
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::const_iterator
PB_DS_CLASS_C_DEC::
begin() const
{
return (const_iterator(m_a_entries));
}
{ return const_iterator(m_a_entries); }
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::iterator
PB_DS_CLASS_C_DEC::
end()
{
return (iterator(m_a_entries + m_size));
}
{ return iterator(m_a_entries + m_size); }
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::const_iterator
PB_DS_CLASS_C_DEC::
end() const
{
return (const_iterator(m_a_entries + m_size));
}
{ return const_iterator(m_a_entries + m_size); }

View File

@ -34,9 +34,9 @@
// warranty.
/**
* @file const_point_iterator.hpp
* @file binary_heap_/point_const_iterator.hpp
* Contains an iterator class returned by the table's const find and insert
* methods.
* methods.
*/
#ifndef PB_DS_BINARY_HEAP_CONST_FIND_ITERATOR_HPP
@ -51,11 +51,11 @@ namespace __gnu_pbds
{
// Const point-type iterator.
template<typename Value_Type, typename Entry, bool Simple,
typename Allocator>
class binary_heap_const_point_iterator_
typename _Alloc>
class binary_heap_point_const_iterator_
{
protected:
typedef typename Allocator::template rebind<Entry>::other::pointer entry_pointer;
typedef typename _Alloc::template rebind<Entry>::other::pointer entry_pointer;
public:
// Category.
@ -68,35 +68,35 @@ namespace __gnu_pbds
typedef Value_Type value_type;
// Iterator's pointer type.
typedef typename Allocator::template rebind<value_type>::other::pointer
typedef typename _Alloc::template rebind<value_type>::other::pointer
pointer;
// Iterator's const pointer type.
typedef
typename Allocator::template rebind<value_type>::other::const_pointer
typename _Alloc::template rebind<value_type>::other::const_pointer
const_pointer;
// Iterator's reference type.
typedef
typename Allocator::template rebind<value_type>::other::reference
typename _Alloc::template rebind<value_type>::other::reference
reference;
// Iterator's const reference type.
typedef
typename Allocator::template rebind<value_type>::other::const_reference
typename _Alloc::template rebind<value_type>::other::const_reference
const_reference;
inline
binary_heap_const_point_iterator_(entry_pointer p_e) : m_p_e(p_e)
binary_heap_point_const_iterator_(entry_pointer p_e) : m_p_e(p_e)
{ }
// Default constructor.
inline
binary_heap_const_point_iterator_() : m_p_e(0) { }
binary_heap_point_const_iterator_() : m_p_e(0) { }
// Copy constructor.
inline
binary_heap_const_point_iterator_(const binary_heap_const_point_iterator_& other)
binary_heap_point_const_iterator_(const binary_heap_point_const_iterator_& other)
: m_p_e(other.m_p_e)
{ }
@ -118,12 +118,12 @@ namespace __gnu_pbds
// Compares content to a different iterator object.
inline bool
operator==(const binary_heap_const_point_iterator_& other) const
operator==(const binary_heap_point_const_iterator_& other) const
{ return m_p_e == other.m_p_e; }
// Compares content (negatively) to a different iterator object.
inline bool
operator!=(const binary_heap_const_point_iterator_& other) const
operator!=(const binary_heap_point_const_iterator_& other) const
{ return m_p_e != other.m_p_e; }
private:

View File

@ -34,7 +34,7 @@
// warranty.
/**
* @file policy_access_fn_imps.hpp
* @file binary_heap_/policy_access_fn_imps.hpp
* Contains an implementation class for a binary_heap.
*/

View File

@ -34,7 +34,7 @@
// warranty.
/**
* @file resize_policy.hpp
* @file binary_heap_/resize_policy.hpp
* Contains an implementation class for a binary_heap.
*/
@ -47,40 +47,49 @@ namespace __gnu_pbds
{
namespace detail
{
#define PB_DS_CLASS_T_DEC template<typename Size_Type>
#define PB_DS_CLASS_C_DEC resize_policy<Size_Type>
template<typename Size_Type>
/// Resize policy for binary heap.
template<typename _Tp>
class resize_policy
{
public:
typedef Size_Type size_type;
private:
enum
{
min_size = 16
ratio = 8,
factor = 2
};
// Next shrink size.
_Tp m_shrink_size;
// Next grow size.
_Tp m_grow_size;
public:
inline
resize_policy();
typedef _Tp size_type;
static const _Tp min_size = 16;
resize_policy() : m_shrink_size(0), m_grow_size(min_size)
{ PB_DS_ASSERT_VALID((*this)) }
resize_policy(const resize_policy& other)
: m_shrink_size(other.m_shrink_size), m_grow_size(other.m_grow_size)
{ PB_DS_ASSERT_VALID((*this)) }
inline void
swap(PB_DS_CLASS_C_DEC& other);
swap(resize_policy<_Tp>&);
inline bool
resize_needed_for_grow(size_type size) const;
resize_needed_for_grow(size_type) const;
inline bool
resize_needed_for_shrink(size_type size) const;
resize_needed_for_shrink(size_type) const;
inline bool
grow_needed(size_type size) const;
grow_needed(size_type) const;
inline bool
shrink_needed(size_type size) const;
shrink_needed(size_type) const;
inline size_type
get_new_size_for_grow() const;
@ -88,8 +97,8 @@ namespace __gnu_pbds
inline size_type
get_new_size_for_shrink() const;
size_type
get_new_size_for_arbitrary(size_type size) const;
inline size_type
get_new_size_for_arbitrary(size_type) const;
inline void
notify_grow_resize();
@ -98,83 +107,67 @@ namespace __gnu_pbds
notify_shrink_resize();
void
notify_arbitrary(size_type actual_size);
notify_arbitrary(size_type);
#ifdef _GLIBCXX_DEBUG
void
assert_valid(const char* file, int line) const;
#endif
assert_valid(const char*, int) const;
#endif
#ifdef PB_DS_BINARY_HEAP_TRACE_
void
trace() const;
#endif
private:
enum
{
ratio = 8,
factor = 2
};
private:
size_type m_next_shrink_size;
size_type m_next_grow_size;
#endif
};
PB_DS_CLASS_T_DEC
inline
PB_DS_CLASS_C_DEC::
resize_policy() :
m_next_shrink_size(0),
m_next_grow_size(min_size)
{ PB_DS_ASSERT_VALID((*this)) }
template<typename _Tp>
const _Tp resize_policy<_Tp>::min_size;
PB_DS_CLASS_T_DEC
template<typename _Tp>
inline void
PB_DS_CLASS_C_DEC::
swap(PB_DS_CLASS_C_DEC& other)
resize_policy<_Tp>::
swap(resize_policy<_Tp>& other)
{
std::swap(m_next_shrink_size, other.m_next_shrink_size);
std::swap(m_next_grow_size, other.m_next_grow_size);
std::swap(m_shrink_size, other.m_shrink_size);
std::swap(m_grow_size, other.m_grow_size);
}
PB_DS_CLASS_T_DEC
template<typename _Tp>
inline bool
PB_DS_CLASS_C_DEC::
resize_policy<_Tp>::
resize_needed_for_grow(size_type size) const
{
_GLIBCXX_DEBUG_ASSERT(size <= m_next_grow_size);
return size == m_next_grow_size;
_GLIBCXX_DEBUG_ASSERT(size <= m_grow_size);
return size == m_grow_size;
}
PB_DS_CLASS_T_DEC
template<typename _Tp>
inline bool
PB_DS_CLASS_C_DEC::
resize_policy<_Tp>::
resize_needed_for_shrink(size_type size) const
{
_GLIBCXX_DEBUG_ASSERT(size <= m_next_grow_size);
return size == m_next_shrink_size;
_GLIBCXX_DEBUG_ASSERT(size <= m_grow_size);
return size == m_shrink_size;
}
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::size_type
PB_DS_CLASS_C_DEC::
template<typename _Tp>
inline typename resize_policy<_Tp>::size_type
resize_policy<_Tp>::
get_new_size_for_grow() const
{ return m_next_grow_size* factor; }
{ return m_grow_size * factor; }
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::size_type
PB_DS_CLASS_C_DEC::
template<typename _Tp>
inline typename resize_policy<_Tp>::size_type
resize_policy<_Tp>::
get_new_size_for_shrink() const
{
const size_type half_size = m_next_grow_size / factor;
return std::max(static_cast<size_type>(min_size), half_size);
const size_type half_size = m_grow_size / factor;
return std::max(min_size, half_size);
}
PB_DS_CLASS_T_DEC
inline typename PB_DS_CLASS_C_DEC::size_type
PB_DS_CLASS_C_DEC::
template<typename _Tp>
inline typename resize_policy<_Tp>::size_type
resize_policy<_Tp>::
get_new_size_for_arbitrary(size_type size) const
{
size_type ret = min_size;
@ -183,71 +176,65 @@ namespace __gnu_pbds
return ret;
}
PB_DS_CLASS_T_DEC
template<typename _Tp>
inline void
PB_DS_CLASS_C_DEC::
resize_policy<_Tp>::
notify_grow_resize()
{
PB_DS_ASSERT_VALID((*this))
_GLIBCXX_DEBUG_ASSERT(m_next_grow_size >= min_size);
m_next_grow_size *= factor;
m_next_shrink_size = m_next_grow_size / ratio;
_GLIBCXX_DEBUG_ASSERT(m_grow_size >= min_size);
m_grow_size *= factor;
m_shrink_size = m_grow_size / ratio;
PB_DS_ASSERT_VALID((*this))
}
PB_DS_CLASS_T_DEC
template<typename _Tp>
inline void
PB_DS_CLASS_C_DEC::
resize_policy<_Tp>::
notify_shrink_resize()
{
PB_DS_ASSERT_VALID((*this))
m_next_shrink_size /= factor;
if (m_next_shrink_size == 1)
m_next_shrink_size = 0;
m_next_grow_size =
std::max(m_next_grow_size / factor, static_cast<size_type>(min_size));
m_shrink_size /= factor;
if (m_shrink_size == 1)
m_shrink_size = 0;
m_grow_size = std::max(m_grow_size / factor, min_size);
PB_DS_ASSERT_VALID((*this))
}
PB_DS_CLASS_T_DEC
template<typename _Tp>
inline void
PB_DS_CLASS_C_DEC::
resize_policy<_Tp>::
notify_arbitrary(size_type actual_size)
{
m_next_grow_size = actual_size;
m_next_shrink_size = m_next_grow_size / ratio;
m_grow_size = actual_size;
m_shrink_size = m_grow_size / ratio;
PB_DS_ASSERT_VALID((*this))
}
#ifdef _GLIBCXX_DEBUG
PB_DS_CLASS_T_DEC
template<typename _Tp>
void
PB_DS_CLASS_C_DEC::
resize_policy<_Tp>::
assert_valid(const char* __file, int __line) const
{
PB_DS_DEBUG_VERIFY(m_next_shrink_size == 0 ||
m_next_shrink_size* ratio == m_next_grow_size);
PB_DS_DEBUG_VERIFY(m_next_grow_size >= min_size);
PB_DS_DEBUG_VERIFY(m_shrink_size == 0
|| m_shrink_size * ratio == m_grow_size);
PB_DS_DEBUG_VERIFY(m_grow_size >= min_size);
}
#endif
#endif
#ifdef PB_DS_BINARY_HEAP_TRACE_
PB_DS_CLASS_T_DEC
template<typename _Tp>
void
PB_DS_CLASS_C_DEC::
resize_policy<_Tp>::
trace() const
{
std::cerr << "shrink = " << m_next_shrink_size <<
" grow = " << m_next_grow_size << std::endl;
std::cerr << "shrink = " << m_shrink_size
<< " grow = " << m_grow_size << std::endl;
}
#endif
#undef PB_DS_CLASS_T_DEC
#undef PB_DS_CLASS_C_DEC
#endif
} // namespace detail
} // namespace __gnu_pbds
#endif
#endif

View File

@ -35,7 +35,7 @@
// warranty.
/**
* @file split_join_fn_imps.hpp
* @file binary_heap_/split_join_fn_imps.hpp
* Contains an implementation class for a binary_heap.
*/
@ -48,40 +48,30 @@ split(Pred pred, PB_DS_CLASS_C_DEC& other)
PB_DS_ASSERT_VALID((*this))
typedef
typename entry_pred<
value_type,
Pred,
simple_value,
Allocator>::type
typename entry_pred<value_type, Pred, _Alloc, simple_value>::type
pred_t;
const size_type left = partition(pred_t(pred));
_GLIBCXX_DEBUG_ASSERT(m_size >= left);
const size_type ersd = m_size - left;
_GLIBCXX_DEBUG_ASSERT(m_size >= ersd);
const size_type actual_size =
resize_policy::get_new_size_for_arbitrary(left);
const size_type other_actual_size =
other.get_new_size_for_arbitrary(ersd);
const size_type new_size = resize_policy::get_new_size_for_arbitrary(left);
const size_type other_actual_size = other.get_new_size_for_arbitrary(ersd);
entry_pointer a_entries = 0;
entry_pointer a_other_entries = 0;
__try
{
a_entries = s_entry_allocator.allocate(actual_size);
a_entries = s_entry_allocator.allocate(new_size);
a_other_entries = s_entry_allocator.allocate(other_actual_size);
}
__catch(...)
{
if (a_entries != 0)
s_entry_allocator.deallocate(a_entries, actual_size);
s_entry_allocator.deallocate(a_entries, new_size);
if (a_other_entries != 0)
s_entry_allocator.deallocate(a_other_entries, other_actual_size);
@ -92,14 +82,14 @@ split(Pred pred, PB_DS_CLASS_C_DEC& other)
for (size_type i = 0; i < other.m_size; ++i)
erase_at(other.m_a_entries, i, s_no_throw_copies_ind);
_GLIBCXX_DEBUG_ASSERT(actual_size >= left);
_GLIBCXX_DEBUG_ASSERT(new_size >= left);
std::copy(m_a_entries, m_a_entries + left, a_entries);
std::copy(m_a_entries + left, m_a_entries + m_size, a_other_entries);
s_entry_allocator.deallocate(m_a_entries, m_actual_size);
s_entry_allocator.deallocate(other.m_a_entries, other.m_actual_size);
m_actual_size = actual_size;
m_actual_size = new_size;
other.m_actual_size = other_actual_size;
m_size = left;
@ -108,8 +98,8 @@ split(Pred pred, PB_DS_CLASS_C_DEC& other)
m_a_entries = a_entries;
other.m_a_entries = a_other_entries;
std::make_heap(m_a_entries, m_a_entries + m_size, static_cast<entry_cmp& >(*this));
std::make_heap(other.m_a_entries, other.m_a_entries + other.m_size, static_cast<entry_cmp& >(other));
make_heap();
other.make_heap();
resize_policy::notify_arbitrary(m_actual_size);
other.notify_arbitrary(other.m_actual_size);
@ -127,20 +117,20 @@ join(PB_DS_CLASS_C_DEC& other)
PB_DS_ASSERT_VALID(other)
const size_type len = m_size + other.m_size;
const size_type actual_size = resize_policy::get_new_size_for_arbitrary(len);
const size_type new_size = resize_policy::get_new_size_for_arbitrary(len);
entry_pointer a_entries = 0;
entry_pointer a_other_entries = 0;
__try
{
a_entries = s_entry_allocator.allocate(actual_size);
a_entries = s_entry_allocator.allocate(new_size);
a_other_entries = s_entry_allocator.allocate(resize_policy::min_size);
}
__catch(...)
{
if (a_entries != 0)
s_entry_allocator.deallocate(a_entries, actual_size);
s_entry_allocator.deallocate(a_entries, new_size);
if (a_other_entries != 0)
s_entry_allocator.deallocate(a_other_entries, resize_policy::min_size);
@ -149,25 +139,23 @@ join(PB_DS_CLASS_C_DEC& other)
}
std::copy(m_a_entries, m_a_entries + m_size, a_entries);
std::copy(other.m_a_entries, other.m_a_entries + other.m_size, a_entries + m_size);
std::copy(other.m_a_entries, other.m_a_entries + other.m_size,
a_entries + m_size);
s_entry_allocator.deallocate(m_a_entries, m_actual_size);
m_a_entries = a_entries;
m_size = len;
m_actual_size = actual_size;
resize_policy::notify_arbitrary(actual_size);
std::make_heap(m_a_entries, m_a_entries + m_size, static_cast<entry_cmp& >(*this));
m_actual_size = new_size;
resize_policy::notify_arbitrary(new_size);
make_heap();
s_entry_allocator.deallocate(other.m_a_entries, other.m_actual_size);
other.m_a_entries = a_other_entries;
other.m_size = 0;
other.m_actual_size = resize_policy::min_size;
other.notify_arbitrary(resize_policy::min_size);
other.make_heap();
PB_DS_ASSERT_VALID((*this))
PB_DS_ASSERT_VALID(other)
}

View File

@ -34,7 +34,7 @@
// warranty.
/**
* @file trace_fn_imps.hpp
* @file binary_heap_/trace_fn_imps.hpp
* Contains an implementation class for a binary_heap.
*/

View File

@ -53,64 +53,56 @@ namespace __gnu_pbds
{
namespace detail
{
#define PB_DS_CLASS_T_DEC \
template<typename Value_Type, class Cmp_Fn, class Allocator>
template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
#define PB_DS_CLASS_C_DEC \
binomial_heap_<Value_Type, Cmp_Fn, Allocator>
binomial_heap<Value_Type, Cmp_Fn, _Alloc>
#define PB_DS_BASE_C_DEC \
binomial_heap_base_<Value_Type, Cmp_Fn, Allocator>
/**
* class description = "8y|\|0|\/|i41 h34p 74813">
**/
template<typename Value_Type, class Cmp_Fn, class Allocator>
class binomial_heap_ : public PB_DS_BASE_C_DEC
/// Binomial heap.
template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
class binomial_heap
: public binomial_heap_base<Value_Type, Cmp_Fn, _Alloc>
{
private:
typedef PB_DS_BASE_C_DEC base_type;
typedef typename base_type::node_pointer node_pointer;
typedef typename base_type::const_node_pointer const_node_pointer;
typedef binomial_heap_base<Value_Type, Cmp_Fn, _Alloc> base_type;
typedef typename base_type::node_pointer node_pointer;
typedef typename base_type::node_const_pointer node_const_pointer;
public:
typedef Value_Type value_type;
typedef typename Allocator::size_type size_type;
typedef typename Allocator::difference_type difference_type;
typedef typename base_type::pointer pointer;
typedef typename base_type::const_pointer const_pointer;
typedef typename base_type::reference reference;
typedef typename base_type::const_reference const_reference;
typedef typename base_type::const_point_iterator const_point_iterator;
typedef typename base_type::point_iterator point_iterator;
typedef typename base_type::const_iterator const_iterator;
typedef typename base_type::iterator iterator;
typedef typename base_type::cmp_fn cmp_fn;
typedef typename base_type::allocator_type allocator_type;
typedef Value_Type value_type;
typedef typename _Alloc::size_type size_type;
typedef typename _Alloc::difference_type difference_type;
typedef typename base_type::pointer pointer;
typedef typename base_type::const_pointer const_pointer;
typedef typename base_type::reference reference;
typedef typename base_type::const_reference const_reference;
typedef typename base_type::point_const_iterator point_const_iterator;
typedef typename base_type::point_iterator point_iterator;
typedef typename base_type::const_iterator const_iterator;
typedef typename base_type::iterator iterator;
typedef typename base_type::cmp_fn cmp_fn;
typedef typename base_type::allocator_type allocator_type;
binomial_heap_();
binomial_heap();
binomial_heap_(const Cmp_Fn& r_cmp_fn);
binomial_heap(const Cmp_Fn&);
binomial_heap_(const PB_DS_CLASS_C_DEC& other);
binomial_heap(const binomial_heap&);
~binomial_heap_();
~binomial_heap();
protected:
#ifdef _GLIBCXX_DEBUG
void
assert_valid(const char* file, int line) const;
#endif
assert_valid(const char*, int) const;
#endif
};
#include <ext/pb_ds/detail/binomial_heap_/constructors_destructor_fn_imps.hpp>
#include <ext/pb_ds/detail/binomial_heap_/debug_fn_imps.hpp>
#undef PB_DS_CLASS_C_DEC
#undef PB_DS_CLASS_T_DEC
#undef PB_DS_BASE_C_DEC
} // namespace detail
} // namespace __gnu_pbds

View File

@ -34,28 +34,27 @@
// warranty.
/**
* @file constructors_destructor_fn_imps.hpp
* @file detail/binomial_heap_/constructors_destructor_fn_imps.hpp
* Contains an implementation for binomial_heap_.
*/
PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC::
binomial_heap_()
binomial_heap()
{ PB_DS_ASSERT_VALID((*this)) }
PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC::
binomial_heap_(const Cmp_Fn& r_cmp_fn) :
PB_DS_BASE_C_DEC(r_cmp_fn)
binomial_heap(const Cmp_Fn& r_cmp_fn)
: base_type(r_cmp_fn)
{ PB_DS_ASSERT_VALID((*this)) }
PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC::
binomial_heap_(const PB_DS_CLASS_C_DEC& other) :
PB_DS_BASE_C_DEC(other)
binomial_heap(const PB_DS_CLASS_C_DEC& other)
: base_type(other)
{ PB_DS_ASSERT_VALID((*this)) }
PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC::
~binomial_heap_() { }
~binomial_heap() { }

View File

@ -34,7 +34,7 @@
// warranty.
/**
* @file debug_fn_imps.hpp
* @file detail/binomial_heap_/debug_fn_imps.hpp
* Contains an implementation for binomial_heap_.
*/

View File

@ -34,7 +34,7 @@
// warranty.
/**
* @file binomial_heap_base_.hpp
* @file binomial_heap_base_/binomial_heap_base_.hpp
* Contains an implementation class for a base of binomial heaps.
*/
@ -51,96 +51,65 @@
#include <ext/pb_ds/detail/cond_dealtor.hpp>
#include <ext/pb_ds/detail/type_utils.hpp>
#include <ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp>
#include <ext/pb_ds/detail/left_child_next_sibling_heap_/null_metadata.hpp>
namespace __gnu_pbds
{
namespace detail
{
#define PB_DS_CLASS_T_DEC \
template<typename Value_Type, class Cmp_Fn, class Allocator>
template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
#define PB_DS_CLASS_C_DEC \
binomial_heap_base_<Value_Type, Cmp_Fn, Allocator>
binomial_heap_base<Value_Type, Cmp_Fn, _Alloc>
#ifdef _GLIBCXX_DEBUG
#define PB_DS_BASE_C_DEC \
left_child_next_sibling_heap_<Value_Type, Cmp_Fn, \
typename Allocator::size_type, \
Allocator, false>
#else
#define PB_DS_BASE_C_DEC \
left_child_next_sibling_heap_<Value_Type, Cmp_Fn, \
typename Allocator::size_type, Allocator>
#endif
#define PB_DS_B_HEAP_BASE \
left_child_next_sibling_heap<Value_Type, Cmp_Fn, \
typename _Alloc::size_type, _Alloc, false>
#else
#define PB_DS_B_HEAP_BASE \
left_child_next_sibling_heap<Value_Type, Cmp_Fn, \
typename _Alloc::size_type, _Alloc>
#endif
/**
* class description = "8y|\|0|\/|i41 h34p 74813">
**/
template<typename Value_Type, class Cmp_Fn, class Allocator>
class binomial_heap_base_ : public PB_DS_BASE_C_DEC
/// Base class for binomial heap.
template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
class binomial_heap_base
: public PB_DS_B_HEAP_BASE
{
private:
typedef PB_DS_BASE_C_DEC base_type;
typedef typename _Alloc::template rebind<Value_Type>::other __rebind_v;
typedef PB_DS_B_HEAP_BASE base_type;
protected:
typedef typename base_type::node node;
typedef typename base_type::node_pointer node_pointer;
typedef typename base_type::const_node_pointer const_node_pointer;
typedef typename base_type::node node;
typedef typename base_type::node_pointer node_pointer;
typedef typename base_type::node_const_pointer node_const_pointer;
public:
typedef Value_Type value_type;
typedef Cmp_Fn cmp_fn;
typedef _Alloc allocator_type;
typedef typename _Alloc::size_type size_type;
typedef typename _Alloc::difference_type difference_type;
typedef typename Allocator::size_type size_type;
typedef typename __rebind_v::pointer pointer;
typedef typename __rebind_v::const_pointer const_pointer;
typedef typename __rebind_v::reference reference;
typedef typename __rebind_v::const_reference const_reference;
typedef typename Allocator::difference_type difference_type;
typedef Value_Type value_type;
typedef
typename Allocator::template rebind<
value_type>::other::pointer
pointer;
typedef
typename Allocator::template rebind<
value_type>::other::const_pointer
const_pointer;
typedef
typename Allocator::template rebind<
value_type>::other::reference
reference;
typedef
typename Allocator::template rebind<
value_type>::other::const_reference
const_reference;
typedef
typename PB_DS_BASE_C_DEC::const_point_iterator
const_point_iterator;
typedef typename PB_DS_BASE_C_DEC::point_iterator point_iterator;
typedef typename PB_DS_BASE_C_DEC::const_iterator const_iterator;
typedef typename PB_DS_BASE_C_DEC::iterator iterator;
typedef Cmp_Fn cmp_fn;
typedef Allocator allocator_type;
typedef typename base_type::point_const_iterator point_const_iterator;
typedef typename base_type::point_iterator point_iterator;
typedef typename base_type::const_iterator const_iterator;
typedef typename base_type::iterator iterator;
public:
inline point_iterator
push(const_reference r_val);
push(const_reference);
void
modify(point_iterator it, const_reference r_new_val);
modify(point_iterator, const_reference);
inline const_reference
top() const;
@ -149,72 +118,72 @@ namespace __gnu_pbds
pop();
void
erase(point_iterator it);
erase(point_iterator);
inline void
clear();
template<typename Pred>
size_type
erase_if(Pred pred);
erase_if(Pred);
template<typename Pred>
void
split(Pred pred, PB_DS_CLASS_C_DEC& other);
split(Pred, PB_DS_CLASS_C_DEC&);
void
join(PB_DS_CLASS_C_DEC& other);
join(PB_DS_CLASS_C_DEC&);
protected:
binomial_heap_base_();
binomial_heap_base();
binomial_heap_base_(const Cmp_Fn& r_cmp_fn);
binomial_heap_base(const Cmp_Fn&);
binomial_heap_base_(const PB_DS_CLASS_C_DEC& other);
binomial_heap_base(const PB_DS_CLASS_C_DEC&);
void
swap(PB_DS_CLASS_C_DEC& other);
swap(PB_DS_CLASS_C_DEC&);
~binomial_heap_base_();
~binomial_heap_base();
template<typename It>
void
copy_from_range(It first_it, It last_it);
copy_from_range(It, It);
inline void
find_max();
#ifdef _GLIBCXX_DEBUG
void
assert_valid(bool strictly_binomial, const char* file, int line) const;
assert_valid(bool, const char*, int) const;
void
assert_max(const char* file, int line) const;
#endif
assert_max(const char*, int) const;
#endif
private:
inline node_pointer
fix(node_pointer p_nd) const;
fix(node_pointer) const;
inline void
insert_node(node_pointer p_nd);
insert_node(node_pointer);
inline void
remove_parentless_node(node_pointer p_nd);
remove_parentless_node(node_pointer);
inline node_pointer
join(node_pointer p_lhs, node_pointer p_rhs) const;
join(node_pointer, node_pointer) const;
#ifdef _GLIBCXX_DEBUG
void
assert_node_consistent(const_node_pointer, bool, bool,
assert_node_consistent(node_const_pointer, bool, bool,
const char*, int) const;
#endif
protected:
node_pointer m_p_max;
node_pointer m_p_max;
};
#define PB_DS_ASSERT_VALID_COND(X, _StrictlyBinomial) \
@ -235,10 +204,8 @@ namespace __gnu_pbds
#undef PB_DS_ASSERT_VALID_COND
#undef PB_DS_CLASS_C_DEC
#undef PB_DS_CLASS_T_DEC
#undef PB_DS_BASE_C_DEC
#undef PB_DS_B_HEAP_BASE
} // namespace detail
} // namespace __gnu_pbds
#endif
#endif

View File

@ -34,7 +34,7 @@
// warranty.
/**
* @file constructors_destructor_fn_imps.hpp
* @file binomial_heap_base_/constructors_destructor_fn_imps.hpp
* Contains an implementation class for a base of binomial heaps.
*/
@ -46,35 +46,27 @@ copy_from_range(It first_it, It last_it)
{
while (first_it != last_it)
push(*(first_it++));
PB_DS_ASSERT_VALID_COND((*this),false)
}
PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC::
binomial_heap_base_() :
m_p_max(0)
binomial_heap_base() : m_p_max(0)
{
PB_DS_ASSERT_VALID_COND((*this),false)
}
PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC::
binomial_heap_base_(const Cmp_Fn& r_cmp_fn) :
PB_DS_BASE_C_DEC(r_cmp_fn),
m_p_max(0)
{
PB_DS_ASSERT_VALID_COND((*this),false)
}
binomial_heap_base(const Cmp_Fn& r_cmp_fn)
: base_type(r_cmp_fn), m_p_max(0)
{ PB_DS_ASSERT_VALID_COND((*this),false) }
PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC::
binomial_heap_base_(const PB_DS_CLASS_C_DEC& other) :
PB_DS_BASE_C_DEC(other),
m_p_max(0)
{
PB_DS_ASSERT_VALID_COND((*this),false)
}
binomial_heap_base(const PB_DS_CLASS_C_DEC& other)
: base_type(other), m_p_max(0)
{ PB_DS_ASSERT_VALID_COND((*this),false) }
PB_DS_CLASS_T_DEC
void
@ -82,16 +74,12 @@ PB_DS_CLASS_C_DEC::
swap(PB_DS_CLASS_C_DEC& other)
{
PB_DS_ASSERT_VALID_COND((*this),false)
base_type::swap(other);
std::swap(m_p_max, other.m_p_max);
PB_DS_ASSERT_VALID_COND((*this),false)
}
PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC::
~binomial_heap_base_()
~binomial_heap_base()
{ }

View File

@ -35,7 +35,7 @@
// warranty.
/**
* @file debug_fn_imps.hpp
* @file binomial_heap_base_/debug_fn_imps.hpp
* Contains an implementation class for a base of binomial heaps.
*/
@ -68,7 +68,7 @@ assert_max(const char* __file, int __line) const
PB_DS_CLASS_T_DEC
void
PB_DS_CLASS_C_DEC::
assert_node_consistent(const_node_pointer p_nd, bool strictly_binomial,
assert_node_consistent(node_const_pointer p_nd, bool strictly_binomial,
bool increasing, const char* __file, int __line) const
{
PB_DS_DEBUG_VERIFY(increasing || strictly_binomial);

View File

@ -34,7 +34,7 @@
// warranty.
/**
* @file erase_fn_imps.hpp
* @file binomial_heap_base_/erase_fn_imps.hpp
* Contains an implementation class for a base of binomial heaps.
*/
@ -50,15 +50,10 @@ pop()
find_max();
_GLIBCXX_DEBUG_ASSERT(m_p_max != 0);
node_pointer p_nd = m_p_max;
remove_parentless_node(m_p_max);
base_type::actual_erase_node(p_nd);
m_p_max = 0;
PB_DS_ASSERT_VALID_COND((*this),true)
}
@ -71,8 +66,7 @@ remove_parentless_node(node_pointer p_nd)
_GLIBCXX_DEBUG_ASSERT(base_type::parent(p_nd) == 0);
node_pointer p_cur_root = p_nd == base_type::m_p_root?
p_nd->m_p_next_sibling :
base_type::m_p_root;
p_nd->m_p_next_sibling : base_type::m_p_root;
if (p_cur_root != 0)
p_cur_root->m_p_prev_or_parent = 0;
@ -84,17 +78,14 @@ remove_parentless_node(node_pointer p_nd)
p_nd->m_p_next_sibling->m_p_prev_or_parent = p_nd->m_p_prev_or_parent;
node_pointer p_child = p_nd->m_p_l_child;
if (p_child != 0)
{
p_child->m_p_prev_or_parent = 0;
while (p_child->m_p_next_sibling != 0)
p_child = p_child->m_p_next_sibling;
}
m_p_max = 0;
base_type::m_p_root = join(p_cur_root, p_child);
}
@ -104,7 +95,6 @@ PB_DS_CLASS_C_DEC::
clear()
{
base_type::clear();
m_p_max = 0;
}
@ -117,13 +107,9 @@ erase(point_iterator it)
_GLIBCXX_DEBUG_ASSERT(!base_type::empty());
base_type::bubble_to_top(it.m_p_nd);
remove_parentless_node(it.m_p_nd);
base_type::actual_erase_node(it.m_p_nd);
m_p_max = 0;
PB_DS_ASSERT_VALID_COND((*this),true)
}
@ -138,55 +124,38 @@ erase_if(Pred pred)
if (base_type::empty())
{
PB_DS_ASSERT_VALID_COND((*this),true)
return 0;
}
base_type::to_linked_list();
node_pointer p_out = base_type::prune(pred);
size_type ersd = 0;
while (p_out != 0)
{
++ersd;
node_pointer p_next = p_out->m_p_next_sibling;
base_type::actual_erase_node(p_out);
p_out = p_next;
}
node_pointer p_cur = base_type::m_p_root;
base_type::m_p_root = 0;
while (p_cur != 0)
{
node_pointer p_next = p_cur->m_p_next_sibling;
p_cur->m_p_l_child = p_cur->m_p_prev_or_parent = 0;
p_cur->m_metadata = 0;
p_cur->m_p_next_sibling = base_type::m_p_root;
if (base_type::m_p_root != 0)
base_type::m_p_root->m_p_prev_or_parent = p_cur;
base_type::m_p_root = p_cur;
base_type::m_p_root = fix(base_type::m_p_root);
p_cur = p_next;
}
m_p_max = 0;
PB_DS_ASSERT_VALID_COND((*this),true)
return ersd;
}

View File

@ -34,7 +34,7 @@
// warranty.
/**
* @file find_fn_imps.hpp
* @file binomial_heap_base_/find_fn_imps.hpp
* Contains an implementation class for a base of binomial heaps.
*/
@ -59,14 +59,11 @@ PB_DS_CLASS_C_DEC::
find_max()
{
node_pointer p_cur = base_type::m_p_root;
m_p_max = p_cur;
while (p_cur != 0)
{
if (Cmp_Fn::operator()(m_p_max->m_value, p_cur->m_value))
m_p_max = p_cur;
p_cur = p_cur->m_p_next_sibling;
}
}

View File

@ -34,7 +34,7 @@
// warranty.
/**
* @file insert_fn_imps.hpp
* @file binomial_heap_base_/insert_fn_imps.hpp
* Contains an implementation class for a base of binomial heaps.
*/
@ -44,15 +44,10 @@ PB_DS_CLASS_C_DEC::
push(const_reference r_val)
{
PB_DS_ASSERT_VALID_COND((*this),true)
node_pointer p_nd = base_type::get_new_node_for_insert(r_val);
insert_node(p_nd);
m_p_max = 0;
PB_DS_ASSERT_VALID_COND((*this),true)
return point_iterator(p_nd);
}
@ -63,60 +58,42 @@ insert_node(node_pointer p_nd)
{
if (base_type::m_p_root == 0)
{
p_nd->m_p_next_sibling = p_nd->m_p_prev_or_parent =
p_nd->m_p_l_child = 0;
p_nd->m_p_next_sibling = 0;
p_nd->m_p_prev_or_parent = 0;
p_nd->m_p_l_child = 0;
p_nd->m_metadata = 0;
base_type::m_p_root = p_nd;
return;
}
if (base_type::m_p_root->m_metadata > 0)
{
p_nd->m_p_prev_or_parent = p_nd->m_p_l_child = 0;
p_nd->m_p_next_sibling = base_type::m_p_root;
base_type::m_p_root->m_p_prev_or_parent = p_nd;
base_type::m_p_root = p_nd;
p_nd->m_metadata = 0;
return;
}
if (Cmp_Fn::operator()(base_type::m_p_root->m_value, p_nd->m_value))
{
p_nd->m_p_next_sibling = base_type::m_p_root->m_p_next_sibling;
p_nd->m_p_prev_or_parent = 0;
p_nd->m_metadata = 1;
p_nd->m_p_l_child = base_type::m_p_root;
base_type::m_p_root->m_p_prev_or_parent = p_nd;
base_type::m_p_root->m_p_next_sibling = 0;
base_type::m_p_root = p_nd;
}
else
{
p_nd->m_p_next_sibling = 0;
p_nd->m_p_l_child = 0;
p_nd->m_p_prev_or_parent = base_type::m_p_root;
p_nd->m_metadata = 0;
_GLIBCXX_DEBUG_ASSERT(base_type::m_p_root->m_p_l_child == 0);
base_type::m_p_root->m_p_l_child = p_nd;
base_type::m_p_root->m_metadata = 1;
}
@ -128,36 +105,31 @@ inline typename PB_DS_CLASS_C_DEC::node_pointer
PB_DS_CLASS_C_DEC::
fix(node_pointer p_nd) const
{
while (p_nd->m_p_next_sibling != 0&&
while (p_nd->m_p_next_sibling != 0 &&
p_nd->m_metadata == p_nd->m_p_next_sibling->m_metadata)
{
node_pointer p_next = p_nd->m_p_next_sibling;
if (Cmp_Fn::operator()(p_nd->m_value, p_next->m_value))
{
p_next->m_p_prev_or_parent =
p_nd->m_p_prev_or_parent;
{
p_next->m_p_prev_or_parent = p_nd->m_p_prev_or_parent;
if (p_nd->m_p_prev_or_parent != 0)
p_nd->m_p_prev_or_parent->m_p_next_sibling = p_next;
base_type::make_child_of(p_nd, p_next);
++p_next->m_metadata;
p_nd = p_next;
}
}
else
{
{
p_nd->m_p_next_sibling = p_next->m_p_next_sibling;
if (p_nd->m_p_next_sibling != 0)
p_next->m_p_next_sibling = 0;
base_type::make_child_of(p_next, p_nd);
++p_nd->m_metadata;
}
}
}
if (p_nd->m_p_next_sibling != 0)
@ -178,39 +150,29 @@ modify(point_iterator it, const_reference r_new_val)
PB_DS_ASSERT_BASE_NODE_CONSISTENT(p_nd, false)
const bool bubble_up = Cmp_Fn::operator()(p_nd->m_value, r_new_val);
p_nd->m_value = r_new_val;
if (bubble_up)
{
node_pointer p_parent = base_type::parent(p_nd);
while (p_parent != 0&&
while (p_parent != 0 &&
Cmp_Fn::operator()(p_parent->m_value, p_nd->m_value))
{
{
base_type::swap_with_parent(p_nd, p_parent);
p_parent = base_type::parent(p_nd);
}
}
if (p_nd->m_p_prev_or_parent == 0)
base_type::m_p_root = p_nd;
m_p_max = 0;
PB_DS_ASSERT_VALID_COND((*this),true)
return;
return;
}
base_type::bubble_to_top(p_nd);
remove_parentless_node(p_nd);
insert_node(p_nd);
m_p_max = 0;
PB_DS_ASSERT_VALID_COND((*this),true)
}

View File

@ -34,7 +34,7 @@
// warranty.
/**
* @file split_join_fn_imps.hpp
* @file binomial_heap_base_/split_join_fn_imps.hpp
* Contains an implementation class for a base of binomial heaps.
*/
@ -48,72 +48,54 @@ split(Pred pred, PB_DS_CLASS_C_DEC& other)
PB_DS_ASSERT_VALID_COND(other,true)
other.clear();
if (base_type::empty())
{
PB_DS_ASSERT_VALID_COND((*this),true)
PB_DS_ASSERT_VALID_COND(other,true)
return;
}
base_type::to_linked_list();
node_pointer p_out = base_type::prune(pred);
while (p_out != 0)
{
_GLIBCXX_DEBUG_ASSERT(base_type::m_size > 0);
--base_type::m_size;
++other.m_size;
node_pointer p_next = p_out->m_p_next_sibling;
p_out->m_p_l_child = p_out->m_p_prev_or_parent = 0;
p_out->m_metadata = 0;
p_out->m_p_next_sibling = other.m_p_root;
if (other.m_p_root != 0)
other.m_p_root->m_p_prev_or_parent = p_out;
other.m_p_root = p_out;
other.m_p_root = other.fix(other.m_p_root);
p_out = p_next;
}
PB_DS_ASSERT_VALID_COND(other,true)
node_pointer p_cur = base_type::m_p_root;
base_type::m_p_root = 0;
while (p_cur != 0)
{
node_pointer p_next = p_cur->m_p_next_sibling;
p_cur->m_p_l_child = p_cur->m_p_prev_or_parent = 0;
p_cur->m_metadata = 0;
p_cur->m_p_next_sibling = base_type::m_p_root;
if (base_type::m_p_root != 0)
base_type::m_p_root->m_p_prev_or_parent = p_cur;
base_type::m_p_root = p_cur;
base_type::m_p_root = fix(base_type::m_p_root);
p_cur = p_next;
}
m_p_max = 0;
PB_DS_ASSERT_VALID_COND((*this),true)
PB_DS_ASSERT_VALID_COND(other,true)
}
@ -127,14 +109,11 @@ join(PB_DS_CLASS_C_DEC& other)
PB_DS_ASSERT_VALID_COND(other,true)
node_pointer p_other = other.m_p_root;
if (p_other != 0)
do
{
node_pointer p_next = p_other->m_p_next_sibling;
std::swap(p_other->m_p_next_sibling, p_other->m_p_prev_or_parent);
p_other = p_next;
}
while (p_other != 0);
@ -157,68 +136,55 @@ PB_DS_CLASS_C_DEC::
join(node_pointer p_lhs, node_pointer p_rhs) const
{
node_pointer p_ret = 0;
node_pointer p_cur = 0;
while (p_lhs != 0 || p_rhs != 0)
{
if (p_rhs == 0)
{
{
if (p_cur == 0)
p_ret = p_cur = p_lhs;
else
{
{
p_cur->m_p_next_sibling = p_lhs;
p_lhs->m_p_prev_or_parent = p_cur;
}
}
p_cur = p_lhs = 0;
}
}
else if (p_lhs == 0 || p_rhs->m_metadata < p_lhs->m_metadata)
{
{
if (p_cur == 0)
{
{
p_ret = p_cur = p_rhs;
p_rhs = p_rhs->m_p_prev_or_parent;
}
}
else
{
{
p_cur->m_p_next_sibling = p_rhs;
p_rhs = p_rhs->m_p_prev_or_parent;
p_cur->m_p_next_sibling->m_p_prev_or_parent = p_cur;
p_cur = p_cur->m_p_next_sibling;
}
}
}
}
else if (p_lhs->m_metadata < p_rhs->m_metadata)
{
{
if (p_cur == 0)
p_ret = p_cur = p_lhs;
else
{
{
p_cur->m_p_next_sibling = p_lhs;
p_lhs->m_p_prev_or_parent = p_cur;
p_cur = p_cur->m_p_next_sibling;
}
}
p_lhs = p_cur->m_p_next_sibling;
}
}
else
{
{
node_pointer p_next_rhs = p_rhs->m_p_prev_or_parent;
p_rhs->m_p_next_sibling = p_lhs;
p_lhs = fix(p_rhs);
p_rhs = p_next_rhs;
}
}
}
if (p_cur != 0)
@ -229,4 +195,3 @@ join(node_pointer p_lhs, node_pointer p_rhs) const
return p_ret;
}

View File

@ -0,0 +1,124 @@
// -*- C++ -*-
// Copyright (C) 2005, 2006, 2009, 2011 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the terms
// of the GNU General Public License as published by the Free Software
// Foundation; either version 3, or (at your option) any later
// version.
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
// Permission to use, copy, modify, sell, and distribute this software
// is hereby granted without fee, provided that the above copyright
// notice appears in all copies, and that both that copyright notice
// and this permission notice appear in supporting documentation. None
// of the above authors, nor IBM Haifa Research Laboratories, make any
// representation about the suitability of this software for any
// purpose. It is provided "as is" without express or implied
// warranty.
/**
* @file branch_policy/branch_policy.hpp
* Contains a base class for branch policies.
*/
#ifndef PB_DS_BRANCH_POLICY_BASE_HPP
#define PB_DS_BRANCH_POLICY_BASE_HPP
#include <ext/pb_ds/tag_and_trait.hpp>
namespace __gnu_pbds
{
/// A null node updator, indicating that no node updates are required.
template<typename _Tp1, typename _Tp2, typename _Tp3, typename _Tp4>
struct null_node_update : public null_type
{ };
namespace detail
{
/// Primary template, base class for branch structure policies.
template<typename Node_CItr, typename Node_Itr, typename _Alloc>
struct branch_policy
{
protected:
typedef typename Node_Itr::value_type it_type;
typedef typename std::iterator_traits<it_type>::value_type value_type;
typedef typename value_type::first_type key_type;
typedef typename remove_const<value_type>::type rcvalue_type;
typedef typename remove_const<key_type>::type rckey_type;
typedef typename _Alloc::template rebind<rcvalue_type>::other rebind_v;
typedef typename _Alloc::template rebind<rckey_type>::other rebind_k;
typedef typename rebind_v::reference reference;
typedef typename rebind_v::const_reference const_reference;
typedef typename rebind_v::const_pointer const_pointer;
typedef typename rebind_k::const_reference key_const_reference;
static inline key_const_reference
extract_key(const_reference r_val)
{ return r_val.first; }
virtual it_type
end() = 0;
it_type
end_iterator() const
{ return const_cast<branch_policy*>(this)->end(); }
virtual
~branch_policy() { }
};
/// Specialization for const iterators.
template<typename Node_CItr, typename _Alloc>
struct branch_policy<Node_CItr, Node_CItr, _Alloc>
{
protected:
typedef typename Node_CItr::value_type it_type;
typedef typename std::iterator_traits<it_type>::value_type value_type;
typedef typename remove_const<value_type>::type rcvalue_type;
typedef typename _Alloc::template rebind<rcvalue_type>::other rebind_v;
typedef typename rebind_v::reference reference;
typedef typename rebind_v::const_reference const_reference;
typedef typename rebind_v::const_pointer const_pointer;
typedef value_type key_type;
typedef typename rebind_v::const_reference key_const_reference;
static inline key_const_reference
extract_key(const_reference r_val)
{ return r_val; }
virtual it_type
end() const = 0;
it_type
end_iterator() const
{ return end(); }
virtual
~branch_policy() { }
};
} // namespace detail
} // namespace __gnu_pbds
#endif // #ifndef PB_DS_BRANCH_POLICY_BASE_HPP

View File

@ -1,6 +1,6 @@
// -*- C++ -*-
// Copyright (C) 2005, 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
// Copyright (C) 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@ -34,22 +34,33 @@
// warranty.
/**
* @file null_metadata.hpp
* Contains an implementation struct for this type of heap's node.
* @file branch_policy/null_node_metadata.hpp
* Contains an implementation class for tree-like classes.
*/
#ifndef PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_0_METADATA_HPP
#define PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_0_METADATA_HPP
#ifndef PB_DS_0_NODE_METADATA_HPP
#define PB_DS_0_NODE_METADATA_HPP
#include <ext/pb_ds/detail/types_traits.hpp>
namespace __gnu_pbds
{
namespace detail
{
struct null_left_child_next_sibling_heap_node_metadata
{ };
/// Constant node iterator.
template<typename Key, typename Data, typename _Alloc>
struct dumnode_const_iterator
{
private:
typedef types_traits<Key, Data, _Alloc, false> __traits_type;
typedef typename __traits_type::pointer const_iterator;
public:
typedef const_iterator value_type;
typedef const_iterator const_reference;
typedef const_reference reference;
};
} // namespace detail
} // namespace __gnu_pbds
#endif // #ifndef PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_0_METADATA_HPP
#endif

View File

@ -1,6 +1,6 @@
// -*- C++ -*-
// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
// Copyright (C) 2005, 2006, 2009, 2011 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@ -34,53 +34,62 @@
// warranty.
/**
* @file node_metadata_base.hpp
* Contains an internal PB_DS_BASE_C_DEC for a patricia tree.
* @file branch_policy/traits.hpp
* Contains an implementation class for tree-like classes.
*/
#ifndef PB_DS_PAT_TRIE_NODE_METADATA_BASE_HPP
#define PB_DS_PAT_TRIE_NODE_METADATA_BASE_HPP
#ifndef PB_DS_NODE_AND_IT_TRAITS_HPP
#define PB_DS_NODE_AND_IT_TRAITS_HPP
#include <ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp>
#include <ext/pb_ds/detail/types_traits.hpp>
#include <ext/pb_ds/detail/bin_search_tree_/traits.hpp>
#include <ext/pb_ds/detail/tree_policy/node_metadata_selector.hpp>
#include <ext/pb_ds/detail/trie_policy/node_metadata_selector.hpp>
#define PB_DS_DEBUG_VERIFY(_Cond) \
_GLIBCXX_DEBUG_VERIFY_AT(_Cond, \
_M_message(#_Cond" assertion from %1;:%2;") \
._M_string(__FILE__)._M_integer(__LINE__) \
,__file,__line)
namespace __gnu_pbds
{
namespace detail
{
/// Tree traits class, primary template.
template<typename Key,
typename Data,
typename Cmp_Fn,
template<typename Node_CItr,
typename Node_Itr,
typename Cmp_Fn_,
typename _Alloc>
class Node_Update,
typename Tag,
typename _Alloc>
struct tree_traits;
template<typename Metadata, class Allocator>
struct pat_trie_node_metadata_base
{
public:
typedef Metadata metadata_type;
typedef
typename Allocator::template rebind<
metadata_type>::other::const_reference
const_metadata_reference;
public:
inline const_metadata_reference
get_metadata() const
{
return (m_metadata);
}
public:
metadata_type m_metadata;
};
template<typename Allocator>
struct pat_trie_node_metadata_base<
null_node_metadata,
Allocator>
{
public:
typedef null_node_metadata metadata_type;
};
/// Trie traits class, primary template.
template<typename Key,
typename Data,
typename _ATraits,
template<typename Node_CItr,
typename Node_Itr,
typename _ATraits_,
typename _Alloc>
class Node_Update,
typename Tag,
typename _Alloc>
struct trie_traits;
} // namespace detail
} // namespace __gnu_pbds
#endif // #ifndef PB_DS_PAT_TRIE_NODE_BASE_HPP
#include <ext/pb_ds/detail/rb_tree_map_/traits.hpp>
#include <ext/pb_ds/detail/splay_tree_/traits.hpp>
#include <ext/pb_ds/detail/ov_tree_map_/traits.hpp>
#include <ext/pb_ds/detail/pat_trie_/traits.hpp>
#undef PB_DS_DEBUG_VERIFY
#endif // #ifndef PB_DS_NODE_AND_IT_TRAITS_HPP

View File

@ -35,7 +35,7 @@
// warranty.
/**
* @file cc_ht_map_.hpp
* @file cc_hash_table_map_/cc_ht_map_.hpp
* Contains an implementation class for cc_ht_map_.
*/
@ -49,99 +49,89 @@
#include <ext/pb_ds/detail/eq_fn/hash_eq_fn.hpp>
#ifdef _GLIBCXX_DEBUG
#include <ext/pb_ds/detail/debug_map_base.hpp>
#endif
#endif
#ifdef PB_DS_HT_MAP_TRACE_
#include <iostream>
#endif
#endif
#include <debug/debug.h>
namespace __gnu_pbds
{
namespace detail
{
#ifdef PB_DS_DATA_TRUE_INDICATOR
#define PB_DS_CC_HASH_NAME cc_ht_map
#endif
#ifdef PB_DS_DATA_FALSE_INDICATOR
#define PB_DS_CC_HASH_NAME cc_ht_set
#endif
#define PB_DS_CLASS_T_DEC \
template<typename Key, typename Mapped, typename Hash_Fn, \
typename Eq_Fn, typename Allocator, bool Store_Hash, \
typename Eq_Fn, typename _Alloc, bool Store_Hash, \
typename Comb_Hash_Fn, typename Resize_Policy>
#ifdef PB_DS_DATA_TRUE_INDICATOR
#define PB_DS_CLASS_NAME cc_ht_map_data_
#endif
#ifdef PB_DS_DATA_FALSE_INDICATOR
#define PB_DS_CLASS_NAME cc_ht_map_no_data_
#endif
#define PB_DS_CLASS_C_DEC \
PB_DS_CLASS_NAME<Key, Mapped, Hash_Fn, Eq_Fn, Allocator, \
PB_DS_CC_HASH_NAME<Key, Mapped, Hash_Fn, Eq_Fn, _Alloc, \
Store_Hash, Comb_Hash_Fn, Resize_Policy>
#define PB_DS_HASH_EQ_FN_C_DEC \
hash_eq_fn<Key, Eq_Fn, Allocator, Store_Hash>
hash_eq_fn<Key, Eq_Fn, _Alloc, Store_Hash>
#define PB_DS_RANGED_HASH_FN_C_DEC \
ranged_hash_fn<Key, Hash_Fn, Allocator, Comb_Hash_Fn, Store_Hash>
ranged_hash_fn<Key, Hash_Fn, _Alloc, Comb_Hash_Fn, Store_Hash>
#define PB_DS_TYPES_TRAITS_C_DEC \
types_traits<Key, Mapped, Allocator, Store_Hash>
#define PB_DS_CC_HASH_TRAITS_BASE \
types_traits<Key, Mapped, _Alloc, Store_Hash>
#ifdef _GLIBCXX_DEBUG
#define PB_DS_DEBUG_MAP_BASE_C_DEC \
debug_map_base<Key, Eq_Fn, typename Allocator::template rebind<Key>::other::const_reference>
#endif
#ifdef PB_DS_DATA_TRUE_INDICATOR
#define PB_DS_V2F(X) (X).first
#define PB_DS_V2S(X) (X).second
#endif
#ifdef PB_DS_DATA_FALSE_INDICATOR
#define PB_DS_V2F(X) (X)
#define PB_DS_V2S(X) Mapped_Data()
debug_map_base<Key, Eq_Fn, \
typename _Alloc::template rebind<Key>::other::const_reference>
#endif
// <011i$i0|\|-<|-|4i|\|i|\|g |-|4$|-| 74813.
/// Collision chaining hash.
template<typename Key,
typename Mapped,
typename Hash_Fn,
typename Eq_Fn,
typename Allocator,
typename _Alloc,
bool Store_Hash,
typename Comb_Hash_Fn,
typename Resize_Policy >
class PB_DS_CLASS_NAME:
class PB_DS_CC_HASH_NAME:
#ifdef _GLIBCXX_DEBUG
protected PB_DS_DEBUG_MAP_BASE_C_DEC,
#endif
#endif
public PB_DS_HASH_EQ_FN_C_DEC,
public Resize_Policy,
public PB_DS_RANGED_HASH_FN_C_DEC,
public PB_DS_TYPES_TRAITS_C_DEC
public PB_DS_CC_HASH_TRAITS_BASE
{
private:
typedef PB_DS_TYPES_TRAITS_C_DEC traits_base;
typedef typename traits_base::comp_hash comp_hash;
typedef typename traits_base::value_type value_type_;
typedef typename traits_base::pointer pointer_;
typedef PB_DS_CC_HASH_TRAITS_BASE traits_base;
typedef typename traits_base::comp_hash comp_hash;
typedef typename traits_base::value_type value_type_;
typedef typename traits_base::pointer pointer_;
typedef typename traits_base::const_pointer const_pointer_;
typedef typename traits_base::reference reference_;
typedef typename traits_base::reference reference_;
typedef typename traits_base::const_reference const_reference_;
struct entry : public traits_base::stored_value_type
struct entry : public traits_base::stored_data_type
{
typename Allocator::template rebind<entry>::other::pointer m_p_next;
typename _Alloc::template rebind<entry>::other::pointer m_p_next;
};
typedef cond_dealtor<entry, Allocator> cond_dealtor_t;
typedef cond_dealtor<entry, _Alloc> cond_dealtor_t;
typedef typename Allocator::template rebind<entry>::other entry_allocator;
typedef typename _Alloc::template rebind<entry>::other entry_allocator;
typedef typename entry_allocator::pointer entry_pointer;
typedef typename entry_allocator::const_pointer const_entry_pointer;
typedef typename entry_allocator::reference entry_reference;
typedef typename entry_allocator::const_reference const_entry_reference;
typedef typename Allocator::template rebind<entry_pointer>::other entry_pointer_allocator;
typedef typename _Alloc::template rebind<entry_pointer>::other entry_pointer_allocator;
typedef typename entry_pointer_allocator::pointer entry_pointer_array;
typedef PB_DS_RANGED_HASH_FN_C_DEC ranged_hash_fn_base;
@ -149,12 +139,12 @@ namespace __gnu_pbds
typedef Resize_Policy resize_base;
#ifdef _GLIBCXX_DEBUG
typedef PB_DS_DEBUG_MAP_BASE_C_DEC debug_base;
#endif
typedef PB_DS_DEBUG_MAP_BASE_C_DEC debug_base;
#endif
#define PB_DS_GEN_POS std::pair<entry_pointer, typename Allocator::size_type>
#define PB_DS_GEN_POS std::pair<entry_pointer, typename _Alloc::size_type>
#include <ext/pb_ds/detail/unordered_iterator/const_point_iterator.hpp>
#include <ext/pb_ds/detail/unordered_iterator/point_const_iterator.hpp>
#include <ext/pb_ds/detail/unordered_iterator/point_iterator.hpp>
#include <ext/pb_ds/detail/unordered_iterator/const_iterator.hpp>
#include <ext/pb_ds/detail/unordered_iterator/iterator.hpp>
@ -162,13 +152,13 @@ namespace __gnu_pbds
#undef PB_DS_GEN_POS
public:
typedef Allocator allocator_type;
typedef typename Allocator::size_type size_type;
typedef typename Allocator::difference_type difference_type;
typedef Hash_Fn hash_fn;
typedef Eq_Fn eq_fn;
typedef Comb_Hash_Fn comb_hash_fn;
typedef Resize_Policy resize_policy;
typedef _Alloc allocator_type;
typedef typename _Alloc::size_type size_type;
typedef typename _Alloc::difference_type difference_type;
typedef Hash_Fn hash_fn;
typedef Eq_Fn eq_fn;
typedef Comb_Hash_Fn comb_hash_fn;
typedef Resize_Policy resize_policy;
enum
{
@ -177,55 +167,55 @@ namespace __gnu_pbds
typedef typename traits_base::key_type key_type;
typedef typename traits_base::key_pointer key_pointer;
typedef typename traits_base::const_key_pointer const_key_pointer;
typedef typename traits_base::key_const_pointer key_const_pointer;
typedef typename traits_base::key_reference key_reference;
typedef typename traits_base::const_key_reference const_key_reference;
typedef typename traits_base::key_const_reference key_const_reference;
typedef typename traits_base::mapped_type mapped_type;
typedef typename traits_base::mapped_pointer mapped_pointer;
typedef typename traits_base::const_mapped_pointer const_mapped_pointer;
typedef typename traits_base::mapped_const_pointer mapped_const_pointer;
typedef typename traits_base::mapped_reference mapped_reference;
typedef typename traits_base::const_mapped_reference const_mapped_reference;
typedef typename traits_base::value_type value_type;
typedef typename traits_base::pointer pointer;
typedef typename traits_base::mapped_const_reference mapped_const_reference;
typedef typename traits_base::value_type value_type;
typedef typename traits_base::pointer pointer;
typedef typename traits_base::const_pointer const_pointer;
typedef typename traits_base::reference reference;
typedef typename traits_base::reference reference;
typedef typename traits_base::const_reference const_reference;
#ifdef PB_DS_DATA_TRUE_INDICATOR
typedef point_iterator_ point_iterator;
#endif
typedef point_iterator_ point_iterator;
#endif
#ifdef PB_DS_DATA_FALSE_INDICATOR
typedef const_point_iterator_ point_iterator;
#endif
typedef point_const_iterator_ point_iterator;
#endif
typedef const_point_iterator_ const_point_iterator;
typedef point_const_iterator_ point_const_iterator;
#ifdef PB_DS_DATA_TRUE_INDICATOR
typedef iterator_ iterator;
#endif
typedef iterator_ iterator;
#endif
#ifdef PB_DS_DATA_FALSE_INDICATOR
typedef const_iterator_ iterator;
#endif
typedef const_iterator_ iterator;
#endif
typedef const_iterator_ const_iterator;
typedef const_iterator_ const_iterator;
PB_DS_CLASS_NAME();
PB_DS_CC_HASH_NAME();
PB_DS_CLASS_NAME(const Hash_Fn&);
PB_DS_CC_HASH_NAME(const Hash_Fn&);
PB_DS_CLASS_NAME(const Hash_Fn&, const Eq_Fn&);
PB_DS_CC_HASH_NAME(const Hash_Fn&, const Eq_Fn&);
PB_DS_CLASS_NAME(const Hash_Fn&, const Eq_Fn&, const Comb_Hash_Fn&);
PB_DS_CC_HASH_NAME(const Hash_Fn&, const Eq_Fn&, const Comb_Hash_Fn&);
PB_DS_CLASS_NAME(const Hash_Fn&, const Eq_Fn&, const Comb_Hash_Fn&,
PB_DS_CC_HASH_NAME(const Hash_Fn&, const Eq_Fn&, const Comb_Hash_Fn&,
const Resize_Policy&);
PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC&);
PB_DS_CC_HASH_NAME(const PB_DS_CLASS_C_DEC&);
virtual
~PB_DS_CLASS_NAME();
~PB_DS_CC_HASH_NAME();
void
swap(PB_DS_CLASS_C_DEC&);
@ -246,28 +236,28 @@ namespace __gnu_pbds
inline bool
empty() const;
Hash_Fn&
Hash_Fn&
get_hash_fn();
const Hash_Fn&
const Hash_Fn&
get_hash_fn() const;
Eq_Fn&
Eq_Fn&
get_eq_fn();
const Eq_Fn&
const Eq_Fn&
get_eq_fn() const;
Comb_Hash_Fn&
Comb_Hash_Fn&
get_comb_hash_fn();
const Comb_Hash_Fn&
const Comb_Hash_Fn&
get_comb_hash_fn() const;
Resize_Policy&
Resize_Policy&
get_resize_policy();
const Resize_Policy&
const Resize_Policy&
get_resize_policy() const;
inline std::pair<point_iterator, bool>
@ -275,30 +265,30 @@ namespace __gnu_pbds
{ return insert_imp(r_val, traits_base::m_store_extra_indicator); }
inline mapped_reference
operator[](const_key_reference r_key)
operator[](key_const_reference r_key)
{
#ifdef PB_DS_DATA_TRUE_INDICATOR
return (subscript_imp(r_key, traits_base::m_store_extra_indicator));
#else
#else
insert(r_key);
return traits_base::s_null_mapped;
#endif
return traits_base::s_null_type;
#endif
}
inline point_iterator
find(const_key_reference);
find(key_const_reference);
inline const_point_iterator
find(const_key_reference) const;
inline point_const_iterator
find(key_const_reference) const;
inline point_iterator
find_end();
inline const_point_iterator
inline point_const_iterator
find_end() const;
inline bool
erase(const_key_reference);
erase(key_const_reference);
template<typename Pred>
inline size_type
@ -321,13 +311,13 @@ namespace __gnu_pbds
#ifdef _GLIBCXX_DEBUG
void
assert_valid(const char* file, int line) const;
#endif
assert_valid(const char*, int) const;
#endif
#ifdef PB_DS_HT_MAP_TRACE_
void
trace() const;
#endif
#endif
private:
void
@ -340,19 +330,23 @@ namespace __gnu_pbds
do_resize_if_needed_no_throw();
void
resize_imp(size_type new_size);
resize_imp(size_type);
void
do_resize(size_type new_size);
do_resize(size_type);
void
resize_imp_no_exceptions(size_type, entry_pointer_array, size_type);
inline entry_pointer
resize_imp_no_exceptions_reassign_pointer(entry_pointer, entry_pointer_array, false_type);
resize_imp_no_exceptions_reassign_pointer(entry_pointer,
entry_pointer_array,
false_type);
inline entry_pointer
resize_imp_no_exceptions_reassign_pointer(entry_pointer, entry_pointer_array, true_type);
resize_imp_no_exceptions_reassign_pointer(entry_pointer,
entry_pointer_array,
true_type);
void
deallocate_links_in_list(entry_pointer);
@ -368,14 +362,14 @@ namespace __gnu_pbds
#ifdef PB_DS_DATA_TRUE_INDICATOR
inline mapped_reference
subscript_imp(const_key_reference r_key, false_type)
subscript_imp(key_const_reference r_key, false_type)
{
_GLIBCXX_DEBUG_ONLY(assert_valid(__FILE__, __LINE__);)
const size_type pos = ranged_hash_fn_base::operator()(r_key);
const size_type pos = ranged_hash_fn_base::operator()(r_key);
entry_pointer p_e = m_entries[pos];
resize_base::notify_insert_search_start();
while (p_e != 0
while (p_e != 0
&& !hash_eq_fn_base::operator()(p_e->m_value.first, r_key))
{
resize_base::notify_insert_search_collision();
@ -394,14 +388,15 @@ namespace __gnu_pbds
}
inline mapped_reference
subscript_imp(const_key_reference r_key, true_type)
subscript_imp(key_const_reference r_key, true_type)
{
_GLIBCXX_DEBUG_ONLY(assert_valid(__FILE__, __LINE__);)
comp_hash pos_hash_pair = ranged_hash_fn_base::operator()(r_key);
entry_pointer p_e = m_entries[pos_hash_pair.first];
resize_base::notify_insert_search_start();
while (p_e != 0 &&
!hash_eq_fn_base::operator()(p_e->m_value.first, p_e->m_hash, r_key, pos_hash_pair.second))
while (p_e != 0 &&
!hash_eq_fn_base::operator()(p_e->m_value.first, p_e->m_hash,
r_key, pos_hash_pair.second))
{
resize_base::notify_insert_search_collision();
p_e = p_e->m_p_next;
@ -415,10 +410,10 @@ namespace __gnu_pbds
}
PB_DS_CHECK_KEY_DOES_NOT_EXIST(r_key)
return insert_new_imp(value_type(r_key, mapped_type()),
return insert_new_imp(value_type(r_key, mapped_type()),
pos_hash_pair)->second;
}
#endif
#endif
inline std::pair<point_iterator, bool>
insert_imp(const_reference, false_type);
@ -433,7 +428,8 @@ namespace __gnu_pbds
pos = ranged_hash_fn_base::operator()(PB_DS_V2F(r_val));
// Following lines might throw an exception.
entry_pointer p_e = get_entry(r_val, traits_base::m_no_throw_copies_indicator);
entry_pointer p_e = get_entry(r_val,
traits_base::m_no_throw_copies_indicator);
// At this point no exceptions can be thrown.
p_e->m_p_next = m_entries[pos];
@ -452,7 +448,8 @@ namespace __gnu_pbds
if (do_resize_if_needed())
r_pos_hash_pair = ranged_hash_fn_base::operator()(PB_DS_V2F(r_val));
entry_pointer p_e = get_entry(r_val, traits_base::m_no_throw_copies_indicator);
entry_pointer p_e = get_entry(r_val,
traits_base::m_no_throw_copies_indicator);
// At this point no exceptions can be thrown.
p_e->m_hash = r_pos_hash_pair.second;
@ -465,11 +462,11 @@ namespace __gnu_pbds
}
inline pointer
find_key_pointer(const_key_reference r_key, false_type)
find_key_pointer(key_const_reference r_key, false_type)
{
entry_pointer p_e = m_entries[ranged_hash_fn_base::operator()(r_key)];
resize_base::notify_find_search_start();
while (p_e != 0 &&
while (p_e != 0 &&
!hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value), r_key))
{
resize_base::notify_find_search_collision();
@ -483,17 +480,17 @@ namespace __gnu_pbds
PB_DS_CHECK_KEY_DOES_NOT_EXIST(r_key)
else
PB_DS_CHECK_KEY_EXISTS(r_key)
#endif
#endif
return &p_e->m_value;
}
inline pointer
find_key_pointer(const_key_reference r_key, true_type)
find_key_pointer(key_const_reference r_key, true_type)
{
comp_hash pos_hash_pair = ranged_hash_fn_base::operator()(r_key);
entry_pointer p_e = m_entries[pos_hash_pair.first];
resize_base::notify_find_search_start();
while (p_e != 0 &&
while (p_e != 0 &&
!hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value),
p_e->m_hash,
r_key, pos_hash_pair.second))
@ -509,30 +506,30 @@ namespace __gnu_pbds
PB_DS_CHECK_KEY_DOES_NOT_EXIST(r_key)
else
PB_DS_CHECK_KEY_EXISTS(r_key)
#endif
#endif
return &p_e->m_value;
}
inline bool
erase_in_pos_imp(const_key_reference, size_type);
erase_in_pos_imp(key_const_reference, size_type);
inline bool
erase_in_pos_imp(const_key_reference, const comp_hash&);
erase_in_pos_imp(key_const_reference, const comp_hash&);
inline void
erase_entry_pointer(entry_pointer&);
#ifdef PB_DS_DATA_TRUE_INDICATOR
void
inc_it_state(pointer& r_p_value,
inc_it_state(pointer& r_p_value,
std::pair<entry_pointer, size_type>& r_pos) const
{
inc_it_state((const_mapped_pointer& )r_p_value, r_pos);
inc_it_state((mapped_const_pointer& )r_p_value, r_pos);
}
#endif
#endif
void
inc_it_state(const_pointer& r_p_value,
inc_it_state(const_pointer& r_p_value,
std::pair<entry_pointer, size_type>& r_pos) const
{
_GLIBCXX_DEBUG_ASSERT(r_p_value != 0);
@ -554,7 +551,7 @@ namespace __gnu_pbds
}
void
get_start_it_state(pointer& r_p_value,
get_start_it_state(pointer& r_p_value,
std::pair<entry_pointer, size_type>& r_pos) const
{
for (r_pos.second = 0; r_pos.second < m_num_e; ++r_pos.second)
@ -570,26 +567,26 @@ namespace __gnu_pbds
#ifdef _GLIBCXX_DEBUG
void
assert_entry_pointer_array_valid(const entry_pointer_array,
const char* file, int line) const;
const char*, int) const;
void
assert_entry_pointer_valid(const entry_pointer, true_type,
const char* file, int line) const;
const char*, int) const;
void
assert_entry_pointer_valid(const entry_pointer, false_type,
const char* file, int line) const;
#endif
const char*, int) const;
#endif
#ifdef PB_DS_HT_MAP_TRACE_
void
trace_list(const_entry_pointer) const;
#endif
#endif
private:
#ifdef PB_DS_DATA_TRUE_INDICATOR
friend class iterator_;
#endif
#endif
friend class const_iterator_;
@ -598,7 +595,7 @@ namespace __gnu_pbds
static iterator s_end_it;
static const_iterator s_const_end_it;
static point_iterator s_find_end_it;
static const_point_iterator s_const_find_end_it;
static point_const_iterator s_const_find_end_it;
size_type m_num_e;
size_type m_num_used_e;
@ -606,8 +603,8 @@ namespace __gnu_pbds
enum
{
store_hash_ok = !Store_Hash
|| !is_same<Hash_Fn, __gnu_pbds::null_hash_fn>::value
store_hash_ok = !Store_Hash
|| !is_same<Hash_Fn, __gnu_pbds::null_type>::value
};
PB_DS_STATIC_ASSERT(sth, store_hash_ok);
@ -629,12 +626,8 @@ namespace __gnu_pbds
#undef PB_DS_CLASS_C_DEC
#undef PB_DS_HASH_EQ_FN_C_DEC
#undef PB_DS_RANGED_HASH_FN_C_DEC
#undef PB_DS_TYPES_TRAITS_C_DEC
#undef PB_DS_CC_HASH_TRAITS_BASE
#undef PB_DS_DEBUG_MAP_BASE_C_DEC
#undef PB_DS_CLASS_NAME
#undef PB_DS_V2F
#undef PB_DS_V2S
#undef PB_DS_CC_HASH_NAME
} // namespace detail
} // namespace __gnu_pbds

Some files were not shown because too many files have changed in this diff Show More