3 // Copyright (C) 2005-2013 Free Software Foundation, Inc.
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the terms
7 // of the GNU General Public License as published by the Free Software
8 // Foundation; either version 3, or (at your option) any later
11 // This library is distributed in the hope that it will be useful, but
12 // WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // General Public License for more details.
16 // Under Section 7 of GPL version 3, you are granted additional
17 // permissions described in the GCC Runtime Library Exception, version
18 // 3.1, as published by the Free Software Foundation.
20 // You should have received a copy of the GNU General Public License and
21 // a copy of the GCC Runtime Library Exception along with this program;
22 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23 // <http://www.gnu.org/licenses/>.
25 // Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
27 // Permission to use, copy, modify, sell, and distribute this software
28 // is hereby granted without fee, provided that the above copyright
29 // notice appears in all copies, and that both that copyright notice
30 // and this permission notice appear in supporting documentation. None
31 // of the above authors, nor IBM Haifa Research Laboratories, make any
32 // representation about the suitability of this software for any
33 // purpose. It is provided "as is" without express or implied
37 * @file binomial_heap_.hpp
38 * Contains an implementation class for a binomial heap.
43 * Vuillemin J is the mastah.
47 #include <debug/debug.h>
48 #include <ext/pb_ds/detail/cond_dealtor.hpp>
49 #include <ext/pb_ds/detail/type_utils.hpp>
50 #include <ext/pb_ds/detail/binomial_heap_base_/binomial_heap_base_.hpp>
56 #define PB_DS_CLASS_T_DEC \
57 template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
59 #define PB_DS_CLASS_C_DEC \
60 binomial_heap<Value_Type, Cmp_Fn, _Alloc>
65 * @ingroup heap-detail
67 template<typename Value_Type, typename Cmp_Fn, typename _Alloc>
69 : public binomial_heap_base<Value_Type, Cmp_Fn, _Alloc>
72 typedef binomial_heap_base<Value_Type, Cmp_Fn, _Alloc> base_type;
73 typedef typename base_type::node_pointer node_pointer;
74 typedef typename base_type::node_const_pointer node_const_pointer;
77 typedef Value_Type value_type;
78 typedef typename _Alloc::size_type size_type;
79 typedef typename _Alloc::difference_type difference_type;
80 typedef typename base_type::pointer pointer;
81 typedef typename base_type::const_pointer const_pointer;
82 typedef typename base_type::reference reference;
83 typedef typename base_type::const_reference const_reference;
84 typedef typename base_type::point_const_iterator point_const_iterator;
85 typedef typename base_type::point_iterator point_iterator;
86 typedef typename base_type::const_iterator const_iterator;
87 typedef typename base_type::iterator iterator;
88 typedef typename base_type::cmp_fn cmp_fn;
89 typedef typename base_type::allocator_type allocator_type;
93 binomial_heap(const Cmp_Fn&);
95 binomial_heap(const binomial_heap&);
100 #ifdef _GLIBCXX_DEBUG
102 assert_valid(const char*, int) const;
106 #include <ext/pb_ds/detail/binomial_heap_/constructors_destructor_fn_imps.hpp>
107 #include <ext/pb_ds/detail/binomial_heap_/debug_fn_imps.hpp>
109 #undef PB_DS_CLASS_C_DEC
110 #undef PB_DS_CLASS_T_DEC
111 } // namespace detail
112 } // namespace __gnu_pbds