Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +2 -0
- ffmpeg/bin/avformat-61.dll +3 -0
- mingw/bin/strip.exe +3 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/assoc_container.hpp +689 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/detail/basic_types.hpp +217 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/detail/binary_heap_/policy_access_fn_imps.hpp +62 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/detail/binary_heap_/resize_policy.hpp +259 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp +178 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/detail/cond_dealtor.hpp +131 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/detail/constructors_destructor_fn_imps.hpp +109 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/detail/container_base_dispatch.hpp +338 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/detail/priority_queue_base_dispatch.hpp +97 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/exception.hpp +109 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/hash_policy.hpp +610 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/list_update_policy.hpp +142 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/priority_queue.hpp +131 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/tag_and_trait.hpp +361 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/tree_policy.hpp +168 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/trie_policy.hpp +361 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/cstdbool +45 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/cstdint +81 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/cstdio +59 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/cstdlib +59 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/ctgmath +39 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/ctime +39 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/ctype.h +39 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/cwchar +59 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/cwctype +59 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/ell_integral.tcc +753 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/inttypes.h +39 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/legendre_function.tcc +310 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/limits.h +39 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/math.h +191 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/memory +74 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/modified_bessel_func.tcc +441 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/poly_hermite.tcc +129 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/poly_laguerre.tcc +334 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/random +71 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/regex +68 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/riemann_zeta.tcc +440 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/special_function_util.h +149 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/stdarg.h +39 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/stdbool.h +39 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/stdint.h +39 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/stdio.h +39 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/stdlib.h +57 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/tgmath.h +39 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/tuple +427 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/type_traits +249 -0
- mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/unordered_map +66 -0
.gitattributes
CHANGED
|
@@ -73,3 +73,5 @@ mingw/bin/objcopy.exe filter=lfs diff=lfs merge=lfs -text
|
|
| 73 |
mingw/bin/ld.bfd.exe filter=lfs diff=lfs merge=lfs -text
|
| 74 |
mingw/bin/gprof.exe filter=lfs diff=lfs merge=lfs -text
|
| 75 |
cmake/bin/cmake-gui.exe filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 73 |
mingw/bin/ld.bfd.exe filter=lfs diff=lfs merge=lfs -text
|
| 74 |
mingw/bin/gprof.exe filter=lfs diff=lfs merge=lfs -text
|
| 75 |
cmake/bin/cmake-gui.exe filter=lfs diff=lfs merge=lfs -text
|
| 76 |
+
ffmpeg/bin/avformat-61.dll filter=lfs diff=lfs merge=lfs -text
|
| 77 |
+
mingw/bin/strip.exe filter=lfs diff=lfs merge=lfs -text
|
ffmpeg/bin/avformat-61.dll
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d2c1a2587ae4ace0e08f65f79d6467b156caec6f6f3d4341ac7667bafc5a64fc
|
| 3 |
+
size 19841536
|
mingw/bin/strip.exe
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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 2, or (at your option) any later
|
| 9 |
+
// version.
|
| 10 |
+
|
| 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.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License
|
| 17 |
+
// along with this library; see the file COPYING. If not, write to
|
| 18 |
+
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
| 19 |
+
// MA 02111-1307, USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free
|
| 22 |
+
// software library without restriction. Specifically, if other files
|
| 23 |
+
// instantiate templates or use macros or inline functions from this
|
| 24 |
+
// file, or you compile this file and link it with other files to
|
| 25 |
+
// produce an executable, this file does not by itself cause the
|
| 26 |
+
// resulting executable to be covered by the GNU General Public
|
| 27 |
+
// License. This exception does not however invalidate any other
|
| 28 |
+
// reasons why the executable file might be covered by the GNU General
|
| 29 |
+
// Public License.
|
| 30 |
+
|
| 31 |
+
// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
|
| 32 |
+
|
| 33 |
+
// Permission to use, copy, modify, sell, and distribute this software
|
| 34 |
+
// is hereby granted without fee, provided that the above copyright
|
| 35 |
+
// notice appears in all copies, and that both that copyright notice
|
| 36 |
+
// and this permission notice appear in supporting documentation. None
|
| 37 |
+
// of the above authors, nor IBM Haifa Research Laboratories, make any
|
| 38 |
+
// representation about the suitability of this software for any
|
| 39 |
+
// purpose. It is provided "as is" without express or implied
|
| 40 |
+
// warranty.
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* @file assoc_container.hpp
|
| 44 |
+
* Contains associative containers.
|
| 45 |
+
*/
|
| 46 |
+
|
| 47 |
+
#ifndef PB_DS_ASSOC_CNTNR_HPP
|
| 48 |
+
#define PB_DS_ASSOC_CNTNR_HPP
|
| 49 |
+
|
| 50 |
+
#include <ext/typelist.h>
|
| 51 |
+
#include <ext/pb_ds/tag_and_trait.hpp>
|
| 52 |
+
#include <ext/pb_ds/detail/standard_policies.hpp>
|
| 53 |
+
#include <ext/pb_ds/detail/container_base_dispatch.hpp>
|
| 54 |
+
#include <ext/pb_ds/detail/basic_tree_policy/traits.hpp>
|
| 55 |
+
|
| 56 |
+
namespace __gnu_pbds
|
| 57 |
+
{
|
| 58 |
+
#define PB_DS_BASE_C_DEC \
|
| 59 |
+
detail::container_base_dispatch<Key, Mapped, Tag, Policy_Tl, Allocator>::type
|
| 60 |
+
|
| 61 |
+
// An abstract basic associative container.
|
| 62 |
+
template<typename Key,
|
| 63 |
+
typename Mapped,
|
| 64 |
+
typename Tag,
|
| 65 |
+
typename Policy_Tl,
|
| 66 |
+
typename Allocator>
|
| 67 |
+
class container_base : public PB_DS_BASE_C_DEC
|
| 68 |
+
{
|
| 69 |
+
private:
|
| 70 |
+
typedef typename PB_DS_BASE_C_DEC base_type;
|
| 71 |
+
|
| 72 |
+
public:
|
| 73 |
+
typedef Tag container_category;
|
| 74 |
+
typedef Allocator allocator;
|
| 75 |
+
typedef typename allocator::size_type size_type;
|
| 76 |
+
typedef typename allocator::difference_type difference_type;
|
| 77 |
+
|
| 78 |
+
// key_type
|
| 79 |
+
typedef typename allocator::template rebind<Key>::other::value_type key_type;
|
| 80 |
+
typedef typename allocator::template rebind<key_type>::other key_rebind;
|
| 81 |
+
typedef typename key_rebind::reference key_reference;
|
| 82 |
+
typedef typename key_rebind::const_reference const_key_reference;
|
| 83 |
+
typedef typename key_rebind::pointer key_pointer;
|
| 84 |
+
typedef typename key_rebind::const_pointer const_key_pointer;
|
| 85 |
+
|
| 86 |
+
// mapped_type
|
| 87 |
+
typedef Mapped mapped_type;
|
| 88 |
+
typedef typename allocator::template rebind<mapped_type>::other mapped_rebind;
|
| 89 |
+
typedef typename mapped_rebind::reference mapped_reference;
|
| 90 |
+
typedef typename mapped_rebind::const_reference const_mapped_reference;
|
| 91 |
+
typedef typename mapped_rebind::pointer mapped_pointer;
|
| 92 |
+
typedef typename mapped_rebind::const_pointer const_mapped_pointer;
|
| 93 |
+
|
| 94 |
+
// value_type
|
| 95 |
+
typedef typename base_type::value_type value_type;
|
| 96 |
+
typedef typename allocator::template rebind<value_type>::other value_rebind;
|
| 97 |
+
typedef typename value_rebind::reference reference;
|
| 98 |
+
typedef typename value_rebind::const_reference const_reference;
|
| 99 |
+
typedef typename value_rebind::pointer pointer;
|
| 100 |
+
typedef typename value_rebind::const_pointer const_pointer;
|
| 101 |
+
|
| 102 |
+
// iterators
|
| 103 |
+
typedef typename base_type::iterator iterator;
|
| 104 |
+
typedef typename base_type::const_iterator const_iterator;
|
| 105 |
+
typedef typename base_type::point_iterator point_iterator;
|
| 106 |
+
typedef typename base_type::const_point_iterator const_point_iterator;
|
| 107 |
+
|
| 108 |
+
virtual
|
| 109 |
+
~container_base() { }
|
| 110 |
+
|
| 111 |
+
protected:
|
| 112 |
+
#define PB_DS_CLASS_NAME container_base
|
| 113 |
+
#include <ext/pb_ds/detail/constructors_destructor_fn_imps.hpp>
|
| 114 |
+
#undef PB_DS_CLASS_NAME
|
| 115 |
+
};
|
| 116 |
+
|
| 117 |
+
#undef PB_DS_BASE_C_DEC
|
| 118 |
+
|
| 119 |
+
|
| 120 |
+
#define PB_DS_BASE_C_DEC \
|
| 121 |
+
container_base<Key, Mapped, Tag, typename __gnu_cxx::typelist::append< \
|
| 122 |
+
typename __gnu_cxx::typelist::create4<Hash_Fn, Eq_Fn, Resize_Policy, detail::integral_constant<int, Store_Hash> >::type, Policy_TL>::type, Allocator>
|
| 123 |
+
|
| 124 |
+
// An abstract basic hash-based associative container.
|
| 125 |
+
template<typename Key,
|
| 126 |
+
typename Mapped,
|
| 127 |
+
typename Hash_Fn,
|
| 128 |
+
typename Eq_Fn,
|
| 129 |
+
typename Resize_Policy,
|
| 130 |
+
bool Store_Hash,
|
| 131 |
+
typename Tag,
|
| 132 |
+
typename Policy_TL,
|
| 133 |
+
typename Allocator>
|
| 134 |
+
class basic_hash_table : public PB_DS_BASE_C_DEC
|
| 135 |
+
{
|
| 136 |
+
private:
|
| 137 |
+
typedef PB_DS_BASE_C_DEC base_type;
|
| 138 |
+
|
| 139 |
+
public:
|
| 140 |
+
virtual
|
| 141 |
+
~basic_hash_table() { }
|
| 142 |
+
|
| 143 |
+
protected:
|
| 144 |
+
#define PB_DS_CLASS_NAME basic_hash_table
|
| 145 |
+
#include <ext/pb_ds/detail/constructors_destructor_fn_imps.hpp>
|
| 146 |
+
#undef PB_DS_CLASS_NAME
|
| 147 |
+
|
| 148 |
+
private:
|
| 149 |
+
basic_hash_table&
|
| 150 |
+
operator=(const base_type&);
|
| 151 |
+
};
|
| 152 |
+
|
| 153 |
+
#undef PB_DS_BASE_C_DEC
|
| 154 |
+
|
| 155 |
+
|
| 156 |
+
#define PB_DS_BASE_C_DEC \
|
| 157 |
+
basic_hash_table<Key, Mapped, Hash_Fn, Eq_Fn, Resize_Policy, Store_Hash, \
|
| 158 |
+
cc_hash_tag, \
|
| 159 |
+
typename __gnu_cxx::typelist::create1<Comb_Hash_Fn>::type, Allocator>
|
| 160 |
+
|
| 161 |
+
// A concrete collision-chaining hash-based associative container.
|
| 162 |
+
template<typename Key,
|
| 163 |
+
typename Mapped,
|
| 164 |
+
typename Hash_Fn = typename detail::default_hash_fn<Key>::type,
|
| 165 |
+
typename Eq_Fn = typename detail::default_eq_fn<Key>::type,
|
| 166 |
+
typename Comb_Hash_Fn = detail::default_comb_hash_fn::type,
|
| 167 |
+
typename Resize_Policy = typename detail::default_resize_policy<Comb_Hash_Fn>::type,
|
| 168 |
+
bool Store_Hash = detail::default_store_hash,
|
| 169 |
+
typename Allocator = std::allocator<char> >
|
| 170 |
+
class cc_hash_table : public PB_DS_BASE_C_DEC
|
| 171 |
+
{
|
| 172 |
+
private:
|
| 173 |
+
typedef PB_DS_BASE_C_DEC base_type;
|
| 174 |
+
|
| 175 |
+
public:
|
| 176 |
+
typedef Hash_Fn hash_fn;
|
| 177 |
+
typedef Eq_Fn eq_fn;
|
| 178 |
+
typedef Resize_Policy resize_policy;
|
| 179 |
+
typedef Comb_Hash_Fn comb_hash_fn;
|
| 180 |
+
|
| 181 |
+
// Default constructor.
|
| 182 |
+
cc_hash_table() { }
|
| 183 |
+
|
| 184 |
+
// Constructor taking some policy objects. r_hash_fn will be
|
| 185 |
+
// copied by the Hash_Fn object of the container object.
|
| 186 |
+
cc_hash_table(const hash_fn& h)
|
| 187 |
+
: base_type(h) { }
|
| 188 |
+
|
| 189 |
+
// Constructor taking some policy objects. r_hash_fn will be
|
| 190 |
+
// copied by the hash_fn object of the container object, and
|
| 191 |
+
// r_eq_fn will be copied by the eq_fn object of the container
|
| 192 |
+
// object.
|
| 193 |
+
cc_hash_table(const hash_fn& h, const eq_fn& e)
|
| 194 |
+
: base_type(h, e) { }
|
| 195 |
+
|
| 196 |
+
// Constructor taking some policy objects. r_hash_fn will be
|
| 197 |
+
// copied by the hash_fn object of the container object, r_eq_fn
|
| 198 |
+
// will be copied by the eq_fn object of the container object, and
|
| 199 |
+
// r_comb_hash_fn will be copied by the comb_hash_fn object of the
|
| 200 |
+
// container object.
|
| 201 |
+
cc_hash_table(const hash_fn& h, const eq_fn& e, const comb_hash_fn& ch)
|
| 202 |
+
: base_type(h, e, ch) { }
|
| 203 |
+
|
| 204 |
+
// Constructor taking some policy objects. r_hash_fn will be
|
| 205 |
+
// copied by the hash_fn object of the container object, r_eq_fn
|
| 206 |
+
// will be copied by the eq_fn object of the container object,
|
| 207 |
+
// r_comb_hash_fn will be copied by the comb_hash_fn object of the
|
| 208 |
+
// container object, and r_resize_policy will be copied by the
|
| 209 |
+
// resize_policy object of the container object.
|
| 210 |
+
cc_hash_table(const hash_fn& h, const eq_fn& e, const comb_hash_fn& ch,
|
| 211 |
+
const resize_policy& rp)
|
| 212 |
+
: base_type(h, e, ch, rp) { }
|
| 213 |
+
|
| 214 |
+
// Constructor taking __iterators to a range of value_types. The
|
| 215 |
+
// value_types between first_it and last_it will be inserted into
|
| 216 |
+
// the container object.
|
| 217 |
+
template<typename It>
|
| 218 |
+
cc_hash_table(It first, It last)
|
| 219 |
+
{ base_type::copy_from_range(first, last); }
|
| 220 |
+
|
| 221 |
+
// Constructor taking __iterators to a range of value_types and
|
| 222 |
+
// some policy objects. The value_types between first_it and
|
| 223 |
+
// last_it will be inserted into the container object.
|
| 224 |
+
template<typename It>
|
| 225 |
+
cc_hash_table(It first, It last, const hash_fn& h)
|
| 226 |
+
: base_type(h)
|
| 227 |
+
{ copy_from_range(first, last); }
|
| 228 |
+
|
| 229 |
+
// Constructor taking __iterators to a range of value_types and
|
| 230 |
+
// some policy objects The value_types between first_it and
|
| 231 |
+
// last_it will be inserted into the container object. r_hash_fn
|
| 232 |
+
// will be copied by the hash_fn object of the container object,
|
| 233 |
+
// and r_eq_fn will be copied by the eq_fn object of the container
|
| 234 |
+
// object.
|
| 235 |
+
template<typename It>
|
| 236 |
+
cc_hash_table(It first, It last, const hash_fn& h, const eq_fn& e)
|
| 237 |
+
: base_type(h, e)
|
| 238 |
+
{ copy_from_range(first, last); }
|
| 239 |
+
|
| 240 |
+
// Constructor taking __iterators to a range of value_types and
|
| 241 |
+
// some policy objects The value_types between first_it and
|
| 242 |
+
// last_it will be inserted into the container object. r_hash_fn
|
| 243 |
+
// will be copied by the hash_fn object of the container object,
|
| 244 |
+
// r_eq_fn will be copied by the eq_fn object of the container
|
| 245 |
+
// object, and r_comb_hash_fn will be copied by the comb_hash_fn
|
| 246 |
+
// object of the container object.
|
| 247 |
+
template<typename It>
|
| 248 |
+
cc_hash_table(It first, It last, const hash_fn& h, const eq_fn& e,
|
| 249 |
+
const comb_hash_fn& ch)
|
| 250 |
+
: base_type(h, e, ch)
|
| 251 |
+
{ copy_from_range(first, last); }
|
| 252 |
+
|
| 253 |
+
// Constructor taking __iterators to a range of value_types and
|
| 254 |
+
// some policy objects The value_types between first_it and
|
| 255 |
+
// last_it will be inserted into the container object. r_hash_fn
|
| 256 |
+
// will be copied by the hash_fn object of the container object,
|
| 257 |
+
// r_eq_fn will be copied by the eq_fn object of the container
|
| 258 |
+
// object, r_comb_hash_fn will be copied by the comb_hash_fn
|
| 259 |
+
// object of the container object, and r_resize_policy will be
|
| 260 |
+
// copied by the resize_policy object of the container object.
|
| 261 |
+
template<typename It>
|
| 262 |
+
cc_hash_table(It first, It last, const hash_fn& h, const eq_fn& e,
|
| 263 |
+
const comb_hash_fn& ch, const resize_policy& rp)
|
| 264 |
+
: base_type(h, e, ch, rp)
|
| 265 |
+
{ copy_from_range(first, last); }
|
| 266 |
+
|
| 267 |
+
cc_hash_table(const cc_hash_table& other)
|
| 268 |
+
: base_type((const base_type&)other)
|
| 269 |
+
{ }
|
| 270 |
+
|
| 271 |
+
virtual
|
| 272 |
+
~cc_hash_table() { }
|
| 273 |
+
|
| 274 |
+
cc_hash_table&
|
| 275 |
+
operator=(const cc_hash_table& other)
|
| 276 |
+
{
|
| 277 |
+
if (this != &other)
|
| 278 |
+
{
|
| 279 |
+
cc_hash_table tmp(other);
|
| 280 |
+
swap(tmp);
|
| 281 |
+
}
|
| 282 |
+
return *this;
|
| 283 |
+
}
|
| 284 |
+
|
| 285 |
+
void
|
| 286 |
+
swap(cc_hash_table& other)
|
| 287 |
+
{ base_type::swap(other); }
|
| 288 |
+
};
|
| 289 |
+
|
| 290 |
+
#undef PB_DS_BASE_C_DEC
|
| 291 |
+
|
| 292 |
+
|
| 293 |
+
#define PB_DS_BASE_C_DEC \
|
| 294 |
+
basic_hash_table<Key, Mapped, Hash_Fn, Eq_Fn, Resize_Policy, Store_Hash, \
|
| 295 |
+
gp_hash_tag, \
|
| 296 |
+
typename __gnu_cxx::typelist::create2<Comb_Probe_Fn, Probe_Fn>::type, Allocator>
|
| 297 |
+
|
| 298 |
+
// A concrete general-probing hash-based associative container.
|
| 299 |
+
template<typename Key,
|
| 300 |
+
typename Mapped,
|
| 301 |
+
typename Hash_Fn = typename detail::default_hash_fn<Key>::type,
|
| 302 |
+
typename Eq_Fn = typename detail::default_eq_fn<Key>::type,
|
| 303 |
+
typename Comb_Probe_Fn = detail::default_comb_hash_fn::type,
|
| 304 |
+
typename Probe_Fn = typename detail::default_probe_fn<Comb_Probe_Fn>::type,
|
| 305 |
+
typename Resize_Policy = typename detail::default_resize_policy<Comb_Probe_Fn>::type,
|
| 306 |
+
bool Store_Hash = detail::default_store_hash,
|
| 307 |
+
typename Allocator = std::allocator<char> >
|
| 308 |
+
class gp_hash_table : public PB_DS_BASE_C_DEC
|
| 309 |
+
{
|
| 310 |
+
private:
|
| 311 |
+
typedef PB_DS_BASE_C_DEC base_type;
|
| 312 |
+
|
| 313 |
+
public:
|
| 314 |
+
typedef Hash_Fn hash_fn;
|
| 315 |
+
typedef Eq_Fn eq_fn;
|
| 316 |
+
typedef Comb_Probe_Fn comb_probe_fn;
|
| 317 |
+
typedef Probe_Fn probe_fn;
|
| 318 |
+
typedef Resize_Policy resize_policy;
|
| 319 |
+
|
| 320 |
+
// Default constructor.
|
| 321 |
+
gp_hash_table() { }
|
| 322 |
+
|
| 323 |
+
// Constructor taking some policy objects. r_hash_fn will be
|
| 324 |
+
// copied by the hash_fn object of the container object.
|
| 325 |
+
gp_hash_table(const hash_fn& h)
|
| 326 |
+
: base_type(h) { }
|
| 327 |
+
|
| 328 |
+
// Constructor taking some policy objects. r_hash_fn will be
|
| 329 |
+
// copied by the hash_fn object of the container object, and
|
| 330 |
+
// r_eq_fn will be copied by the eq_fn object of the container
|
| 331 |
+
// object.
|
| 332 |
+
gp_hash_table(const hash_fn& h, const eq_fn& e)
|
| 333 |
+
: base_type(h, e) { }
|
| 334 |
+
|
| 335 |
+
// Constructor taking some policy objects. r_hash_fn will be
|
| 336 |
+
// copied by the hash_fn object of the container object, r_eq_fn
|
| 337 |
+
// will be copied by the eq_fn object of the container object, and
|
| 338 |
+
// r_comb_probe_fn will be copied by the comb_probe_fn object of
|
| 339 |
+
// the container object.
|
| 340 |
+
gp_hash_table(const hash_fn& h, const eq_fn& e, const comb_probe_fn& cp)
|
| 341 |
+
: base_type(h, e, cp) { }
|
| 342 |
+
|
| 343 |
+
// Constructor taking some policy objects. r_hash_fn will be
|
| 344 |
+
// copied by the hash_fn object of the container object, r_eq_fn
|
| 345 |
+
// will be copied by the eq_fn object of the container object,
|
| 346 |
+
// r_comb_probe_fn will be copied by the comb_probe_fn object of
|
| 347 |
+
// the container object, and r_probe_fn will be copied by the
|
| 348 |
+
// probe_fn object of the container object.
|
| 349 |
+
gp_hash_table(const hash_fn& h, const eq_fn& e, const comb_probe_fn& cp,
|
| 350 |
+
const probe_fn& p)
|
| 351 |
+
: base_type(h, e, cp, p) { }
|
| 352 |
+
|
| 353 |
+
// Constructor taking some policy objects. r_hash_fn will be
|
| 354 |
+
// copied by the hash_fn object of the container object, r_eq_fn
|
| 355 |
+
// will be copied by the eq_fn object of the container object,
|
| 356 |
+
// r_comb_probe_fn will be copied by the comb_probe_fn object of
|
| 357 |
+
// the container object, r_probe_fn will be copied by the probe_fn
|
| 358 |
+
// object of the container object, and r_resize_policy will be
|
| 359 |
+
// copied by the Resize_Policy object of the container object.
|
| 360 |
+
gp_hash_table(const hash_fn& h, const eq_fn& e, const comb_probe_fn& cp,
|
| 361 |
+
const probe_fn& p, const resize_policy& rp)
|
| 362 |
+
: base_type(h, e, cp, p, rp) { }
|
| 363 |
+
|
| 364 |
+
// Constructor taking __iterators to a range of value_types. The
|
| 365 |
+
// value_types between first_it and last_it will be inserted into
|
| 366 |
+
// the container object.
|
| 367 |
+
template<typename It>
|
| 368 |
+
gp_hash_table(It first, It last)
|
| 369 |
+
{ base_type::copy_from_range(first, last); }
|
| 370 |
+
|
| 371 |
+
// Constructor taking __iterators to a range of value_types and
|
| 372 |
+
// some policy objects. The value_types between first_it and
|
| 373 |
+
// last_it will be inserted into the container object. r_hash_fn
|
| 374 |
+
// will be copied by the hash_fn object of the container object.
|
| 375 |
+
template<typename It>
|
| 376 |
+
gp_hash_table(It first, It last, const hash_fn& h)
|
| 377 |
+
: base_type(h)
|
| 378 |
+
{ base_type::copy_from_range(first, last); }
|
| 379 |
+
|
| 380 |
+
// Constructor taking __iterators to a range of value_types and
|
| 381 |
+
// some policy objects. The value_types between first_it and
|
| 382 |
+
// last_it will be inserted into the container object. r_hash_fn
|
| 383 |
+
// will be copied by the hash_fn object of the container object,
|
| 384 |
+
// and r_eq_fn will be copied by the eq_fn object of the container
|
| 385 |
+
// object.
|
| 386 |
+
template<typename It>
|
| 387 |
+
gp_hash_table(It first, It last, const hash_fn& h, const eq_fn& e)
|
| 388 |
+
: base_type(h, e)
|
| 389 |
+
{ base_type::copy_from_range(first, last); }
|
| 390 |
+
|
| 391 |
+
// Constructor taking __iterators to a range of value_types and
|
| 392 |
+
// some policy objects. The value_types between first_it and
|
| 393 |
+
// last_it will be inserted into the container object. r_hash_fn
|
| 394 |
+
// will be copied by the hash_fn object of the container object,
|
| 395 |
+
// r_eq_fn will be copied by the eq_fn object of the container
|
| 396 |
+
// object, and r_comb_probe_fn will be copied by the comb_probe_fn
|
| 397 |
+
// object of the container object.
|
| 398 |
+
template<typename It>
|
| 399 |
+
gp_hash_table(It first, It last, const hash_fn& h, const eq_fn& e,
|
| 400 |
+
const comb_probe_fn& cp)
|
| 401 |
+
: base_type(h, e, cp)
|
| 402 |
+
{ base_type::copy_from_range(first, last); }
|
| 403 |
+
|
| 404 |
+
// Constructor taking __iterators to a range of value_types and
|
| 405 |
+
// some policy objects. The value_types between first_it and
|
| 406 |
+
// last_it will be inserted into the container object. r_hash_fn
|
| 407 |
+
// will be copied by the hash_fn object of the container object,
|
| 408 |
+
// r_eq_fn will be copied by the eq_fn object of the container
|
| 409 |
+
// object, r_comb_probe_fn will be copied by the comb_probe_fn
|
| 410 |
+
// object of the container object, and r_probe_fn will be copied
|
| 411 |
+
// by the probe_fn object of the container object.
|
| 412 |
+
template<typename It>
|
| 413 |
+
gp_hash_table(It first, It last, const hash_fn& h, const eq_fn& e,
|
| 414 |
+
const comb_probe_fn& cp, const probe_fn& p)
|
| 415 |
+
: base_type(h, e, cp, p)
|
| 416 |
+
{ base_type::copy_from_range(first, last); }
|
| 417 |
+
|
| 418 |
+
// Constructor taking __iterators to a range of value_types and
|
| 419 |
+
// some policy objects. The value_types between first_it and
|
| 420 |
+
// last_it will be inserted into the container object. r_hash_fn
|
| 421 |
+
// will be copied by the hash_fn object of the container object,
|
| 422 |
+
// r_eq_fn will be copied by the eq_fn object of the container
|
| 423 |
+
// object, r_comb_probe_fn will be copied by the comb_probe_fn
|
| 424 |
+
// object of the container object, r_probe_fn will be copied by
|
| 425 |
+
// the probe_fn object of the container object, and
|
| 426 |
+
// r_resize_policy will be copied by the resize_policy object of
|
| 427 |
+
// the container object.
|
| 428 |
+
template<typename It>
|
| 429 |
+
gp_hash_table(It first, It last, const hash_fn& h, const eq_fn& e,
|
| 430 |
+
const comb_probe_fn& cp, const probe_fn& p,
|
| 431 |
+
const resize_policy& rp)
|
| 432 |
+
: base_type(h, e, cp, p, rp)
|
| 433 |
+
{ base_type::copy_from_range(first, last); }
|
| 434 |
+
|
| 435 |
+
gp_hash_table(const gp_hash_table& other)
|
| 436 |
+
: base_type((const base_type&)other)
|
| 437 |
+
{ }
|
| 438 |
+
|
| 439 |
+
virtual
|
| 440 |
+
~gp_hash_table() { }
|
| 441 |
+
|
| 442 |
+
gp_hash_table&
|
| 443 |
+
operator=(const gp_hash_table& other)
|
| 444 |
+
{
|
| 445 |
+
if (this != &other)
|
| 446 |
+
{
|
| 447 |
+
gp_hash_table tmp(other);
|
| 448 |
+
swap(tmp);
|
| 449 |
+
}
|
| 450 |
+
return *this;
|
| 451 |
+
}
|
| 452 |
+
|
| 453 |
+
void
|
| 454 |
+
swap(gp_hash_table& other)
|
| 455 |
+
{ base_type::swap(other); }
|
| 456 |
+
};
|
| 457 |
+
|
| 458 |
+
#undef PB_DS_BASE_C_DEC
|
| 459 |
+
|
| 460 |
+
|
| 461 |
+
#define PB_DS_BASE_C_DEC \
|
| 462 |
+
container_base<Key, Mapped, Tag, Policy_Tl, Allocator>
|
| 463 |
+
|
| 464 |
+
// An abstract basic tree-like (tree, trie) associative container.
|
| 465 |
+
template<typename Key, typename Mapped, typename Tag,
|
| 466 |
+
typename Node_Update, typename Policy_Tl, typename Allocator>
|
| 467 |
+
class basic_tree : public PB_DS_BASE_C_DEC
|
| 468 |
+
{
|
| 469 |
+
private:
|
| 470 |
+
typedef PB_DS_BASE_C_DEC base_type;
|
| 471 |
+
|
| 472 |
+
public:
|
| 473 |
+
typedef Node_Update node_update;
|
| 474 |
+
|
| 475 |
+
virtual
|
| 476 |
+
~basic_tree() { }
|
| 477 |
+
|
| 478 |
+
protected:
|
| 479 |
+
#define PB_DS_CLASS_NAME basic_tree
|
| 480 |
+
#include <ext/pb_ds/detail/constructors_destructor_fn_imps.hpp>
|
| 481 |
+
#undef PB_DS_CLASS_NAME
|
| 482 |
+
};
|
| 483 |
+
|
| 484 |
+
#undef PB_DS_BASE_C_DEC
|
| 485 |
+
|
| 486 |
+
|
| 487 |
+
#define PB_DS_TREE_NODE_AND_IT_TRAITS_C_DEC \
|
| 488 |
+
detail::tree_traits<Key, Mapped,Cmp_Fn,Node_Update,Tag, Allocator>
|
| 489 |
+
|
| 490 |
+
#define PB_DS_BASE_C_DEC \
|
| 491 |
+
basic_tree<Key,Mapped,Tag,typename PB_DS_TREE_NODE_AND_IT_TRAITS_C_DEC::node_update, \
|
| 492 |
+
typename __gnu_cxx::typelist::create2<Cmp_Fn, PB_DS_TREE_NODE_AND_IT_TRAITS_C_DEC >::type, Allocator>
|
| 493 |
+
|
| 494 |
+
// A concrete basic tree-based associative container.
|
| 495 |
+
template<typename Key, typename Mapped, typename Cmp_Fn = std::less<Key>,
|
| 496 |
+
typename Tag = rb_tree_tag,
|
| 497 |
+
template<typename Const_Node_Iterator, typename Node_Iterator, typename Cmp_Fn_, typename Allocator_>
|
| 498 |
+
class Node_Update = __gnu_pbds::null_tree_node_update,
|
| 499 |
+
typename Allocator = std::allocator<char> >
|
| 500 |
+
class tree : public PB_DS_BASE_C_DEC
|
| 501 |
+
{
|
| 502 |
+
private:
|
| 503 |
+
typedef PB_DS_BASE_C_DEC base_type;
|
| 504 |
+
|
| 505 |
+
public:
|
| 506 |
+
// Comparison functor type.
|
| 507 |
+
typedef Cmp_Fn cmp_fn;
|
| 508 |
+
|
| 509 |
+
tree() { }
|
| 510 |
+
|
| 511 |
+
// Constructor taking some policy objects. r_cmp_fn will be copied
|
| 512 |
+
// by the Cmp_Fn object of the container object.
|
| 513 |
+
tree(const cmp_fn& c)
|
| 514 |
+
: base_type(c) { }
|
| 515 |
+
|
| 516 |
+
// Constructor taking __iterators to a range of value_types. The
|
| 517 |
+
// value_types between first_it and last_it will be inserted into
|
| 518 |
+
// the container object.
|
| 519 |
+
template<typename It>
|
| 520 |
+
tree(It first, It last)
|
| 521 |
+
{ base_type::copy_from_range(first, last); }
|
| 522 |
+
|
| 523 |
+
// Constructor taking __iterators to a range of value_types and
|
| 524 |
+
// some policy objects The value_types between first_it and
|
| 525 |
+
// last_it will be inserted into the container object. r_cmp_fn
|
| 526 |
+
// will be copied by the cmp_fn object of the container object.
|
| 527 |
+
template<typename It>
|
| 528 |
+
tree(It first, It last, const cmp_fn& c)
|
| 529 |
+
: base_type(c)
|
| 530 |
+
{ base_type::copy_from_range(first, last); }
|
| 531 |
+
|
| 532 |
+
tree(const tree& other)
|
| 533 |
+
: base_type((const base_type&)other) { }
|
| 534 |
+
|
| 535 |
+
virtual
|
| 536 |
+
~tree() { }
|
| 537 |
+
|
| 538 |
+
tree&
|
| 539 |
+
operator=(const tree& other)
|
| 540 |
+
{
|
| 541 |
+
if (this != &other)
|
| 542 |
+
{
|
| 543 |
+
tree tmp(other);
|
| 544 |
+
swap(tmp);
|
| 545 |
+
}
|
| 546 |
+
return *this;
|
| 547 |
+
}
|
| 548 |
+
|
| 549 |
+
void
|
| 550 |
+
swap(tree& other)
|
| 551 |
+
{ base_type::swap(other); }
|
| 552 |
+
};
|
| 553 |
+
|
| 554 |
+
#undef PB_DS_BASE_C_DEC
|
| 555 |
+
#undef PB_DS_TREE_NODE_AND_IT_TRAITS_C_DEC
|
| 556 |
+
|
| 557 |
+
|
| 558 |
+
#define PB_DS_TRIE_NODE_AND_ITS_TRAITS \
|
| 559 |
+
detail::trie_traits<Key,Mapped,E_Access_Traits,Node_Update,Tag,Allocator>
|
| 560 |
+
|
| 561 |
+
#define PB_DS_BASE_C_DEC \
|
| 562 |
+
basic_tree<Key,Mapped,Tag, typename PB_DS_TRIE_NODE_AND_ITS_TRAITS::node_update, \
|
| 563 |
+
typename __gnu_cxx::typelist::create2<E_Access_Traits, PB_DS_TRIE_NODE_AND_ITS_TRAITS >::type, Allocator>
|
| 564 |
+
|
| 565 |
+
// A concrete basic trie-based associative container.
|
| 566 |
+
template<typename Key,
|
| 567 |
+
typename Mapped,
|
| 568 |
+
typename E_Access_Traits = typename detail::default_trie_e_access_traits<Key>::type,
|
| 569 |
+
typename Tag = pat_trie_tag,
|
| 570 |
+
template<typename Const_Node_Iterator,
|
| 571 |
+
typename Node_Iterator,
|
| 572 |
+
typename E_Access_Traits_,
|
| 573 |
+
typename Allocator_>
|
| 574 |
+
class Node_Update = null_trie_node_update,
|
| 575 |
+
typename Allocator = std::allocator<char> >
|
| 576 |
+
class trie : public PB_DS_BASE_C_DEC
|
| 577 |
+
{
|
| 578 |
+
private:
|
| 579 |
+
typedef PB_DS_BASE_C_DEC base_type;
|
| 580 |
+
|
| 581 |
+
public:
|
| 582 |
+
// Element access traits type.
|
| 583 |
+
typedef E_Access_Traits e_access_traits;
|
| 584 |
+
|
| 585 |
+
trie() { }
|
| 586 |
+
|
| 587 |
+
// Constructor taking some policy objects. r_e_access_traits will
|
| 588 |
+
// be copied by the E_Access_Traits object of the container
|
| 589 |
+
// object.
|
| 590 |
+
trie(const e_access_traits& t)
|
| 591 |
+
: base_type(t) { }
|
| 592 |
+
|
| 593 |
+
// Constructor taking __iterators to a range of value_types. The
|
| 594 |
+
// value_types between first_it and last_it will be inserted into
|
| 595 |
+
// the container object.
|
| 596 |
+
template<typename It>
|
| 597 |
+
trie(It first, It last)
|
| 598 |
+
{ base_type::copy_from_range(first, last); }
|
| 599 |
+
|
| 600 |
+
// Constructor taking __iterators to a range of value_types and
|
| 601 |
+
// some policy objects. The value_types between first_it and
|
| 602 |
+
// last_it will be inserted into the container object.
|
| 603 |
+
template<typename It>
|
| 604 |
+
trie(It first, It last, const e_access_traits& t)
|
| 605 |
+
: base_type(t)
|
| 606 |
+
{ base_type::copy_from_range(first, last); }
|
| 607 |
+
|
| 608 |
+
trie(const trie& other)
|
| 609 |
+
: base_type((const base_type&)other) { }
|
| 610 |
+
|
| 611 |
+
virtual
|
| 612 |
+
~trie() { }
|
| 613 |
+
|
| 614 |
+
trie&
|
| 615 |
+
operator=(const trie& other)
|
| 616 |
+
{
|
| 617 |
+
if (this != &other)
|
| 618 |
+
{
|
| 619 |
+
trie tmp(other);
|
| 620 |
+
swap(tmp);
|
| 621 |
+
}
|
| 622 |
+
return *this;
|
| 623 |
+
}
|
| 624 |
+
|
| 625 |
+
void
|
| 626 |
+
swap(trie& other)
|
| 627 |
+
{ base_type::swap(other); }
|
| 628 |
+
};
|
| 629 |
+
|
| 630 |
+
#undef PB_DS_BASE_C_DEC
|
| 631 |
+
#undef PB_DS_TRIE_NODE_AND_ITS_TRAITS
|
| 632 |
+
|
| 633 |
+
|
| 634 |
+
#define PB_DS_BASE_C_DEC \
|
| 635 |
+
container_base<Key, Mapped, list_update_tag, \
|
| 636 |
+
typename __gnu_cxx::typelist::create2<Eq_Fn, Update_Policy>::type, Allocator>
|
| 637 |
+
|
| 638 |
+
// A list-update based associative container.
|
| 639 |
+
template<typename Key,
|
| 640 |
+
typename Mapped,
|
| 641 |
+
class Eq_Fn = typename detail::default_eq_fn<Key>::type,
|
| 642 |
+
class Update_Policy = detail::default_update_policy::type,
|
| 643 |
+
class Allocator = std::allocator<char> >
|
| 644 |
+
class list_update : public PB_DS_BASE_C_DEC
|
| 645 |
+
{
|
| 646 |
+
private:
|
| 647 |
+
typedef PB_DS_BASE_C_DEC base_type;
|
| 648 |
+
|
| 649 |
+
public:
|
| 650 |
+
typedef Eq_Fn eq_fn;
|
| 651 |
+
typedef Update_Policy update_policy;
|
| 652 |
+
typedef Allocator allocator;
|
| 653 |
+
|
| 654 |
+
list_update() { }
|
| 655 |
+
|
| 656 |
+
// Constructor taking __iterators to a range of value_types. The
|
| 657 |
+
// value_types between first_it and last_it will be inserted into
|
| 658 |
+
// the container object.
|
| 659 |
+
template<typename It>
|
| 660 |
+
list_update(It first, It last)
|
| 661 |
+
{ base_type::copy_from_range(first, last); }
|
| 662 |
+
|
| 663 |
+
list_update(const list_update& other)
|
| 664 |
+
: base_type((const base_type&)other) { }
|
| 665 |
+
|
| 666 |
+
virtual
|
| 667 |
+
~list_update() { }
|
| 668 |
+
|
| 669 |
+
list_update&
|
| 670 |
+
operator=(const list_update& other)
|
| 671 |
+
{
|
| 672 |
+
if (this !=& other)
|
| 673 |
+
{
|
| 674 |
+
list_update tmp(other);
|
| 675 |
+
swap(tmp);
|
| 676 |
+
}
|
| 677 |
+
return *this;
|
| 678 |
+
}
|
| 679 |
+
|
| 680 |
+
void
|
| 681 |
+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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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 2, or (at your option) any later
|
| 9 |
+
// version.
|
| 10 |
+
|
| 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.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License
|
| 17 |
+
// along with this library; see the file COPYING. If not, write to
|
| 18 |
+
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
| 19 |
+
// MA 02111-1307, USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free
|
| 22 |
+
// software library without restriction. Specifically, if other files
|
| 23 |
+
// instantiate templates or use macros or inline functions from this
|
| 24 |
+
// file, or you compile this file and link it with other files to
|
| 25 |
+
// produce an executable, this file does not by itself cause the
|
| 26 |
+
// resulting executable to be covered by the GNU General Public
|
| 27 |
+
// License. This exception does not however invalidate any other
|
| 28 |
+
// reasons why the executable file might be covered by the GNU General
|
| 29 |
+
// Public License.
|
| 30 |
+
|
| 31 |
+
// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
|
| 32 |
+
|
| 33 |
+
// Permission to use, copy, modify, sell, and distribute this software
|
| 34 |
+
// is hereby granted without fee, provided that the above copyright
|
| 35 |
+
// notice appears in all copies, and that both that copyright notice
|
| 36 |
+
// and this permission notice appear in supporting documentation. None
|
| 37 |
+
// of the above authors, nor IBM Haifa Research Laboratories, make any
|
| 38 |
+
// representation about the suitability of this software for any
|
| 39 |
+
// purpose. It is provided "as is" without express or implied
|
| 40 |
+
// warranty.
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* @file basic_types.hpp
|
| 44 |
+
* Contains basic types used by containers.
|
| 45 |
+
*/
|
| 46 |
+
|
| 47 |
+
#ifndef PB_DS_BASIC_TYPES_HPP
|
| 48 |
+
#define PB_DS_BASIC_TYPES_HPP
|
| 49 |
+
|
| 50 |
+
#include <algorithm>
|
| 51 |
+
#include <utility>
|
| 52 |
+
#include <ext/pb_ds/tag_and_trait.hpp>
|
| 53 |
+
#include <ext/pb_ds/detail/type_utils.hpp>
|
| 54 |
+
|
| 55 |
+
namespace __gnu_pbds
|
| 56 |
+
{
|
| 57 |
+
namespace detail
|
| 58 |
+
{
|
| 59 |
+
template<typename Key, typename Mapped, typename Allocator, bool Store_Hash>
|
| 60 |
+
struct value_type_base;
|
| 61 |
+
|
| 62 |
+
/**
|
| 63 |
+
* Specialization of value_type_base for the case where the hash value
|
| 64 |
+
* is not stored alongside each value.
|
| 65 |
+
**/
|
| 66 |
+
template<typename Key, typename Mapped, typename Allocator>
|
| 67 |
+
struct value_type_base<Key, Mapped, Allocator, false>
|
| 68 |
+
{
|
| 69 |
+
typedef typename Allocator::template rebind<Mapped>::other mapped_type_allocator;
|
| 70 |
+
typedef typename mapped_type_allocator::value_type mapped_type;
|
| 71 |
+
typedef typename mapped_type_allocator::pointer mapped_pointer;
|
| 72 |
+
typedef typename mapped_type_allocator::const_pointer const_mapped_pointer;
|
| 73 |
+
typedef typename mapped_type_allocator::reference mapped_reference;
|
| 74 |
+
typedef typename mapped_type_allocator::const_reference const_mapped_reference;
|
| 75 |
+
|
| 76 |
+
typedef typename Allocator::template rebind<std::pair<const Key, Mapped> >::other value_type_allocator;
|
| 77 |
+
typedef typename value_type_allocator::value_type value_type;
|
| 78 |
+
typedef typename value_type_allocator::pointer pointer;
|
| 79 |
+
typedef typename value_type_allocator::const_pointer const_pointer;
|
| 80 |
+
typedef typename value_type_allocator::reference reference;
|
| 81 |
+
typedef typename value_type_allocator::const_reference const_reference;
|
| 82 |
+
|
| 83 |
+
struct stored_value_type
|
| 84 |
+
{
|
| 85 |
+
value_type m_value;
|
| 86 |
+
};
|
| 87 |
+
};
|
| 88 |
+
|
| 89 |
+
/**
|
| 90 |
+
* Specialization of value_type_base for the case where the hash value
|
| 91 |
+
* is stored alongside each value.
|
| 92 |
+
**/
|
| 93 |
+
template<typename Key, typename Mapped, typename Allocator>
|
| 94 |
+
struct value_type_base<Key, Mapped, Allocator, true>
|
| 95 |
+
{
|
| 96 |
+
typedef typename Allocator::template rebind<Mapped>::other mapped_type_allocator;
|
| 97 |
+
typedef typename mapped_type_allocator::value_type mapped_type;
|
| 98 |
+
typedef typename mapped_type_allocator::pointer mapped_pointer;
|
| 99 |
+
typedef typename mapped_type_allocator::const_pointer const_mapped_pointer;
|
| 100 |
+
typedef typename mapped_type_allocator::reference mapped_reference;
|
| 101 |
+
typedef typename mapped_type_allocator::const_reference const_mapped_reference;
|
| 102 |
+
|
| 103 |
+
typedef typename Allocator::template rebind<std::pair<const Key, Mapped> >::other value_type_allocator;
|
| 104 |
+
typedef typename value_type_allocator::value_type value_type;
|
| 105 |
+
typedef typename value_type_allocator::pointer pointer;
|
| 106 |
+
typedef typename value_type_allocator::const_pointer const_pointer;
|
| 107 |
+
typedef typename value_type_allocator::reference reference;
|
| 108 |
+
typedef typename value_type_allocator::const_reference const_reference;
|
| 109 |
+
|
| 110 |
+
struct stored_value_type
|
| 111 |
+
{
|
| 112 |
+
value_type m_value;
|
| 113 |
+
typename Allocator::size_type m_hash;
|
| 114 |
+
};
|
| 115 |
+
};
|
| 116 |
+
|
| 117 |
+
#define PB_DS_CLASS_T_DEC \
|
| 118 |
+
template<typename Key, typename Allocator>
|
| 119 |
+
|
| 120 |
+
#define PB_DS_CLASS_C_DEC \
|
| 121 |
+
value_type_base<Key, null_mapped_type, Allocator, false>
|
| 122 |
+
|
| 123 |
+
/**
|
| 124 |
+
* Specialization of value_type_base for the case where the hash value
|
| 125 |
+
* is not stored alongside each value.
|
| 126 |
+
**/
|
| 127 |
+
template<typename Key, typename Allocator>
|
| 128 |
+
struct value_type_base<Key, null_mapped_type, Allocator, false>
|
| 129 |
+
{
|
| 130 |
+
typedef typename Allocator::template rebind<null_mapped_type>::other mapped_type_allocator;
|
| 131 |
+
typedef typename mapped_type_allocator::value_type mapped_type;
|
| 132 |
+
typedef typename mapped_type_allocator::pointer mapped_pointer;
|
| 133 |
+
typedef typename mapped_type_allocator::const_pointer const_mapped_pointer;
|
| 134 |
+
typedef typename mapped_type_allocator::reference mapped_reference;
|
| 135 |
+
typedef typename mapped_type_allocator::const_reference const_mapped_reference;
|
| 136 |
+
|
| 137 |
+
typedef Key value_type;
|
| 138 |
+
|
| 139 |
+
typedef typename Allocator::template rebind<value_type>::other value_type_allocator;
|
| 140 |
+
typedef typename value_type_allocator::pointer pointer;
|
| 141 |
+
typedef typename value_type_allocator::const_pointer const_pointer;
|
| 142 |
+
typedef typename value_type_allocator::reference reference;
|
| 143 |
+
typedef typename value_type_allocator::const_reference const_reference;
|
| 144 |
+
|
| 145 |
+
struct stored_value_type
|
| 146 |
+
{
|
| 147 |
+
value_type m_value;
|
| 148 |
+
};
|
| 149 |
+
|
| 150 |
+
static null_mapped_type s_null_mapped;
|
| 151 |
+
};
|
| 152 |
+
|
| 153 |
+
PB_DS_CLASS_T_DEC
|
| 154 |
+
null_mapped_type PB_DS_CLASS_C_DEC::s_null_mapped;
|
| 155 |
+
|
| 156 |
+
#undef PB_DS_CLASS_T_DEC
|
| 157 |
+
#undef PB_DS_CLASS_C_DEC
|
| 158 |
+
|
| 159 |
+
#define PB_DS_CLASS_T_DEC \
|
| 160 |
+
template<typename Key, typename Allocator>
|
| 161 |
+
|
| 162 |
+
#define PB_DS_CLASS_C_DEC \
|
| 163 |
+
value_type_base<Key, null_mapped_type, Allocator, true>
|
| 164 |
+
|
| 165 |
+
/**
|
| 166 |
+
* Specialization of value_type_base for the case where the hash value
|
| 167 |
+
* is stored alongside each value.
|
| 168 |
+
**/
|
| 169 |
+
template<typename Key, typename Allocator>
|
| 170 |
+
struct value_type_base<Key, null_mapped_type, Allocator, true>
|
| 171 |
+
{
|
| 172 |
+
typedef typename Allocator::template rebind<null_mapped_type>::other mapped_type_allocator;
|
| 173 |
+
typedef typename mapped_type_allocator::value_type mapped_type;
|
| 174 |
+
typedef typename mapped_type_allocator::pointer mapped_pointer;
|
| 175 |
+
typedef typename mapped_type_allocator::const_pointer const_mapped_pointer;
|
| 176 |
+
typedef typename mapped_type_allocator::reference mapped_reference;
|
| 177 |
+
typedef typename mapped_type_allocator::const_reference const_mapped_reference;
|
| 178 |
+
|
| 179 |
+
typedef Key value_type;
|
| 180 |
+
|
| 181 |
+
typedef typename Allocator::template rebind<value_type>::other value_type_allocator;
|
| 182 |
+
typedef typename value_type_allocator::pointer pointer;
|
| 183 |
+
typedef typename value_type_allocator::const_pointer const_pointer;
|
| 184 |
+
typedef typename value_type_allocator::reference reference;
|
| 185 |
+
typedef typename value_type_allocator::const_reference const_reference;
|
| 186 |
+
|
| 187 |
+
struct stored_value_type
|
| 188 |
+
{
|
| 189 |
+
value_type m_value;
|
| 190 |
+
typename Allocator::size_type m_hash;
|
| 191 |
+
};
|
| 192 |
+
|
| 193 |
+
static null_mapped_type s_null_mapped;
|
| 194 |
+
};
|
| 195 |
+
|
| 196 |
+
PB_DS_CLASS_T_DEC
|
| 197 |
+
null_mapped_type PB_DS_CLASS_C_DEC::s_null_mapped;
|
| 198 |
+
|
| 199 |
+
#undef PB_DS_CLASS_T_DEC
|
| 200 |
+
#undef PB_DS_CLASS_C_DEC
|
| 201 |
+
|
| 202 |
+
template<typename Key, typename Mapped>
|
| 203 |
+
struct no_throw_copies
|
| 204 |
+
{
|
| 205 |
+
typedef integral_constant<int, is_simple<Key>::value && is_simple<Mapped>::value> indicator;
|
| 206 |
+
};
|
| 207 |
+
|
| 208 |
+
template<typename Key>
|
| 209 |
+
struct no_throw_copies<Key, null_mapped_type>
|
| 210 |
+
{
|
| 211 |
+
typedef integral_constant<int, is_simple<Key>::value> indicator;
|
| 212 |
+
};
|
| 213 |
+
} // namespace detail
|
| 214 |
+
} // namespace __gnu_pbds
|
| 215 |
+
|
| 216 |
+
#endif
|
| 217 |
+
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/detail/binary_heap_/policy_access_fn_imps.hpp
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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 2, or (at your option) any later
|
| 9 |
+
// version.
|
| 10 |
+
|
| 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.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License
|
| 17 |
+
// along with this library; see the file COPYING. If not, write to
|
| 18 |
+
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
| 19 |
+
// MA 02111-1307, USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free
|
| 22 |
+
// software library without restriction. Specifically, if other files
|
| 23 |
+
// instantiate templates or use macros or inline functions from this
|
| 24 |
+
// file, or you compile this file and link it with other files to
|
| 25 |
+
// produce an executable, this file does not by itself cause the
|
| 26 |
+
// resulting executable to be covered by the GNU General Public
|
| 27 |
+
// License. This exception does not however invalidate any other
|
| 28 |
+
// reasons why the executable file might be covered by the GNU General
|
| 29 |
+
// Public License.
|
| 30 |
+
|
| 31 |
+
// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
|
| 32 |
+
|
| 33 |
+
// Permission to use, copy, modify, sell, and distribute this software
|
| 34 |
+
// is hereby granted without fee, provided that the above copyright
|
| 35 |
+
// notice appears in all copies, and that both that copyright notice
|
| 36 |
+
// and this permission notice appear in supporting documentation. None
|
| 37 |
+
// of the above authors, nor IBM Haifa Research Laboratories, make any
|
| 38 |
+
// representation about the suitability of this software for any
|
| 39 |
+
// purpose. It is provided "as is" without express or implied
|
| 40 |
+
// warranty.
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* @file policy_access_fn_imps.hpp
|
| 44 |
+
* Contains an implementation class for a binary_heap.
|
| 45 |
+
*/
|
| 46 |
+
|
| 47 |
+
PB_DS_CLASS_T_DEC
|
| 48 |
+
Cmp_Fn&
|
| 49 |
+
PB_DS_CLASS_C_DEC::
|
| 50 |
+
get_cmp_fn()
|
| 51 |
+
{
|
| 52 |
+
return (*this);
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
PB_DS_CLASS_T_DEC
|
| 56 |
+
const Cmp_Fn&
|
| 57 |
+
PB_DS_CLASS_C_DEC::
|
| 58 |
+
get_cmp_fn() const
|
| 59 |
+
{
|
| 60 |
+
return (*this);
|
| 61 |
+
}
|
| 62 |
+
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/detail/binary_heap_/resize_policy.hpp
ADDED
|
@@ -0,0 +1,259 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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 2, or (at your option) any later
|
| 9 |
+
// version.
|
| 10 |
+
|
| 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.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License
|
| 17 |
+
// along with this library; see the file COPYING. If not, write to
|
| 18 |
+
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
| 19 |
+
// MA 02111-1307, USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free
|
| 22 |
+
// software library without restriction. Specifically, if other files
|
| 23 |
+
// instantiate templates or use macros or inline functions from this
|
| 24 |
+
// file, or you compile this file and link it with other files to
|
| 25 |
+
// produce an executable, this file does not by itself cause the
|
| 26 |
+
// resulting executable to be covered by the GNU General Public
|
| 27 |
+
// License. This exception does not however invalidate any other
|
| 28 |
+
// reasons why the executable file might be covered by the GNU General
|
| 29 |
+
// Public License.
|
| 30 |
+
|
| 31 |
+
// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
|
| 32 |
+
|
| 33 |
+
// Permission to use, copy, modify, sell, and distribute this software
|
| 34 |
+
// is hereby granted without fee, provided that the above copyright
|
| 35 |
+
// notice appears in all copies, and that both that copyright notice
|
| 36 |
+
// and this permission notice appear in supporting documentation. None
|
| 37 |
+
// of the above authors, nor IBM Haifa Research Laboratories, make any
|
| 38 |
+
// representation about the suitability of this software for any
|
| 39 |
+
// purpose. It is provided "as is" without express or implied
|
| 40 |
+
// warranty.
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* @file resize_policy.hpp
|
| 44 |
+
* Contains an implementation class for a binary_heap.
|
| 45 |
+
*/
|
| 46 |
+
|
| 47 |
+
#ifndef PB_DS_BINARY_HEAP_RESIZE_POLICY_HPP
|
| 48 |
+
#define PB_DS_BINARY_HEAP_RESIZE_POLICY_HPP
|
| 49 |
+
|
| 50 |
+
#include <debug/debug.h>
|
| 51 |
+
|
| 52 |
+
namespace __gnu_pbds
|
| 53 |
+
{
|
| 54 |
+
namespace detail
|
| 55 |
+
{
|
| 56 |
+
|
| 57 |
+
#define PB_DS_CLASS_T_DEC template<typename Size_Type>
|
| 58 |
+
|
| 59 |
+
#define PB_DS_CLASS_C_DEC resize_policy<Size_Type>
|
| 60 |
+
|
| 61 |
+
template<typename Size_Type>
|
| 62 |
+
class resize_policy
|
| 63 |
+
{
|
| 64 |
+
public:
|
| 65 |
+
typedef Size_Type size_type;
|
| 66 |
+
|
| 67 |
+
enum
|
| 68 |
+
{
|
| 69 |
+
min_size = 16
|
| 70 |
+
};
|
| 71 |
+
|
| 72 |
+
public:
|
| 73 |
+
inline
|
| 74 |
+
resize_policy();
|
| 75 |
+
|
| 76 |
+
inline void
|
| 77 |
+
swap(PB_DS_CLASS_C_DEC& other);
|
| 78 |
+
|
| 79 |
+
inline bool
|
| 80 |
+
resize_needed_for_grow(size_type size) const;
|
| 81 |
+
|
| 82 |
+
inline bool
|
| 83 |
+
resize_needed_for_shrink(size_type size) const;
|
| 84 |
+
|
| 85 |
+
inline bool
|
| 86 |
+
grow_needed(size_type size) const;
|
| 87 |
+
|
| 88 |
+
inline bool
|
| 89 |
+
shrink_needed(size_type size) const;
|
| 90 |
+
|
| 91 |
+
inline size_type
|
| 92 |
+
get_new_size_for_grow() const;
|
| 93 |
+
|
| 94 |
+
inline size_type
|
| 95 |
+
get_new_size_for_shrink() const;
|
| 96 |
+
|
| 97 |
+
size_type
|
| 98 |
+
get_new_size_for_arbitrary(size_type size) const;
|
| 99 |
+
|
| 100 |
+
inline void
|
| 101 |
+
notify_grow_resize();
|
| 102 |
+
|
| 103 |
+
inline void
|
| 104 |
+
notify_shrink_resize();
|
| 105 |
+
|
| 106 |
+
void
|
| 107 |
+
notify_arbitrary(size_type actual_size);
|
| 108 |
+
|
| 109 |
+
#ifdef _GLIBCXX_DEBUG
|
| 110 |
+
void
|
| 111 |
+
assert_valid() const;
|
| 112 |
+
#endif
|
| 113 |
+
|
| 114 |
+
#ifdef PB_DS_BINARY_HEAP_TRACE_
|
| 115 |
+
void
|
| 116 |
+
trace() const;
|
| 117 |
+
#endif
|
| 118 |
+
|
| 119 |
+
private:
|
| 120 |
+
enum
|
| 121 |
+
{
|
| 122 |
+
ratio = 8,
|
| 123 |
+
factor = 2
|
| 124 |
+
};
|
| 125 |
+
|
| 126 |
+
private:
|
| 127 |
+
size_type m_next_shrink_size;
|
| 128 |
+
size_type m_next_grow_size;
|
| 129 |
+
};
|
| 130 |
+
|
| 131 |
+
PB_DS_CLASS_T_DEC
|
| 132 |
+
inline
|
| 133 |
+
PB_DS_CLASS_C_DEC::
|
| 134 |
+
resize_policy() :
|
| 135 |
+
m_next_shrink_size(0),
|
| 136 |
+
m_next_grow_size(min_size)
|
| 137 |
+
{ _GLIBCXX_DEBUG_ONLY(assert_valid();) }
|
| 138 |
+
|
| 139 |
+
PB_DS_CLASS_T_DEC
|
| 140 |
+
inline void
|
| 141 |
+
PB_DS_CLASS_C_DEC::
|
| 142 |
+
swap(PB_DS_CLASS_C_DEC& other)
|
| 143 |
+
{
|
| 144 |
+
std::swap(m_next_shrink_size, other.m_next_shrink_size);
|
| 145 |
+
std::swap(m_next_grow_size, other.m_next_grow_size);
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
PB_DS_CLASS_T_DEC
|
| 149 |
+
inline bool
|
| 150 |
+
PB_DS_CLASS_C_DEC::
|
| 151 |
+
resize_needed_for_grow(size_type size) const
|
| 152 |
+
{
|
| 153 |
+
_GLIBCXX_DEBUG_ASSERT(size <= m_next_grow_size);
|
| 154 |
+
return size == m_next_grow_size;
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
PB_DS_CLASS_T_DEC
|
| 158 |
+
inline bool
|
| 159 |
+
PB_DS_CLASS_C_DEC::
|
| 160 |
+
resize_needed_for_shrink(size_type size) const
|
| 161 |
+
{
|
| 162 |
+
_GLIBCXX_DEBUG_ASSERT(size <= m_next_grow_size);
|
| 163 |
+
return size == m_next_shrink_size;
|
| 164 |
+
}
|
| 165 |
+
|
| 166 |
+
PB_DS_CLASS_T_DEC
|
| 167 |
+
inline typename PB_DS_CLASS_C_DEC::size_type
|
| 168 |
+
PB_DS_CLASS_C_DEC::
|
| 169 |
+
get_new_size_for_grow() const
|
| 170 |
+
{ return m_next_grow_size* factor; }
|
| 171 |
+
|
| 172 |
+
PB_DS_CLASS_T_DEC
|
| 173 |
+
inline typename PB_DS_CLASS_C_DEC::size_type
|
| 174 |
+
PB_DS_CLASS_C_DEC::
|
| 175 |
+
get_new_size_for_shrink() const
|
| 176 |
+
{
|
| 177 |
+
const size_type half_size = m_next_grow_size / factor;
|
| 178 |
+
return std::max(static_cast<size_type>(min_size), half_size);
|
| 179 |
+
}
|
| 180 |
+
|
| 181 |
+
PB_DS_CLASS_T_DEC
|
| 182 |
+
inline typename PB_DS_CLASS_C_DEC::size_type
|
| 183 |
+
PB_DS_CLASS_C_DEC::
|
| 184 |
+
get_new_size_for_arbitrary(size_type size) const
|
| 185 |
+
{
|
| 186 |
+
size_type ret = min_size;
|
| 187 |
+
while (ret < size)
|
| 188 |
+
ret *= factor;
|
| 189 |
+
return ret;
|
| 190 |
+
}
|
| 191 |
+
|
| 192 |
+
PB_DS_CLASS_T_DEC
|
| 193 |
+
inline void
|
| 194 |
+
PB_DS_CLASS_C_DEC::
|
| 195 |
+
notify_grow_resize()
|
| 196 |
+
{
|
| 197 |
+
_GLIBCXX_DEBUG_ONLY(assert_valid();)
|
| 198 |
+
_GLIBCXX_DEBUG_ASSERT(m_next_grow_size >= min_size);
|
| 199 |
+
m_next_grow_size *= factor;
|
| 200 |
+
m_next_shrink_size = m_next_grow_size / ratio;
|
| 201 |
+
_GLIBCXX_DEBUG_ONLY(assert_valid();)
|
| 202 |
+
}
|
| 203 |
+
|
| 204 |
+
PB_DS_CLASS_T_DEC
|
| 205 |
+
inline void
|
| 206 |
+
PB_DS_CLASS_C_DEC::
|
| 207 |
+
notify_shrink_resize()
|
| 208 |
+
{
|
| 209 |
+
_GLIBCXX_DEBUG_ONLY(assert_valid();)
|
| 210 |
+
m_next_shrink_size /= factor;
|
| 211 |
+
if (m_next_shrink_size == 1)
|
| 212 |
+
m_next_shrink_size = 0;
|
| 213 |
+
|
| 214 |
+
m_next_grow_size =
|
| 215 |
+
std::max(m_next_grow_size / factor, static_cast<size_type>(min_size));
|
| 216 |
+
_GLIBCXX_DEBUG_ONLY(assert_valid();)
|
| 217 |
+
}
|
| 218 |
+
|
| 219 |
+
PB_DS_CLASS_T_DEC
|
| 220 |
+
inline void
|
| 221 |
+
PB_DS_CLASS_C_DEC::
|
| 222 |
+
notify_arbitrary(size_type actual_size)
|
| 223 |
+
{
|
| 224 |
+
m_next_grow_size = actual_size;
|
| 225 |
+
m_next_shrink_size = m_next_grow_size / ratio;
|
| 226 |
+
_GLIBCXX_DEBUG_ONLY(assert_valid();)
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
#ifdef _GLIBCXX_DEBUG
|
| 230 |
+
PB_DS_CLASS_T_DEC
|
| 231 |
+
void
|
| 232 |
+
PB_DS_CLASS_C_DEC::
|
| 233 |
+
assert_valid() const
|
| 234 |
+
{
|
| 235 |
+
_GLIBCXX_DEBUG_ASSERT(m_next_shrink_size == 0 ||
|
| 236 |
+
m_next_shrink_size* ratio == m_next_grow_size);
|
| 237 |
+
|
| 238 |
+
_GLIBCXX_DEBUG_ASSERT(m_next_grow_size >= min_size);
|
| 239 |
+
}
|
| 240 |
+
#endif
|
| 241 |
+
|
| 242 |
+
#ifdef PB_DS_BINARY_HEAP_TRACE_
|
| 243 |
+
PB_DS_CLASS_T_DEC
|
| 244 |
+
void
|
| 245 |
+
PB_DS_CLASS_C_DEC::
|
| 246 |
+
trace() const
|
| 247 |
+
{
|
| 248 |
+
std::cerr << "shrink = " << m_next_shrink_size <<
|
| 249 |
+
" grow = " << m_next_grow_size << std::endl;
|
| 250 |
+
}
|
| 251 |
+
#endif
|
| 252 |
+
|
| 253 |
+
#undef PB_DS_CLASS_T_DEC
|
| 254 |
+
#undef PB_DS_CLASS_C_DEC
|
| 255 |
+
|
| 256 |
+
} // namespace detail
|
| 257 |
+
} // namespace __gnu_pbds
|
| 258 |
+
|
| 259 |
+
#endif
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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 2, or (at your option) any later
|
| 9 |
+
// version.
|
| 10 |
+
|
| 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.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License
|
| 17 |
+
// along with this library; see the file COPYING. If not, write to
|
| 18 |
+
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
| 19 |
+
// MA 02111-1307, USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free
|
| 22 |
+
// software library without restriction. Specifically, if other files
|
| 23 |
+
// instantiate templates or use macros or inline functions from this
|
| 24 |
+
// file, or you compile this file and link it with other files to
|
| 25 |
+
// produce an executable, this file does not by itself cause the
|
| 26 |
+
// resulting executable to be covered by the GNU General Public
|
| 27 |
+
// License. This exception does not however invalidate any other
|
| 28 |
+
// reasons why the executable file might be covered by the GNU General
|
| 29 |
+
// Public License.
|
| 30 |
+
|
| 31 |
+
// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
|
| 32 |
+
|
| 33 |
+
// Permission to use, copy, modify, sell, and distribute this software
|
| 34 |
+
// is hereby granted without fee, provided that the above copyright
|
| 35 |
+
// notice appears in all copies, and that both that copyright notice
|
| 36 |
+
// and this permission notice appear in supporting documentation. None
|
| 37 |
+
// of the above authors, nor IBM Haifa Research Laboratories, make any
|
| 38 |
+
// representation about the suitability of this software for any
|
| 39 |
+
// purpose. It is provided "as is" without express or implied
|
| 40 |
+
// warranty.
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* @file split_join_fn_imps.hpp
|
| 44 |
+
* Contains an implementation class for a binary_heap.
|
| 45 |
+
*/
|
| 46 |
+
|
| 47 |
+
PB_DS_CLASS_T_DEC
|
| 48 |
+
template<typename Pred>
|
| 49 |
+
void
|
| 50 |
+
PB_DS_CLASS_C_DEC::
|
| 51 |
+
split(Pred pred, PB_DS_CLASS_C_DEC& other)
|
| 52 |
+
{
|
| 53 |
+
_GLIBCXX_DEBUG_ONLY(assert_valid();)
|
| 54 |
+
|
| 55 |
+
typedef
|
| 56 |
+
typename entry_pred<
|
| 57 |
+
value_type,
|
| 58 |
+
Pred,
|
| 59 |
+
simple_value,
|
| 60 |
+
Allocator>::type
|
| 61 |
+
pred_t;
|
| 62 |
+
|
| 63 |
+
const size_type left = partition(pred_t(pred));
|
| 64 |
+
|
| 65 |
+
_GLIBCXX_DEBUG_ASSERT(m_size >= left);
|
| 66 |
+
|
| 67 |
+
const size_type ersd = m_size - left;
|
| 68 |
+
|
| 69 |
+
_GLIBCXX_DEBUG_ASSERT(m_size >= ersd);
|
| 70 |
+
|
| 71 |
+
const size_type actual_size =
|
| 72 |
+
resize_policy::get_new_size_for_arbitrary(left);
|
| 73 |
+
|
| 74 |
+
const size_type other_actual_size =
|
| 75 |
+
other.get_new_size_for_arbitrary(ersd);
|
| 76 |
+
|
| 77 |
+
entry_pointer a_entries = NULL;
|
| 78 |
+
entry_pointer a_other_entries = NULL;
|
| 79 |
+
|
| 80 |
+
try
|
| 81 |
+
{
|
| 82 |
+
a_entries = s_entry_allocator.allocate(actual_size);
|
| 83 |
+
|
| 84 |
+
a_other_entries = s_entry_allocator.allocate(other_actual_size);
|
| 85 |
+
}
|
| 86 |
+
catch(...)
|
| 87 |
+
{
|
| 88 |
+
if (a_entries != NULL)
|
| 89 |
+
s_entry_allocator.deallocate(a_entries, actual_size);
|
| 90 |
+
|
| 91 |
+
if (a_other_entries != NULL)
|
| 92 |
+
s_entry_allocator.deallocate(a_other_entries, other_actual_size);
|
| 93 |
+
|
| 94 |
+
__throw_exception_again;
|
| 95 |
+
};
|
| 96 |
+
|
| 97 |
+
for (size_type i = 0; i < other.m_size; ++i)
|
| 98 |
+
erase_at(other.m_a_entries, i, s_no_throw_copies_ind);
|
| 99 |
+
|
| 100 |
+
_GLIBCXX_DEBUG_ASSERT(actual_size >= left);
|
| 101 |
+
std::copy(m_a_entries, m_a_entries + left, a_entries);
|
| 102 |
+
std::copy(m_a_entries + left, m_a_entries + m_size, a_other_entries);
|
| 103 |
+
|
| 104 |
+
s_entry_allocator.deallocate(m_a_entries, m_actual_size);
|
| 105 |
+
s_entry_allocator.deallocate(other.m_a_entries, other.m_actual_size);
|
| 106 |
+
|
| 107 |
+
m_actual_size = actual_size;
|
| 108 |
+
other.m_actual_size = other_actual_size;
|
| 109 |
+
|
| 110 |
+
m_size = left;
|
| 111 |
+
other.m_size = ersd;
|
| 112 |
+
|
| 113 |
+
m_a_entries = a_entries;
|
| 114 |
+
other.m_a_entries = a_other_entries;
|
| 115 |
+
|
| 116 |
+
std::make_heap(m_a_entries, m_a_entries + m_size, static_cast<entry_cmp& >(*this));
|
| 117 |
+
std::make_heap(other.m_a_entries, other.m_a_entries + other.m_size, static_cast<entry_cmp& >(other));
|
| 118 |
+
|
| 119 |
+
resize_policy::notify_arbitrary(m_actual_size);
|
| 120 |
+
other.notify_arbitrary(other.m_actual_size);
|
| 121 |
+
|
| 122 |
+
_GLIBCXX_DEBUG_ONLY(assert_valid();)
|
| 123 |
+
_GLIBCXX_DEBUG_ONLY(other.assert_valid();)
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
PB_DS_CLASS_T_DEC
|
| 127 |
+
inline void
|
| 128 |
+
PB_DS_CLASS_C_DEC::
|
| 129 |
+
join(PB_DS_CLASS_C_DEC& other)
|
| 130 |
+
{
|
| 131 |
+
_GLIBCXX_DEBUG_ONLY(assert_valid();)
|
| 132 |
+
_GLIBCXX_DEBUG_ONLY(other.assert_valid();)
|
| 133 |
+
|
| 134 |
+
const size_type len = m_size + other.m_size;
|
| 135 |
+
const size_type actual_size = resize_policy::get_new_size_for_arbitrary(len);
|
| 136 |
+
|
| 137 |
+
entry_pointer a_entries = NULL;
|
| 138 |
+
entry_pointer a_other_entries = NULL;
|
| 139 |
+
|
| 140 |
+
try
|
| 141 |
+
{
|
| 142 |
+
a_entries = s_entry_allocator.allocate(actual_size);
|
| 143 |
+
a_other_entries = s_entry_allocator.allocate(resize_policy::min_size);
|
| 144 |
+
}
|
| 145 |
+
catch(...)
|
| 146 |
+
{
|
| 147 |
+
if (a_entries != NULL)
|
| 148 |
+
s_entry_allocator.deallocate(a_entries, actual_size);
|
| 149 |
+
|
| 150 |
+
if (a_other_entries != NULL)
|
| 151 |
+
s_entry_allocator.deallocate(a_other_entries, resize_policy::min_size);
|
| 152 |
+
|
| 153 |
+
__throw_exception_again;
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
std::copy(m_a_entries, m_a_entries + m_size, a_entries);
|
| 157 |
+
std::copy(other.m_a_entries, other.m_a_entries + other.m_size, a_entries + m_size);
|
| 158 |
+
|
| 159 |
+
s_entry_allocator.deallocate(m_a_entries, m_actual_size);
|
| 160 |
+
m_a_entries = a_entries;
|
| 161 |
+
m_size = len;
|
| 162 |
+
m_actual_size = actual_size;
|
| 163 |
+
|
| 164 |
+
resize_policy::notify_arbitrary(actual_size);
|
| 165 |
+
|
| 166 |
+
std::make_heap(m_a_entries, m_a_entries + m_size, static_cast<entry_cmp& >(*this));
|
| 167 |
+
|
| 168 |
+
s_entry_allocator.deallocate(other.m_a_entries, other.m_actual_size);
|
| 169 |
+
other.m_a_entries = a_other_entries;
|
| 170 |
+
other.m_size = 0;
|
| 171 |
+
other.m_actual_size = resize_policy::min_size;
|
| 172 |
+
|
| 173 |
+
other.notify_arbitrary(resize_policy::min_size);
|
| 174 |
+
|
| 175 |
+
_GLIBCXX_DEBUG_ONLY(assert_valid();)
|
| 176 |
+
_GLIBCXX_DEBUG_ONLY(other.assert_valid();)
|
| 177 |
+
}
|
| 178 |
+
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/detail/cond_dealtor.hpp
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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 2, or (at your option) any later
|
| 9 |
+
// version.
|
| 10 |
+
|
| 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.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License
|
| 17 |
+
// along with this library; see the file COPYING. If not, write to
|
| 18 |
+
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
| 19 |
+
// MA 02111-1307, USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free
|
| 22 |
+
// software library without restriction. Specifically, if other files
|
| 23 |
+
// instantiate templates or use macros or inline functions from this
|
| 24 |
+
// file, or you compile this file and link it with other files to
|
| 25 |
+
// produce an executable, this file does not by itself cause the
|
| 26 |
+
// resulting executable to be covered by the GNU General Public
|
| 27 |
+
// License. This exception does not however invalidate any other
|
| 28 |
+
// reasons why the executable file might be covered by the GNU General
|
| 29 |
+
// Public License.
|
| 30 |
+
|
| 31 |
+
// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
|
| 32 |
+
|
| 33 |
+
// Permission to use, copy, modify, sell, and distribute this software
|
| 34 |
+
// is hereby granted without fee, provided that the above copyright
|
| 35 |
+
// notice appears in all copies, and that both that copyright notice
|
| 36 |
+
// and this permission notice appear in supporting documentation. None
|
| 37 |
+
// of the above authors, nor IBM Haifa Research Laboratories, make any
|
| 38 |
+
// representation about the suitability of this software for any
|
| 39 |
+
// purpose. It is provided "as is" without express or implied
|
| 40 |
+
// warranty.
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* @file cond_dealtor.hpp
|
| 44 |
+
* Contains a conditional deallocator.
|
| 45 |
+
*/
|
| 46 |
+
|
| 47 |
+
#ifndef PB_DS_COND_DEALTOR_HPP
|
| 48 |
+
#define PB_DS_COND_DEALTOR_HPP
|
| 49 |
+
|
| 50 |
+
namespace __gnu_pbds
|
| 51 |
+
{
|
| 52 |
+
|
| 53 |
+
namespace detail
|
| 54 |
+
{
|
| 55 |
+
|
| 56 |
+
#define PB_DS_COND_DEALTOR_CLASS_T_DEC \
|
| 57 |
+
template<typename Entry, class Allocator>
|
| 58 |
+
|
| 59 |
+
#define PB_DS_COND_DEALTOR_CLASS_C_DEC \
|
| 60 |
+
cond_dealtor< \
|
| 61 |
+
Entry, \
|
| 62 |
+
Allocator>
|
| 63 |
+
|
| 64 |
+
template<typename Entry, class Allocator>
|
| 65 |
+
class cond_dealtor
|
| 66 |
+
{
|
| 67 |
+
public:
|
| 68 |
+
typedef
|
| 69 |
+
typename Allocator::template rebind<Entry>::other
|
| 70 |
+
entry_allocator;
|
| 71 |
+
|
| 72 |
+
typedef typename entry_allocator::pointer entry_pointer;
|
| 73 |
+
|
| 74 |
+
public:
|
| 75 |
+
inline
|
| 76 |
+
cond_dealtor(entry_pointer p_e);
|
| 77 |
+
|
| 78 |
+
inline
|
| 79 |
+
~cond_dealtor();
|
| 80 |
+
|
| 81 |
+
inline void
|
| 82 |
+
set_no_action();
|
| 83 |
+
|
| 84 |
+
private:
|
| 85 |
+
entry_pointer m_p_e;
|
| 86 |
+
|
| 87 |
+
bool m_no_action_destructor;
|
| 88 |
+
|
| 89 |
+
static entry_allocator s_alloc;
|
| 90 |
+
};
|
| 91 |
+
|
| 92 |
+
PB_DS_COND_DEALTOR_CLASS_T_DEC
|
| 93 |
+
typename PB_DS_COND_DEALTOR_CLASS_C_DEC::entry_allocator
|
| 94 |
+
PB_DS_COND_DEALTOR_CLASS_C_DEC::s_alloc;
|
| 95 |
+
|
| 96 |
+
PB_DS_COND_DEALTOR_CLASS_T_DEC
|
| 97 |
+
inline
|
| 98 |
+
PB_DS_COND_DEALTOR_CLASS_C_DEC::
|
| 99 |
+
cond_dealtor(entry_pointer p_e) :
|
| 100 |
+
m_p_e(p_e),
|
| 101 |
+
m_no_action_destructor(false)
|
| 102 |
+
{ }
|
| 103 |
+
|
| 104 |
+
PB_DS_COND_DEALTOR_CLASS_T_DEC
|
| 105 |
+
inline void
|
| 106 |
+
PB_DS_COND_DEALTOR_CLASS_C_DEC::
|
| 107 |
+
set_no_action()
|
| 108 |
+
{
|
| 109 |
+
m_no_action_destructor = true;
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
PB_DS_COND_DEALTOR_CLASS_T_DEC
|
| 113 |
+
inline
|
| 114 |
+
PB_DS_COND_DEALTOR_CLASS_C_DEC::
|
| 115 |
+
~cond_dealtor()
|
| 116 |
+
{
|
| 117 |
+
if (m_no_action_destructor)
|
| 118 |
+
return;
|
| 119 |
+
|
| 120 |
+
s_alloc.deallocate(m_p_e, 1);
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
#undef PB_DS_COND_DEALTOR_CLASS_T_DEC
|
| 124 |
+
#undef PB_DS_COND_DEALTOR_CLASS_C_DEC
|
| 125 |
+
|
| 126 |
+
} // namespace detail
|
| 127 |
+
|
| 128 |
+
} // namespace __gnu_pbds
|
| 129 |
+
|
| 130 |
+
#endif // #ifndef PB_DS_COND_DEALTOR_HPP
|
| 131 |
+
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/detail/constructors_destructor_fn_imps.hpp
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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 2, or (at your option) any later
|
| 9 |
+
// version.
|
| 10 |
+
|
| 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.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License
|
| 17 |
+
// along with this library; see the file COPYING. If not, write to
|
| 18 |
+
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
| 19 |
+
// MA 02111-1307, USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free
|
| 22 |
+
// software library without restriction. Specifically, if other files
|
| 23 |
+
// instantiate templates or use macros or inline functions from this
|
| 24 |
+
// file, or you compile this file and link it with other files to
|
| 25 |
+
// produce an executable, this file does not by itself cause the
|
| 26 |
+
// resulting executable to be covered by the GNU General Public
|
| 27 |
+
// License. This exception does not however invalidate any other
|
| 28 |
+
// reasons why the executable file might be covered by the GNU General
|
| 29 |
+
// Public License.
|
| 30 |
+
|
| 31 |
+
// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
|
| 32 |
+
|
| 33 |
+
// Permission to use, copy, modify, sell, and distribute this software
|
| 34 |
+
// is hereby granted without fee, provided that the above copyright
|
| 35 |
+
// notice appears in all copies, and that both that copyright notice
|
| 36 |
+
// and this permission notice appear in supporting documentation. None
|
| 37 |
+
// of the above authors, nor IBM Haifa Research Laboratories, make any
|
| 38 |
+
// representation about the suitability of this software for any
|
| 39 |
+
// purpose. It is provided "as is" without express or implied
|
| 40 |
+
// warranty.
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* @file constructors_destructor_fn_imps.hpp
|
| 44 |
+
* Contains constructors_destructor_fn_imps applicable to different containers.
|
| 45 |
+
*/
|
| 46 |
+
|
| 47 |
+
inline
|
| 48 |
+
PB_DS_CLASS_NAME()
|
| 49 |
+
{ }
|
| 50 |
+
|
| 51 |
+
inline
|
| 52 |
+
PB_DS_CLASS_NAME(const PB_DS_CLASS_NAME& other)
|
| 53 |
+
: base_type((const base_type&)other)
|
| 54 |
+
{ }
|
| 55 |
+
|
| 56 |
+
template<typename T0>
|
| 57 |
+
inline
|
| 58 |
+
PB_DS_CLASS_NAME(T0 t0) : base_type(t0)
|
| 59 |
+
{ }
|
| 60 |
+
|
| 61 |
+
template<typename T0, typename T1>
|
| 62 |
+
inline
|
| 63 |
+
PB_DS_CLASS_NAME(T0 t0, T1 t1) : base_type(t0, t1)
|
| 64 |
+
{ }
|
| 65 |
+
|
| 66 |
+
template<typename T0, typename T1, typename T2>
|
| 67 |
+
inline
|
| 68 |
+
PB_DS_CLASS_NAME(T0 t0, T1 t1, T2 t2) : base_type(t0, t1, t2)
|
| 69 |
+
{ }
|
| 70 |
+
|
| 71 |
+
template<typename T0, typename T1, typename T2, typename T3>
|
| 72 |
+
inline
|
| 73 |
+
PB_DS_CLASS_NAME(T0 t0, T1 t1, T2 t2, T3 t3)
|
| 74 |
+
: base_type(t0, t1, t2, t3)
|
| 75 |
+
{ }
|
| 76 |
+
|
| 77 |
+
template<typename T0, typename T1, typename T2, typename T3, typename T4>
|
| 78 |
+
inline
|
| 79 |
+
PB_DS_CLASS_NAME(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4)
|
| 80 |
+
: base_type(t0, t1, t2, t3, t4)
|
| 81 |
+
{ }
|
| 82 |
+
|
| 83 |
+
template<typename T0, typename T1, typename T2, typename T3, typename T4,
|
| 84 |
+
typename T5>
|
| 85 |
+
inline
|
| 86 |
+
PB_DS_CLASS_NAME(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5)
|
| 87 |
+
: base_type(t0, t1, t2, t3, t4, t5)
|
| 88 |
+
{ }
|
| 89 |
+
|
| 90 |
+
template<typename T0, typename T1, typename T2, typename T3, typename T4,
|
| 91 |
+
typename T5, typename T6>
|
| 92 |
+
inline
|
| 93 |
+
PB_DS_CLASS_NAME(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6)
|
| 94 |
+
: base_type(t0, t1, t2, t3, t4, t5, t6)
|
| 95 |
+
{ }
|
| 96 |
+
|
| 97 |
+
template<typename T0, typename T1, typename T2, typename T3, typename T4,
|
| 98 |
+
typename T5, typename T6, typename T7>
|
| 99 |
+
inline
|
| 100 |
+
PB_DS_CLASS_NAME(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7)
|
| 101 |
+
: base_type(t0, t1, t2, t3, t4, t5, t6, t7)
|
| 102 |
+
{ }
|
| 103 |
+
|
| 104 |
+
template<typename T0, typename T1, typename T2, typename T3, typename T4,
|
| 105 |
+
typename T5, typename T6, typename T7, typename T8>
|
| 106 |
+
inline
|
| 107 |
+
PB_DS_CLASS_NAME(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8)
|
| 108 |
+
: base_type(t0, t1, t2, t3, t4, t5, t6, t7, t8)
|
| 109 |
+
{ }
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/detail/container_base_dispatch.hpp
ADDED
|
@@ -0,0 +1,338 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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 2, or (at your option) any later
|
| 9 |
+
// version.
|
| 10 |
+
|
| 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.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License
|
| 17 |
+
// along with this library; see the file COPYING. If not, write to
|
| 18 |
+
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
| 19 |
+
// MA 02111-1307, USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free
|
| 22 |
+
// software library without restriction. Specifically, if other files
|
| 23 |
+
// instantiate templates or use macros or inline functions from this
|
| 24 |
+
// file, or you compile this file and link it with other files to
|
| 25 |
+
// produce an executable, this file does not by itself cause the
|
| 26 |
+
// resulting executable to be covered by the GNU General Public
|
| 27 |
+
// License. This exception does not however invalidate any other
|
| 28 |
+
// reasons why the executable file might be covered by the GNU General
|
| 29 |
+
// Public License.
|
| 30 |
+
|
| 31 |
+
// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
|
| 32 |
+
|
| 33 |
+
// Permission to use, copy, modify, sell, and distribute this software
|
| 34 |
+
// is hereby granted without fee, provided that the above copyright
|
| 35 |
+
// notice appears in all copies, and that both that copyright notice
|
| 36 |
+
// and this permission notice appear in supporting documentation. None
|
| 37 |
+
// of the above authors, nor IBM Haifa Research Laboratories, make any
|
| 38 |
+
// representation about the suitability of this software for any
|
| 39 |
+
// purpose. It is provided "as is" without express or implied
|
| 40 |
+
// warranty.
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* @file container_base_dispatch.hpp
|
| 44 |
+
* Contains an associative container dispatching base.
|
| 45 |
+
*/
|
| 46 |
+
|
| 47 |
+
#ifndef PB_DS_ASSOC_CNTNR_BASE_DS_DISPATCHER_HPP
|
| 48 |
+
#define PB_DS_ASSOC_CNTNR_BASE_DS_DISPATCHER_HPP
|
| 49 |
+
|
| 50 |
+
#include <ext/typelist.h>
|
| 51 |
+
|
| 52 |
+
#define PB_DS_DATA_TRUE_INDICATOR
|
| 53 |
+
#include <ext/pb_ds/detail/list_update_map_/lu_map_.hpp>
|
| 54 |
+
#undef PB_DS_DATA_TRUE_INDICATOR
|
| 55 |
+
|
| 56 |
+
#define PB_DS_DATA_FALSE_INDICATOR
|
| 57 |
+
#include <ext/pb_ds/detail/list_update_map_/lu_map_.hpp>
|
| 58 |
+
#undef PB_DS_DATA_FALSE_INDICATOR
|
| 59 |
+
|
| 60 |
+
#define PB_DS_DATA_TRUE_INDICATOR
|
| 61 |
+
#include <ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp>
|
| 62 |
+
#undef PB_DS_DATA_TRUE_INDICATOR
|
| 63 |
+
|
| 64 |
+
#define PB_DS_DATA_FALSE_INDICATOR
|
| 65 |
+
#include <ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp>
|
| 66 |
+
#undef PB_DS_DATA_FALSE_INDICATOR
|
| 67 |
+
|
| 68 |
+
#define PB_DS_DATA_TRUE_INDICATOR
|
| 69 |
+
#include <ext/pb_ds/detail/splay_tree_/splay_tree_.hpp>
|
| 70 |
+
#undef PB_DS_DATA_TRUE_INDICATOR
|
| 71 |
+
|
| 72 |
+
#define PB_DS_DATA_FALSE_INDICATOR
|
| 73 |
+
#include <ext/pb_ds/detail/splay_tree_/splay_tree_.hpp>
|
| 74 |
+
#undef PB_DS_DATA_FALSE_INDICATOR
|
| 75 |
+
|
| 76 |
+
#define PB_DS_DATA_TRUE_INDICATOR
|
| 77 |
+
#include <ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp>
|
| 78 |
+
#undef PB_DS_DATA_TRUE_INDICATOR
|
| 79 |
+
|
| 80 |
+
#define PB_DS_DATA_FALSE_INDICATOR
|
| 81 |
+
#include <ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp>
|
| 82 |
+
#undef PB_DS_DATA_FALSE_INDICATOR
|
| 83 |
+
|
| 84 |
+
#define PB_DS_DATA_TRUE_INDICATOR
|
| 85 |
+
#include <ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp>
|
| 86 |
+
#undef PB_DS_DATA_TRUE_INDICATOR
|
| 87 |
+
|
| 88 |
+
#define PB_DS_DATA_FALSE_INDICATOR
|
| 89 |
+
#include <ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp>
|
| 90 |
+
#undef PB_DS_DATA_FALSE_INDICATOR
|
| 91 |
+
|
| 92 |
+
#define PB_DS_DATA_TRUE_INDICATOR
|
| 93 |
+
#include <ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp>
|
| 94 |
+
#undef PB_DS_DATA_TRUE_INDICATOR
|
| 95 |
+
|
| 96 |
+
#define PB_DS_DATA_FALSE_INDICATOR
|
| 97 |
+
#include <ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp>
|
| 98 |
+
#undef PB_DS_DATA_FALSE_INDICATOR
|
| 99 |
+
|
| 100 |
+
#define PB_DS_DATA_TRUE_INDICATOR
|
| 101 |
+
#include <ext/pb_ds/detail/pat_trie_/pat_trie_.hpp>
|
| 102 |
+
#undef PB_DS_DATA_TRUE_INDICATOR
|
| 103 |
+
|
| 104 |
+
#define PB_DS_DATA_FALSE_INDICATOR
|
| 105 |
+
#include <ext/pb_ds/detail/pat_trie_/pat_trie_.hpp>
|
| 106 |
+
#undef PB_DS_DATA_FALSE_INDICATOR
|
| 107 |
+
|
| 108 |
+
namespace __gnu_pbds
|
| 109 |
+
{
|
| 110 |
+
namespace detail
|
| 111 |
+
{
|
| 112 |
+
// Primary template.
|
| 113 |
+
template<typename Key, typename Mapped, typename Data_Structure_Taq,
|
| 114 |
+
typename Policy_Tl, typename Alloc>
|
| 115 |
+
struct container_base_dispatch;
|
| 116 |
+
|
| 117 |
+
template<typename Key, typename Mapped, typename Policy_Tl, typename Alloc>
|
| 118 |
+
struct container_base_dispatch<Key, Mapped, list_update_tag,
|
| 119 |
+
Policy_Tl, Alloc>
|
| 120 |
+
{
|
| 121 |
+
private:
|
| 122 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
|
| 123 |
+
typedef typename at0::type at0t;
|
| 124 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
|
| 125 |
+
typedef typename at1::type at1t;
|
| 126 |
+
|
| 127 |
+
public:
|
| 128 |
+
typedef lu_map_data_<Key, Mapped, at0t, Alloc, at1t> type;
|
| 129 |
+
};
|
| 130 |
+
|
| 131 |
+
template<typename Key, typename Policy_Tl, typename Alloc>
|
| 132 |
+
struct container_base_dispatch<Key, null_mapped_type, list_update_tag,
|
| 133 |
+
Policy_Tl, Alloc>
|
| 134 |
+
{
|
| 135 |
+
private:
|
| 136 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
|
| 137 |
+
typedef typename at0::type at0t;
|
| 138 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
|
| 139 |
+
typedef typename at1::type at1t;
|
| 140 |
+
|
| 141 |
+
public:
|
| 142 |
+
typedef lu_map_no_data_<Key, null_mapped_type, at0t, Alloc, at1t> type;
|
| 143 |
+
};
|
| 144 |
+
|
| 145 |
+
template<typename Key, typename Mapped, typename Policy_Tl, typename Alloc>
|
| 146 |
+
struct container_base_dispatch<Key, Mapped, pat_trie_tag, Policy_Tl, Alloc>
|
| 147 |
+
{
|
| 148 |
+
private:
|
| 149 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
|
| 150 |
+
typedef typename at1::type at1t;
|
| 151 |
+
|
| 152 |
+
public:
|
| 153 |
+
typedef pat_trie_data_<Key, Mapped, at1t, Alloc> type;
|
| 154 |
+
};
|
| 155 |
+
|
| 156 |
+
template<typename Key, typename Policy_Tl, typename Alloc>
|
| 157 |
+
struct container_base_dispatch<Key, null_mapped_type, pat_trie_tag,
|
| 158 |
+
Policy_Tl, Alloc>
|
| 159 |
+
{
|
| 160 |
+
private:
|
| 161 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
|
| 162 |
+
typedef typename at1::type at1t;
|
| 163 |
+
|
| 164 |
+
public:
|
| 165 |
+
typedef pat_trie_no_data_<Key, null_mapped_type, at1t, Alloc> type;
|
| 166 |
+
};
|
| 167 |
+
|
| 168 |
+
template<typename Key, typename Mapped, typename Policy_Tl, typename Alloc>
|
| 169 |
+
struct container_base_dispatch<Key, Mapped, rb_tree_tag, Policy_Tl, Alloc>
|
| 170 |
+
{
|
| 171 |
+
private:
|
| 172 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
|
| 173 |
+
typedef typename at0::type at0t;
|
| 174 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
|
| 175 |
+
typedef typename at1::type at1t;
|
| 176 |
+
|
| 177 |
+
public:
|
| 178 |
+
typedef rb_tree_data_<Key, Mapped, at0t, at1t, Alloc> type;
|
| 179 |
+
};
|
| 180 |
+
|
| 181 |
+
template<typename Key, typename Policy_Tl, typename Alloc>
|
| 182 |
+
struct container_base_dispatch<Key, null_mapped_type, rb_tree_tag,
|
| 183 |
+
Policy_Tl, Alloc>
|
| 184 |
+
{
|
| 185 |
+
private:
|
| 186 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
|
| 187 |
+
typedef typename at0::type at0t;
|
| 188 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
|
| 189 |
+
typedef typename at1::type at1t;
|
| 190 |
+
|
| 191 |
+
public:
|
| 192 |
+
typedef rb_tree_no_data_<Key, null_mapped_type, at0t, at1t, Alloc> type;
|
| 193 |
+
};
|
| 194 |
+
|
| 195 |
+
template<typename Key, typename Mapped, typename Policy_Tl, typename Alloc>
|
| 196 |
+
struct container_base_dispatch<Key, Mapped, splay_tree_tag,
|
| 197 |
+
Policy_Tl, Alloc>
|
| 198 |
+
{
|
| 199 |
+
private:
|
| 200 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
|
| 201 |
+
typedef typename at0::type at0t;
|
| 202 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
|
| 203 |
+
typedef typename at1::type at1t;
|
| 204 |
+
|
| 205 |
+
public:
|
| 206 |
+
typedef splay_tree_data_<Key, Mapped, at0t, at1t, Alloc> type;
|
| 207 |
+
};
|
| 208 |
+
|
| 209 |
+
template<typename Key, typename Policy_Tl, typename Alloc>
|
| 210 |
+
struct container_base_dispatch<Key, null_mapped_type, splay_tree_tag,
|
| 211 |
+
Policy_Tl, Alloc>
|
| 212 |
+
{
|
| 213 |
+
private:
|
| 214 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
|
| 215 |
+
typedef typename at0::type at0t;
|
| 216 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
|
| 217 |
+
typedef typename at1::type at1t;
|
| 218 |
+
|
| 219 |
+
public:
|
| 220 |
+
typedef splay_tree_no_data_<Key, null_mapped_type, at0t, at1t, Alloc> type;
|
| 221 |
+
};
|
| 222 |
+
|
| 223 |
+
template<typename Key, typename Mapped, typename Policy_Tl, typename Alloc>
|
| 224 |
+
struct container_base_dispatch<Key, Mapped, ov_tree_tag, Policy_Tl, Alloc>
|
| 225 |
+
{
|
| 226 |
+
private:
|
| 227 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
|
| 228 |
+
typedef typename at0::type at0t;
|
| 229 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
|
| 230 |
+
typedef typename at1::type at1t;
|
| 231 |
+
|
| 232 |
+
public:
|
| 233 |
+
typedef ov_tree_data_<Key, Mapped, at0t, at1t, Alloc> type;
|
| 234 |
+
};
|
| 235 |
+
|
| 236 |
+
template<typename Key, typename Policy_Tl, typename Alloc>
|
| 237 |
+
struct container_base_dispatch<Key, null_mapped_type, ov_tree_tag,
|
| 238 |
+
Policy_Tl, Alloc>
|
| 239 |
+
{
|
| 240 |
+
private:
|
| 241 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
|
| 242 |
+
typedef typename at0::type at0t;
|
| 243 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
|
| 244 |
+
typedef typename at1::type at1t;
|
| 245 |
+
|
| 246 |
+
public:
|
| 247 |
+
typedef ov_tree_no_data_<Key, null_mapped_type, at0t, at1t, Alloc> type;
|
| 248 |
+
};
|
| 249 |
+
|
| 250 |
+
template<typename Key, typename Mapped, typename Policy_Tl, typename Alloc>
|
| 251 |
+
struct container_base_dispatch<Key, Mapped, cc_hash_tag, Policy_Tl, Alloc>
|
| 252 |
+
{
|
| 253 |
+
private:
|
| 254 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
|
| 255 |
+
typedef typename at0::type at0t;
|
| 256 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
|
| 257 |
+
typedef typename at1::type at1t;
|
| 258 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 2> at2;
|
| 259 |
+
typedef typename at2::type at2t;
|
| 260 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 3> at3;
|
| 261 |
+
typedef typename at3::type at3t;
|
| 262 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 4> at4;
|
| 263 |
+
typedef typename at4::type at4t;
|
| 264 |
+
|
| 265 |
+
public:
|
| 266 |
+
typedef cc_ht_map_data_<Key, Mapped, at0t, at1t, Alloc, at3t::value,
|
| 267 |
+
at4t, at2t> type;
|
| 268 |
+
};
|
| 269 |
+
|
| 270 |
+
template<typename Key, typename Policy_Tl, typename Alloc>
|
| 271 |
+
struct container_base_dispatch<Key, null_mapped_type, cc_hash_tag,
|
| 272 |
+
Policy_Tl, Alloc>
|
| 273 |
+
{
|
| 274 |
+
private:
|
| 275 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
|
| 276 |
+
typedef typename at0::type at0t;
|
| 277 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
|
| 278 |
+
typedef typename at1::type at1t;
|
| 279 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 2> at2;
|
| 280 |
+
typedef typename at2::type at2t;
|
| 281 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 3> at3;
|
| 282 |
+
typedef typename at3::type at3t;
|
| 283 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 4> at4;
|
| 284 |
+
typedef typename at4::type at4t;
|
| 285 |
+
|
| 286 |
+
public:
|
| 287 |
+
typedef cc_ht_map_no_data_<Key, null_mapped_type, at0t, at1t, Alloc,
|
| 288 |
+
at3t::value, at4t, at2t> type;
|
| 289 |
+
};
|
| 290 |
+
|
| 291 |
+
template<typename Key, typename Mapped, typename Policy_Tl, typename Alloc>
|
| 292 |
+
struct container_base_dispatch<Key, Mapped, gp_hash_tag, Policy_Tl, Alloc>
|
| 293 |
+
{
|
| 294 |
+
private:
|
| 295 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
|
| 296 |
+
typedef typename at0::type at0t;
|
| 297 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
|
| 298 |
+
typedef typename at1::type at1t;
|
| 299 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 2> at2;
|
| 300 |
+
typedef typename at2::type at2t;
|
| 301 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 3> at3;
|
| 302 |
+
typedef typename at3::type at3t;
|
| 303 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 4> at4;
|
| 304 |
+
typedef typename at4::type at4t;
|
| 305 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 5> at5;
|
| 306 |
+
typedef typename at5::type at5t;
|
| 307 |
+
|
| 308 |
+
public:
|
| 309 |
+
typedef gp_ht_map_data_<Key, Mapped, at0t, at1t, Alloc, at3t::value,
|
| 310 |
+
at4t, at5t, at2t> type;
|
| 311 |
+
};
|
| 312 |
+
|
| 313 |
+
template<typename Key, typename Policy_Tl, typename Alloc>
|
| 314 |
+
struct container_base_dispatch<Key, null_mapped_type, gp_hash_tag,
|
| 315 |
+
Policy_Tl, Alloc>
|
| 316 |
+
{
|
| 317 |
+
private:
|
| 318 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 0> at0;
|
| 319 |
+
typedef typename at0::type at0t;
|
| 320 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 1> at1;
|
| 321 |
+
typedef typename at1::type at1t;
|
| 322 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 2> at2;
|
| 323 |
+
typedef typename at2::type at2t;
|
| 324 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 3> at3;
|
| 325 |
+
typedef typename at3::type at3t;
|
| 326 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 4> at4;
|
| 327 |
+
typedef typename at4::type at4t;
|
| 328 |
+
typedef __gnu_cxx::typelist::at_index<Policy_Tl, 5> at5;
|
| 329 |
+
typedef typename at5::type at5t;
|
| 330 |
+
|
| 331 |
+
public:
|
| 332 |
+
typedef gp_ht_map_no_data_<Key, null_mapped_type, at0t, at1t, Alloc,
|
| 333 |
+
at3t::value, at4t, at5t, at2t> type;
|
| 334 |
+
};
|
| 335 |
+
} // namespace detail
|
| 336 |
+
} // namespace __gnu_pbds
|
| 337 |
+
|
| 338 |
+
#endif
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/detail/priority_queue_base_dispatch.hpp
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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 2, or (at your option) any later
|
| 9 |
+
// version.
|
| 10 |
+
|
| 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.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License
|
| 17 |
+
// along with this library; see the file COPYING. If not, write to
|
| 18 |
+
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
| 19 |
+
// MA 02111-1307, USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free
|
| 22 |
+
// software library without restriction. Specifically, if other files
|
| 23 |
+
// instantiate templates or use macros or inline functions from this
|
| 24 |
+
// file, or you compile this file and link it with other files to
|
| 25 |
+
// produce an executable, this file does not by itself cause the
|
| 26 |
+
// resulting executable to be covered by the GNU General Public
|
| 27 |
+
// License. This exception does not however invalidate any other
|
| 28 |
+
// reasons why the executable file might be covered by the GNU General
|
| 29 |
+
// Public License.
|
| 30 |
+
|
| 31 |
+
// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
|
| 32 |
+
|
| 33 |
+
// Permission to use, copy, modify, sell, and distribute this software
|
| 34 |
+
// is hereby granted without fee, provided that the above copyright
|
| 35 |
+
// notice appears in all copies, and that both that copyright notice
|
| 36 |
+
// and this permission notice appear in supporting documentation. None
|
| 37 |
+
// of the above authors, nor IBM Haifa Research Laboratories, make any
|
| 38 |
+
// representation about the suitability of this software for any
|
| 39 |
+
// purpose. It is provided "as is" without express or implied
|
| 40 |
+
// warranty.
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* @file priority_queue_base_dispatch.hpp
|
| 44 |
+
* Contains an pqiative container dispatching base.
|
| 45 |
+
*/
|
| 46 |
+
|
| 47 |
+
#ifndef PB_DS_PRIORITY_QUEUE_BASE_DS_DISPATCHER_HPP
|
| 48 |
+
#define PB_DS_PRIORITY_QUEUE_BASE_DS_DISPATCHER_HPP
|
| 49 |
+
|
| 50 |
+
#include <ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp>
|
| 51 |
+
#include <ext/pb_ds/detail/binomial_heap_/binomial_heap_.hpp>
|
| 52 |
+
#include <ext/pb_ds/detail/rc_binomial_heap_/rc_binomial_heap_.hpp>
|
| 53 |
+
#include <ext/pb_ds/detail/binary_heap_/binary_heap_.hpp>
|
| 54 |
+
#include <ext/pb_ds/detail/thin_heap_/thin_heap_.hpp>
|
| 55 |
+
|
| 56 |
+
namespace __gnu_pbds
|
| 57 |
+
{
|
| 58 |
+
namespace detail
|
| 59 |
+
{
|
| 60 |
+
|
| 61 |
+
template<typename Value_Type, typename Cmp_Fn, typename Tag, typename Allocator>
|
| 62 |
+
struct priority_queue_base_dispatch;
|
| 63 |
+
|
| 64 |
+
template<typename Value_Type, typename Cmp_Fn, typename Allocator>
|
| 65 |
+
struct priority_queue_base_dispatch<Value_Type, Cmp_Fn, pairing_heap_tag, Allocator>
|
| 66 |
+
{
|
| 67 |
+
typedef pairing_heap_< Value_Type, Cmp_Fn, Allocator> type;
|
| 68 |
+
};
|
| 69 |
+
|
| 70 |
+
template<typename Value_Type, typename Cmp_Fn, typename Allocator>
|
| 71 |
+
struct priority_queue_base_dispatch<Value_Type, Cmp_Fn, binomial_heap_tag, Allocator>
|
| 72 |
+
{
|
| 73 |
+
typedef binomial_heap_< Value_Type, Cmp_Fn, Allocator> type;
|
| 74 |
+
};
|
| 75 |
+
|
| 76 |
+
template<typename Value_Type, typename Cmp_Fn, typename Allocator>
|
| 77 |
+
struct priority_queue_base_dispatch<Value_Type, Cmp_Fn, rc_binomial_heap_tag, Allocator>
|
| 78 |
+
{
|
| 79 |
+
typedef rc_binomial_heap_< Value_Type, Cmp_Fn, Allocator> type;
|
| 80 |
+
};
|
| 81 |
+
|
| 82 |
+
template<typename Value_Type, typename Cmp_Fn, typename Allocator>
|
| 83 |
+
struct priority_queue_base_dispatch<Value_Type, Cmp_Fn, binary_heap_tag, Allocator>
|
| 84 |
+
{
|
| 85 |
+
typedef binary_heap_< Value_Type, Cmp_Fn, Allocator> type;
|
| 86 |
+
};
|
| 87 |
+
|
| 88 |
+
template<typename Value_Type, typename Cmp_Fn, typename Allocator>
|
| 89 |
+
struct priority_queue_base_dispatch<Value_Type, Cmp_Fn, thin_heap_tag, Allocator>
|
| 90 |
+
{
|
| 91 |
+
typedef thin_heap_< Value_Type, Cmp_Fn, Allocator> type;
|
| 92 |
+
};
|
| 93 |
+
|
| 94 |
+
} // namespace detail
|
| 95 |
+
} // namespace __gnu_pbds
|
| 96 |
+
|
| 97 |
+
#endif // #ifndef PB_DS_PRIORITY_QUEUE_BASE_DS_DISPATCHER_HPP
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/exception.hpp
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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 2, or (at your option) any later
|
| 9 |
+
// version.
|
| 10 |
+
|
| 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.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License
|
| 17 |
+
// along with this library; see the file COPYING. If not, write to
|
| 18 |
+
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
| 19 |
+
// MA 02111-1307, USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free
|
| 22 |
+
// software library without restriction. Specifically, if other files
|
| 23 |
+
// instantiate templates or use macros or inline functions from this
|
| 24 |
+
// file, or you compile this file and link it with other files to
|
| 25 |
+
// produce an executable, this file does not by itself cause the
|
| 26 |
+
// resulting executable to be covered by the GNU General Public
|
| 27 |
+
// License. This exception does not however invalidate any other
|
| 28 |
+
// reasons why the executable file might be covered by the GNU General
|
| 29 |
+
// Public License.
|
| 30 |
+
|
| 31 |
+
// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
|
| 32 |
+
|
| 33 |
+
// Permission to use, copy, modify, sell, and distribute this software
|
| 34 |
+
// is hereby granted without fee, provided that the above copyright
|
| 35 |
+
// notice appears in all copies, and that both that copyright notice
|
| 36 |
+
// and this permission notice appear in supporting documentation. None
|
| 37 |
+
// of the above authors, nor IBM Haifa Research Laboratories, make any
|
| 38 |
+
// representation about the suitability of this software for any
|
| 39 |
+
// purpose. It is provided "as is" without express or implied
|
| 40 |
+
// warranty.
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* @file exception.hpp
|
| 44 |
+
* Contains exception classes.
|
| 45 |
+
*/
|
| 46 |
+
|
| 47 |
+
#ifndef PB_DS_EXCEPTION_HPP
|
| 48 |
+
#define PB_DS_EXCEPTION_HPP
|
| 49 |
+
|
| 50 |
+
#include <stdexcept>
|
| 51 |
+
#include <cstdlib>
|
| 52 |
+
|
| 53 |
+
namespace __gnu_pbds
|
| 54 |
+
{
|
| 55 |
+
// Base class for exceptions.
|
| 56 |
+
struct container_error : public std::logic_error
|
| 57 |
+
{
|
| 58 |
+
container_error()
|
| 59 |
+
: std::logic_error(__N("__gnu_pbds::container_error")) { }
|
| 60 |
+
};
|
| 61 |
+
|
| 62 |
+
// An entry cannot be inserted into a container object for logical
|
| 63 |
+
// reasons (not, e.g., if memory is unabvailable, in which case
|
| 64 |
+
// the allocator's exception will be thrown).
|
| 65 |
+
struct insert_error : public container_error { };
|
| 66 |
+
|
| 67 |
+
// A join cannot be performed logical reasons (i.e., the ranges of
|
| 68 |
+
// the two container objects being joined overlaps.
|
| 69 |
+
struct join_error : public container_error { };
|
| 70 |
+
|
| 71 |
+
// A container cannot be resized.
|
| 72 |
+
struct resize_error : public container_error { };
|
| 73 |
+
|
| 74 |
+
#if __EXCEPTIONS
|
| 75 |
+
inline void
|
| 76 |
+
__throw_container_error(void)
|
| 77 |
+
{ throw container_error(); }
|
| 78 |
+
|
| 79 |
+
inline void
|
| 80 |
+
__throw_insert_error(void)
|
| 81 |
+
{ throw insert_error(); }
|
| 82 |
+
|
| 83 |
+
inline void
|
| 84 |
+
__throw_join_error(void)
|
| 85 |
+
{ throw join_error(); }
|
| 86 |
+
|
| 87 |
+
inline void
|
| 88 |
+
__throw_resize_error(void)
|
| 89 |
+
{ throw resize_error(); }
|
| 90 |
+
#else
|
| 91 |
+
inline void
|
| 92 |
+
__throw_container_error(void)
|
| 93 |
+
{ std::abort(); }
|
| 94 |
+
|
| 95 |
+
inline void
|
| 96 |
+
__throw_insert_error(void)
|
| 97 |
+
{ std::abort(); }
|
| 98 |
+
|
| 99 |
+
inline void
|
| 100 |
+
__throw_join_error(void)
|
| 101 |
+
{ std::abort(); }
|
| 102 |
+
|
| 103 |
+
inline void
|
| 104 |
+
__throw_resize_error(void)
|
| 105 |
+
{ std::abort(); }
|
| 106 |
+
#endif
|
| 107 |
+
} // namespace __gnu_pbds
|
| 108 |
+
|
| 109 |
+
#endif
|
mingw/lib/gcc/mingw32/4.3.3/include/c++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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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 2, or (at your option) any later
|
| 9 |
+
// version.
|
| 10 |
+
|
| 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.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License
|
| 17 |
+
// along with this library; see the file COPYING. If not, write to
|
| 18 |
+
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
| 19 |
+
// MA 02111-1307, USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free
|
| 22 |
+
// software library without restriction. Specifically, if other files
|
| 23 |
+
// instantiate templates or use macros or inline functions from this
|
| 24 |
+
// file, or you compile this file and link it with other files to
|
| 25 |
+
// produce an executable, this file does not by itself cause the
|
| 26 |
+
// resulting executable to be covered by the GNU General Public
|
| 27 |
+
// License. This exception does not however invalidate any other
|
| 28 |
+
// reasons why the executable file might be covered by the GNU General
|
| 29 |
+
// Public License.
|
| 30 |
+
|
| 31 |
+
// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
|
| 32 |
+
|
| 33 |
+
// Permission to use, copy, modify, sell, and distribute this software
|
| 34 |
+
// is hereby granted without fee, provided that the above copyright
|
| 35 |
+
// notice appears in all copies, and that both that copyright notice
|
| 36 |
+
// and this permission notice appear in supporting documentation. None
|
| 37 |
+
// of the above authors, nor IBM Haifa Research Laboratories, make any
|
| 38 |
+
// representation about the suitability of this software for any
|
| 39 |
+
// purpose. It is provided "as is" without express or implied
|
| 40 |
+
// warranty.
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* @file hash_policy.hpp
|
| 44 |
+
* Contains hash-related policies.
|
| 45 |
+
*/
|
| 46 |
+
|
| 47 |
+
#ifndef PB_DS_HASH_POLICY_HPP
|
| 48 |
+
#define PB_DS_HASH_POLICY_HPP
|
| 49 |
+
|
| 50 |
+
#include <algorithm>
|
| 51 |
+
#include <vector>
|
| 52 |
+
#include <cmath>
|
| 53 |
+
#include <ext/pb_ds/exception.hpp>
|
| 54 |
+
#include <ext/pb_ds/detail/type_utils.hpp>
|
| 55 |
+
#include <ext/pb_ds/detail/hash_fn/mask_based_range_hashing.hpp>
|
| 56 |
+
#include <ext/pb_ds/detail/hash_fn/mod_based_range_hashing.hpp>
|
| 57 |
+
#include <ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_size_base.hpp>
|
| 58 |
+
|
| 59 |
+
namespace __gnu_pbds
|
| 60 |
+
{
|
| 61 |
+
// A null hash function, indicating that the combining hash function
|
| 62 |
+
// is actually a ranged hash function.
|
| 63 |
+
struct null_hash_fn
|
| 64 |
+
{ };
|
| 65 |
+
|
| 66 |
+
// A null probe function, indicating that the combining probe
|
| 67 |
+
// function is actually a ranged probe function.
|
| 68 |
+
struct null_probe_fn
|
| 69 |
+
{ };
|
| 70 |
+
|
| 71 |
+
#define PB_DS_CLASS_T_DEC template<typename Size_Type>
|
| 72 |
+
#define PB_DS_CLASS_C_DEC linear_probe_fn<Size_Type>
|
| 73 |
+
|
| 74 |
+
// A probe sequence policy using fixed increments.
|
| 75 |
+
template<typename Size_Type = size_t>
|
| 76 |
+
class linear_probe_fn
|
| 77 |
+
{
|
| 78 |
+
public:
|
| 79 |
+
typedef Size_Type size_type;
|
| 80 |
+
|
| 81 |
+
void
|
| 82 |
+
swap(PB_DS_CLASS_C_DEC& other);
|
| 83 |
+
|
| 84 |
+
protected:
|
| 85 |
+
// Returns the i-th offset from the hash value.
|
| 86 |
+
inline size_type
|
| 87 |
+
operator()(size_type i) const;
|
| 88 |
+
};
|
| 89 |
+
|
| 90 |
+
#include <ext/pb_ds/detail/hash_fn/linear_probe_fn_imp.hpp>
|
| 91 |
+
|
| 92 |
+
#undef PB_DS_CLASS_T_DEC
|
| 93 |
+
#undef PB_DS_CLASS_C_DEC
|
| 94 |
+
|
| 95 |
+
#define PB_DS_CLASS_T_DEC template<typename Size_Type>
|
| 96 |
+
#define PB_DS_CLASS_C_DEC quadratic_probe_fn<Size_Type>
|
| 97 |
+
|
| 98 |
+
// A probe sequence policy using square increments.
|
| 99 |
+
template<typename Size_Type = size_t>
|
| 100 |
+
class quadratic_probe_fn
|
| 101 |
+
{
|
| 102 |
+
public:
|
| 103 |
+
typedef Size_Type size_type;
|
| 104 |
+
|
| 105 |
+
void
|
| 106 |
+
swap(PB_DS_CLASS_C_DEC& other);
|
| 107 |
+
|
| 108 |
+
protected:
|
| 109 |
+
// Returns the i-th offset from the hash value.
|
| 110 |
+
inline size_type
|
| 111 |
+
operator()(size_type i) const;
|
| 112 |
+
};
|
| 113 |
+
|
| 114 |
+
#include <ext/pb_ds/detail/hash_fn/quadratic_probe_fn_imp.hpp>
|
| 115 |
+
|
| 116 |
+
#undef PB_DS_CLASS_T_DEC
|
| 117 |
+
#undef PB_DS_CLASS_C_DEC
|
| 118 |
+
|
| 119 |
+
#define PB_DS_CLASS_T_DEC template<typename Size_Type>
|
| 120 |
+
#define PB_DS_CLASS_C_DEC direct_mask_range_hashing<Size_Type>
|
| 121 |
+
|
| 122 |
+
// A mask range-hashing class (uses a bit-mask).
|
| 123 |
+
template<typename Size_Type = size_t>
|
| 124 |
+
class direct_mask_range_hashing
|
| 125 |
+
: public detail::mask_based_range_hashing<Size_Type>
|
| 126 |
+
{
|
| 127 |
+
private:
|
| 128 |
+
typedef detail::mask_based_range_hashing<Size_Type> mask_based_base;
|
| 129 |
+
|
| 130 |
+
public:
|
| 131 |
+
typedef Size_Type size_type;
|
| 132 |
+
|
| 133 |
+
void
|
| 134 |
+
swap(PB_DS_CLASS_C_DEC& other);
|
| 135 |
+
|
| 136 |
+
protected:
|
| 137 |
+
void
|
| 138 |
+
notify_resized(size_type size);
|
| 139 |
+
|
| 140 |
+
// Transforms the __hash value hash into a ranged-hash value
|
| 141 |
+
// (using a bit-mask).
|
| 142 |
+
inline size_type
|
| 143 |
+
operator()(size_type hash) const;
|
| 144 |
+
};
|
| 145 |
+
|
| 146 |
+
#include <ext/pb_ds/detail/hash_fn/direct_mask_range_hashing_imp.hpp>
|
| 147 |
+
|
| 148 |
+
#undef PB_DS_CLASS_T_DEC
|
| 149 |
+
#undef PB_DS_CLASS_C_DEC
|
| 150 |
+
|
| 151 |
+
#define PB_DS_CLASS_T_DEC template<typename Size_Type>
|
| 152 |
+
#define PB_DS_CLASS_C_DEC direct_mod_range_hashing<Size_Type>
|
| 153 |
+
|
| 154 |
+
// A mod range-hashing class (uses the modulo function).
|
| 155 |
+
template<typename Size_Type = size_t>
|
| 156 |
+
class direct_mod_range_hashing
|
| 157 |
+
: public detail::mod_based_range_hashing<Size_Type>
|
| 158 |
+
{
|
| 159 |
+
public:
|
| 160 |
+
typedef Size_Type size_type;
|
| 161 |
+
|
| 162 |
+
void
|
| 163 |
+
swap(PB_DS_CLASS_C_DEC& other);
|
| 164 |
+
|
| 165 |
+
protected:
|
| 166 |
+
void
|
| 167 |
+
notify_resized(size_type size);
|
| 168 |
+
|
| 169 |
+
// Transforms the __hash value hash into a ranged-hash value
|
| 170 |
+
// (using a modulo operation).
|
| 171 |
+
inline size_type
|
| 172 |
+
operator()(size_type hash) const;
|
| 173 |
+
|
| 174 |
+
private:
|
| 175 |
+
typedef detail::mod_based_range_hashing<size_type> mod_based_base;
|
| 176 |
+
};
|
| 177 |
+
|
| 178 |
+
#include <ext/pb_ds/detail/hash_fn/direct_mod_range_hashing_imp.hpp>
|
| 179 |
+
|
| 180 |
+
#undef PB_DS_CLASS_T_DEC
|
| 181 |
+
#undef PB_DS_CLASS_C_DEC
|
| 182 |
+
|
| 183 |
+
#define PB_DS_CLASS_T_DEC template<bool External_Load_Access, typename Size_Type>
|
| 184 |
+
#define PB_DS_CLASS_C_DEC hash_load_check_resize_trigger<External_Load_Access, Size_Type>
|
| 185 |
+
#define PB_DS_SIZE_BASE_C_DEC detail::hash_load_check_resize_trigger_size_base<Size_Type, External_Load_Access>
|
| 186 |
+
|
| 187 |
+
// A resize trigger policy based on a load check. It keeps the
|
| 188 |
+
// load factor between some load factors load_min and load_max.
|
| 189 |
+
template<bool External_Load_Access = false, typename Size_Type = size_t>
|
| 190 |
+
class hash_load_check_resize_trigger : private PB_DS_SIZE_BASE_C_DEC
|
| 191 |
+
{
|
| 192 |
+
public:
|
| 193 |
+
typedef Size_Type size_type;
|
| 194 |
+
|
| 195 |
+
enum
|
| 196 |
+
{
|
| 197 |
+
external_load_access = External_Load_Access
|
| 198 |
+
};
|
| 199 |
+
|
| 200 |
+
// Default constructor, or constructor taking load_min and
|
| 201 |
+
// load_max load factors between which this policy will keep the
|
| 202 |
+
// actual load.
|
| 203 |
+
hash_load_check_resize_trigger(float load_min = 0.125,
|
| 204 |
+
float load_max = 0.5);
|
| 205 |
+
|
| 206 |
+
void
|
| 207 |
+
swap(hash_load_check_resize_trigger& other);
|
| 208 |
+
|
| 209 |
+
virtual
|
| 210 |
+
~hash_load_check_resize_trigger();
|
| 211 |
+
|
| 212 |
+
// Returns a pair of the minimal and maximal loads, respectively.
|
| 213 |
+
inline std::pair<float, float>
|
| 214 |
+
get_loads() const;
|
| 215 |
+
|
| 216 |
+
// Sets the loads through a pair of the minimal and maximal
|
| 217 |
+
// loads, respectively.
|
| 218 |
+
void
|
| 219 |
+
set_loads(std::pair<float, float> load_pair);
|
| 220 |
+
|
| 221 |
+
protected:
|
| 222 |
+
inline void
|
| 223 |
+
notify_insert_search_start();
|
| 224 |
+
|
| 225 |
+
inline void
|
| 226 |
+
notify_insert_search_collision();
|
| 227 |
+
|
| 228 |
+
inline void
|
| 229 |
+
notify_insert_search_end();
|
| 230 |
+
|
| 231 |
+
inline void
|
| 232 |
+
notify_find_search_start();
|
| 233 |
+
|
| 234 |
+
inline void
|
| 235 |
+
notify_find_search_collision();
|
| 236 |
+
|
| 237 |
+
inline void
|
| 238 |
+
notify_find_search_end();
|
| 239 |
+
|
| 240 |
+
inline void
|
| 241 |
+
notify_erase_search_start();
|
| 242 |
+
|
| 243 |
+
inline void
|
| 244 |
+
notify_erase_search_collision();
|
| 245 |
+
|
| 246 |
+
inline void
|
| 247 |
+
notify_erase_search_end();
|
| 248 |
+
|
| 249 |
+
// Notifies an element was inserted. The total number of entries
|
| 250 |
+
// in the table is num_entries.
|
| 251 |
+
inline void
|
| 252 |
+
notify_inserted(size_type num_entries);
|
| 253 |
+
|
| 254 |
+
inline void
|
| 255 |
+
notify_erased(size_type num_entries);
|
| 256 |
+
|
| 257 |
+
// Notifies the table was cleared.
|
| 258 |
+
void
|
| 259 |
+
notify_cleared();
|
| 260 |
+
|
| 261 |
+
// Notifies the table was resized as a result of this object's
|
| 262 |
+
// signifying that a resize is needed.
|
| 263 |
+
void
|
| 264 |
+
notify_resized(size_type new_size);
|
| 265 |
+
|
| 266 |
+
void
|
| 267 |
+
notify_externally_resized(size_type new_size);
|
| 268 |
+
|
| 269 |
+
inline bool
|
| 270 |
+
is_resize_needed() const;
|
| 271 |
+
|
| 272 |
+
inline bool
|
| 273 |
+
is_grow_needed(size_type size, size_type num_entries) const;
|
| 274 |
+
|
| 275 |
+
private:
|
| 276 |
+
virtual void
|
| 277 |
+
do_resize(size_type new_size);
|
| 278 |
+
|
| 279 |
+
typedef PB_DS_SIZE_BASE_C_DEC size_base;
|
| 280 |
+
|
| 281 |
+
#ifdef _GLIBCXX_DEBUG
|
| 282 |
+
void
|
| 283 |
+
assert_valid() const;
|
| 284 |
+
#endif
|
| 285 |
+
|
| 286 |
+
float m_load_min;
|
| 287 |
+
float m_load_max;
|
| 288 |
+
size_type m_next_shrink_size;
|
| 289 |
+
size_type m_next_grow_size;
|
| 290 |
+
bool m_resize_needed;
|
| 291 |
+
};
|
| 292 |
+
|
| 293 |
+
#include <ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp>
|
| 294 |
+
|
| 295 |
+
#undef PB_DS_CLASS_T_DEC
|
| 296 |
+
#undef PB_DS_CLASS_C_DEC
|
| 297 |
+
#undef PB_DS_SIZE_BASE_C_DEC
|
| 298 |
+
|
| 299 |
+
#define PB_DS_CLASS_T_DEC template<bool External_Load_Access, typename Size_Type>
|
| 300 |
+
#define PB_DS_CLASS_C_DEC cc_hash_max_collision_check_resize_trigger<External_Load_Access, Size_Type>
|
| 301 |
+
|
| 302 |
+
// A resize trigger policy based on collision checks. It keeps the
|
| 303 |
+
// simulated load factor lower than some given load factor.
|
| 304 |
+
template<bool External_Load_Access = false, typename Size_Type = size_t>
|
| 305 |
+
class cc_hash_max_collision_check_resize_trigger
|
| 306 |
+
{
|
| 307 |
+
public:
|
| 308 |
+
typedef Size_Type size_type;
|
| 309 |
+
|
| 310 |
+
enum
|
| 311 |
+
{
|
| 312 |
+
external_load_access = External_Load_Access
|
| 313 |
+
};
|
| 314 |
+
|
| 315 |
+
// Default constructor, or constructor taking load, a __load
|
| 316 |
+
// factor which it will attempt to maintain.
|
| 317 |
+
cc_hash_max_collision_check_resize_trigger(float load = 0.5);
|
| 318 |
+
|
| 319 |
+
void
|
| 320 |
+
swap(PB_DS_CLASS_C_DEC& other);
|
| 321 |
+
|
| 322 |
+
// Returns the current load.
|
| 323 |
+
inline float
|
| 324 |
+
get_load() const;
|
| 325 |
+
|
| 326 |
+
// Sets the load; does not resize the container.
|
| 327 |
+
void
|
| 328 |
+
set_load(float load);
|
| 329 |
+
|
| 330 |
+
protected:
|
| 331 |
+
inline void
|
| 332 |
+
notify_insert_search_start();
|
| 333 |
+
|
| 334 |
+
inline void
|
| 335 |
+
notify_insert_search_collision();
|
| 336 |
+
|
| 337 |
+
inline void
|
| 338 |
+
notify_insert_search_end();
|
| 339 |
+
|
| 340 |
+
inline void
|
| 341 |
+
notify_find_search_start();
|
| 342 |
+
|
| 343 |
+
inline void
|
| 344 |
+
notify_find_search_collision();
|
| 345 |
+
|
| 346 |
+
inline void
|
| 347 |
+
notify_find_search_end();
|
| 348 |
+
|
| 349 |
+
inline void
|
| 350 |
+
notify_erase_search_start();
|
| 351 |
+
|
| 352 |
+
inline void
|
| 353 |
+
notify_erase_search_collision();
|
| 354 |
+
|
| 355 |
+
inline void
|
| 356 |
+
notify_erase_search_end();
|
| 357 |
+
|
| 358 |
+
inline void
|
| 359 |
+
notify_inserted(size_type num_entries);
|
| 360 |
+
|
| 361 |
+
inline void
|
| 362 |
+
notify_erased(size_type num_entries);
|
| 363 |
+
|
| 364 |
+
void
|
| 365 |
+
notify_cleared();
|
| 366 |
+
|
| 367 |
+
// Notifies the table was resized as a result of this object's
|
| 368 |
+
// signifying that a resize is needed.
|
| 369 |
+
void
|
| 370 |
+
notify_resized(size_type new_size);
|
| 371 |
+
|
| 372 |
+
void
|
| 373 |
+
notify_externally_resized(size_type new_size);
|
| 374 |
+
|
| 375 |
+
inline bool
|
| 376 |
+
is_resize_needed() const;
|
| 377 |
+
|
| 378 |
+
inline bool
|
| 379 |
+
is_grow_needed(size_type size, size_type num_entries) const;
|
| 380 |
+
|
| 381 |
+
private:
|
| 382 |
+
void
|
| 383 |
+
calc_max_num_coll();
|
| 384 |
+
|
| 385 |
+
inline void
|
| 386 |
+
calc_resize_needed();
|
| 387 |
+
|
| 388 |
+
float m_load;
|
| 389 |
+
size_type m_size;
|
| 390 |
+
size_type m_num_col;
|
| 391 |
+
size_type m_max_col;
|
| 392 |
+
bool m_resize_needed;
|
| 393 |
+
};
|
| 394 |
+
|
| 395 |
+
#include <ext/pb_ds/detail/resize_policy/cc_hash_max_collision_check_resize_trigger_imp.hpp>
|
| 396 |
+
|
| 397 |
+
#undef PB_DS_CLASS_T_DEC
|
| 398 |
+
#undef PB_DS_CLASS_C_DEC
|
| 399 |
+
|
| 400 |
+
#define PB_DS_CLASS_T_DEC template<typename Size_Type>
|
| 401 |
+
#define PB_DS_CLASS_C_DEC hash_exponential_size_policy<Size_Type>
|
| 402 |
+
|
| 403 |
+
// A size policy whose sequence of sizes form an exponential
|
| 404 |
+
// sequence (typically powers of 2.
|
| 405 |
+
template<typename Size_Type = size_t>
|
| 406 |
+
class hash_exponential_size_policy
|
| 407 |
+
{
|
| 408 |
+
public:
|
| 409 |
+
typedef Size_Type size_type;
|
| 410 |
+
|
| 411 |
+
// Default constructor, or onstructor taking a start_size, or
|
| 412 |
+
// constructor taking a start size and grow_factor. The policy
|
| 413 |
+
// will use the sequence of sizes start_size, start_size*
|
| 414 |
+
// grow_factor, start_size* grow_factor^2, ...
|
| 415 |
+
hash_exponential_size_policy(size_type start_size = 8,
|
| 416 |
+
size_type grow_factor = 2);
|
| 417 |
+
|
| 418 |
+
void
|
| 419 |
+
swap(PB_DS_CLASS_C_DEC& other);
|
| 420 |
+
|
| 421 |
+
protected:
|
| 422 |
+
size_type
|
| 423 |
+
get_nearest_larger_size(size_type size) const;
|
| 424 |
+
|
| 425 |
+
size_type
|
| 426 |
+
get_nearest_smaller_size(size_type size) const;
|
| 427 |
+
|
| 428 |
+
private:
|
| 429 |
+
size_type m_start_size;
|
| 430 |
+
size_type m_grow_factor;
|
| 431 |
+
};
|
| 432 |
+
|
| 433 |
+
#include <ext/pb_ds/detail/resize_policy/hash_exponential_size_policy_imp.hpp>
|
| 434 |
+
|
| 435 |
+
#undef PB_DS_CLASS_T_DEC
|
| 436 |
+
#undef PB_DS_CLASS_C_DEC
|
| 437 |
+
|
| 438 |
+
#define PB_DS_CLASS_T_DEC
|
| 439 |
+
#define PB_DS_CLASS_C_DEC hash_prime_size_policy
|
| 440 |
+
|
| 441 |
+
// A size policy whose sequence of sizes form a nearly-exponential
|
| 442 |
+
// sequence of primes.
|
| 443 |
+
class hash_prime_size_policy
|
| 444 |
+
{
|
| 445 |
+
public:
|
| 446 |
+
// Size type.
|
| 447 |
+
typedef size_t size_type;
|
| 448 |
+
|
| 449 |
+
// Default constructor, or onstructor taking a start_size The
|
| 450 |
+
// policy will use the sequence of sizes approximately
|
| 451 |
+
// start_size, start_size* 2, start_size* 2^2, ...
|
| 452 |
+
hash_prime_size_policy(size_type start_size = 8);
|
| 453 |
+
|
| 454 |
+
inline void
|
| 455 |
+
swap(PB_DS_CLASS_C_DEC& other);
|
| 456 |
+
|
| 457 |
+
protected:
|
| 458 |
+
size_type
|
| 459 |
+
get_nearest_larger_size(size_type size) const;
|
| 460 |
+
|
| 461 |
+
size_type
|
| 462 |
+
get_nearest_smaller_size(size_type size) const;
|
| 463 |
+
|
| 464 |
+
private:
|
| 465 |
+
size_type m_start_size;
|
| 466 |
+
};
|
| 467 |
+
|
| 468 |
+
#include <ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp>
|
| 469 |
+
|
| 470 |
+
#undef PB_DS_CLASS_T_DEC
|
| 471 |
+
#undef PB_DS_CLASS_C_DEC
|
| 472 |
+
|
| 473 |
+
#define PB_DS_CLASS_T_DEC template<typename Size_Policy, typename Trigger_Policy, bool External_Size_Access, typename Size_Type>
|
| 474 |
+
|
| 475 |
+
#define PB_DS_CLASS_C_DEC hash_standard_resize_policy<Size_Policy, Trigger_Policy, External_Size_Access, Size_Type>
|
| 476 |
+
|
| 477 |
+
// A resize policy which delegates operations to size and trigger policies.
|
| 478 |
+
template<typename Size_Policy = hash_exponential_size_policy<>,
|
| 479 |
+
typename Trigger_Policy = hash_load_check_resize_trigger<>,
|
| 480 |
+
bool External_Size_Access = false,
|
| 481 |
+
typename Size_Type = size_t>
|
| 482 |
+
class hash_standard_resize_policy
|
| 483 |
+
: public Size_Policy, public Trigger_Policy
|
| 484 |
+
{
|
| 485 |
+
public:
|
| 486 |
+
typedef Size_Type size_type;
|
| 487 |
+
typedef Trigger_Policy trigger_policy;
|
| 488 |
+
typedef Size_Policy size_policy;
|
| 489 |
+
|
| 490 |
+
enum
|
| 491 |
+
{
|
| 492 |
+
external_size_access = External_Size_Access
|
| 493 |
+
};
|
| 494 |
+
|
| 495 |
+
// Default constructor.
|
| 496 |
+
hash_standard_resize_policy();
|
| 497 |
+
|
| 498 |
+
// constructor taking some policies r_size_policy will be copied
|
| 499 |
+
// by the Size_Policy object of this object.
|
| 500 |
+
hash_standard_resize_policy(const Size_Policy& r_size_policy);
|
| 501 |
+
|
| 502 |
+
// constructor taking some policies. r_size_policy will be
|
| 503 |
+
// copied by the Size_Policy object of this
|
| 504 |
+
// object. r_trigger_policy will be copied by the Trigger_Policy
|
| 505 |
+
// object of this object.
|
| 506 |
+
hash_standard_resize_policy(const Size_Policy& r_size_policy,
|
| 507 |
+
const Trigger_Policy& r_trigger_policy);
|
| 508 |
+
|
| 509 |
+
virtual
|
| 510 |
+
~hash_standard_resize_policy();
|
| 511 |
+
|
| 512 |
+
inline void
|
| 513 |
+
swap(PB_DS_CLASS_C_DEC& other);
|
| 514 |
+
|
| 515 |
+
// Access to the Size_Policy object used.
|
| 516 |
+
Size_Policy&
|
| 517 |
+
get_size_policy();
|
| 518 |
+
|
| 519 |
+
// Const access to the Size_Policy object used.
|
| 520 |
+
const Size_Policy&
|
| 521 |
+
get_size_policy() const;
|
| 522 |
+
|
| 523 |
+
// Access to the Trigger_Policy object used.
|
| 524 |
+
Trigger_Policy&
|
| 525 |
+
get_trigger_policy();
|
| 526 |
+
|
| 527 |
+
// Access to the Trigger_Policy object used.
|
| 528 |
+
const Trigger_Policy&
|
| 529 |
+
get_trigger_policy() const;
|
| 530 |
+
|
| 531 |
+
// Returns the actual size of the container.
|
| 532 |
+
inline size_type
|
| 533 |
+
get_actual_size() const;
|
| 534 |
+
|
| 535 |
+
// Resizes the container to suggested_new_size, a suggested size
|
| 536 |
+
// (the actual size will be determined by the Size_Policy
|
| 537 |
+
// object).
|
| 538 |
+
void
|
| 539 |
+
resize(size_type suggested_new_size);
|
| 540 |
+
|
| 541 |
+
protected:
|
| 542 |
+
inline void
|
| 543 |
+
notify_insert_search_start();
|
| 544 |
+
|
| 545 |
+
inline void
|
| 546 |
+
notify_insert_search_collision();
|
| 547 |
+
|
| 548 |
+
inline void
|
| 549 |
+
notify_insert_search_end();
|
| 550 |
+
|
| 551 |
+
inline void
|
| 552 |
+
notify_find_search_start();
|
| 553 |
+
|
| 554 |
+
inline void
|
| 555 |
+
notify_find_search_collision();
|
| 556 |
+
|
| 557 |
+
inline void
|
| 558 |
+
notify_find_search_end();
|
| 559 |
+
|
| 560 |
+
inline void
|
| 561 |
+
notify_erase_search_start();
|
| 562 |
+
|
| 563 |
+
inline void
|
| 564 |
+
notify_erase_search_collision();
|
| 565 |
+
|
| 566 |
+
inline void
|
| 567 |
+
notify_erase_search_end();
|
| 568 |
+
|
| 569 |
+
inline void
|
| 570 |
+
notify_inserted(size_type num_e);
|
| 571 |
+
|
| 572 |
+
inline void
|
| 573 |
+
notify_erased(size_type num_e);
|
| 574 |
+
|
| 575 |
+
void
|
| 576 |
+
notify_cleared();
|
| 577 |
+
|
| 578 |
+
void
|
| 579 |
+
notify_resized(size_type new_size);
|
| 580 |
+
|
| 581 |
+
inline bool
|
| 582 |
+
is_resize_needed() const;
|
| 583 |
+
|
| 584 |
+
// Queries what the new size should be, when the container is
|
| 585 |
+
// resized naturally. The current __size of the container is
|
| 586 |
+
// size, and the number of used entries within the container is
|
| 587 |
+
// num_used_e.
|
| 588 |
+
size_type
|
| 589 |
+
get_new_size(size_type size, size_type num_used_e) const;
|
| 590 |
+
|
| 591 |
+
private:
|
| 592 |
+
// Resizes to new_size.
|
| 593 |
+
virtual void
|
| 594 |
+
do_resize(size_type new_size);
|
| 595 |
+
|
| 596 |
+
typedef Trigger_Policy trigger_policy_base;
|
| 597 |
+
|
| 598 |
+
typedef Size_Policy size_policy_base;
|
| 599 |
+
|
| 600 |
+
size_type m_size;
|
| 601 |
+
};
|
| 602 |
+
|
| 603 |
+
#include <ext/pb_ds/detail/resize_policy/hash_standard_resize_policy_imp.hpp>
|
| 604 |
+
|
| 605 |
+
#undef PB_DS_CLASS_T_DEC
|
| 606 |
+
#undef PB_DS_CLASS_C_DEC
|
| 607 |
+
|
| 608 |
+
} // namespace __gnu_pbds
|
| 609 |
+
|
| 610 |
+
#endif
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/list_update_policy.hpp
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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 2, or (at your option) any later
|
| 9 |
+
// version.
|
| 10 |
+
|
| 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.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License
|
| 17 |
+
// along with this library; see the file COPYING. If not, write to
|
| 18 |
+
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
| 19 |
+
// MA 02111-1307, USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free
|
| 22 |
+
// software library without restriction. Specifically, if other files
|
| 23 |
+
// instantiate templates or use macros or inline functions from this
|
| 24 |
+
// file, or you compile this file and link it with other files to
|
| 25 |
+
// produce an executable, this file does not by itself cause the
|
| 26 |
+
// resulting executable to be covered by the GNU General Public
|
| 27 |
+
// License. This exception does not however invalidate any other
|
| 28 |
+
// reasons why the executable file might be covered by the GNU General
|
| 29 |
+
// Public License.
|
| 30 |
+
|
| 31 |
+
// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
|
| 32 |
+
|
| 33 |
+
// Permission to use, copy, modify, sell, and distribute this software
|
| 34 |
+
// is hereby granted without fee, provided that the above copyright
|
| 35 |
+
// notice appears in all copies, and that both that copyright notice
|
| 36 |
+
// and this permission notice appear in supporting documentation. None
|
| 37 |
+
// of the above authors, nor IBM Haifa Research Laboratories, make any
|
| 38 |
+
// representation about the suitability of this software for any
|
| 39 |
+
// purpose. It is provided "as is" without express or implied
|
| 40 |
+
// warranty.
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* @file list_update_policy.hpp
|
| 44 |
+
* Contains policies for list update containers.
|
| 45 |
+
*/
|
| 46 |
+
|
| 47 |
+
#ifndef PB_DS_LU_POLICY_HPP
|
| 48 |
+
#define PB_DS_LU_POLICY_HPP
|
| 49 |
+
|
| 50 |
+
#include <cstdlib>
|
| 51 |
+
#include <ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp>
|
| 52 |
+
|
| 53 |
+
namespace __gnu_pbds
|
| 54 |
+
{
|
| 55 |
+
// A null type that means that each link in a list-based container
|
| 56 |
+
// does not actually need metadata.
|
| 57 |
+
struct null_lu_metadata
|
| 58 |
+
{ };
|
| 59 |
+
|
| 60 |
+
#define PB_DS_CLASS_T_DEC template<typename Allocator>
|
| 61 |
+
#define PB_DS_CLASS_C_DEC move_to_front_lu_policy<Allocator>
|
| 62 |
+
|
| 63 |
+
// A list-update policy that unconditionally moves elements to the
|
| 64 |
+
// front of the list.
|
| 65 |
+
template<typename Allocator = std::allocator<char> >
|
| 66 |
+
class move_to_front_lu_policy
|
| 67 |
+
{
|
| 68 |
+
public:
|
| 69 |
+
typedef Allocator allocator;
|
| 70 |
+
|
| 71 |
+
// Metadata on which this functor operates.
|
| 72 |
+
typedef null_lu_metadata metadata_type;
|
| 73 |
+
|
| 74 |
+
// Reference to metadata on which this functor operates.
|
| 75 |
+
typedef typename allocator::template rebind<metadata_type>::other metadata_rebind;
|
| 76 |
+
typedef typename metadata_rebind::reference metadata_reference;
|
| 77 |
+
|
| 78 |
+
// Creates a metadata object.
|
| 79 |
+
metadata_type
|
| 80 |
+
operator()() const;
|
| 81 |
+
|
| 82 |
+
// Decides whether a metadata object should be moved to the front
|
| 83 |
+
// of the list.
|
| 84 |
+
inline bool
|
| 85 |
+
operator()(metadata_reference r_metadata) const;
|
| 86 |
+
|
| 87 |
+
private:
|
| 88 |
+
static null_lu_metadata s_metadata;
|
| 89 |
+
};
|
| 90 |
+
|
| 91 |
+
#include <ext/pb_ds/detail/list_update_policy/mtf_lu_policy_imp.hpp>
|
| 92 |
+
|
| 93 |
+
#undef PB_DS_CLASS_T_DEC
|
| 94 |
+
#undef PB_DS_CLASS_C_DEC
|
| 95 |
+
|
| 96 |
+
#define PB_DS_CLASS_T_DEC template<size_t Max_Count, class Allocator>
|
| 97 |
+
#define PB_DS_CLASS_C_DEC counter_lu_policy<Max_Count, Allocator>
|
| 98 |
+
|
| 99 |
+
// A list-update policy that moves elements to the front of the list
|
| 100 |
+
// based on the counter algorithm.
|
| 101 |
+
template<size_t Max_Count = 5, typename Allocator = std::allocator<char> >
|
| 102 |
+
class counter_lu_policy
|
| 103 |
+
: private detail::counter_lu_policy_base<typename Allocator::size_type>
|
| 104 |
+
{
|
| 105 |
+
public:
|
| 106 |
+
typedef Allocator allocator;
|
| 107 |
+
|
| 108 |
+
enum
|
| 109 |
+
{
|
| 110 |
+
max_count = Max_Count
|
| 111 |
+
};
|
| 112 |
+
|
| 113 |
+
typedef typename allocator::size_type size_type;
|
| 114 |
+
|
| 115 |
+
// Metadata on which this functor operates.
|
| 116 |
+
typedef detail::counter_lu_metadata<size_type> metadata_type;
|
| 117 |
+
|
| 118 |
+
// Reference to metadata on which this functor operates.
|
| 119 |
+
typedef typename Allocator::template rebind<metadata_type>::other metadata_rebind;
|
| 120 |
+
typedef typename metadata_rebind::reference metadata_reference;
|
| 121 |
+
|
| 122 |
+
// Creates a metadata object.
|
| 123 |
+
metadata_type
|
| 124 |
+
operator()() const;
|
| 125 |
+
|
| 126 |
+
// Decides whether a metadata object should be moved to the front
|
| 127 |
+
// of the list.
|
| 128 |
+
bool
|
| 129 |
+
operator()(metadata_reference r_metadata) const;
|
| 130 |
+
|
| 131 |
+
private:
|
| 132 |
+
typedef detail::counter_lu_policy_base<typename Allocator::size_type> base_type;
|
| 133 |
+
};
|
| 134 |
+
|
| 135 |
+
#include <ext/pb_ds/detail/list_update_policy/counter_lu_policy_imp.hpp>
|
| 136 |
+
|
| 137 |
+
#undef PB_DS_CLASS_T_DEC
|
| 138 |
+
#undef PB_DS_CLASS_C_DEC
|
| 139 |
+
|
| 140 |
+
} // namespace __gnu_pbds
|
| 141 |
+
|
| 142 |
+
#endif
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/priority_queue.hpp
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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 2, or (at your option) any later
|
| 9 |
+
// version.
|
| 10 |
+
|
| 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.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License
|
| 17 |
+
// along with this library; see the file COPYING. If not, write to
|
| 18 |
+
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
| 19 |
+
// MA 02111-1307, USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free
|
| 22 |
+
// software library without restriction. Specifically, if other files
|
| 23 |
+
// instantiate templates or use macros or inline functions from this
|
| 24 |
+
// file, or you compile this file and link it with other files to
|
| 25 |
+
// produce an executable, this file does not by itself cause the
|
| 26 |
+
// resulting executable to be covered by the GNU General Public
|
| 27 |
+
// License. This exception does not however invalidate any other
|
| 28 |
+
// reasons why the executable file might be covered by the GNU General
|
| 29 |
+
// Public License.
|
| 30 |
+
|
| 31 |
+
// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
|
| 32 |
+
|
| 33 |
+
// Permission to use, copy, modify, sell, and distribute this software
|
| 34 |
+
// is hereby granted without fee, provided that the above copyright
|
| 35 |
+
// notice appears in all copies, and that both that copyright notice
|
| 36 |
+
// and this permission notice appear in supporting documentation. None
|
| 37 |
+
// of the above authors, nor IBM Haifa Research Laboratories, make any
|
| 38 |
+
// representation about the suitability of this software for any
|
| 39 |
+
// purpose. It is provided "as is" without express or implied
|
| 40 |
+
// warranty.
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* @file priority_queue.hpp
|
| 44 |
+
* Contains priority_queues.
|
| 45 |
+
*/
|
| 46 |
+
|
| 47 |
+
#ifndef PB_DS_PRIORITY_QUEUE_HPP
|
| 48 |
+
#define PB_DS_PRIORITY_QUEUE_HPP
|
| 49 |
+
|
| 50 |
+
#include <ext/pb_ds/tag_and_trait.hpp>
|
| 51 |
+
#include <ext/pb_ds/detail/priority_queue_base_dispatch.hpp>
|
| 52 |
+
#include <ext/pb_ds/detail/standard_policies.hpp>
|
| 53 |
+
|
| 54 |
+
namespace __gnu_pbds
|
| 55 |
+
{
|
| 56 |
+
// A priority queue.
|
| 57 |
+
template<typename Value_Type,
|
| 58 |
+
typename Cmp_Fn = std::less<Value_Type>,
|
| 59 |
+
typename Tag = pairing_heap_tag,
|
| 60 |
+
typename Allocator = std::allocator<char> >
|
| 61 |
+
class priority_queue
|
| 62 |
+
: public detail::priority_queue_base_dispatch<Value_Type,Cmp_Fn,Tag,Allocator>::type
|
| 63 |
+
{
|
| 64 |
+
private:
|
| 65 |
+
typedef typename detail::priority_queue_base_dispatch<Value_Type,Cmp_Fn,Tag,Allocator>::type base_type;
|
| 66 |
+
|
| 67 |
+
public:
|
| 68 |
+
typedef Value_Type value_type;
|
| 69 |
+
typedef Cmp_Fn cmp_fn;
|
| 70 |
+
typedef Tag container_category;
|
| 71 |
+
typedef Allocator allocator;
|
| 72 |
+
typedef typename allocator::size_type size_type;
|
| 73 |
+
typedef typename allocator::difference_type difference_type;
|
| 74 |
+
|
| 75 |
+
typedef typename allocator::template rebind<value_type>::other value_rebind;
|
| 76 |
+
typedef typename value_rebind::reference reference;
|
| 77 |
+
typedef typename value_rebind::const_reference const_reference;
|
| 78 |
+
typedef typename value_rebind::pointer pointer;
|
| 79 |
+
typedef typename value_rebind::const_pointer const_pointer;
|
| 80 |
+
|
| 81 |
+
typedef typename base_type::const_point_iterator const_point_iterator;
|
| 82 |
+
typedef typename base_type::point_iterator point_iterator;
|
| 83 |
+
typedef typename base_type::const_iterator const_iterator;
|
| 84 |
+
typedef typename base_type::iterator iterator;
|
| 85 |
+
|
| 86 |
+
priority_queue() { }
|
| 87 |
+
|
| 88 |
+
// Constructor taking some policy objects. r_cmp_fn will be copied
|
| 89 |
+
// by the Cmp_Fn object of the container object.
|
| 90 |
+
priority_queue(const cmp_fn& r_cmp_fn) : base_type(r_cmp_fn) { }
|
| 91 |
+
|
| 92 |
+
// Constructor taking __iterators to a range of value_types. The
|
| 93 |
+
// value_types between first_it and last_it will be inserted into
|
| 94 |
+
// the container object.
|
| 95 |
+
template<typename It>
|
| 96 |
+
priority_queue(It first_it, It last_it)
|
| 97 |
+
{ base_type::copy_from_range(first_it, last_it); }
|
| 98 |
+
|
| 99 |
+
// Constructor taking __iterators to a range of value_types and
|
| 100 |
+
// some policy objects The value_types between first_it and
|
| 101 |
+
// last_it will be inserted into the container object. r_cmp_fn
|
| 102 |
+
// will be copied by the cmp_fn object of the container object.
|
| 103 |
+
template<typename It>
|
| 104 |
+
priority_queue(It first_it, It last_it, const cmp_fn& r_cmp_fn)
|
| 105 |
+
: base_type(r_cmp_fn)
|
| 106 |
+
{ base_type::copy_from_range(first_it, last_it); }
|
| 107 |
+
|
| 108 |
+
priority_queue(const priority_queue& other)
|
| 109 |
+
: base_type((const base_type& )other) { }
|
| 110 |
+
|
| 111 |
+
virtual
|
| 112 |
+
~priority_queue() { }
|
| 113 |
+
|
| 114 |
+
priority_queue&
|
| 115 |
+
operator=(const priority_queue& other)
|
| 116 |
+
{
|
| 117 |
+
if (this !=& other)
|
| 118 |
+
{
|
| 119 |
+
priority_queue tmp(other);
|
| 120 |
+
swap(tmp);
|
| 121 |
+
}
|
| 122 |
+
return *this;
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
void
|
| 126 |
+
swap(priority_queue& other)
|
| 127 |
+
{ base_type::swap(other); }
|
| 128 |
+
};
|
| 129 |
+
} // namespace __gnu_pbds
|
| 130 |
+
|
| 131 |
+
#endif
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/tag_and_trait.hpp
ADDED
|
@@ -0,0 +1,361 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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 2, or (at your option) any later
|
| 9 |
+
// version.
|
| 10 |
+
|
| 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.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License
|
| 17 |
+
// along with this library; see the file COPYING. If not, write to
|
| 18 |
+
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
| 19 |
+
// MA 02111-1307, USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free
|
| 22 |
+
// software library without restriction. Specifically, if other files
|
| 23 |
+
// instantiate templates or use macros or inline functions from this
|
| 24 |
+
// file, or you compile this file and link it with other files to
|
| 25 |
+
// produce an executable, this file does not by itself cause the
|
| 26 |
+
// resulting executable to be covered by the GNU General Public
|
| 27 |
+
// License. This exception does not however invalidate any other
|
| 28 |
+
// reasons why the executable file might be covered by the GNU General
|
| 29 |
+
// Public License.
|
| 30 |
+
|
| 31 |
+
// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
|
| 32 |
+
|
| 33 |
+
// Permission to use, copy, modify, sell, and distribute this software
|
| 34 |
+
// is hereby granted without fee, provided that the above copyright
|
| 35 |
+
// notice appears in all copies, and that both that copyright notice
|
| 36 |
+
// and this permission notice appear in supporting documentation. None
|
| 37 |
+
// of the above authors, nor IBM Haifa Research Laboratories, make any
|
| 38 |
+
// representation about the suitability of this software for any
|
| 39 |
+
// purpose. It is provided "as is" without express or implied
|
| 40 |
+
// warranty.
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* @file tag_and_trait.hpp
|
| 44 |
+
* Contains tags and traits, e.g., ones describing underlying
|
| 45 |
+
* data structures.
|
| 46 |
+
*/
|
| 47 |
+
|
| 48 |
+
#ifndef PB_DS_TAG_AND_TRAIT_HPP
|
| 49 |
+
#define PB_DS_TAG_AND_TRAIT_HPP
|
| 50 |
+
|
| 51 |
+
#include <ext/pb_ds/detail/type_utils.hpp>
|
| 52 |
+
|
| 53 |
+
/**
|
| 54 |
+
* @namespace __gnu_pbds
|
| 55 |
+
* @brief GNU extensions for policy-based data structures for public use.
|
| 56 |
+
*/
|
| 57 |
+
namespace __gnu_pbds
|
| 58 |
+
{
|
| 59 |
+
// A trivial iterator tag. Signifies that the iterators has none of
|
| 60 |
+
// the STL's movement abilities.
|
| 61 |
+
struct trivial_iterator_tag
|
| 62 |
+
{ };
|
| 63 |
+
|
| 64 |
+
// Prohibit moving trivial iterators.
|
| 65 |
+
typedef void trivial_iterator_difference_type;
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
// Signifies a basic invalidation guarantee that any iterator,
|
| 69 |
+
// pointer, or reference to a container object's mapped value type
|
| 70 |
+
// is valid as long as the container is not modified.
|
| 71 |
+
struct basic_invalidation_guarantee
|
| 72 |
+
{ };
|
| 73 |
+
|
| 74 |
+
// Signifies an invalidation guarantee that includes all those of
|
| 75 |
+
// its base, and additionally, that any point-type iterator,
|
| 76 |
+
// pointer, or reference to a container object's mapped value type
|
| 77 |
+
// is valid as long as its corresponding entry has not be erased,
|
| 78 |
+
// regardless of modifications to the container object.
|
| 79 |
+
struct point_invalidation_guarantee : public basic_invalidation_guarantee
|
| 80 |
+
{ };
|
| 81 |
+
|
| 82 |
+
// Signifies an invalidation guarantee that includes all those of
|
| 83 |
+
// its base, and additionally, that any range-type iterator
|
| 84 |
+
// (including the returns of begin() and end()) is in the correct
|
| 85 |
+
// relative positions to other range-type iterators as long as its
|
| 86 |
+
// corresponding entry has not be erased, regardless of
|
| 87 |
+
// modifications to the container object.
|
| 88 |
+
struct range_invalidation_guarantee : public point_invalidation_guarantee
|
| 89 |
+
{ };
|
| 90 |
+
|
| 91 |
+
|
| 92 |
+
// A mapped-policy indicating that an associative container is a set.
|
| 93 |
+
// XXX should this be a trait of the form is_set<T> ??
|
| 94 |
+
struct null_mapped_type { };
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
// Base data structure tag.
|
| 98 |
+
struct container_tag
|
| 99 |
+
{ };
|
| 100 |
+
|
| 101 |
+
// Basic associative-container.
|
| 102 |
+
struct associative_container_tag : public container_tag { };
|
| 103 |
+
|
| 104 |
+
// Basic hash.
|
| 105 |
+
struct basic_hash_tag : public associative_container_tag { };
|
| 106 |
+
|
| 107 |
+
// Collision-chaining hash.
|
| 108 |
+
struct cc_hash_tag : public basic_hash_tag { };
|
| 109 |
+
|
| 110 |
+
// General-probing hash.
|
| 111 |
+
struct gp_hash_tag : public basic_hash_tag { };
|
| 112 |
+
|
| 113 |
+
// Basic tree.
|
| 114 |
+
struct basic_tree_tag : public associative_container_tag { };
|
| 115 |
+
|
| 116 |
+
// tree.
|
| 117 |
+
struct tree_tag : public basic_tree_tag { };
|
| 118 |
+
|
| 119 |
+
// Red-black tree.
|
| 120 |
+
struct rb_tree_tag : public tree_tag { };
|
| 121 |
+
|
| 122 |
+
// Splay tree.
|
| 123 |
+
struct splay_tree_tag : public tree_tag { };
|
| 124 |
+
|
| 125 |
+
// Ordered-vector tree.
|
| 126 |
+
struct ov_tree_tag : public tree_tag { };
|
| 127 |
+
|
| 128 |
+
// trie.
|
| 129 |
+
struct trie_tag : public basic_tree_tag { };
|
| 130 |
+
|
| 131 |
+
// PATRICIA trie.
|
| 132 |
+
struct pat_trie_tag : public trie_tag { };
|
| 133 |
+
|
| 134 |
+
// List-update.
|
| 135 |
+
struct list_update_tag : public associative_container_tag { };
|
| 136 |
+
|
| 137 |
+
// Basic priority-queue.
|
| 138 |
+
struct priority_queue_tag : public container_tag { };
|
| 139 |
+
|
| 140 |
+
// Pairing-heap.
|
| 141 |
+
struct pairing_heap_tag : public priority_queue_tag { };
|
| 142 |
+
|
| 143 |
+
// Binomial-heap.
|
| 144 |
+
struct binomial_heap_tag : public priority_queue_tag { };
|
| 145 |
+
|
| 146 |
+
// Redundant-counter binomial-heap.
|
| 147 |
+
struct rc_binomial_heap_tag : public priority_queue_tag { };
|
| 148 |
+
|
| 149 |
+
// Binary-heap (array-based).
|
| 150 |
+
struct binary_heap_tag : public priority_queue_tag { };
|
| 151 |
+
|
| 152 |
+
// Thin heap.
|
| 153 |
+
struct thin_heap_tag : public priority_queue_tag { };
|
| 154 |
+
|
| 155 |
+
|
| 156 |
+
template<typename Tag>
|
| 157 |
+
struct container_traits_base;
|
| 158 |
+
|
| 159 |
+
template<>
|
| 160 |
+
struct container_traits_base<cc_hash_tag>
|
| 161 |
+
{
|
| 162 |
+
typedef cc_hash_tag container_category;
|
| 163 |
+
typedef point_invalidation_guarantee invalidation_guarantee;
|
| 164 |
+
|
| 165 |
+
enum
|
| 166 |
+
{
|
| 167 |
+
order_preserving = false,
|
| 168 |
+
erase_can_throw = false,
|
| 169 |
+
split_join_can_throw = false,
|
| 170 |
+
reverse_iteration = false
|
| 171 |
+
};
|
| 172 |
+
};
|
| 173 |
+
|
| 174 |
+
template<>
|
| 175 |
+
struct container_traits_base<gp_hash_tag>
|
| 176 |
+
{
|
| 177 |
+
typedef gp_hash_tag container_category;
|
| 178 |
+
typedef basic_invalidation_guarantee invalidation_guarantee;
|
| 179 |
+
|
| 180 |
+
enum
|
| 181 |
+
{
|
| 182 |
+
order_preserving = false,
|
| 183 |
+
erase_can_throw = false,
|
| 184 |
+
split_join_can_throw = false,
|
| 185 |
+
reverse_iteration = false
|
| 186 |
+
};
|
| 187 |
+
};
|
| 188 |
+
|
| 189 |
+
template<>
|
| 190 |
+
struct container_traits_base<rb_tree_tag>
|
| 191 |
+
{
|
| 192 |
+
typedef rb_tree_tag container_category;
|
| 193 |
+
typedef range_invalidation_guarantee invalidation_guarantee;
|
| 194 |
+
|
| 195 |
+
enum
|
| 196 |
+
{
|
| 197 |
+
order_preserving = true,
|
| 198 |
+
erase_can_throw = false,
|
| 199 |
+
split_join_can_throw = false,
|
| 200 |
+
reverse_iteration = true
|
| 201 |
+
};
|
| 202 |
+
};
|
| 203 |
+
|
| 204 |
+
template<>
|
| 205 |
+
struct container_traits_base<splay_tree_tag>
|
| 206 |
+
{
|
| 207 |
+
typedef splay_tree_tag container_category;
|
| 208 |
+
typedef range_invalidation_guarantee invalidation_guarantee;
|
| 209 |
+
|
| 210 |
+
enum
|
| 211 |
+
{
|
| 212 |
+
order_preserving = true,
|
| 213 |
+
erase_can_throw = false,
|
| 214 |
+
split_join_can_throw = false,
|
| 215 |
+
reverse_iteration = true
|
| 216 |
+
};
|
| 217 |
+
};
|
| 218 |
+
|
| 219 |
+
template<>
|
| 220 |
+
struct container_traits_base<ov_tree_tag>
|
| 221 |
+
{
|
| 222 |
+
typedef ov_tree_tag container_category;
|
| 223 |
+
typedef basic_invalidation_guarantee invalidation_guarantee;
|
| 224 |
+
|
| 225 |
+
enum
|
| 226 |
+
{
|
| 227 |
+
order_preserving = true,
|
| 228 |
+
erase_can_throw = true,
|
| 229 |
+
split_join_can_throw = true,
|
| 230 |
+
reverse_iteration = false
|
| 231 |
+
};
|
| 232 |
+
};
|
| 233 |
+
|
| 234 |
+
template<>
|
| 235 |
+
struct container_traits_base<pat_trie_tag>
|
| 236 |
+
{
|
| 237 |
+
typedef pat_trie_tag container_category;
|
| 238 |
+
typedef range_invalidation_guarantee invalidation_guarantee;
|
| 239 |
+
|
| 240 |
+
enum
|
| 241 |
+
{
|
| 242 |
+
order_preserving = true,
|
| 243 |
+
erase_can_throw = false,
|
| 244 |
+
split_join_can_throw = true,
|
| 245 |
+
reverse_iteration = true
|
| 246 |
+
};
|
| 247 |
+
};
|
| 248 |
+
|
| 249 |
+
template<>
|
| 250 |
+
struct container_traits_base<list_update_tag>
|
| 251 |
+
{
|
| 252 |
+
typedef list_update_tag container_category;
|
| 253 |
+
typedef point_invalidation_guarantee invalidation_guarantee;
|
| 254 |
+
|
| 255 |
+
enum
|
| 256 |
+
{
|
| 257 |
+
order_preserving = false,
|
| 258 |
+
erase_can_throw = false,
|
| 259 |
+
split_join_can_throw = false,
|
| 260 |
+
reverse_iteration = false
|
| 261 |
+
};
|
| 262 |
+
};
|
| 263 |
+
|
| 264 |
+
|
| 265 |
+
template<>
|
| 266 |
+
struct container_traits_base<pairing_heap_tag>
|
| 267 |
+
{
|
| 268 |
+
typedef pairing_heap_tag container_category;
|
| 269 |
+
typedef point_invalidation_guarantee invalidation_guarantee;
|
| 270 |
+
|
| 271 |
+
enum
|
| 272 |
+
{
|
| 273 |
+
order_preserving = false,
|
| 274 |
+
erase_can_throw = false,
|
| 275 |
+
split_join_can_throw = false,
|
| 276 |
+
reverse_iteration = false
|
| 277 |
+
};
|
| 278 |
+
};
|
| 279 |
+
|
| 280 |
+
template<>
|
| 281 |
+
struct container_traits_base<thin_heap_tag>
|
| 282 |
+
{
|
| 283 |
+
typedef thin_heap_tag container_category;
|
| 284 |
+
typedef point_invalidation_guarantee invalidation_guarantee;
|
| 285 |
+
|
| 286 |
+
enum
|
| 287 |
+
{
|
| 288 |
+
order_preserving = false,
|
| 289 |
+
erase_can_throw = false,
|
| 290 |
+
split_join_can_throw = false,
|
| 291 |
+
reverse_iteration = false
|
| 292 |
+
};
|
| 293 |
+
};
|
| 294 |
+
|
| 295 |
+
template<>
|
| 296 |
+
struct container_traits_base<binomial_heap_tag>
|
| 297 |
+
{
|
| 298 |
+
typedef binomial_heap_tag container_category;
|
| 299 |
+
typedef point_invalidation_guarantee invalidation_guarantee;
|
| 300 |
+
|
| 301 |
+
enum
|
| 302 |
+
{
|
| 303 |
+
order_preserving = false,
|
| 304 |
+
erase_can_throw = false,
|
| 305 |
+
split_join_can_throw = false,
|
| 306 |
+
reverse_iteration = false
|
| 307 |
+
};
|
| 308 |
+
};
|
| 309 |
+
|
| 310 |
+
template<>
|
| 311 |
+
struct container_traits_base<rc_binomial_heap_tag>
|
| 312 |
+
{
|
| 313 |
+
typedef rc_binomial_heap_tag container_category;
|
| 314 |
+
typedef point_invalidation_guarantee invalidation_guarantee;
|
| 315 |
+
|
| 316 |
+
enum
|
| 317 |
+
{
|
| 318 |
+
order_preserving = false,
|
| 319 |
+
erase_can_throw = false,
|
| 320 |
+
split_join_can_throw = false,
|
| 321 |
+
reverse_iteration = false
|
| 322 |
+
};
|
| 323 |
+
};
|
| 324 |
+
|
| 325 |
+
template<>
|
| 326 |
+
struct container_traits_base<binary_heap_tag>
|
| 327 |
+
{
|
| 328 |
+
typedef binary_heap_tag container_category;
|
| 329 |
+
typedef basic_invalidation_guarantee invalidation_guarantee;
|
| 330 |
+
|
| 331 |
+
enum
|
| 332 |
+
{
|
| 333 |
+
order_preserving = false,
|
| 334 |
+
erase_can_throw = false,
|
| 335 |
+
split_join_can_throw = true,
|
| 336 |
+
reverse_iteration = false
|
| 337 |
+
};
|
| 338 |
+
};
|
| 339 |
+
|
| 340 |
+
|
| 341 |
+
// See Matt Austern for the name, S. Meyers MEFC++ #2, others.
|
| 342 |
+
template<typename Cntnr>
|
| 343 |
+
struct container_traits
|
| 344 |
+
: public container_traits_base<typename Cntnr::container_category>
|
| 345 |
+
{
|
| 346 |
+
typedef Cntnr container_type;
|
| 347 |
+
typedef typename Cntnr::container_category container_category;
|
| 348 |
+
typedef container_traits_base<container_category> base_type;
|
| 349 |
+
typedef typename base_type::invalidation_guarantee invalidation_guarantee;
|
| 350 |
+
|
| 351 |
+
enum
|
| 352 |
+
{
|
| 353 |
+
order_preserving = base_type::order_preserving,
|
| 354 |
+
erase_can_throw = base_type::erase_can_throw,
|
| 355 |
+
split_join_can_throw = base_type::split_join_can_throw,
|
| 356 |
+
reverse_iteration = base_type::reverse_iteration
|
| 357 |
+
};
|
| 358 |
+
};
|
| 359 |
+
} // namespace __gnu_pbds
|
| 360 |
+
|
| 361 |
+
#endif
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/tree_policy.hpp
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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foundation, Inc.
|
| 4 |
+
//
|
| 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 2, or (at your option) any later
|
| 9 |
+
// version.
|
| 10 |
+
|
| 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.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License
|
| 17 |
+
// along with this library; see the file COPYING. If not, write to
|
| 18 |
+
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
| 19 |
+
// MA 02111-1307, USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free
|
| 22 |
+
// software library without restriction. Specifically, if other files
|
| 23 |
+
// instantiate templates or use macros or inline functions from this
|
| 24 |
+
// file, or you compile this file and link it with other files to
|
| 25 |
+
// produce an executable, this file does not by itself cause the
|
| 26 |
+
// resulting executable to be covered by the GNU General Public
|
| 27 |
+
// License. This exception does not however invalidate any other
|
| 28 |
+
// reasons why the executable file might be covered by the GNU General
|
| 29 |
+
// Public License.
|
| 30 |
+
|
| 31 |
+
// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
|
| 32 |
+
|
| 33 |
+
// Permission to use, copy, modify, sell, and distribute this software
|
| 34 |
+
// is hereby granted without fee, provided that the above copyright
|
| 35 |
+
// notice appears in all copies, and that both that copyright notice
|
| 36 |
+
// and this permission notice appear in supporting documentation. None
|
| 37 |
+
// of the above authors, nor IBM Haifa Research Laboratories, make any
|
| 38 |
+
// representation about the suitability of this software for any
|
| 39 |
+
// purpose. It is provided "as is" without express or implied
|
| 40 |
+
// warranty.
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* @file tree_policy.hpp
|
| 44 |
+
* Contains tree-related policies.
|
| 45 |
+
*/
|
| 46 |
+
|
| 47 |
+
#ifndef PB_DS_TREE_POLICY_HPP
|
| 48 |
+
#define PB_DS_TREE_POLICY_HPP
|
| 49 |
+
|
| 50 |
+
#include <iterator>
|
| 51 |
+
#include <ext/pb_ds/detail/type_utils.hpp>
|
| 52 |
+
#include <ext/pb_ds/detail/basic_tree_policy/basic_tree_policy_base.hpp>
|
| 53 |
+
|
| 54 |
+
namespace __gnu_pbds
|
| 55 |
+
{
|
| 56 |
+
// A null node updator, indicating that no node updates are required.
|
| 57 |
+
template<typename Const_Node_Iterator,
|
| 58 |
+
typename Node_Iterator,
|
| 59 |
+
typename Cmp_Fn,
|
| 60 |
+
typename Allocator>
|
| 61 |
+
struct null_tree_node_update
|
| 62 |
+
{ };
|
| 63 |
+
|
| 64 |
+
#define PB_DS_CLASS_T_DEC \
|
| 65 |
+
template<typename Const_Node_Iterator, class Node_Iterator, class Cmp_Fn, class Allocator>
|
| 66 |
+
|
| 67 |
+
#define PB_DS_CLASS_C_DEC \
|
| 68 |
+
tree_order_statistics_node_update<Const_Node_Iterator, Node_Iterator, Cmp_Fn, Allocator>
|
| 69 |
+
|
| 70 |
+
#define PB_DS_BASE_C_DEC \
|
| 71 |
+
detail::basic_tree_policy_base<Const_Node_Iterator, Node_Iterator, Allocator>
|
| 72 |
+
|
| 73 |
+
// Functor updating ranks of entrees.
|
| 74 |
+
template<typename Const_Node_Iterator, typename Node_Iterator,
|
| 75 |
+
typename Cmp_Fn, typename Allocator>
|
| 76 |
+
class tree_order_statistics_node_update : private PB_DS_BASE_C_DEC
|
| 77 |
+
{
|
| 78 |
+
private:
|
| 79 |
+
typedef PB_DS_BASE_C_DEC base_type;
|
| 80 |
+
|
| 81 |
+
public:
|
| 82 |
+
typedef Cmp_Fn cmp_fn;
|
| 83 |
+
typedef Allocator allocator;
|
| 84 |
+
typedef typename allocator::size_type size_type;
|
| 85 |
+
typedef typename base_type::key_type key_type;
|
| 86 |
+
typedef typename base_type::const_key_reference const_key_reference;
|
| 87 |
+
|
| 88 |
+
typedef size_type metadata_type;
|
| 89 |
+
typedef Const_Node_Iterator const_node_iterator;
|
| 90 |
+
typedef Node_Iterator node_iterator;
|
| 91 |
+
typedef typename const_node_iterator::value_type const_iterator;
|
| 92 |
+
typedef typename node_iterator::value_type iterator;
|
| 93 |
+
|
| 94 |
+
// Finds an entry by __order. Returns a const_iterator to the
|
| 95 |
+
// entry with the __order order, or a const_iterator to the
|
| 96 |
+
// container object's end if order is at least the size of the
|
| 97 |
+
// container object.
|
| 98 |
+
inline const_iterator
|
| 99 |
+
find_by_order(size_type order) const;
|
| 100 |
+
|
| 101 |
+
// Finds an entry by __order. Returns an iterator to the entry
|
| 102 |
+
// with the __order order, or an iterator to the container
|
| 103 |
+
// object's end if order is at least the size of the container
|
| 104 |
+
// object.
|
| 105 |
+
inline iterator
|
| 106 |
+
find_by_order(size_type order);
|
| 107 |
+
|
| 108 |
+
// Returns the order of a key within a sequence. For exapmle, if
|
| 109 |
+
// r_key is the smallest key, this method will return 0; if r_key
|
| 110 |
+
// is a key between the smallest and next key, this method will
|
| 111 |
+
// return 1; if r_key is a key larger than the largest key, this
|
| 112 |
+
// method will return the size of r_c.
|
| 113 |
+
inline size_type
|
| 114 |
+
order_of_key(const_key_reference r_key) const;
|
| 115 |
+
|
| 116 |
+
private:
|
| 117 |
+
// Const reference to the container's value-type.
|
| 118 |
+
typedef typename base_type::const_reference const_reference;
|
| 119 |
+
|
| 120 |
+
// Const pointer to the container's value-type.
|
| 121 |
+
typedef typename base_type::const_pointer const_pointer;
|
| 122 |
+
|
| 123 |
+
typedef typename allocator::template rebind<metadata_type>::other metadata_rebind;
|
| 124 |
+
// Const metadata reference.
|
| 125 |
+
typedef typename metadata_rebind::const_reference const_metadata_reference;
|
| 126 |
+
|
| 127 |
+
// Metadata reference.
|
| 128 |
+
typedef typename metadata_rebind::reference metadata_reference;
|
| 129 |
+
|
| 130 |
+
// Returns the const_node_iterator associated with the tree's root node.
|
| 131 |
+
virtual const_node_iterator
|
| 132 |
+
node_begin() const = 0;
|
| 133 |
+
|
| 134 |
+
// Returns the node_iterator associated with the tree's root node.
|
| 135 |
+
virtual node_iterator
|
| 136 |
+
node_begin() = 0;
|
| 137 |
+
|
| 138 |
+
// Returns the const_node_iterator associated with a just-after leaf node.
|
| 139 |
+
virtual const_node_iterator
|
| 140 |
+
node_end() const = 0;
|
| 141 |
+
|
| 142 |
+
// Returns the node_iterator associated with a just-after leaf node.
|
| 143 |
+
virtual node_iterator
|
| 144 |
+
node_end() = 0;
|
| 145 |
+
|
| 146 |
+
// Access to the cmp_fn object.
|
| 147 |
+
virtual cmp_fn&
|
| 148 |
+
get_cmp_fn() = 0;
|
| 149 |
+
|
| 150 |
+
protected:
|
| 151 |
+
// Updates the rank of a node through a node_iterator node_it;
|
| 152 |
+
// end_nd_it is the end node iterator.
|
| 153 |
+
inline void
|
| 154 |
+
operator()(node_iterator node_it, const_node_iterator end_nd_it) const;
|
| 155 |
+
|
| 156 |
+
virtual
|
| 157 |
+
~tree_order_statistics_node_update();
|
| 158 |
+
};
|
| 159 |
+
|
| 160 |
+
#include <ext/pb_ds/detail/tree_policy/order_statistics_imp.hpp>
|
| 161 |
+
|
| 162 |
+
#undef PB_DS_CLASS_T_DEC
|
| 163 |
+
#undef PB_DS_CLASS_C_DEC
|
| 164 |
+
#undef PB_DS_BASE_C_DEC
|
| 165 |
+
|
| 166 |
+
} // namespace __gnu_pbds
|
| 167 |
+
|
| 168 |
+
#endif
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/ext/pb_ds/trie_policy.hpp
ADDED
|
@@ -0,0 +1,361 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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2 |
+
|
| 3 |
+
// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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 2, or (at your option) any later
|
| 9 |
+
// version.
|
| 10 |
+
|
| 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.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License
|
| 17 |
+
// along with this library; see the file COPYING. If not, write to
|
| 18 |
+
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
| 19 |
+
// MA 02111-1307, USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free
|
| 22 |
+
// software library without restriction. Specifically, if other files
|
| 23 |
+
// instantiate templates or use macros or inline functions from this
|
| 24 |
+
// file, or you compile this file and link it with other files to
|
| 25 |
+
// produce an executable, this file does not by itself cause the
|
| 26 |
+
// resulting executable to be covered by the GNU General Public
|
| 27 |
+
// License. This exception does not however invalidate any other
|
| 28 |
+
// reasons why the executable file might be covered by the GNU General
|
| 29 |
+
// Public License.
|
| 30 |
+
|
| 31 |
+
// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
|
| 32 |
+
|
| 33 |
+
// Permission to use, copy, modify, sell, and distribute this software
|
| 34 |
+
// is hereby granted without fee, provided that the above copyright
|
| 35 |
+
// notice appears in all copies, and that both that copyright notice
|
| 36 |
+
// and this permission notice appear in supporting documentation. None
|
| 37 |
+
// of the above authors, nor IBM Haifa Research Laboratories, make any
|
| 38 |
+
// representation about the suitability of this software for any
|
| 39 |
+
// purpose. It is provided "as is" without express or implied
|
| 40 |
+
// warranty.
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* @file trie_policy.hpp
|
| 44 |
+
* Contains trie-related policies.
|
| 45 |
+
*/
|
| 46 |
+
|
| 47 |
+
#ifndef PB_DS_TRIE_POLICY_HPP
|
| 48 |
+
#define PB_DS_TRIE_POLICY_HPP
|
| 49 |
+
|
| 50 |
+
#include <string>
|
| 51 |
+
#include <ext/pb_ds/detail/type_utils.hpp>
|
| 52 |
+
#include <ext/pb_ds/detail/trie_policy/trie_policy_base.hpp>
|
| 53 |
+
|
| 54 |
+
namespace __gnu_pbds
|
| 55 |
+
{
|
| 56 |
+
// A null node updator, indicating that no node updates are required.
|
| 57 |
+
template<typename Const_Node_Iterator,
|
| 58 |
+
typename Node_Iterator,
|
| 59 |
+
typename E_Access_Traits,
|
| 60 |
+
typename Allocator>
|
| 61 |
+
struct null_trie_node_update
|
| 62 |
+
{ };
|
| 63 |
+
|
| 64 |
+
#define PB_DS_CLASS_T_DEC \
|
| 65 |
+
template<typename String, typename String::value_type Min_E_Val, typename String::value_type Max_E_Val, bool Reverse, typename Allocator>
|
| 66 |
+
|
| 67 |
+
#define PB_DS_CLASS_C_DEC \
|
| 68 |
+
string_trie_e_access_traits<String, Min_E_Val,Max_E_Val,Reverse,Allocator>
|
| 69 |
+
|
| 70 |
+
// Element access traits for string types.
|
| 71 |
+
template<typename String = std::string,
|
| 72 |
+
typename String::value_type Min_E_Val = detail::__numeric_traits<typename String::value_type>::__min,
|
| 73 |
+
typename String::value_type Max_E_Val = detail::__numeric_traits<typename String::value_type>::__max,
|
| 74 |
+
bool Reverse = false,
|
| 75 |
+
typename Allocator = std::allocator<char> >
|
| 76 |
+
struct string_trie_e_access_traits
|
| 77 |
+
{
|
| 78 |
+
public:
|
| 79 |
+
typedef typename Allocator::size_type size_type;
|
| 80 |
+
typedef String key_type;
|
| 81 |
+
typedef typename Allocator::template rebind<key_type>::other key_rebind;
|
| 82 |
+
typedef typename key_rebind::const_reference const_key_reference;
|
| 83 |
+
|
| 84 |
+
enum
|
| 85 |
+
{
|
| 86 |
+
reverse = Reverse
|
| 87 |
+
};
|
| 88 |
+
|
| 89 |
+
// Element const iterator type.
|
| 90 |
+
typedef typename detail::__conditional_type<Reverse, typename String::const_reverse_iterator, typename String::const_iterator>::__type const_iterator;
|
| 91 |
+
|
| 92 |
+
// Element type.
|
| 93 |
+
typedef typename std::iterator_traits<const_iterator>::value_type e_type;
|
| 94 |
+
|
| 95 |
+
enum
|
| 96 |
+
{
|
| 97 |
+
min_e_val = Min_E_Val,
|
| 98 |
+
max_e_val = Max_E_Val,
|
| 99 |
+
max_size = max_e_val - min_e_val + 1
|
| 100 |
+
};
|
| 101 |
+
PB_DS_STATIC_ASSERT(min_max_size, max_size >= 2);
|
| 102 |
+
|
| 103 |
+
// Returns a const_iterator to the first element of
|
| 104 |
+
// const_key_reference agumnet.
|
| 105 |
+
inline static const_iterator
|
| 106 |
+
begin(const_key_reference);
|
| 107 |
+
|
| 108 |
+
// Returns a const_iterator to the after-last element of
|
| 109 |
+
// const_key_reference argument.
|
| 110 |
+
inline static const_iterator
|
| 111 |
+
end(const_key_reference);
|
| 112 |
+
|
| 113 |
+
// Maps an element to a position.
|
| 114 |
+
inline static size_type
|
| 115 |
+
e_pos(e_type e);
|
| 116 |
+
|
| 117 |
+
private:
|
| 118 |
+
|
| 119 |
+
inline static const_iterator
|
| 120 |
+
begin_imp(const_key_reference, detail::false_type);
|
| 121 |
+
|
| 122 |
+
inline static const_iterator
|
| 123 |
+
begin_imp(const_key_reference, detail::true_type);
|
| 124 |
+
|
| 125 |
+
inline static const_iterator
|
| 126 |
+
end_imp(const_key_reference, detail::false_type);
|
| 127 |
+
|
| 128 |
+
inline static const_iterator
|
| 129 |
+
end_imp(const_key_reference, detail::true_type);
|
| 130 |
+
|
| 131 |
+
static detail::integral_constant<int, Reverse> s_rev_ind;
|
| 132 |
+
};
|
| 133 |
+
|
| 134 |
+
#include <ext/pb_ds/detail/trie_policy/string_trie_e_access_traits_imp.hpp>
|
| 135 |
+
|
| 136 |
+
#undef PB_DS_CLASS_T_DEC
|
| 137 |
+
#undef PB_DS_CLASS_C_DEC
|
| 138 |
+
|
| 139 |
+
#define PB_DS_CLASS_T_DEC \
|
| 140 |
+
template<typename Const_Node_Iterator,typename Node_Iterator,class E_Access_Traits, typename Allocator>
|
| 141 |
+
|
| 142 |
+
#define PB_DS_CLASS_C_DEC \
|
| 143 |
+
trie_prefix_search_node_update<Const_Node_Iterator, Node_Iterator, E_Access_Traits,Allocator>
|
| 144 |
+
|
| 145 |
+
#define PB_DS_BASE_C_DEC \
|
| 146 |
+
detail::trie_policy_base<Const_Node_Iterator,Node_Iterator,E_Access_Traits, Allocator>
|
| 147 |
+
|
| 148 |
+
// A node updator that allows tries to be searched for the range of
|
| 149 |
+
// values that match a certain prefix.
|
| 150 |
+
template<typename Const_Node_Iterator,
|
| 151 |
+
typename Node_Iterator,
|
| 152 |
+
typename E_Access_Traits,
|
| 153 |
+
typename Allocator>
|
| 154 |
+
class trie_prefix_search_node_update : private PB_DS_BASE_C_DEC
|
| 155 |
+
{
|
| 156 |
+
private:
|
| 157 |
+
typedef PB_DS_BASE_C_DEC base_type;
|
| 158 |
+
|
| 159 |
+
public:
|
| 160 |
+
typedef typename base_type::key_type key_type;
|
| 161 |
+
typedef typename base_type::const_key_reference const_key_reference;
|
| 162 |
+
|
| 163 |
+
// Element access traits.
|
| 164 |
+
typedef E_Access_Traits e_access_traits;
|
| 165 |
+
|
| 166 |
+
// Const element iterator.
|
| 167 |
+
typedef typename e_access_traits::const_iterator const_e_iterator;
|
| 168 |
+
|
| 169 |
+
// Allocator type.
|
| 170 |
+
typedef Allocator allocator;
|
| 171 |
+
|
| 172 |
+
// Size type.
|
| 173 |
+
typedef typename allocator::size_type size_type;
|
| 174 |
+
typedef detail::null_node_metadata metadata_type;
|
| 175 |
+
typedef Const_Node_Iterator const_node_iterator;
|
| 176 |
+
typedef Node_Iterator node_iterator;
|
| 177 |
+
typedef typename const_node_iterator::value_type const_iterator;
|
| 178 |
+
typedef typename node_iterator::value_type iterator;
|
| 179 |
+
|
| 180 |
+
// Finds the const iterator range corresponding to all values
|
| 181 |
+
// whose prefixes match r_key.
|
| 182 |
+
std::pair<const_iterator, const_iterator>
|
| 183 |
+
prefix_range(const_key_reference) const;
|
| 184 |
+
|
| 185 |
+
// Finds the iterator range corresponding to all values whose
|
| 186 |
+
// prefixes match r_key.
|
| 187 |
+
std::pair<iterator, iterator>
|
| 188 |
+
prefix_range(const_key_reference);
|
| 189 |
+
|
| 190 |
+
// Finds the const iterator range corresponding to all values
|
| 191 |
+
// whose prefixes match [b, e).
|
| 192 |
+
std::pair<const_iterator, const_iterator>
|
| 193 |
+
prefix_range(const_e_iterator, const_e_iterator) const;
|
| 194 |
+
|
| 195 |
+
// Finds the iterator range corresponding to all values whose
|
| 196 |
+
// prefixes match [b, e).
|
| 197 |
+
std::pair<iterator, iterator>
|
| 198 |
+
prefix_range(const_e_iterator, const_e_iterator);
|
| 199 |
+
|
| 200 |
+
protected:
|
| 201 |
+
// Called to update a node's metadata.
|
| 202 |
+
inline void
|
| 203 |
+
operator()(node_iterator node_it, const_node_iterator end_nd_it) const;
|
| 204 |
+
|
| 205 |
+
private:
|
| 206 |
+
// Returns the const iterator associated with the just-after last element.
|
| 207 |
+
virtual const_iterator
|
| 208 |
+
end() const = 0;
|
| 209 |
+
|
| 210 |
+
// Returns the iterator associated with the just-after last element.
|
| 211 |
+
virtual iterator
|
| 212 |
+
end() = 0;
|
| 213 |
+
|
| 214 |
+
// Returns the const_node_iterator associated with the trie's root node.
|
| 215 |
+
virtual const_node_iterator
|
| 216 |
+
node_begin() const = 0;
|
| 217 |
+
|
| 218 |
+
// Returns the node_iterator associated with the trie's root node.
|
| 219 |
+
virtual node_iterator
|
| 220 |
+
node_begin() = 0;
|
| 221 |
+
|
| 222 |
+
// Returns the const_node_iterator associated with a just-after leaf node.
|
| 223 |
+
virtual const_node_iterator
|
| 224 |
+
node_end() const = 0;
|
| 225 |
+
|
| 226 |
+
// Returns the node_iterator associated with a just-after leaf node.
|
| 227 |
+
virtual node_iterator
|
| 228 |
+
node_end() = 0;
|
| 229 |
+
|
| 230 |
+
// Access to the cmp_fn object.
|
| 231 |
+
virtual const e_access_traits&
|
| 232 |
+
get_e_access_traits() const = 0;
|
| 233 |
+
|
| 234 |
+
node_iterator
|
| 235 |
+
next_child(node_iterator, const_e_iterator, const_e_iterator,
|
| 236 |
+
node_iterator, const e_access_traits&);
|
| 237 |
+
};
|
| 238 |
+
|
| 239 |
+
#include <ext/pb_ds/detail/trie_policy/prefix_search_node_update_imp.hpp>
|
| 240 |
+
|
| 241 |
+
#undef PB_DS_CLASS_C_DEC
|
| 242 |
+
|
| 243 |
+
#define PB_DS_CLASS_C_DEC \
|
| 244 |
+
trie_order_statistics_node_update<Const_Node_Iterator, Node_Iterator,E_Access_Traits, Allocator>
|
| 245 |
+
|
| 246 |
+
// Functor updating ranks of entrees.
|
| 247 |
+
template<typename Const_Node_Iterator,
|
| 248 |
+
typename Node_Iterator,
|
| 249 |
+
typename E_Access_Traits,
|
| 250 |
+
typename Allocator>
|
| 251 |
+
class trie_order_statistics_node_update : private PB_DS_BASE_C_DEC
|
| 252 |
+
{
|
| 253 |
+
private:
|
| 254 |
+
typedef PB_DS_BASE_C_DEC base_type;
|
| 255 |
+
|
| 256 |
+
public:
|
| 257 |
+
typedef E_Access_Traits e_access_traits;
|
| 258 |
+
typedef typename e_access_traits::const_iterator const_e_iterator;
|
| 259 |
+
typedef Allocator allocator;
|
| 260 |
+
typedef typename allocator::size_type size_type;
|
| 261 |
+
typedef typename base_type::key_type key_type;
|
| 262 |
+
typedef typename base_type::const_key_reference const_key_reference;
|
| 263 |
+
|
| 264 |
+
typedef size_type metadata_type;
|
| 265 |
+
typedef Const_Node_Iterator const_node_iterator;
|
| 266 |
+
typedef Node_Iterator node_iterator;
|
| 267 |
+
typedef typename const_node_iterator::value_type const_iterator;
|
| 268 |
+
typedef typename node_iterator::value_type iterator;
|
| 269 |
+
|
| 270 |
+
// Finds an entry by __order. Returns a const_iterator to the
|
| 271 |
+
// entry with the __order order, or a const_iterator to the
|
| 272 |
+
// container object's end if order is at least the size of the
|
| 273 |
+
// container object.
|
| 274 |
+
inline const_iterator
|
| 275 |
+
find_by_order(size_type) const;
|
| 276 |
+
|
| 277 |
+
// Finds an entry by __order. Returns an iterator to the entry
|
| 278 |
+
// with the __order order, or an iterator to the container
|
| 279 |
+
// object's end if order is at least the size of the container
|
| 280 |
+
// object.
|
| 281 |
+
inline iterator
|
| 282 |
+
find_by_order(size_type);
|
| 283 |
+
|
| 284 |
+
// Returns the order of a key within a sequence. For exapmle, if
|
| 285 |
+
// r_key is the smallest key, this method will return 0; if r_key
|
| 286 |
+
// is a key between the smallest and next key, this method will
|
| 287 |
+
// return 1; if r_key is a key larger than the largest key, this
|
| 288 |
+
// method will return the size of r_c.
|
| 289 |
+
inline size_type
|
| 290 |
+
order_of_key(const_key_reference) const;
|
| 291 |
+
|
| 292 |
+
// Returns the order of a prefix within a sequence. For exapmle,
|
| 293 |
+
// if [b, e] is the smallest prefix, this method will return 0; if
|
| 294 |
+
// r_key is a key between the smallest and next key, this method
|
| 295 |
+
// will return 1; if r_key is a key larger than the largest key,
|
| 296 |
+
// this method will return the size of r_c.
|
| 297 |
+
inline size_type
|
| 298 |
+
order_of_prefix(const_e_iterator, const_e_iterator) const;
|
| 299 |
+
|
| 300 |
+
private:
|
| 301 |
+
typedef typename base_type::const_reference const_reference;
|
| 302 |
+
typedef typename base_type::const_pointer const_pointer;
|
| 303 |
+
|
| 304 |
+
typedef typename Allocator::template rebind<metadata_type>::other metadata_rebind;
|
| 305 |
+
typedef typename metadata_rebind::const_reference const_metadata_reference;
|
| 306 |
+
typedef typename metadata_rebind::reference metadata_reference;
|
| 307 |
+
|
| 308 |
+
// Returns true if the container is empty.
|
| 309 |
+
virtual bool
|
| 310 |
+
empty() const = 0;
|
| 311 |
+
|
| 312 |
+
// Returns the iterator associated with the trie's first element.
|
| 313 |
+
virtual iterator
|
| 314 |
+
begin() = 0;
|
| 315 |
+
|
| 316 |
+
// Returns the iterator associated with the trie's
|
| 317 |
+
// just-after-last element.
|
| 318 |
+
virtual iterator
|
| 319 |
+
end() = 0;
|
| 320 |
+
|
| 321 |
+
// Returns the const_node_iterator associated with the trie's root node.
|
| 322 |
+
virtual const_node_iterator
|
| 323 |
+
node_begin() const = 0;
|
| 324 |
+
|
| 325 |
+
// Returns the node_iterator associated with the trie's root node.
|
| 326 |
+
virtual node_iterator
|
| 327 |
+
node_begin() = 0;
|
| 328 |
+
|
| 329 |
+
// Returns the const_node_iterator associated with a just-after
|
| 330 |
+
// leaf node.
|
| 331 |
+
virtual const_node_iterator
|
| 332 |
+
node_end() const = 0;
|
| 333 |
+
|
| 334 |
+
// Returns the node_iterator associated with a just-after leaf node.
|
| 335 |
+
virtual node_iterator
|
| 336 |
+
node_end() = 0;
|
| 337 |
+
|
| 338 |
+
// Access to the cmp_fn object.
|
| 339 |
+
virtual e_access_traits&
|
| 340 |
+
get_e_access_traits() = 0;
|
| 341 |
+
|
| 342 |
+
protected:
|
| 343 |
+
// Updates the rank of a node through a node_iterator node_it;
|
| 344 |
+
// end_nd_it is the end node iterator.
|
| 345 |
+
inline void
|
| 346 |
+
operator()(node_iterator, const_node_iterator) const;
|
| 347 |
+
|
| 348 |
+
// Destructor.
|
| 349 |
+
virtual
|
| 350 |
+
~trie_order_statistics_node_update();
|
| 351 |
+
};
|
| 352 |
+
|
| 353 |
+
#include <ext/pb_ds/detail/trie_policy/order_statistics_imp.hpp>
|
| 354 |
+
|
| 355 |
+
#undef PB_DS_CLASS_T_DEC
|
| 356 |
+
#undef PB_DS_CLASS_C_DEC
|
| 357 |
+
#undef PB_DS_BASE_C_DEC
|
| 358 |
+
|
| 359 |
+
} // namespace __gnu_pbds
|
| 360 |
+
|
| 361 |
+
#endif
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/cstdbool
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// TR1 cstdbool -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2006, 2007 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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
|
| 7 |
+
// terms of the GNU General Public License as published by the
|
| 8 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 9 |
+
// any later version.
|
| 10 |
+
|
| 11 |
+
// This library is distributed in the hope that it will be useful,
|
| 12 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 13 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 14 |
+
// GNU General Public License for more details.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License along
|
| 17 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 18 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 19 |
+
// USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free software
|
| 22 |
+
// library without restriction. Specifically, if other files instantiate
|
| 23 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 24 |
+
// this file and link it with other files to produce an executable, this
|
| 25 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 26 |
+
// the GNU General Public License. This exception does not however
|
| 27 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 28 |
+
// the GNU General Public License.
|
| 29 |
+
|
| 30 |
+
/** @file tr1/cstdbool
|
| 31 |
+
* This is a TR1 C++ Library header.
|
| 32 |
+
*/
|
| 33 |
+
|
| 34 |
+
#ifndef _GLIBCXX_TR1_CSTDBOOL
|
| 35 |
+
#define _GLIBCXX_TR1_CSTDBOOL 1
|
| 36 |
+
|
| 37 |
+
#pragma GCC system_header
|
| 38 |
+
|
| 39 |
+
#include <bits/c++config.h>
|
| 40 |
+
|
| 41 |
+
#if _GLIBCXX_HAVE_STDBOOL_H
|
| 42 |
+
#include <stdbool.h>
|
| 43 |
+
#endif
|
| 44 |
+
|
| 45 |
+
#endif // _GLIBCXX_TR1_CSTDBOOL
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/cstdint
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// TR1 cstdint -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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
|
| 7 |
+
// terms of the GNU General Public License as published by the
|
| 8 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 9 |
+
// any later version.
|
| 10 |
+
|
| 11 |
+
// This library is distributed in the hope that it will be useful,
|
| 12 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 13 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 14 |
+
// GNU General Public License for more details.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License along
|
| 17 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 18 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 19 |
+
// USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free software
|
| 22 |
+
// library without restriction. Specifically, if other files instantiate
|
| 23 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 24 |
+
// this file and link it with other files to produce an executable, this
|
| 25 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 26 |
+
// the GNU General Public License. This exception does not however
|
| 27 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 28 |
+
// the GNU General Public License.
|
| 29 |
+
|
| 30 |
+
/** @file tr1/cstdint
|
| 31 |
+
* This is a TR1 C++ Library header.
|
| 32 |
+
*/
|
| 33 |
+
|
| 34 |
+
#ifndef _GLIBCXX_TR1_CSTDINT
|
| 35 |
+
#define _GLIBCXX_TR1_CSTDINT 1
|
| 36 |
+
|
| 37 |
+
#pragma GCC system_header
|
| 38 |
+
|
| 39 |
+
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
| 40 |
+
# error TR1 header cannot be included from C++0x header
|
| 41 |
+
#endif
|
| 42 |
+
|
| 43 |
+
#include <bits/c++config.h>
|
| 44 |
+
|
| 45 |
+
// For 8.22.1/1 (see C99, Notes 219, 220, 222)
|
| 46 |
+
# if _GLIBCXX_HAVE_STDINT_H
|
| 47 |
+
# ifndef __STDC_LIMIT_MACROS
|
| 48 |
+
# define _UNDEF__STDC_LIMIT_MACROS
|
| 49 |
+
# define __STDC_LIMIT_MACROS
|
| 50 |
+
# endif
|
| 51 |
+
# ifndef __STDC_CONSTANT_MACROS
|
| 52 |
+
# define _UNDEF__STDC_CONSTANT_MACROS
|
| 53 |
+
# define __STDC_CONSTANT_MACROS
|
| 54 |
+
# endif
|
| 55 |
+
# include <stdint.h>
|
| 56 |
+
# ifdef _UNDEF__STDC_LIMIT_MACROS
|
| 57 |
+
# undef __STDC_LIMIT_MACROS
|
| 58 |
+
# undef _UNDEF__STDC_LIMIT_MACROS
|
| 59 |
+
# endif
|
| 60 |
+
# ifdef _UNDEF__STDC_CONSTANT_MACROS
|
| 61 |
+
# undef __STDC_CONSTANT_MACROS
|
| 62 |
+
# undef _UNDEF__STDC_CONSTANT_MACROS
|
| 63 |
+
# endif
|
| 64 |
+
# endif
|
| 65 |
+
|
| 66 |
+
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
| 67 |
+
# include <tr1_impl/cstdint>
|
| 68 |
+
#else
|
| 69 |
+
# define _GLIBCXX_INCLUDE_AS_TR1
|
| 70 |
+
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
|
| 71 |
+
# define _GLIBCXX_END_NAMESPACE_TR1 }
|
| 72 |
+
# define _GLIBCXX_TR1 tr1::
|
| 73 |
+
# include <tr1_impl/cstdint>
|
| 74 |
+
# undef _GLIBCXX_TR1
|
| 75 |
+
# undef _GLIBCXX_END_NAMESPACE_TR1
|
| 76 |
+
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
| 77 |
+
# undef _GLIBCXX_INCLUDE_AS_TR1
|
| 78 |
+
#endif
|
| 79 |
+
|
| 80 |
+
#endif // _GLIBCXX_TR1_CSTDINT
|
| 81 |
+
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/cstdio
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// TR1 cstdio -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2006 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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
|
| 7 |
+
// terms of the GNU General Public License as published by the
|
| 8 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 9 |
+
// any later version.
|
| 10 |
+
|
| 11 |
+
// This library is distributed in the hope that it will be useful,
|
| 12 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 13 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 14 |
+
// GNU General Public License for more details.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License along
|
| 17 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 18 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 19 |
+
// USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free software
|
| 22 |
+
// library without restriction. Specifically, if other files instantiate
|
| 23 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 24 |
+
// this file and link it with other files to produce an executable, this
|
| 25 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 26 |
+
// the GNU General Public License. This exception does not however
|
| 27 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 28 |
+
// the GNU General Public License.
|
| 29 |
+
|
| 30 |
+
/** @file tr1/cstdio
|
| 31 |
+
* This is a TR1 C++ Library header.
|
| 32 |
+
*/
|
| 33 |
+
|
| 34 |
+
#ifndef _GLIBCXX_TR1_CSTDIO
|
| 35 |
+
#define _GLIBCXX_TR1_CSTDIO 1
|
| 36 |
+
|
| 37 |
+
#pragma GCC system_header
|
| 38 |
+
|
| 39 |
+
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
| 40 |
+
# error TR1 header cannot be included from C++0x header
|
| 41 |
+
#endif
|
| 42 |
+
|
| 43 |
+
#include <cstdio>
|
| 44 |
+
|
| 45 |
+
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
| 46 |
+
# include <tr1_impl/cstdio>
|
| 47 |
+
#else
|
| 48 |
+
# define _GLIBCXX_INCLUDE_AS_TR1
|
| 49 |
+
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
|
| 50 |
+
# define _GLIBCXX_END_NAMESPACE_TR1 }
|
| 51 |
+
# define _GLIBCXX_TR1 tr1::
|
| 52 |
+
# include <tr1_impl/cstdio>
|
| 53 |
+
# undef _GLIBCXX_TR1
|
| 54 |
+
# undef _GLIBCXX_END_NAMESPACE_TR1
|
| 55 |
+
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
| 56 |
+
# undef _GLIBCXX_INCLUDE_AS_TR1
|
| 57 |
+
#endif
|
| 58 |
+
|
| 59 |
+
#endif // _GLIBCXX_TR1_CSTDIO
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/cstdlib
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// TR1 cstdlib -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2006 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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
|
| 7 |
+
// terms of the GNU General Public License as published by the
|
| 8 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 9 |
+
// any later version.
|
| 10 |
+
|
| 11 |
+
// This library is distributed in the hope that it will be useful,
|
| 12 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 13 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 14 |
+
// GNU General Public License for more details.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License along
|
| 17 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 18 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 19 |
+
// USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free software
|
| 22 |
+
// library without restriction. Specifically, if other files instantiate
|
| 23 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 24 |
+
// this file and link it with other files to produce an executable, this
|
| 25 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 26 |
+
// the GNU General Public License. This exception does not however
|
| 27 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 28 |
+
// the GNU General Public License.
|
| 29 |
+
|
| 30 |
+
/** @file tr1/cstdlib
|
| 31 |
+
* This is a TR1 C++ Library header.
|
| 32 |
+
*/
|
| 33 |
+
|
| 34 |
+
#ifndef _GLIBCXX_TR1_CSTDLIB
|
| 35 |
+
#define _GLIBCXX_TR1_CSTDLIB 1
|
| 36 |
+
|
| 37 |
+
#pragma GCC system_header
|
| 38 |
+
|
| 39 |
+
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
| 40 |
+
# error TR1 header cannot be included from C++0x header
|
| 41 |
+
#endif
|
| 42 |
+
|
| 43 |
+
#include <cstdlib>
|
| 44 |
+
|
| 45 |
+
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
| 46 |
+
# include <tr1_impl/cstdlib>
|
| 47 |
+
#else
|
| 48 |
+
# define _GLIBCXX_INCLUDE_AS_TR1
|
| 49 |
+
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
|
| 50 |
+
# define _GLIBCXX_END_NAMESPACE_TR1 }
|
| 51 |
+
# define _GLIBCXX_TR1 tr1::
|
| 52 |
+
# include <tr1_impl/cstdlib>
|
| 53 |
+
# undef _GLIBCXX_TR1
|
| 54 |
+
# undef _GLIBCXX_END_NAMESPACE_TR1
|
| 55 |
+
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
| 56 |
+
# undef _GLIBCXX_INCLUDE_AS_TR1
|
| 57 |
+
#endif
|
| 58 |
+
|
| 59 |
+
#endif // _GLIBCXX_TR1_CSTDLIB
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/ctgmath
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// TR1 ctgmath -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2006, 2007 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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
|
| 7 |
+
// terms of the GNU General Public License as published by the
|
| 8 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 9 |
+
// any later version.
|
| 10 |
+
|
| 11 |
+
// This library is distributed in the hope that it will be useful,
|
| 12 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 13 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 14 |
+
// GNU General Public License for more details.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License along
|
| 17 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 18 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 19 |
+
// USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free software
|
| 22 |
+
// library without restriction. Specifically, if other files instantiate
|
| 23 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 24 |
+
// this file and link it with other files to produce an executable, this
|
| 25 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 26 |
+
// the GNU General Public License. This exception does not however
|
| 27 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 28 |
+
// the GNU General Public License.
|
| 29 |
+
|
| 30 |
+
/** @file tr1/ctgmath
|
| 31 |
+
* This is a TR1 C++ Library header.
|
| 32 |
+
*/
|
| 33 |
+
|
| 34 |
+
#ifndef _GLIBCXX_TR1_CTGMATH
|
| 35 |
+
#define _GLIBCXX_TR1_CTGMATH 1
|
| 36 |
+
|
| 37 |
+
#include <tr1/cmath>
|
| 38 |
+
|
| 39 |
+
#endif // _GLIBCXX_TR1_CTGMATH
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/ctime
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// TR1 ctime -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2006, 2007 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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
|
| 7 |
+
// terms of the GNU General Public License as published by the
|
| 8 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 9 |
+
// any later version.
|
| 10 |
+
|
| 11 |
+
// This library is distributed in the hope that it will be useful,
|
| 12 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 13 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 14 |
+
// GNU General Public License for more details.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License along
|
| 17 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 18 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 19 |
+
// USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free software
|
| 22 |
+
// library without restriction. Specifically, if other files instantiate
|
| 23 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 24 |
+
// this file and link it with other files to produce an executable, this
|
| 25 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 26 |
+
// the GNU General Public License. This exception does not however
|
| 27 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 28 |
+
// the GNU General Public License.
|
| 29 |
+
|
| 30 |
+
/** @file tr1/ctime
|
| 31 |
+
* This is a TR1 C++ Library header.
|
| 32 |
+
*/
|
| 33 |
+
|
| 34 |
+
#ifndef _GLIBCXX_TR1_CTIME
|
| 35 |
+
#define _GLIBCXX_TR1_CTIME 1
|
| 36 |
+
|
| 37 |
+
#include <ctime>
|
| 38 |
+
|
| 39 |
+
#endif // _GLIBCXX_TR1_CTIME
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/ctype.h
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// TR1 ctype.h -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2006 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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
|
| 7 |
+
// terms of the GNU General Public License as published by the
|
| 8 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 9 |
+
// any later version.
|
| 10 |
+
|
| 11 |
+
// This library is distributed in the hope that it will be useful,
|
| 12 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 13 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 14 |
+
// GNU General Public License for more details.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License along
|
| 17 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 18 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 19 |
+
// USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free software
|
| 22 |
+
// library without restriction. Specifically, if other files instantiate
|
| 23 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 24 |
+
// this file and link it with other files to produce an executable, this
|
| 25 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 26 |
+
// the GNU General Public License. This exception does not however
|
| 27 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 28 |
+
// the GNU General Public License.
|
| 29 |
+
|
| 30 |
+
/** @file tr1/ctype.h
|
| 31 |
+
* This is a TR1 C++ Library header.
|
| 32 |
+
*/
|
| 33 |
+
|
| 34 |
+
#ifndef _TR1_CTYPE_H
|
| 35 |
+
#define _TR1_CTYPE_H 1
|
| 36 |
+
|
| 37 |
+
#include <tr1/cctype>
|
| 38 |
+
|
| 39 |
+
#endif
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/cwchar
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// TR1 cwchar -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2006, 2007 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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
|
| 7 |
+
// terms of the GNU General Public License as published by the
|
| 8 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 9 |
+
// any later version.
|
| 10 |
+
|
| 11 |
+
// This library is distributed in the hope that it will be useful,
|
| 12 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 13 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 14 |
+
// GNU General Public License for more details.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License along
|
| 17 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 18 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 19 |
+
// USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free software
|
| 22 |
+
// library without restriction. Specifically, if other files instantiate
|
| 23 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 24 |
+
// this file and link it with other files to produce an executable, this
|
| 25 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 26 |
+
// the GNU General Public License. This exception does not however
|
| 27 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 28 |
+
// the GNU General Public License.
|
| 29 |
+
|
| 30 |
+
/** @file tr1/cwchar
|
| 31 |
+
* This is a TR1 C++ Library header.
|
| 32 |
+
*/
|
| 33 |
+
|
| 34 |
+
#ifndef _GLIBCXX_TR1_CWCHAR
|
| 35 |
+
#define _GLIBCXX_TR1_CWCHAR 1
|
| 36 |
+
|
| 37 |
+
#pragma GCC system_header
|
| 38 |
+
|
| 39 |
+
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
| 40 |
+
# error TR1 header cannot be included from C++0x header
|
| 41 |
+
#endif
|
| 42 |
+
|
| 43 |
+
#include <cwchar>
|
| 44 |
+
|
| 45 |
+
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
| 46 |
+
# include <tr1_impl/cwchar>
|
| 47 |
+
#else
|
| 48 |
+
# define _GLIBCXX_INCLUDE_AS_TR1
|
| 49 |
+
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
|
| 50 |
+
# define _GLIBCXX_END_NAMESPACE_TR1 }
|
| 51 |
+
# define _GLIBCXX_TR1 tr1::
|
| 52 |
+
# include <tr1_impl/cwchar>
|
| 53 |
+
# undef _GLIBCXX_TR1
|
| 54 |
+
# undef _GLIBCXX_END_NAMESPACE_TR1
|
| 55 |
+
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
| 56 |
+
# undef _GLIBCXX_INCLUDE_AS_TR1
|
| 57 |
+
#endif
|
| 58 |
+
|
| 59 |
+
#endif // _GLIBCXX_TR1_CWCHAR
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/cwctype
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// TR1 cwctype -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2006, 2007 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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
|
| 7 |
+
// terms of the GNU General Public License as published by the
|
| 8 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 9 |
+
// any later version.
|
| 10 |
+
|
| 11 |
+
// This library is distributed in the hope that it will be useful,
|
| 12 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 13 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 14 |
+
// GNU General Public License for more details.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License along
|
| 17 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 18 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 19 |
+
// USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free software
|
| 22 |
+
// library without restriction. Specifically, if other files instantiate
|
| 23 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 24 |
+
// this file and link it with other files to produce an executable, this
|
| 25 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 26 |
+
// the GNU General Public License. This exception does not however
|
| 27 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 28 |
+
// the GNU General Public License.
|
| 29 |
+
|
| 30 |
+
/** @file tr1/cwctype
|
| 31 |
+
* This is a TR1 C++ Library header.
|
| 32 |
+
*/
|
| 33 |
+
|
| 34 |
+
#ifndef _GLIBCXX_TR1_CWCTYPE
|
| 35 |
+
#define _GLIBCXX_TR1_CWCTYPE 1
|
| 36 |
+
|
| 37 |
+
#pragma GCC system_header
|
| 38 |
+
|
| 39 |
+
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
| 40 |
+
# error TR1 header cannot be included from C++0x header
|
| 41 |
+
#endif
|
| 42 |
+
|
| 43 |
+
#include <cwctype>
|
| 44 |
+
|
| 45 |
+
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
| 46 |
+
# include <tr1_impl/cwctype>
|
| 47 |
+
#else
|
| 48 |
+
# define _GLIBCXX_INCLUDE_AS_TR1
|
| 49 |
+
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
|
| 50 |
+
# define _GLIBCXX_END_NAMESPACE_TR1 }
|
| 51 |
+
# define _GLIBCXX_TR1 tr1::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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Special functions -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2006, 2007, 2008
|
| 4 |
+
// Free Software Foundation, Inc.
|
| 5 |
+
//
|
| 6 |
+
// This file is part of the GNU ISO C++ Library. This library is free
|
| 7 |
+
// software; you can redistribute it and/or modify it under the
|
| 8 |
+
// terms of the GNU General Public License as published by the
|
| 9 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 10 |
+
// any later version.
|
| 11 |
+
//
|
| 12 |
+
// This library is distributed in the hope that it will be useful,
|
| 13 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
// GNU General Public License for more details.
|
| 16 |
+
//
|
| 17 |
+
// You should have received a copy of the GNU General Public License along
|
| 18 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 19 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 20 |
+
// USA.
|
| 21 |
+
//
|
| 22 |
+
// As a special exception, you may use this file as part of a free software
|
| 23 |
+
// library without restriction. Specifically, if other files instantiate
|
| 24 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 25 |
+
// this file and link it with other files to produce an executable, this
|
| 26 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 27 |
+
// the GNU General Public License. This exception does not however
|
| 28 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 29 |
+
// the GNU General Public License.
|
| 30 |
+
|
| 31 |
+
/** @file tr1/ell_integral.tcc
|
| 32 |
+
* This is an internal header file, included by other library headers.
|
| 33 |
+
* You should not attempt to use it directly.
|
| 34 |
+
*/
|
| 35 |
+
|
| 36 |
+
//
|
| 37 |
+
// ISO C++ 14882 TR1: 5.2 Special functions
|
| 38 |
+
//
|
| 39 |
+
|
| 40 |
+
// Written by Edward Smith-Rowland based on:
|
| 41 |
+
// (1) B. C. Carlson Numer. Math. 33, 1 (1979)
|
| 42 |
+
// (2) B. C. Carlson, Special Functions of Applied Mathematics (1977)
|
| 43 |
+
// (3) The Gnu Scientific Library, http://www.gnu.org/software/gsl
|
| 44 |
+
// (4) Numerical Recipes in C, 2nd ed, by W. H. Press, S. A. Teukolsky,
|
| 45 |
+
// W. T. Vetterling, B. P. Flannery, Cambridge University Press
|
| 46 |
+
// (1992), pp. 261-269
|
| 47 |
+
|
| 48 |
+
#ifndef _GLIBCXX_TR1_ELL_INTEGRAL_TCC
|
| 49 |
+
#define _GLIBCXX_TR1_ELL_INTEGRAL_TCC 1
|
| 50 |
+
|
| 51 |
+
namespace std
|
| 52 |
+
{
|
| 53 |
+
namespace tr1
|
| 54 |
+
{
|
| 55 |
+
|
| 56 |
+
// [5.2] Special functions
|
| 57 |
+
|
| 58 |
+
// Implementation-space details.
|
| 59 |
+
namespace __detail
|
| 60 |
+
{
|
| 61 |
+
|
| 62 |
+
/**
|
| 63 |
+
* @brief Return the Carlson elliptic function @f$ R_F(x,y,z) @f$
|
| 64 |
+
* of the first kind.
|
| 65 |
+
*
|
| 66 |
+
* The Carlson elliptic function of the first kind is defined by:
|
| 67 |
+
* @f[
|
| 68 |
+
* R_F(x,y,z) = \frac{1}{2} \int_0^\infty
|
| 69 |
+
* \frac{dt}{(t + x)^{1/2}(t + y)^{1/2}(t + z)^{1/2}}
|
| 70 |
+
* @f]
|
| 71 |
+
*
|
| 72 |
+
* @param __x The first of three symmetric arguments.
|
| 73 |
+
* @param __y The second of three symmetric arguments.
|
| 74 |
+
* @param __z The third of three symmetric arguments.
|
| 75 |
+
* @return The Carlson elliptic function of the first kind.
|
| 76 |
+
*/
|
| 77 |
+
template<typename _Tp>
|
| 78 |
+
_Tp
|
| 79 |
+
__ellint_rf(const _Tp __x, const _Tp __y, const _Tp __z)
|
| 80 |
+
{
|
| 81 |
+
const _Tp __min = std::numeric_limits<_Tp>::min();
|
| 82 |
+
const _Tp __max = std::numeric_limits<_Tp>::max();
|
| 83 |
+
const _Tp __lolim = _Tp(5) * __min;
|
| 84 |
+
const _Tp __uplim = __max / _Tp(5);
|
| 85 |
+
|
| 86 |
+
if (__x < _Tp(0) || __y < _Tp(0) || __z < _Tp(0))
|
| 87 |
+
std::__throw_domain_error(__N("Argument less than zero "
|
| 88 |
+
"in __ellint_rf."));
|
| 89 |
+
else if (__x + __y < __lolim || __x + __z < __lolim
|
| 90 |
+
|| __y + __z < __lolim)
|
| 91 |
+
std::__throw_domain_error(__N("Argument too small in __ellint_rf"));
|
| 92 |
+
else
|
| 93 |
+
{
|
| 94 |
+
const _Tp __c0 = _Tp(1) / _Tp(4);
|
| 95 |
+
const _Tp __c1 = _Tp(1) / _Tp(24);
|
| 96 |
+
const _Tp __c2 = _Tp(1) / _Tp(10);
|
| 97 |
+
const _Tp __c3 = _Tp(3) / _Tp(44);
|
| 98 |
+
const _Tp __c4 = _Tp(1) / _Tp(14);
|
| 99 |
+
|
| 100 |
+
_Tp __xn = __x;
|
| 101 |
+
_Tp __yn = __y;
|
| 102 |
+
_Tp __zn = __z;
|
| 103 |
+
|
| 104 |
+
const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
|
| 105 |
+
const _Tp __errtol = std::pow(__eps, _Tp(1) / _Tp(6));
|
| 106 |
+
_Tp __mu;
|
| 107 |
+
_Tp __xndev, __yndev, __zndev;
|
| 108 |
+
|
| 109 |
+
const unsigned int __max_iter = 100;
|
| 110 |
+
for (unsigned int __iter = 0; __iter < __max_iter; ++__iter)
|
| 111 |
+
{
|
| 112 |
+
__mu = (__xn + __yn + __zn) / _Tp(3);
|
| 113 |
+
__xndev = 2 - (__mu + __xn) / __mu;
|
| 114 |
+
__yndev = 2 - (__mu + __yn) / __mu;
|
| 115 |
+
__zndev = 2 - (__mu + __zn) / __mu;
|
| 116 |
+
_Tp __epsilon = std::max(std::abs(__xndev), std::abs(__yndev));
|
| 117 |
+
__epsilon = std::max(__epsilon, std::abs(__zndev));
|
| 118 |
+
if (__epsilon < __errtol)
|
| 119 |
+
break;
|
| 120 |
+
const _Tp __xnroot = std::sqrt(__xn);
|
| 121 |
+
const _Tp __ynroot = std::sqrt(__yn);
|
| 122 |
+
const _Tp __znroot = std::sqrt(__zn);
|
| 123 |
+
const _Tp __lambda = __xnroot * (__ynroot + __znroot)
|
| 124 |
+
+ __ynroot * __znroot;
|
| 125 |
+
__xn = __c0 * (__xn + __lambda);
|
| 126 |
+
__yn = __c0 * (__yn + __lambda);
|
| 127 |
+
__zn = __c0 * (__zn + __lambda);
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
const _Tp __e2 = __xndev * __yndev - __zndev * __zndev;
|
| 131 |
+
const _Tp __e3 = __xndev * __yndev * __zndev;
|
| 132 |
+
const _Tp __s = _Tp(1) + (__c1 * __e2 - __c2 - __c3 * __e3) * __e2
|
| 133 |
+
+ __c4 * __e3;
|
| 134 |
+
|
| 135 |
+
return __s / std::sqrt(__mu);
|
| 136 |
+
}
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
|
| 140 |
+
/**
|
| 141 |
+
* @brief Return the complete elliptic integral of the first kind
|
| 142 |
+
* @f$ K(k) @f$ by series expansion.
|
| 143 |
+
*
|
| 144 |
+
* The complete elliptic integral of the first kind is defined as
|
| 145 |
+
* @f[
|
| 146 |
+
* K(k) = F(k,\pi/2) = \int_0^{\pi/2}\frac{d\theta}
|
| 147 |
+
* {\sqrt{1 - k^2sin^2\theta}}
|
| 148 |
+
* @f]
|
| 149 |
+
*
|
| 150 |
+
* This routine is not bad as long as |k| is somewhat smaller than 1
|
| 151 |
+
* but is not is good as the Carlson elliptic integral formulation.
|
| 152 |
+
*
|
| 153 |
+
* @param __k The argument of the complete elliptic function.
|
| 154 |
+
* @return The complete elliptic function of the first kind.
|
| 155 |
+
*/
|
| 156 |
+
template<typename _Tp>
|
| 157 |
+
_Tp
|
| 158 |
+
__comp_ellint_1_series(const _Tp __k)
|
| 159 |
+
{
|
| 160 |
+
|
| 161 |
+
const _Tp __kk = __k * __k;
|
| 162 |
+
|
| 163 |
+
_Tp __term = __kk / _Tp(4);
|
| 164 |
+
_Tp __sum = _Tp(1) + __term;
|
| 165 |
+
|
| 166 |
+
const unsigned int __max_iter = 1000;
|
| 167 |
+
for (unsigned int __i = 2; __i < __max_iter; ++__i)
|
| 168 |
+
{
|
| 169 |
+
__term *= (2 * __i - 1) * __kk / (2 * __i);
|
| 170 |
+
if (__term < std::numeric_limits<_Tp>::epsilon())
|
| 171 |
+
break;
|
| 172 |
+
__sum += __term;
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
return __numeric_constants<_Tp>::__pi_2() * __sum;
|
| 176 |
+
}
|
| 177 |
+
|
| 178 |
+
|
| 179 |
+
/**
|
| 180 |
+
* @brief Return the complete elliptic integral of the first kind
|
| 181 |
+
* @f$ K(k) @f$ using the Carlson formulation.
|
| 182 |
+
*
|
| 183 |
+
* The complete elliptic integral of the first kind is defined as
|
| 184 |
+
* @f[
|
| 185 |
+
* K(k) = F(k,\pi/2) = \int_0^{\pi/2}\frac{d\theta}
|
| 186 |
+
* {\sqrt{1 - k^2 sin^2\theta}}
|
| 187 |
+
* @f]
|
| 188 |
+
* where @f$ F(k,\phi) @f$ is the incomplete elliptic integral of the
|
| 189 |
+
* first kind.
|
| 190 |
+
*
|
| 191 |
+
* @param __k The argument of the complete elliptic function.
|
| 192 |
+
* @return The complete elliptic function of the first kind.
|
| 193 |
+
*/
|
| 194 |
+
template<typename _Tp>
|
| 195 |
+
_Tp
|
| 196 |
+
__comp_ellint_1(const _Tp __k)
|
| 197 |
+
{
|
| 198 |
+
|
| 199 |
+
if (__isnan(__k))
|
| 200 |
+
return std::numeric_limits<_Tp>::quiet_NaN();
|
| 201 |
+
else if (std::abs(__k) >= _Tp(1))
|
| 202 |
+
return std::numeric_limits<_Tp>::quiet_NaN();
|
| 203 |
+
else
|
| 204 |
+
return __ellint_rf(_Tp(0), _Tp(1) - __k * __k, _Tp(1));
|
| 205 |
+
}
|
| 206 |
+
|
| 207 |
+
|
| 208 |
+
/**
|
| 209 |
+
* @brief Return the incomplete elliptic integral of the first kind
|
| 210 |
+
* @f$ F(k,\phi) @f$ using the Carlson formulation.
|
| 211 |
+
*
|
| 212 |
+
* The incomplete elliptic integral of the first kind is defined as
|
| 213 |
+
* @f[
|
| 214 |
+
* F(k,\phi) = \int_0^{\phi}\frac{d\theta}
|
| 215 |
+
* {\sqrt{1 - k^2 sin^2\theta}}
|
| 216 |
+
* @f]
|
| 217 |
+
*
|
| 218 |
+
* @param __k The argument of the elliptic function.
|
| 219 |
+
* @param __phi The integral limit argument of the elliptic function.
|
| 220 |
+
* @return The elliptic function of the first kind.
|
| 221 |
+
*/
|
| 222 |
+
template<typename _Tp>
|
| 223 |
+
_Tp
|
| 224 |
+
__ellint_1(const _Tp __k, const _Tp __phi)
|
| 225 |
+
{
|
| 226 |
+
|
| 227 |
+
if (__isnan(__k) || __isnan(__phi))
|
| 228 |
+
return std::numeric_limits<_Tp>::quiet_NaN();
|
| 229 |
+
else if (std::abs(__k) > _Tp(1))
|
| 230 |
+
std::__throw_domain_error(__N("Bad argument in __ellint_1."));
|
| 231 |
+
else
|
| 232 |
+
{
|
| 233 |
+
// Reduce phi to -pi/2 < phi < +pi/2.
|
| 234 |
+
const int __n = std::floor(__phi / __numeric_constants<_Tp>::__pi()
|
| 235 |
+
+ _Tp(0.5L));
|
| 236 |
+
const _Tp __phi_red = __phi
|
| 237 |
+
- __n * __numeric_constants<_Tp>::__pi();
|
| 238 |
+
|
| 239 |
+
const _Tp __s = std::sin(__phi_red);
|
| 240 |
+
const _Tp __c = std::cos(__phi_red);
|
| 241 |
+
|
| 242 |
+
const _Tp __F = __s
|
| 243 |
+
* __ellint_rf(__c * __c,
|
| 244 |
+
_Tp(1) - __k * __k * __s * __s, _Tp(1));
|
| 245 |
+
|
| 246 |
+
if (__n == 0)
|
| 247 |
+
return __F;
|
| 248 |
+
else
|
| 249 |
+
return __F + _Tp(2) * __n * __comp_ellint_1(__k);
|
| 250 |
+
}
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
|
| 254 |
+
/**
|
| 255 |
+
* @brief Return the complete elliptic integral of the second kind
|
| 256 |
+
* @f$ E(k) @f$ by series expansion.
|
| 257 |
+
*
|
| 258 |
+
* The complete elliptic integral of the second kind is defined as
|
| 259 |
+
* @f[
|
| 260 |
+
* E(k,\pi/2) = \int_0^{\pi/2}\sqrt{1 - k^2 sin^2\theta}
|
| 261 |
+
* @f]
|
| 262 |
+
*
|
| 263 |
+
* This routine is not bad as long as |k| is somewhat smaller than 1
|
| 264 |
+
* but is not is good as the Carlson elliptic integral formulation.
|
| 265 |
+
*
|
| 266 |
+
* @param __k The argument of the complete elliptic function.
|
| 267 |
+
* @return The complete elliptic function of the second kind.
|
| 268 |
+
*/
|
| 269 |
+
template<typename _Tp>
|
| 270 |
+
_Tp
|
| 271 |
+
__comp_ellint_2_series(const _Tp __k)
|
| 272 |
+
{
|
| 273 |
+
|
| 274 |
+
const _Tp __kk = __k * __k;
|
| 275 |
+
|
| 276 |
+
_Tp __term = __kk;
|
| 277 |
+
_Tp __sum = __term;
|
| 278 |
+
|
| 279 |
+
const unsigned int __max_iter = 1000;
|
| 280 |
+
for (unsigned int __i = 2; __i < __max_iter; ++__i)
|
| 281 |
+
{
|
| 282 |
+
const _Tp __i2m = 2 * __i - 1;
|
| 283 |
+
const _Tp __i2 = 2 * __i;
|
| 284 |
+
__term *= __i2m * __i2m * __kk / (__i2 * __i2);
|
| 285 |
+
if (__term < std::numeric_limits<_Tp>::epsilon())
|
| 286 |
+
break;
|
| 287 |
+
__sum += __term / __i2m;
|
| 288 |
+
}
|
| 289 |
+
|
| 290 |
+
return __numeric_constants<_Tp>::__pi_2() * (_Tp(1) - __sum);
|
| 291 |
+
}
|
| 292 |
+
|
| 293 |
+
|
| 294 |
+
/**
|
| 295 |
+
* @brief Return the Carlson elliptic function of the second kind
|
| 296 |
+
* @f$ R_D(x,y,z) = R_J(x,y,z,z) @f$ where
|
| 297 |
+
* @f$ R_J(x,y,z,p) @f$ is the Carlson elliptic function
|
| 298 |
+
* of the third kind.
|
| 299 |
+
*
|
| 300 |
+
* The Carlson elliptic function of the second kind is defined by:
|
| 301 |
+
* @f[
|
| 302 |
+
* R_D(x,y,z) = \frac{3}{2} \int_0^\infty
|
| 303 |
+
* \frac{dt}{(t + x)^{1/2}(t + y)^{1/2}(t + z)^{3/2}}
|
| 304 |
+
* @f]
|
| 305 |
+
*
|
| 306 |
+
* Based on Carlson's algorithms:
|
| 307 |
+
* - B. C. Carlson Numer. Math. 33, 1 (1979)
|
| 308 |
+
* - B. C. Carlson, Special Functions of Applied Mathematics (1977)
|
| 309 |
+
* - Numerical Recipes in C, 2nd ed, pp. 261-269,
|
| 310 |
+
* by Press, Teukolsky, Vetterling, Flannery (1992)
|
| 311 |
+
*
|
| 312 |
+
* @param __x The first of two symmetric arguments.
|
| 313 |
+
* @param __y The second of two symmetric arguments.
|
| 314 |
+
* @param __z The third argument.
|
| 315 |
+
* @return The Carlson elliptic function of the second kind.
|
| 316 |
+
*/
|
| 317 |
+
template<typename _Tp>
|
| 318 |
+
_Tp
|
| 319 |
+
__ellint_rd(const _Tp __x, const _Tp __y, const _Tp __z)
|
| 320 |
+
{
|
| 321 |
+
const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
|
| 322 |
+
const _Tp __errtol = std::pow(__eps / _Tp(8), _Tp(1) / _Tp(6));
|
| 323 |
+
const _Tp __min = std::numeric_limits<_Tp>::min();
|
| 324 |
+
const _Tp __max = std::numeric_limits<_Tp>::max();
|
| 325 |
+
const _Tp __lolim = _Tp(2) / std::pow(__max, _Tp(2) / _Tp(3));
|
| 326 |
+
const _Tp __uplim = std::pow(_Tp(0.1L) * __errtol / __min, _Tp(2) / _Tp(3));
|
| 327 |
+
|
| 328 |
+
if (__x < _Tp(0) || __y < _Tp(0))
|
| 329 |
+
std::__throw_domain_error(__N("Argument less than zero "
|
| 330 |
+
"in __ellint_rd."));
|
| 331 |
+
else if (__x + __y < __lolim || __z < __lolim)
|
| 332 |
+
std::__throw_domain_error(__N("Argument too small "
|
| 333 |
+
"in __ellint_rd."));
|
| 334 |
+
else
|
| 335 |
+
{
|
| 336 |
+
const _Tp __c0 = _Tp(1) / _Tp(4);
|
| 337 |
+
const _Tp __c1 = _Tp(3) / _Tp(14);
|
| 338 |
+
const _Tp __c2 = _Tp(1) / _Tp(6);
|
| 339 |
+
const _Tp __c3 = _Tp(9) / _Tp(22);
|
| 340 |
+
const _Tp __c4 = _Tp(3) / _Tp(26);
|
| 341 |
+
|
| 342 |
+
_Tp __xn = __x;
|
| 343 |
+
_Tp __yn = __y;
|
| 344 |
+
_Tp __zn = __z;
|
| 345 |
+
_Tp __sigma = _Tp(0);
|
| 346 |
+
_Tp __power4 = _Tp(1);
|
| 347 |
+
|
| 348 |
+
_Tp __mu;
|
| 349 |
+
_Tp __xndev, __yndev, __zndev;
|
| 350 |
+
|
| 351 |
+
const unsigned int __max_iter = 100;
|
| 352 |
+
for (unsigned int __iter = 0; __iter < __max_iter; ++__iter)
|
| 353 |
+
{
|
| 354 |
+
__mu = (__xn + __yn + _Tp(3) * __zn) / _Tp(5);
|
| 355 |
+
__xndev = (__mu - __xn) / __mu;
|
| 356 |
+
__yndev = (__mu - __yn) / __mu;
|
| 357 |
+
__zndev = (__mu - __zn) / __mu;
|
| 358 |
+
_Tp __epsilon = std::max(std::abs(__xndev), std::abs(__yndev));
|
| 359 |
+
__epsilon = std::max(__epsilon, std::abs(__zndev));
|
| 360 |
+
if (__epsilon < __errtol)
|
| 361 |
+
break;
|
| 362 |
+
_Tp __xnroot = std::sqrt(__xn);
|
| 363 |
+
_Tp __ynroot = std::sqrt(__yn);
|
| 364 |
+
_Tp __znroot = std::sqrt(__zn);
|
| 365 |
+
_Tp __lambda = __xnroot * (__ynroot + __znroot)
|
| 366 |
+
+ __ynroot * __znroot;
|
| 367 |
+
__sigma += __power4 / (__znroot * (__zn + __lambda));
|
| 368 |
+
__power4 *= __c0;
|
| 369 |
+
__xn = __c0 * (__xn + __lambda);
|
| 370 |
+
__yn = __c0 * (__yn + __lambda);
|
| 371 |
+
__zn = __c0 * (__zn + __lambda);
|
| 372 |
+
}
|
| 373 |
+
|
| 374 |
+
_Tp __ea = __xndev * __yndev;
|
| 375 |
+
_Tp __eb = __zndev * __zndev;
|
| 376 |
+
_Tp __ec = __ea - __eb;
|
| 377 |
+
_Tp __ed = __ea - _Tp(6) * __eb;
|
| 378 |
+
_Tp __ef = __ed + __ec + __ec;
|
| 379 |
+
_Tp __s1 = __ed * (-__c1 + __c3 * __ed
|
| 380 |
+
/ _Tp(3) - _Tp(3) * __c4 * __zndev * __ef
|
| 381 |
+
/ _Tp(2));
|
| 382 |
+
_Tp __s2 = __zndev
|
| 383 |
+
* (__c2 * __ef
|
| 384 |
+
+ __zndev * (-__c3 * __ec - __zndev * __c4 - __ea));
|
| 385 |
+
|
| 386 |
+
return _Tp(3) * __sigma + __power4 * (_Tp(1) + __s1 + __s2)
|
| 387 |
+
/ (__mu * std::sqrt(__mu));
|
| 388 |
+
}
|
| 389 |
+
}
|
| 390 |
+
|
| 391 |
+
|
| 392 |
+
/**
|
| 393 |
+
* @brief Return the complete elliptic integral of the second kind
|
| 394 |
+
* @f$ E(k) @f$ using the Carlson formulation.
|
| 395 |
+
*
|
| 396 |
+
* The complete elliptic integral of the second kind is defined as
|
| 397 |
+
* @f[
|
| 398 |
+
* E(k,\pi/2) = \int_0^{\pi/2}\sqrt{1 - k^2 sin^2\theta}
|
| 399 |
+
* @f]
|
| 400 |
+
*
|
| 401 |
+
* @param __k The argument of the complete elliptic function.
|
| 402 |
+
* @return The complete elliptic function of the second kind.
|
| 403 |
+
*/
|
| 404 |
+
template<typename _Tp>
|
| 405 |
+
_Tp
|
| 406 |
+
__comp_ellint_2(const _Tp __k)
|
| 407 |
+
{
|
| 408 |
+
|
| 409 |
+
if (__isnan(__k))
|
| 410 |
+
return std::numeric_limits<_Tp>::quiet_NaN();
|
| 411 |
+
else if (std::abs(__k) == 1)
|
| 412 |
+
return _Tp(1);
|
| 413 |
+
else if (std::abs(__k) > _Tp(1))
|
| 414 |
+
std::__throw_domain_error(__N("Bad argument in __comp_ellint_2."));
|
| 415 |
+
else
|
| 416 |
+
{
|
| 417 |
+
const _Tp __kk = __k * __k;
|
| 418 |
+
|
| 419 |
+
return __ellint_rf(_Tp(0), _Tp(1) - __kk, _Tp(1))
|
| 420 |
+
- __kk * __ellint_rd(_Tp(0), _Tp(1) - __kk, _Tp(1)) / _Tp(3);
|
| 421 |
+
}
|
| 422 |
+
}
|
| 423 |
+
|
| 424 |
+
|
| 425 |
+
/**
|
| 426 |
+
* @brief Return the incomplete elliptic integral of the second kind
|
| 427 |
+
* @f$ E(k,\phi) @f$ using the Carlson formulation.
|
| 428 |
+
*
|
| 429 |
+
* The incomplete elliptic integral of the second kind is defined as
|
| 430 |
+
* @f[
|
| 431 |
+
* E(k,\phi) = \int_0^{\phi} \sqrt{1 - k^2 sin^2\theta}
|
| 432 |
+
* @f]
|
| 433 |
+
*
|
| 434 |
+
* @param __k The argument of the elliptic function.
|
| 435 |
+
* @param __phi The integral limit argument of the elliptic function.
|
| 436 |
+
* @return The elliptic function of the second kind.
|
| 437 |
+
*/
|
| 438 |
+
template<typename _Tp>
|
| 439 |
+
_Tp
|
| 440 |
+
__ellint_2(const _Tp __k, const _Tp __phi)
|
| 441 |
+
{
|
| 442 |
+
|
| 443 |
+
if (__isnan(__k) || __isnan(__phi))
|
| 444 |
+
return std::numeric_limits<_Tp>::quiet_NaN();
|
| 445 |
+
else if (std::abs(__k) > _Tp(1))
|
| 446 |
+
std::__throw_domain_error(__N("Bad argument in __ellint_2."));
|
| 447 |
+
else
|
| 448 |
+
{
|
| 449 |
+
// Reduce phi to -pi/2 < phi < +pi/2.
|
| 450 |
+
const int __n = std::floor(__phi / __numeric_constants<_Tp>::__pi()
|
| 451 |
+
+ _Tp(0.5L));
|
| 452 |
+
const _Tp __phi_red = __phi
|
| 453 |
+
- __n * __numeric_constants<_Tp>::__pi();
|
| 454 |
+
|
| 455 |
+
const _Tp __kk = __k * __k;
|
| 456 |
+
const _Tp __s = std::sin(__phi_red);
|
| 457 |
+
const _Tp __ss = __s * __s;
|
| 458 |
+
const _Tp __sss = __ss * __s;
|
| 459 |
+
const _Tp __c = std::cos(__phi_red);
|
| 460 |
+
const _Tp __cc = __c * __c;
|
| 461 |
+
|
| 462 |
+
const _Tp __E = __s
|
| 463 |
+
* __ellint_rf(__cc, _Tp(1) - __kk * __ss, _Tp(1))
|
| 464 |
+
- __kk * __sss
|
| 465 |
+
* __ellint_rd(__cc, _Tp(1) - __kk * __ss, _Tp(1))
|
| 466 |
+
/ _Tp(3);
|
| 467 |
+
|
| 468 |
+
if (__n == 0)
|
| 469 |
+
return __E;
|
| 470 |
+
else
|
| 471 |
+
return __E + _Tp(2) * __n * __comp_ellint_2(__k);
|
| 472 |
+
}
|
| 473 |
+
}
|
| 474 |
+
|
| 475 |
+
|
| 476 |
+
/**
|
| 477 |
+
* @brief Return the Carlson elliptic function
|
| 478 |
+
* @f$ R_C(x,y) = R_F(x,y,y) @f$ where @f$ R_F(x,y,z) @f$
|
| 479 |
+
* is the Carlson elliptic function of the first kind.
|
| 480 |
+
*
|
| 481 |
+
* The Carlson elliptic function is defined by:
|
| 482 |
+
* @f[
|
| 483 |
+
* R_C(x,y) = \frac{1}{2} \int_0^\infty
|
| 484 |
+
* \frac{dt}{(t + x)^{1/2}(t + y)}
|
| 485 |
+
* @f]
|
| 486 |
+
*
|
| 487 |
+
* Based on Carlson's algorithms:
|
| 488 |
+
* - B. C. Carlson Numer. Math. 33, 1 (1979)
|
| 489 |
+
* - B. C. Carlson, Special Functions of Applied Mathematics (1977)
|
| 490 |
+
* - Numerical Recipes in C, 2nd ed, pp. 261-269,
|
| 491 |
+
* by Press, Teukolsky, Vetterling, Flannery (1992)
|
| 492 |
+
*
|
| 493 |
+
* @param __x The first argument.
|
| 494 |
+
* @param __y The second argument.
|
| 495 |
+
* @return The Carlson elliptic function.
|
| 496 |
+
*/
|
| 497 |
+
template<typename _Tp>
|
| 498 |
+
_Tp
|
| 499 |
+
__ellint_rc(const _Tp __x, const _Tp __y)
|
| 500 |
+
{
|
| 501 |
+
const _Tp __min = std::numeric_limits<_Tp>::min();
|
| 502 |
+
const _Tp __max = std::numeric_limits<_Tp>::max();
|
| 503 |
+
const _Tp __lolim = _Tp(5) * __min;
|
| 504 |
+
const _Tp __uplim = __max / _Tp(5);
|
| 505 |
+
|
| 506 |
+
if (__x < _Tp(0) || __y < _Tp(0) || __x + __y < __lolim)
|
| 507 |
+
std::__throw_domain_error(__N("Argument less than zero "
|
| 508 |
+
"in __ellint_rc."));
|
| 509 |
+
else
|
| 510 |
+
{
|
| 511 |
+
const _Tp __c0 = _Tp(1) / _Tp(4);
|
| 512 |
+
const _Tp __c1 = _Tp(1) / _Tp(7);
|
| 513 |
+
const _Tp __c2 = _Tp(9) / _Tp(22);
|
| 514 |
+
const _Tp __c3 = _Tp(3) / _Tp(10);
|
| 515 |
+
const _Tp __c4 = _Tp(3) / _Tp(8);
|
| 516 |
+
|
| 517 |
+
_Tp __xn = __x;
|
| 518 |
+
_Tp __yn = __y;
|
| 519 |
+
|
| 520 |
+
const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
|
| 521 |
+
const _Tp __errtol = std::pow(__eps / _Tp(30), _Tp(1) / _Tp(6));
|
| 522 |
+
_Tp __mu;
|
| 523 |
+
_Tp __sn;
|
| 524 |
+
|
| 525 |
+
const unsigned int __max_iter = 100;
|
| 526 |
+
for (unsigned int __iter = 0; __iter < __max_iter; ++__iter)
|
| 527 |
+
{
|
| 528 |
+
__mu = (__xn + _Tp(2) * __yn) / _Tp(3);
|
| 529 |
+
__sn = (__yn + __mu) / __mu - _Tp(2);
|
| 530 |
+
if (std::abs(__sn) < __errtol)
|
| 531 |
+
break;
|
| 532 |
+
const _Tp __lambda = _Tp(2) * std::sqrt(__xn) * std::sqrt(__yn)
|
| 533 |
+
+ __yn;
|
| 534 |
+
__xn = __c0 * (__xn + __lambda);
|
| 535 |
+
__yn = __c0 * (__yn + __lambda);
|
| 536 |
+
}
|
| 537 |
+
|
| 538 |
+
_Tp __s = __sn * __sn
|
| 539 |
+
* (__c3 + __sn*(__c1 + __sn * (__c4 + __sn * __c2)));
|
| 540 |
+
|
| 541 |
+
return (_Tp(1) + __s) / std::sqrt(__mu);
|
| 542 |
+
}
|
| 543 |
+
}
|
| 544 |
+
|
| 545 |
+
|
| 546 |
+
/**
|
| 547 |
+
* @brief Return the Carlson elliptic function @f$ R_J(x,y,z,p) @f$
|
| 548 |
+
* of the third kind.
|
| 549 |
+
*
|
| 550 |
+
* The Carlson elliptic function of the third kind is defined by:
|
| 551 |
+
* @f[
|
| 552 |
+
* R_J(x,y,z,p) = \frac{3}{2} \int_0^\infty
|
| 553 |
+
* \frac{dt}{(t + x)^{1/2}(t + y)^{1/2}(t + z)^{1/2}(t + p)}
|
| 554 |
+
* @f]
|
| 555 |
+
*
|
| 556 |
+
* Based on Carlson's algorithms:
|
| 557 |
+
* - B. C. Carlson Numer. Math. 33, 1 (1979)
|
| 558 |
+
* - B. C. Carlson, Special Functions of Applied Mathematics (1977)
|
| 559 |
+
* - Numerical Recipes in C, 2nd ed, pp. 261-269,
|
| 560 |
+
* by Press, Teukolsky, Vetterling, Flannery (1992)
|
| 561 |
+
*
|
| 562 |
+
* @param __x The first of three symmetric arguments.
|
| 563 |
+
* @param __y The second of three symmetric arguments.
|
| 564 |
+
* @param __z The third of three symmetric arguments.
|
| 565 |
+
* @param __p The fourth argument.
|
| 566 |
+
* @return The Carlson elliptic function of the fourth kind.
|
| 567 |
+
*/
|
| 568 |
+
template<typename _Tp>
|
| 569 |
+
_Tp
|
| 570 |
+
__ellint_rj(const _Tp __x, const _Tp __y, const _Tp __z, const _Tp __p)
|
| 571 |
+
{
|
| 572 |
+
const _Tp __min = std::numeric_limits<_Tp>::min();
|
| 573 |
+
const _Tp __max = std::numeric_limits<_Tp>::max();
|
| 574 |
+
const _Tp __lolim = std::pow(_Tp(5) * __min, _Tp(1)/_Tp(3));
|
| 575 |
+
const _Tp __uplim = _Tp(0.3L)
|
| 576 |
+
* std::pow(_Tp(0.2L) * __max, _Tp(1)/_Tp(3));
|
| 577 |
+
|
| 578 |
+
if (__x < _Tp(0) || __y < _Tp(0) || __z < _Tp(0))
|
| 579 |
+
std::__throw_domain_error(__N("Argument less than zero "
|
| 580 |
+
"in __ellint_rj."));
|
| 581 |
+
else if (__x + __y < __lolim || __x + __z < __lolim
|
| 582 |
+
|| __y + __z < __lolim || __p < __lolim)
|
| 583 |
+
std::__throw_domain_error(__N("Argument too small "
|
| 584 |
+
"in __ellint_rj"));
|
| 585 |
+
else
|
| 586 |
+
{
|
| 587 |
+
const _Tp __c0 = _Tp(1) / _Tp(4);
|
| 588 |
+
const _Tp __c1 = _Tp(3) / _Tp(14);
|
| 589 |
+
const _Tp __c2 = _Tp(1) / _Tp(3);
|
| 590 |
+
const _Tp __c3 = _Tp(3) / _Tp(22);
|
| 591 |
+
const _Tp __c4 = _Tp(3) / _Tp(26);
|
| 592 |
+
|
| 593 |
+
_Tp __xn = __x;
|
| 594 |
+
_Tp __yn = __y;
|
| 595 |
+
_Tp __zn = __z;
|
| 596 |
+
_Tp __pn = __p;
|
| 597 |
+
_Tp __sigma = _Tp(0);
|
| 598 |
+
_Tp __power4 = _Tp(1);
|
| 599 |
+
|
| 600 |
+
const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
|
| 601 |
+
const _Tp __errtol = std::pow(__eps / _Tp(8), _Tp(1) / _Tp(6));
|
| 602 |
+
|
| 603 |
+
_Tp __lambda, __mu;
|
| 604 |
+
_Tp __xndev, __yndev, __zndev, __pndev;
|
| 605 |
+
|
| 606 |
+
const unsigned int __max_iter = 100;
|
| 607 |
+
for (unsigned int __iter = 0; __iter < __max_iter; ++__iter)
|
| 608 |
+
{
|
| 609 |
+
__mu = (__xn + __yn + __zn + _Tp(2) * __pn) / _Tp(5);
|
| 610 |
+
__xndev = (__mu - __xn) / __mu;
|
| 611 |
+
__yndev = (__mu - __yn) / __mu;
|
| 612 |
+
__zndev = (__mu - __zn) / __mu;
|
| 613 |
+
__pndev = (__mu - __pn) / __mu;
|
| 614 |
+
_Tp __epsilon = std::max(std::abs(__xndev), std::abs(__yndev));
|
| 615 |
+
__epsilon = std::max(__epsilon, std::abs(__zndev));
|
| 616 |
+
__epsilon = std::max(__epsilon, std::abs(__pndev));
|
| 617 |
+
if (__epsilon < __errtol)
|
| 618 |
+
break;
|
| 619 |
+
const _Tp __xnroot = std::sqrt(__xn);
|
| 620 |
+
const _Tp __ynroot = std::sqrt(__yn);
|
| 621 |
+
const _Tp __znroot = std::sqrt(__zn);
|
| 622 |
+
const _Tp __lambda = __xnroot * (__ynroot + __znroot)
|
| 623 |
+
+ __ynroot * __znroot;
|
| 624 |
+
const _Tp __alpha1 = __pn * (__xnroot + __ynroot + __znroot)
|
| 625 |
+
+ __xnroot * __ynroot * __znroot;
|
| 626 |
+
const _Tp __alpha2 = __alpha1 * __alpha1;
|
| 627 |
+
const _Tp __beta = __pn * (__pn + __lambda)
|
| 628 |
+
* (__pn + __lambda);
|
| 629 |
+
__sigma += __power4 * __ellint_rc(__alpha2, __beta);
|
| 630 |
+
__power4 *= __c0;
|
| 631 |
+
__xn = __c0 * (__xn + __lambda);
|
| 632 |
+
__yn = __c0 * (__yn + __lambda);
|
| 633 |
+
__zn = __c0 * (__zn + __lambda);
|
| 634 |
+
__pn = __c0 * (__pn + __lambda);
|
| 635 |
+
}
|
| 636 |
+
|
| 637 |
+
_Tp __ea = __xndev * (__yndev + __zndev) + __yndev * __zndev;
|
| 638 |
+
_Tp __eb = __xndev * __yndev * __zndev;
|
| 639 |
+
_Tp __ec = __pndev * __pndev;
|
| 640 |
+
_Tp __e2 = __ea - _Tp(3) * __ec;
|
| 641 |
+
_Tp __e3 = __eb + _Tp(2) * __pndev * (__ea - __ec);
|
| 642 |
+
_Tp __s1 = _Tp(1) + __e2 * (-__c1 + _Tp(3) * __c3 * __e2 / _Tp(4)
|
| 643 |
+
- _Tp(3) * __c4 * __e3 / _Tp(2));
|
| 644 |
+
_Tp __s2 = __eb * (__c2 / _Tp(2)
|
| 645 |
+
+ __pndev * (-__c3 - __c3 + __pndev * __c4));
|
| 646 |
+
_Tp __s3 = __pndev * __ea * (__c2 - __pndev * __c3)
|
| 647 |
+
- __c2 * __pndev * __ec;
|
| 648 |
+
|
| 649 |
+
return _Tp(3) * __sigma + __power4 * (__s1 + __s2 + __s3)
|
| 650 |
+
/ (__mu * std::sqrt(__mu));
|
| 651 |
+
}
|
| 652 |
+
}
|
| 653 |
+
|
| 654 |
+
|
| 655 |
+
/**
|
| 656 |
+
* @brief Return the complete elliptic integral of the third kind
|
| 657 |
+
* @f$ \Pi(k,\nu) = \Pi(k,\nu,\pi/2) @f$ using the
|
| 658 |
+
* Carlson formulation.
|
| 659 |
+
*
|
| 660 |
+
* The complete elliptic integral of the third kind is defined as
|
| 661 |
+
* @f[
|
| 662 |
+
* \Pi(k,\nu) = \int_0^{\pi/2}
|
| 663 |
+
* \frac{d\theta}
|
| 664 |
+
* {(1 - \nu \sin^2\theta)\sqrt{1 - k^2 \sin^2\theta}}
|
| 665 |
+
* @f]
|
| 666 |
+
*
|
| 667 |
+
* @param __k The argument of the elliptic function.
|
| 668 |
+
* @param __nu The second argument of the elliptic function.
|
| 669 |
+
* @return The complete elliptic function of the third kind.
|
| 670 |
+
*/
|
| 671 |
+
template<typename _Tp>
|
| 672 |
+
_Tp
|
| 673 |
+
__comp_ellint_3(const _Tp __k, const _Tp __nu)
|
| 674 |
+
{
|
| 675 |
+
|
| 676 |
+
if (__isnan(__k) || __isnan(__nu))
|
| 677 |
+
return std::numeric_limits<_Tp>::quiet_NaN();
|
| 678 |
+
else if (__nu == _Tp(1))
|
| 679 |
+
return std::numeric_limits<_Tp>::infinity();
|
| 680 |
+
else if (std::abs(__k) > _Tp(1))
|
| 681 |
+
std::__throw_domain_error(__N("Bad argument in __comp_ellint_3."));
|
| 682 |
+
else
|
| 683 |
+
{
|
| 684 |
+
const _Tp __kk = __k * __k;
|
| 685 |
+
|
| 686 |
+
return __ellint_rf(_Tp(0), _Tp(1) - __kk, _Tp(1))
|
| 687 |
+
- __nu
|
| 688 |
+
* __ellint_rj(_Tp(0), _Tp(1) - __kk, _Tp(1), _Tp(1) + __nu)
|
| 689 |
+
/ _Tp(3);
|
| 690 |
+
}
|
| 691 |
+
}
|
| 692 |
+
|
| 693 |
+
|
| 694 |
+
/**
|
| 695 |
+
* @brief Return the incomplete elliptic integral of the third kind
|
| 696 |
+
* @f$ \Pi(k,\nu,\phi) @f$ using the Carlson formulation.
|
| 697 |
+
*
|
| 698 |
+
* The incomplete elliptic integral of the third kind is defined as
|
| 699 |
+
* @f[
|
| 700 |
+
* \Pi(k,\nu,\phi) = \int_0^{\phi}
|
| 701 |
+
* \frac{d\theta}
|
| 702 |
+
* {(1 - \nu \sin^2\theta)
|
| 703 |
+
* \sqrt{1 - k^2 \sin^2\theta}}
|
| 704 |
+
* @f]
|
| 705 |
+
*
|
| 706 |
+
* @param __k The argument of the elliptic function.
|
| 707 |
+
* @param __nu The second argument of the elliptic function.
|
| 708 |
+
* @param __phi The integral limit argument of the elliptic function.
|
| 709 |
+
* @return The elliptic function of the third kind.
|
| 710 |
+
*/
|
| 711 |
+
template<typename _Tp>
|
| 712 |
+
_Tp
|
| 713 |
+
__ellint_3(const _Tp __k, const _Tp __nu, const _Tp __phi)
|
| 714 |
+
{
|
| 715 |
+
|
| 716 |
+
if (__isnan(__k) || __isnan(__nu) || __isnan(__phi))
|
| 717 |
+
return std::numeric_limits<_Tp>::quiet_NaN();
|
| 718 |
+
else if (std::abs(__k) > _Tp(1))
|
| 719 |
+
std::__throw_domain_error(__N("Bad argument in __ellint_3."));
|
| 720 |
+
else
|
| 721 |
+
{
|
| 722 |
+
// Reduce phi to -pi/2 < phi < +pi/2.
|
| 723 |
+
const int __n = std::floor(__phi / __numeric_constants<_Tp>::__pi()
|
| 724 |
+
+ _Tp(0.5L));
|
| 725 |
+
const _Tp __phi_red = __phi
|
| 726 |
+
- __n * __numeric_constants<_Tp>::__pi();
|
| 727 |
+
|
| 728 |
+
const _Tp __kk = __k * __k;
|
| 729 |
+
const _Tp __s = std::sin(__phi_red);
|
| 730 |
+
const _Tp __ss = __s * __s;
|
| 731 |
+
const _Tp __sss = __ss * __s;
|
| 732 |
+
const _Tp __c = std::cos(__phi_red);
|
| 733 |
+
const _Tp __cc = __c * __c;
|
| 734 |
+
|
| 735 |
+
const _Tp __Pi = __s
|
| 736 |
+
* __ellint_rf(__cc, _Tp(1) - __kk * __ss, _Tp(1))
|
| 737 |
+
- __nu * __sss
|
| 738 |
+
* __ellint_rj(__cc, _Tp(1) - __kk * __ss, _Tp(1),
|
| 739 |
+
_Tp(1) + __nu * __ss) / _Tp(3);
|
| 740 |
+
|
| 741 |
+
if (__n == 0)
|
| 742 |
+
return __Pi;
|
| 743 |
+
else
|
| 744 |
+
return __Pi + _Tp(2) * __n * __comp_ellint_3(__k, __nu);
|
| 745 |
+
}
|
| 746 |
+
}
|
| 747 |
+
|
| 748 |
+
} // namespace std::tr1::__detail
|
| 749 |
+
}
|
| 750 |
+
}
|
| 751 |
+
|
| 752 |
+
#endif // _GLIBCXX_TR1_ELL_INTEGRAL_TCC
|
| 753 |
+
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/inttypes.h
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// TR1 inttypes.h -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2006, 2007 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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
|
| 7 |
+
// terms of the GNU General Public License as published by the
|
| 8 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 9 |
+
// any later version.
|
| 10 |
+
|
| 11 |
+
// This library is distributed in the hope that it will be useful,
|
| 12 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 13 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 14 |
+
// GNU General Public License for more details.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License along
|
| 17 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 18 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 19 |
+
// USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free software
|
| 22 |
+
// library without restriction. Specifically, if other files instantiate
|
| 23 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 24 |
+
// this file and link it with other files to produce an executable, this
|
| 25 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 26 |
+
// the GNU General Public License. This exception does not however
|
| 27 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 28 |
+
// the GNU General Public License.
|
| 29 |
+
|
| 30 |
+
/** @file tr1/inttypes.h
|
| 31 |
+
* This is a TR1 C++ Library header.
|
| 32 |
+
*/
|
| 33 |
+
|
| 34 |
+
#ifndef _GLIBCXX_TR1_INTTYPES_H
|
| 35 |
+
#define _GLIBCXX_TR1_INTTYPES_H 1
|
| 36 |
+
|
| 37 |
+
#include <tr1/cinttypes>
|
| 38 |
+
|
| 39 |
+
#endif // _GLIBCXX_TR1_INTTYPES_H
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/legendre_function.tcc
ADDED
|
@@ -0,0 +1,310 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Special functions -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2006, 2007, 2008
|
| 4 |
+
// Free Software Foundation, Inc.
|
| 5 |
+
//
|
| 6 |
+
// This file is part of the GNU ISO C++ Library. This library is free
|
| 7 |
+
// software; you can redistribute it and/or modify it under the
|
| 8 |
+
// terms of the GNU General Public License as published by the
|
| 9 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 10 |
+
// any later version.
|
| 11 |
+
//
|
| 12 |
+
// This library is distributed in the hope that it will be useful,
|
| 13 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
// GNU General Public License for more details.
|
| 16 |
+
//
|
| 17 |
+
// You should have received a copy of the GNU General Public License along
|
| 18 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 19 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 20 |
+
// USA.
|
| 21 |
+
//
|
| 22 |
+
// As a special exception, you may use this file as part of a free software
|
| 23 |
+
// library without restriction. Specifically, if other files instantiate
|
| 24 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 25 |
+
// this file and link it with other files to produce an executable, this
|
| 26 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 27 |
+
// the GNU General Public License. This exception does not however
|
| 28 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 29 |
+
// the GNU General Public License.
|
| 30 |
+
|
| 31 |
+
/** @file tr1/legendre_function.tcc
|
| 32 |
+
* This is an internal header file, included by other library headers.
|
| 33 |
+
* You should not attempt to use it directly.
|
| 34 |
+
*/
|
| 35 |
+
|
| 36 |
+
//
|
| 37 |
+
// ISO C++ 14882 TR1: 5.2 Special functions
|
| 38 |
+
//
|
| 39 |
+
|
| 40 |
+
// Written by Edward Smith-Rowland based on:
|
| 41 |
+
// (1) Handbook of Mathematical Functions,
|
| 42 |
+
// ed. Milton Abramowitz and Irene A. Stegun,
|
| 43 |
+
// Dover Publications,
|
| 44 |
+
// Section 8, pp. 331-341
|
| 45 |
+
// (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl
|
| 46 |
+
// (3) Numerical Recipes in C, by W. H. Press, S. A. Teukolsky,
|
| 47 |
+
// W. T. Vetterling, B. P. Flannery, Cambridge University Press (1992),
|
| 48 |
+
// 2nd ed, pp. 252-254
|
| 49 |
+
|
| 50 |
+
#ifndef _GLIBCXX_TR1_LEGENDRE_FUNCTION_TCC
|
| 51 |
+
#define _GLIBCXX_TR1_LEGENDRE_FUNCTION_TCC 1
|
| 52 |
+
|
| 53 |
+
#include "special_function_util.h"
|
| 54 |
+
|
| 55 |
+
namespace std
|
| 56 |
+
{
|
| 57 |
+
namespace tr1
|
| 58 |
+
{
|
| 59 |
+
|
| 60 |
+
// [5.2] Special functions
|
| 61 |
+
|
| 62 |
+
// Implementation-space details.
|
| 63 |
+
namespace __detail
|
| 64 |
+
{
|
| 65 |
+
|
| 66 |
+
/**
|
| 67 |
+
* @brief Return the Legendre polynomial by recursion on order
|
| 68 |
+
* @f$ l @f$.
|
| 69 |
+
*
|
| 70 |
+
* The Legendre function of @f$ l @f$ and @f$ x @f$,
|
| 71 |
+
* @f$ P_l(x) @f$, is defined by:
|
| 72 |
+
* @f[
|
| 73 |
+
* P_l(x) = \frac{1}{2^l l!}\frac{d^l}{dx^l}(x^2 - 1)^{l}
|
| 74 |
+
* @f]
|
| 75 |
+
*
|
| 76 |
+
* @param l The order of the Legendre polynomial. @f$l >= 0@f$.
|
| 77 |
+
* @param x The argument of the Legendre polynomial. @f$|x| <= 1@f$.
|
| 78 |
+
*/
|
| 79 |
+
template<typename _Tp>
|
| 80 |
+
_Tp
|
| 81 |
+
__poly_legendre_p(const unsigned int __l, const _Tp __x)
|
| 82 |
+
{
|
| 83 |
+
|
| 84 |
+
if ((__x < _Tp(-1)) || (__x > _Tp(+1)))
|
| 85 |
+
std::__throw_domain_error(__N("Argument out of range"
|
| 86 |
+
" in __poly_legendre_p."));
|
| 87 |
+
else if (__isnan(__x))
|
| 88 |
+
return std::numeric_limits<_Tp>::quiet_NaN();
|
| 89 |
+
else if (__x == +_Tp(1))
|
| 90 |
+
return +_Tp(1);
|
| 91 |
+
else if (__x == -_Tp(1))
|
| 92 |
+
return (__l % 2 == 1 ? -_Tp(1) : +_Tp(1));
|
| 93 |
+
else
|
| 94 |
+
{
|
| 95 |
+
_Tp __p_lm2 = _Tp(1);
|
| 96 |
+
if (__l == 0)
|
| 97 |
+
return __p_lm2;
|
| 98 |
+
|
| 99 |
+
_Tp __p_lm1 = __x;
|
| 100 |
+
if (__l == 1)
|
| 101 |
+
return __p_lm1;
|
| 102 |
+
|
| 103 |
+
_Tp __p_l = 0;
|
| 104 |
+
for (unsigned int __ll = 2; __ll <= __l; ++__ll)
|
| 105 |
+
{
|
| 106 |
+
// This arrangement is supposed to be better for roundoff
|
| 107 |
+
// protection, Arfken, 2nd Ed, Eq 12.17a.
|
| 108 |
+
__p_l = _Tp(2) * __x * __p_lm1 - __p_lm2
|
| 109 |
+
- (__x * __p_lm1 - __p_lm2) / _Tp(__ll);
|
| 110 |
+
__p_lm2 = __p_lm1;
|
| 111 |
+
__p_lm1 = __p_l;
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
+
return __p_l;
|
| 115 |
+
}
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
|
| 119 |
+
/**
|
| 120 |
+
* @brief Return the associated Legendre function by recursion
|
| 121 |
+
* on @f$ l @f$.
|
| 122 |
+
*
|
| 123 |
+
* The associated Legendre function is derived from the Legendre function
|
| 124 |
+
* @f$ P_l(x) @f$ by the Rodrigues formula:
|
| 125 |
+
* @f[
|
| 126 |
+
* P_l^m(x) = (1 - x^2)^{m/2}\frac{d^m}{dx^m}P_l(x)
|
| 127 |
+
* @f]
|
| 128 |
+
*
|
| 129 |
+
* @param l The order of the associated Legendre function.
|
| 130 |
+
* @f$ l >= 0 @f$.
|
| 131 |
+
* @param m The order of the associated Legendre function.
|
| 132 |
+
* @f$ m <= l @f$.
|
| 133 |
+
* @param x The argument of the associated Legendre function.
|
| 134 |
+
* @f$ |x| <= 1 @f$.
|
| 135 |
+
*/
|
| 136 |
+
template<typename _Tp>
|
| 137 |
+
_Tp
|
| 138 |
+
__assoc_legendre_p(const unsigned int __l, const unsigned int __m,
|
| 139 |
+
const _Tp __x)
|
| 140 |
+
{
|
| 141 |
+
|
| 142 |
+
if (__x < _Tp(-1) || __x > _Tp(+1))
|
| 143 |
+
std::__throw_domain_error(__N("Argument out of range"
|
| 144 |
+
" in __assoc_legendre_p."));
|
| 145 |
+
else if (__m > __l)
|
| 146 |
+
std::__throw_domain_error(__N("Degree out of range"
|
| 147 |
+
" in __assoc_legendre_p."));
|
| 148 |
+
else if (__isnan(__x))
|
| 149 |
+
return std::numeric_limits<_Tp>::quiet_NaN();
|
| 150 |
+
else if (__m == 0)
|
| 151 |
+
return __poly_legendre_p(__l, __x);
|
| 152 |
+
else
|
| 153 |
+
{
|
| 154 |
+
_Tp __p_mm = _Tp(1);
|
| 155 |
+
if (__m > 0)
|
| 156 |
+
{
|
| 157 |
+
// Two square roots seem more accurate more of the time
|
| 158 |
+
// than just one.
|
| 159 |
+
_Tp __root = std::sqrt(_Tp(1) - __x) * std::sqrt(_Tp(1) + __x);
|
| 160 |
+
_Tp __fact = _Tp(1);
|
| 161 |
+
for (unsigned int __i = 1; __i <= __m; ++__i)
|
| 162 |
+
{
|
| 163 |
+
__p_mm *= -__fact * __root;
|
| 164 |
+
__fact += _Tp(2);
|
| 165 |
+
}
|
| 166 |
+
}
|
| 167 |
+
if (__l == __m)
|
| 168 |
+
return __p_mm;
|
| 169 |
+
|
| 170 |
+
_Tp __p_mp1m = _Tp(2 * __m + 1) * __x * __p_mm;
|
| 171 |
+
if (__l == __m + 1)
|
| 172 |
+
return __p_mp1m;
|
| 173 |
+
|
| 174 |
+
_Tp __p_lm2m = __p_mm;
|
| 175 |
+
_Tp __P_lm1m = __p_mp1m;
|
| 176 |
+
_Tp __p_lm = _Tp(0);
|
| 177 |
+
for (unsigned int __j = __m + 2; __j <= __l; ++__j)
|
| 178 |
+
{
|
| 179 |
+
__p_lm = (_Tp(2 * __j - 1) * __x * __P_lm1m
|
| 180 |
+
- _Tp(__j + __m - 1) * __p_lm2m) / _Tp(__j - __m);
|
| 181 |
+
__p_lm2m = __P_lm1m;
|
| 182 |
+
__P_lm1m = __p_lm;
|
| 183 |
+
}
|
| 184 |
+
|
| 185 |
+
return __p_lm;
|
| 186 |
+
}
|
| 187 |
+
}
|
| 188 |
+
|
| 189 |
+
|
| 190 |
+
/**
|
| 191 |
+
* @brief Return the spherical associated Legendre function.
|
| 192 |
+
*
|
| 193 |
+
* The spherical associated Legendre function of @f$ l @f$, @f$ m @f$,
|
| 194 |
+
* and @f$ \theta @f$ is defined as @f$ Y_l^m(\theta,0) @f$ where
|
| 195 |
+
* @f[
|
| 196 |
+
* Y_l^m(\theta,\phi) = (-1)^m[\frac{(2l+1)}{4\pi}
|
| 197 |
+
* \frac{(l-m)!}{(l+m)!}]
|
| 198 |
+
* P_l^m(\cos\theta) \exp^{im\phi}
|
| 199 |
+
* @f]
|
| 200 |
+
* is the spherical harmonic function and @f$ P_l^m(x) @f$ is the
|
| 201 |
+
* associated Legendre function.
|
| 202 |
+
*
|
| 203 |
+
* This function differs from the associated Legendre function by
|
| 204 |
+
* argument (@f$x = \cos(\theta)@f$) and by a normalization factor
|
| 205 |
+
* but this factor is rather large for large @f$ l @f$ and @f$ m @f$
|
| 206 |
+
* and so this function is stable for larger differences of @f$ l @f$
|
| 207 |
+
* and @f$ m @f$.
|
| 208 |
+
*
|
| 209 |
+
* @param l The order of the spherical associated Legendre function.
|
| 210 |
+
* @f$ l >= 0 @f$.
|
| 211 |
+
* @param m The order of the spherical associated Legendre function.
|
| 212 |
+
* @f$ m <= l @f$.
|
| 213 |
+
* @param theta The radian angle argument of the spherical associated
|
| 214 |
+
* Legendre function.
|
| 215 |
+
*/
|
| 216 |
+
template <typename _Tp>
|
| 217 |
+
_Tp
|
| 218 |
+
__sph_legendre(const unsigned int __l, const unsigned int __m,
|
| 219 |
+
const _Tp __theta)
|
| 220 |
+
{
|
| 221 |
+
if (__isnan(__theta))
|
| 222 |
+
return std::numeric_limits<_Tp>::quiet_NaN();
|
| 223 |
+
|
| 224 |
+
const _Tp __x = std::cos(__theta);
|
| 225 |
+
|
| 226 |
+
if (__l < __m)
|
| 227 |
+
{
|
| 228 |
+
std::__throw_domain_error(__N("Bad argument "
|
| 229 |
+
"in __sph_legendre."));
|
| 230 |
+
}
|
| 231 |
+
else if (__m == 0)
|
| 232 |
+
{
|
| 233 |
+
_Tp __P = __poly_legendre_p(__l, __x);
|
| 234 |
+
_Tp __fact = std::sqrt(_Tp(2 * __l + 1)
|
| 235 |
+
/ (_Tp(4) * __numeric_constants<_Tp>::__pi()));
|
| 236 |
+
__P *= __fact;
|
| 237 |
+
return __P;
|
| 238 |
+
}
|
| 239 |
+
else if (__x == _Tp(1) || __x == -_Tp(1))
|
| 240 |
+
{
|
| 241 |
+
// m > 0 here
|
| 242 |
+
return _Tp(0);
|
| 243 |
+
}
|
| 244 |
+
else
|
| 245 |
+
{
|
| 246 |
+
// m > 0 and |x| < 1 here
|
| 247 |
+
|
| 248 |
+
// Starting value for recursion.
|
| 249 |
+
// Y_m^m(x) = sqrt( (2m+1)/(4pi m) gamma(m+1/2)/gamma(m) )
|
| 250 |
+
// (-1)^m (1-x^2)^(m/2) / pi^(1/4)
|
| 251 |
+
const _Tp __sgn = ( __m % 2 == 1 ? -_Tp(1) : _Tp(1));
|
| 252 |
+
const _Tp __y_mp1m_factor = __x * std::sqrt(_Tp(2 * __m + 3));
|
| 253 |
+
#if _GLIBCXX_USE_C99_MATH_TR1
|
| 254 |
+
const _Tp __lncirc = std::tr1::log1p(-__x * __x);
|
| 255 |
+
#else
|
| 256 |
+
const _Tp __lncirc = std::log(_Tp(1) - __x * __x);
|
| 257 |
+
#endif
|
| 258 |
+
// Gamma(m+1/2) / Gamma(m)
|
| 259 |
+
#if _GLIBCXX_USE_C99_MATH_TR1
|
| 260 |
+
const _Tp __lnpoch = std::tr1::lgamma(_Tp(__m + _Tp(0.5L)))
|
| 261 |
+
- std::tr1::lgamma(_Tp(__m));
|
| 262 |
+
#else
|
| 263 |
+
const _Tp __lnpoch = __log_gamma(_Tp(__m + _Tp(0.5L)))
|
| 264 |
+
- __log_gamma(_Tp(__m));
|
| 265 |
+
#endif
|
| 266 |
+
const _Tp __lnpre_val =
|
| 267 |
+
-_Tp(0.25L) * __numeric_constants<_Tp>::__lnpi()
|
| 268 |
+
+ _Tp(0.5L) * (__lnpoch + __m * __lncirc);
|
| 269 |
+
_Tp __sr = std::sqrt((_Tp(2) + _Tp(1) / __m)
|
| 270 |
+
/ (_Tp(4) * __numeric_constants<_Tp>::__pi()));
|
| 271 |
+
_Tp __y_mm = __sgn * __sr * std::exp(__lnpre_val);
|
| 272 |
+
_Tp __y_mp1m = __y_mp1m_factor * __y_mm;
|
| 273 |
+
|
| 274 |
+
if (__l == __m)
|
| 275 |
+
{
|
| 276 |
+
return __y_mm;
|
| 277 |
+
}
|
| 278 |
+
else if (__l == __m + 1)
|
| 279 |
+
{
|
| 280 |
+
return __y_mp1m;
|
| 281 |
+
}
|
| 282 |
+
else
|
| 283 |
+
{
|
| 284 |
+
_Tp __y_lm = _Tp(0);
|
| 285 |
+
|
| 286 |
+
// Compute Y_l^m, l > m+1, upward recursion on l.
|
| 287 |
+
for ( int __ll = __m + 2; __ll <= __l; ++__ll)
|
| 288 |
+
{
|
| 289 |
+
const _Tp __rat1 = _Tp(__ll - __m) / _Tp(__ll + __m);
|
| 290 |
+
const _Tp __rat2 = _Tp(__ll - __m - 1) / _Tp(__ll + __m - 1);
|
| 291 |
+
const _Tp __fact1 = std::sqrt(__rat1 * _Tp(2 * __ll + 1)
|
| 292 |
+
* _Tp(2 * __ll - 1));
|
| 293 |
+
const _Tp __fact2 = std::sqrt(__rat1 * __rat2 * _Tp(2 * __ll + 1)
|
| 294 |
+
/ _Tp(2 * __ll - 3));
|
| 295 |
+
__y_lm = (__x * __y_mp1m * __fact1
|
| 296 |
+
- (__ll + __m - 1) * __y_mm * __fact2) / _Tp(__ll - __m);
|
| 297 |
+
__y_mm = __y_mp1m;
|
| 298 |
+
__y_mp1m = __y_lm;
|
| 299 |
+
}
|
| 300 |
+
|
| 301 |
+
return __y_lm;
|
| 302 |
+
}
|
| 303 |
+
}
|
| 304 |
+
}
|
| 305 |
+
|
| 306 |
+
} // namespace std::tr1::__detail
|
| 307 |
+
}
|
| 308 |
+
}
|
| 309 |
+
|
| 310 |
+
#endif // _GLIBCXX_TR1_LEGENDRE_FUNCTION_TCC
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/limits.h
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// TR1 limits.h -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2006 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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
|
| 7 |
+
// terms of the GNU General Public License as published by the
|
| 8 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 9 |
+
// any later version.
|
| 10 |
+
|
| 11 |
+
// This library is distributed in the hope that it will be useful,
|
| 12 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 13 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 14 |
+
// GNU General Public License for more details.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License along
|
| 17 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 18 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 19 |
+
// USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free software
|
| 22 |
+
// library without restriction. Specifically, if other files instantiate
|
| 23 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 24 |
+
// this file and link it with other files to produce an executable, this
|
| 25 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 26 |
+
// the GNU General Public License. This exception does not however
|
| 27 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 28 |
+
// the GNU General Public License.
|
| 29 |
+
|
| 30 |
+
/** @file tr1/limits.h
|
| 31 |
+
* This is a TR1 C++ Library header.
|
| 32 |
+
*/
|
| 33 |
+
|
| 34 |
+
#if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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// TR1 math.h -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2006, 2007 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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
|
| 7 |
+
// terms of the GNU General Public License as published by the
|
| 8 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 9 |
+
// any later version.
|
| 10 |
+
|
| 11 |
+
// This library is distributed in the hope that it will be useful,
|
| 12 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 13 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 14 |
+
// GNU General Public License for more details.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License along
|
| 17 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 18 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 19 |
+
// USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free software
|
| 22 |
+
// library without restriction. Specifically, if other files instantiate
|
| 23 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 24 |
+
// this file and link it with other files to produce an executable, this
|
| 25 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 26 |
+
// the GNU General Public License. This exception does not however
|
| 27 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 28 |
+
// the GNU General Public License.
|
| 29 |
+
|
| 30 |
+
/** @file tr1/math.h
|
| 31 |
+
* This is a TR1 C++ Library header.
|
| 32 |
+
*/
|
| 33 |
+
|
| 34 |
+
#ifndef _GLIBCXX_TR1_MATH_H
|
| 35 |
+
#define _GLIBCXX_TR1_MATH_H 1
|
| 36 |
+
|
| 37 |
+
#include <tr1/cmath>
|
| 38 |
+
|
| 39 |
+
#if _GLIBCXX_USE_C99_MATH_TR1
|
| 40 |
+
|
| 41 |
+
using std::tr1::acos;
|
| 42 |
+
using std::tr1::acosh;
|
| 43 |
+
using std::tr1::asin;
|
| 44 |
+
using std::tr1::asinh;
|
| 45 |
+
using std::tr1::atan;
|
| 46 |
+
using std::tr1::atan2;
|
| 47 |
+
using std::tr1::atanh;
|
| 48 |
+
using std::tr1::cbrt;
|
| 49 |
+
using std::tr1::ceil;
|
| 50 |
+
using std::tr1::copysign;
|
| 51 |
+
using std::tr1::cos;
|
| 52 |
+
using std::tr1::cosh;
|
| 53 |
+
using std::tr1::erf;
|
| 54 |
+
using std::tr1::erfc;
|
| 55 |
+
using std::tr1::exp;
|
| 56 |
+
using std::tr1::exp2;
|
| 57 |
+
using std::tr1::expm1;
|
| 58 |
+
using std::tr1::fabs;
|
| 59 |
+
using std::tr1::fdim;
|
| 60 |
+
using std::tr1::floor;
|
| 61 |
+
using std::tr1::fma;
|
| 62 |
+
using std::tr1::fmax;
|
| 63 |
+
using std::tr1::fmin;
|
| 64 |
+
using std::tr1::fmod;
|
| 65 |
+
using std::tr1::frexp;
|
| 66 |
+
using std::tr1::hypot;
|
| 67 |
+
using std::tr1::ilogb;
|
| 68 |
+
using std::tr1::ldexp;
|
| 69 |
+
using std::tr1::lgamma;
|
| 70 |
+
using std::tr1::llrint;
|
| 71 |
+
using std::tr1::llround;
|
| 72 |
+
using std::tr1::log;
|
| 73 |
+
using std::tr1::log10;
|
| 74 |
+
using std::tr1::log1p;
|
| 75 |
+
using std::tr1::log2;
|
| 76 |
+
using std::tr1::logb;
|
| 77 |
+
using std::tr1::lrint;
|
| 78 |
+
using std::tr1::lround;
|
| 79 |
+
using std::tr1::nearbyint;
|
| 80 |
+
using std::tr1::nextafter;
|
| 81 |
+
using std::tr1::nexttoward;
|
| 82 |
+
using std::tr1::pow;
|
| 83 |
+
using std::tr1::remainder;
|
| 84 |
+
using std::tr1::remquo;
|
| 85 |
+
using std::tr1::rint;
|
| 86 |
+
using std::tr1::round;
|
| 87 |
+
using std::tr1::scalbln;
|
| 88 |
+
using std::tr1::scalbn;
|
| 89 |
+
using std::tr1::sin;
|
| 90 |
+
using std::tr1::sinh;
|
| 91 |
+
using std::tr1::sqrt;
|
| 92 |
+
using std::tr1::tan;
|
| 93 |
+
using std::tr1::tanh;
|
| 94 |
+
using std::tr1::tgamma;
|
| 95 |
+
using std::tr1::trunc;
|
| 96 |
+
|
| 97 |
+
#endif
|
| 98 |
+
|
| 99 |
+
using std::tr1::assoc_laguerref;
|
| 100 |
+
using std::tr1::assoc_laguerre;
|
| 101 |
+
using std::tr1::assoc_laguerrel;
|
| 102 |
+
|
| 103 |
+
using std::tr1::assoc_legendref;
|
| 104 |
+
using std::tr1::assoc_legendre;
|
| 105 |
+
using std::tr1::assoc_legendrel;
|
| 106 |
+
|
| 107 |
+
using std::tr1::betaf;
|
| 108 |
+
using std::tr1::beta;
|
| 109 |
+
using std::tr1::betal;
|
| 110 |
+
|
| 111 |
+
using std::tr1::comp_ellint_1f;
|
| 112 |
+
using std::tr1::comp_ellint_1;
|
| 113 |
+
using std::tr1::comp_ellint_1l;
|
| 114 |
+
|
| 115 |
+
using std::tr1::comp_ellint_2f;
|
| 116 |
+
using std::tr1::comp_ellint_2;
|
| 117 |
+
using std::tr1::comp_ellint_2l;
|
| 118 |
+
|
| 119 |
+
using std::tr1::comp_ellint_3f;
|
| 120 |
+
using std::tr1::comp_ellint_3;
|
| 121 |
+
using std::tr1::comp_ellint_3l;
|
| 122 |
+
|
| 123 |
+
using std::tr1::conf_hypergf;
|
| 124 |
+
using std::tr1::conf_hyperg;
|
| 125 |
+
using std::tr1::conf_hypergl;
|
| 126 |
+
|
| 127 |
+
using std::tr1::cyl_bessel_if;
|
| 128 |
+
using std::tr1::cyl_bessel_i;
|
| 129 |
+
using std::tr1::cyl_bessel_il;
|
| 130 |
+
|
| 131 |
+
using std::tr1::cyl_bessel_jf;
|
| 132 |
+
using std::tr1::cyl_bessel_j;
|
| 133 |
+
using std::tr1::cyl_bessel_jl;
|
| 134 |
+
|
| 135 |
+
using std::tr1::cyl_bessel_kf;
|
| 136 |
+
using std::tr1::cyl_bessel_k;
|
| 137 |
+
using std::tr1::cyl_bessel_kl;
|
| 138 |
+
|
| 139 |
+
using std::tr1::cyl_neumannf;
|
| 140 |
+
using std::tr1::cyl_neumann;
|
| 141 |
+
using std::tr1::cyl_neumannl;
|
| 142 |
+
|
| 143 |
+
using std::tr1::ellint_1f;
|
| 144 |
+
using std::tr1::ellint_1;
|
| 145 |
+
using std::tr1::ellint_1l;
|
| 146 |
+
|
| 147 |
+
using std::tr1::ellint_2f;
|
| 148 |
+
using std::tr1::ellint_2;
|
| 149 |
+
using std::tr1::ellint_2l;
|
| 150 |
+
|
| 151 |
+
using std::tr1::ellint_3f;
|
| 152 |
+
using std::tr1::ellint_3;
|
| 153 |
+
using std::tr1::ellint_3l;
|
| 154 |
+
|
| 155 |
+
using std::tr1::expintf;
|
| 156 |
+
using std::tr1::expint;
|
| 157 |
+
using std::tr1::expintl;
|
| 158 |
+
|
| 159 |
+
using std::tr1::hermitef;
|
| 160 |
+
using std::tr1::hermite;
|
| 161 |
+
using std::tr1::hermitel;
|
| 162 |
+
|
| 163 |
+
using std::tr1::hypergf;
|
| 164 |
+
using std::tr1::hyperg;
|
| 165 |
+
using std::tr1::hypergl;
|
| 166 |
+
|
| 167 |
+
using std::tr1::laguerref;
|
| 168 |
+
using std::tr1::laguerre;
|
| 169 |
+
using std::tr1::laguerrel;
|
| 170 |
+
|
| 171 |
+
using std::tr1::legendref;
|
| 172 |
+
using std::tr1::legendre;
|
| 173 |
+
using std::tr1::legendrel;
|
| 174 |
+
|
| 175 |
+
using std::tr1::riemann_zetaf;
|
| 176 |
+
using std::tr1::riemann_zeta;
|
| 177 |
+
using std::tr1::riemann_zetal;
|
| 178 |
+
|
| 179 |
+
using std::tr1::sph_besself;
|
| 180 |
+
using std::tr1::sph_bessel;
|
| 181 |
+
using std::tr1::sph_bessell;
|
| 182 |
+
|
| 183 |
+
using std::tr1::sph_legendref;
|
| 184 |
+
using std::tr1::sph_legendre;
|
| 185 |
+
using std::tr1::sph_legendrel;
|
| 186 |
+
|
| 187 |
+
using std::tr1::sph_neumannf;
|
| 188 |
+
using std::tr1::sph_neumann;
|
| 189 |
+
using std::tr1::sph_neumannl;
|
| 190 |
+
|
| 191 |
+
#endif // _GLIBCXX_TR1_MATH_H
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/memory
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// <tr1/memory> -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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
|
| 7 |
+
// terms of the GNU General Public License as published by the
|
| 8 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 9 |
+
// any later version.
|
| 10 |
+
|
| 11 |
+
// This library is distributed in the hope that it will be useful,
|
| 12 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 13 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 14 |
+
// GNU General Public License for more details.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License along
|
| 17 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 18 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 19 |
+
// USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free software
|
| 22 |
+
// library without restriction. Specifically, if other files instantiate
|
| 23 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 24 |
+
// this file and link it with other files to produce an executable, this
|
| 25 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 26 |
+
// the GNU General Public License. This exception does not however
|
| 27 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 28 |
+
// the GNU General Public License.
|
| 29 |
+
|
| 30 |
+
/**
|
| 31 |
+
* @file tr1/memory
|
| 32 |
+
* This is a TR1 C++ Library header.
|
| 33 |
+
*/
|
| 34 |
+
|
| 35 |
+
#ifndef _GLIBCXX_TR1_MEMORY
|
| 36 |
+
#define _GLIBCXX_TR1_MEMORY 1
|
| 37 |
+
|
| 38 |
+
#pragma GCC system_header
|
| 39 |
+
|
| 40 |
+
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
| 41 |
+
# error TR1 header cannot be included from C++0x header
|
| 42 |
+
#endif
|
| 43 |
+
|
| 44 |
+
#include <memory>
|
| 45 |
+
#include <exception> // std::exception
|
| 46 |
+
#include <typeinfo> // std::type_info in get_deleter
|
| 47 |
+
#include <bits/stl_algobase.h> // std::swap
|
| 48 |
+
#include <iosfwd> // std::basic_ostream
|
| 49 |
+
#include <ext/atomicity.h>
|
| 50 |
+
#include <ext/concurrence.h>
|
| 51 |
+
#include <bits/functexcept.h>
|
| 52 |
+
#include <bits/stl_function.h> // std::less
|
| 53 |
+
#include <debug/debug.h>
|
| 54 |
+
#include <tr1/type_traits>
|
| 55 |
+
|
| 56 |
+
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
| 57 |
+
# include <tr1_impl/boost_sp_counted_base.h>
|
| 58 |
+
# include <tr1/boost_sp_shared_count.h>
|
| 59 |
+
# include <tr1_impl/boost_shared_ptr.h>
|
| 60 |
+
#else
|
| 61 |
+
# define _GLIBCXX_INCLUDE_AS_TR1
|
| 62 |
+
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
|
| 63 |
+
# define _GLIBCXX_END_NAMESPACE_TR1 }
|
| 64 |
+
# define _GLIBCXX_TR1 tr1::
|
| 65 |
+
# include <tr1_impl/boost_sp_counted_base.h>
|
| 66 |
+
# include <tr1/boost_sp_shared_count.h>
|
| 67 |
+
# include <tr1_impl/boost_shared_ptr.h>
|
| 68 |
+
# undef _GLIBCXX_TR1
|
| 69 |
+
# undef _GLIBCXX_END_NAMESPACE_TR1
|
| 70 |
+
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
| 71 |
+
# undef _GLIBCXX_INCLUDE_AS_TR1
|
| 72 |
+
#endif
|
| 73 |
+
|
| 74 |
+
#endif // _GLIBCXX_TR1_MEMORY
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/modified_bessel_func.tcc
ADDED
|
@@ -0,0 +1,441 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Special functions -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2006, 2007, 2008
|
| 4 |
+
// Free Software Foundation, Inc.
|
| 5 |
+
//
|
| 6 |
+
// This file is part of the GNU ISO C++ Library. This library is free
|
| 7 |
+
// software; you can redistribute it and/or modify it under the
|
| 8 |
+
// terms of the GNU General Public License as published by the
|
| 9 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 10 |
+
// any later version.
|
| 11 |
+
//
|
| 12 |
+
// This library is distributed in the hope that it will be useful,
|
| 13 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
// GNU General Public License for more details.
|
| 16 |
+
//
|
| 17 |
+
// You should have received a copy of the GNU General Public License along
|
| 18 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 19 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 20 |
+
// USA.
|
| 21 |
+
//
|
| 22 |
+
// As a special exception, you may use this file as part of a free software
|
| 23 |
+
// library without restriction. Specifically, if other files instantiate
|
| 24 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 25 |
+
// this file and link it with other files to produce an executable, this
|
| 26 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 27 |
+
// the GNU General Public License. This exception does not however
|
| 28 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 29 |
+
// the GNU General Public License.
|
| 30 |
+
|
| 31 |
+
/** @file tr1/modified_bessel_func.tcc
|
| 32 |
+
* This is an internal header file, included by other library headers.
|
| 33 |
+
* You should not attempt to use it directly.
|
| 34 |
+
*/
|
| 35 |
+
|
| 36 |
+
//
|
| 37 |
+
// ISO C++ 14882 TR1: 5.2 Special functions
|
| 38 |
+
//
|
| 39 |
+
|
| 40 |
+
// Written by Edward Smith-Rowland.
|
| 41 |
+
//
|
| 42 |
+
// References:
|
| 43 |
+
// (1) Handbook of Mathematical Functions,
|
| 44 |
+
// Ed. Milton Abramowitz and Irene A. Stegun,
|
| 45 |
+
// Dover Publications,
|
| 46 |
+
// Section 9, pp. 355-434, Section 10 pp. 435-478
|
| 47 |
+
// (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl
|
| 48 |
+
// (3) Numerical Recipes in C, by W. H. Press, S. A. Teukolsky,
|
| 49 |
+
// W. T. Vetterling, B. P. Flannery, Cambridge University Press (1992),
|
| 50 |
+
// 2nd ed, pp. 246-249.
|
| 51 |
+
|
| 52 |
+
#ifndef _GLIBCXX_TR1_MODIFIED_BESSEL_FUNC_TCC
|
| 53 |
+
#define _GLIBCXX_TR1_MODIFIED_BESSEL_FUNC_TCC 1
|
| 54 |
+
|
| 55 |
+
#include "special_function_util.h"
|
| 56 |
+
|
| 57 |
+
namespace std
|
| 58 |
+
{
|
| 59 |
+
namespace tr1
|
| 60 |
+
{
|
| 61 |
+
|
| 62 |
+
// [5.2] Special functions
|
| 63 |
+
|
| 64 |
+
// Implementation-space details.
|
| 65 |
+
namespace __detail
|
| 66 |
+
{
|
| 67 |
+
|
| 68 |
+
/**
|
| 69 |
+
* @brief Compute the modified Bessel functions @f$ I_\nu(x) @f$ and
|
| 70 |
+
* @f$ K_\nu(x) @f$ and their first derivatives
|
| 71 |
+
* @f$ I'_\nu(x) @f$ and @f$ K'_\nu(x) @f$ respectively.
|
| 72 |
+
* These four functions are computed together for numerical
|
| 73 |
+
* stability.
|
| 74 |
+
*
|
| 75 |
+
* @param __nu The order of the Bessel functions.
|
| 76 |
+
* @param __x The argument of the Bessel functions.
|
| 77 |
+
* @param __Inu The output regular modified Bessel function.
|
| 78 |
+
* @param __Knu The output irregular modified Bessel function.
|
| 79 |
+
* @param __Ipnu The output derivative of the regular
|
| 80 |
+
* modified Bessel function.
|
| 81 |
+
* @param __Kpnu The output derivative of the irregular
|
| 82 |
+
* modified Bessel function.
|
| 83 |
+
*/
|
| 84 |
+
template <typename _Tp>
|
| 85 |
+
void
|
| 86 |
+
__bessel_ik(const _Tp __nu, const _Tp __x,
|
| 87 |
+
_Tp & __Inu, _Tp & __Knu, _Tp & __Ipnu, _Tp & __Kpnu)
|
| 88 |
+
{
|
| 89 |
+
if (__x == _Tp(0))
|
| 90 |
+
{
|
| 91 |
+
if (__nu == _Tp(0))
|
| 92 |
+
{
|
| 93 |
+
__Inu = _Tp(1);
|
| 94 |
+
__Ipnu = _Tp(0);
|
| 95 |
+
}
|
| 96 |
+
else if (__nu == _Tp(1))
|
| 97 |
+
{
|
| 98 |
+
__Inu = _Tp(0);
|
| 99 |
+
__Ipnu = _Tp(0.5L);
|
| 100 |
+
}
|
| 101 |
+
else
|
| 102 |
+
{
|
| 103 |
+
__Inu = _Tp(0);
|
| 104 |
+
__Ipnu = _Tp(0);
|
| 105 |
+
}
|
| 106 |
+
__Knu = std::numeric_limits<_Tp>::infinity();
|
| 107 |
+
__Kpnu = -std::numeric_limits<_Tp>::infinity();
|
| 108 |
+
return;
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
|
| 112 |
+
const _Tp __fp_min = _Tp(10) * std::numeric_limits<_Tp>::epsilon();
|
| 113 |
+
const int __max_iter = 15000;
|
| 114 |
+
const _Tp __x_min = _Tp(2);
|
| 115 |
+
|
| 116 |
+
const int __nl = static_cast<int>(__nu + _Tp(0.5L));
|
| 117 |
+
|
| 118 |
+
const _Tp __mu = __nu - __nl;
|
| 119 |
+
const _Tp __mu2 = __mu * __mu;
|
| 120 |
+
const _Tp __xi = _Tp(1) / __x;
|
| 121 |
+
const _Tp __xi2 = _Tp(2) * __xi;
|
| 122 |
+
_Tp __h = __nu * __xi;
|
| 123 |
+
if ( __h < __fp_min )
|
| 124 |
+
__h = __fp_min;
|
| 125 |
+
_Tp __b = __xi2 * __nu;
|
| 126 |
+
_Tp __d = _Tp(0);
|
| 127 |
+
_Tp __c = __h;
|
| 128 |
+
int __i;
|
| 129 |
+
for ( __i = 1; __i <= __max_iter; ++__i )
|
| 130 |
+
{
|
| 131 |
+
__b += __xi2;
|
| 132 |
+
__d = _Tp(1) / (__b + __d);
|
| 133 |
+
__c = __b + _Tp(1) / __c;
|
| 134 |
+
const _Tp __del = __c * __d;
|
| 135 |
+
__h *= __del;
|
| 136 |
+
if (std::abs(__del - _Tp(1)) < __eps)
|
| 137 |
+
break;
|
| 138 |
+
}
|
| 139 |
+
if (__i > __max_iter)
|
| 140 |
+
std::__throw_runtime_error(__N("Argument x too large "
|
| 141 |
+
"in __bessel_jn; "
|
| 142 |
+
"try asymptotic expansion."));
|
| 143 |
+
_Tp __Inul = __fp_min;
|
| 144 |
+
_Tp __Ipnul = __h * __Inul;
|
| 145 |
+
_Tp __Inul1 = __Inul;
|
| 146 |
+
_Tp __Ipnu1 = __Ipnul;
|
| 147 |
+
_Tp __fact = __nu * __xi;
|
| 148 |
+
for (int __l = __nl; __l >= 1; --__l)
|
| 149 |
+
{
|
| 150 |
+
const _Tp __Inutemp = __fact * __Inul + __Ipnul;
|
| 151 |
+
__fact -= __xi;
|
| 152 |
+
__Ipnul = __fact * __Inutemp + __Inul;
|
| 153 |
+
__Inul = __Inutemp;
|
| 154 |
+
}
|
| 155 |
+
_Tp __f = __Ipnul / __Inul;
|
| 156 |
+
_Tp __Kmu, __Knu1;
|
| 157 |
+
if (__x < __x_min)
|
| 158 |
+
{
|
| 159 |
+
const _Tp __x2 = __x / _Tp(2);
|
| 160 |
+
const _Tp __pimu = __numeric_constants<_Tp>::__pi() * __mu;
|
| 161 |
+
const _Tp __fact = (std::abs(__pimu) < __eps
|
| 162 |
+
? _Tp(1) : __pimu / std::sin(__pimu));
|
| 163 |
+
_Tp __d = -std::log(__x2);
|
| 164 |
+
_Tp __e = __mu * __d;
|
| 165 |
+
const _Tp __fact2 = (std::abs(__e) < __eps
|
| 166 |
+
? _Tp(1) : std::sinh(__e) / __e);
|
| 167 |
+
_Tp __gam1, __gam2, __gampl, __gammi;
|
| 168 |
+
__gamma_temme(__mu, __gam1, __gam2, __gampl, __gammi);
|
| 169 |
+
_Tp __ff = __fact
|
| 170 |
+
* (__gam1 * std::cosh(__e) + __gam2 * __fact2 * __d);
|
| 171 |
+
_Tp __sum = __ff;
|
| 172 |
+
__e = std::exp(__e);
|
| 173 |
+
_Tp __p = __e / (_Tp(2) * __gampl);
|
| 174 |
+
_Tp __q = _Tp(1) / (_Tp(2) * __e * __gammi);
|
| 175 |
+
_Tp __c = _Tp(1);
|
| 176 |
+
__d = __x2 * __x2;
|
| 177 |
+
_Tp __sum1 = __p;
|
| 178 |
+
int __i;
|
| 179 |
+
for (__i = 1; __i <= __max_iter; ++__i)
|
| 180 |
+
{
|
| 181 |
+
__ff = (__i * __ff + __p + __q) / (__i * __i - __mu2);
|
| 182 |
+
__c *= __d / __i;
|
| 183 |
+
__p /= __i - __mu;
|
| 184 |
+
__q /= __i + __mu;
|
| 185 |
+
const _Tp __del = __c * __ff;
|
| 186 |
+
__sum += __del;
|
| 187 |
+
const _Tp __del1 = __c * (__p - __i * __ff);
|
| 188 |
+
__sum1 += __del1;
|
| 189 |
+
if (std::abs(__del) < __eps * std::abs(__sum))
|
| 190 |
+
break;
|
| 191 |
+
}
|
| 192 |
+
if (__i > __max_iter)
|
| 193 |
+
std::__throw_runtime_error(__N("Bessel k series failed to converge "
|
| 194 |
+
"in __bessel_jn."));
|
| 195 |
+
__Kmu = __sum;
|
| 196 |
+
__Knu1 = __sum1 * __xi2;
|
| 197 |
+
}
|
| 198 |
+
else
|
| 199 |
+
{
|
| 200 |
+
_Tp __b = _Tp(2) * (_Tp(1) + __x);
|
| 201 |
+
_Tp __d = _Tp(1) / __b;
|
| 202 |
+
_Tp __delh = __d;
|
| 203 |
+
_Tp __h = __delh;
|
| 204 |
+
_Tp __q1 = _Tp(0);
|
| 205 |
+
_Tp __q2 = _Tp(1);
|
| 206 |
+
_Tp __a1 = _Tp(0.25L) - __mu2;
|
| 207 |
+
_Tp __q = __c = __a1;
|
| 208 |
+
_Tp __a = -__a1;
|
| 209 |
+
_Tp __s = _Tp(1) + __q * __delh;
|
| 210 |
+
int __i;
|
| 211 |
+
for (__i = 2; __i <= __max_iter; ++__i)
|
| 212 |
+
{
|
| 213 |
+
__a -= 2 * (__i - 1);
|
| 214 |
+
__c = -__a * __c / __i;
|
| 215 |
+
const _Tp __qnew = (__q1 - __b * __q2) / __a;
|
| 216 |
+
__q1 = __q2;
|
| 217 |
+
__q2 = __qnew;
|
| 218 |
+
__q += __c * __qnew;
|
| 219 |
+
__b += _Tp(2);
|
| 220 |
+
__d = _Tp(1) / (__b + __a * __d);
|
| 221 |
+
__delh = (__b * __d - _Tp(1)) * __delh;
|
| 222 |
+
__h += __delh;
|
| 223 |
+
const _Tp __dels = __q * __delh;
|
| 224 |
+
__s += __dels;
|
| 225 |
+
if ( std::abs(__dels / __s) < __eps )
|
| 226 |
+
break;
|
| 227 |
+
}
|
| 228 |
+
if (__i > __max_iter)
|
| 229 |
+
std::__throw_runtime_error(__N("Steed's method failed "
|
| 230 |
+
"in __bessel_jn."));
|
| 231 |
+
__h = __a1 * __h;
|
| 232 |
+
__Kmu = std::sqrt(__numeric_constants<_Tp>::__pi() / (_Tp(2) * __x))
|
| 233 |
+
* std::exp(-__x) / __s;
|
| 234 |
+
__Knu1 = __Kmu * (__mu + __x + _Tp(0.5L) - __h) * __xi;
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
_Tp __Kpmu = __mu * __xi * __Kmu - __Knu1;
|
| 238 |
+
_Tp __Inumu = __xi / (__f * __Kmu - __Kpmu);
|
| 239 |
+
__Inu = __Inumu * __Inul1 / __Inul;
|
| 240 |
+
__Ipnu = __Inumu * __Ipnu1 / __Inul;
|
| 241 |
+
for ( __i = 1; __i <= __nl; ++__i )
|
| 242 |
+
{
|
| 243 |
+
const _Tp __Knutemp = (__mu + __i) * __xi2 * __Knu1 + __Kmu;
|
| 244 |
+
__Kmu = __Knu1;
|
| 245 |
+
__Knu1 = __Knutemp;
|
| 246 |
+
}
|
| 247 |
+
__Knu = __Kmu;
|
| 248 |
+
__Kpnu = __nu * __xi * __Kmu - __Knu1;
|
| 249 |
+
|
| 250 |
+
return;
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
|
| 254 |
+
/**
|
| 255 |
+
* @brief Return the regular modified Bessel function of order
|
| 256 |
+
* \f$ \nu \f$: \f$ I_{\nu}(x) \f$.
|
| 257 |
+
*
|
| 258 |
+
* The regular modified cylindrical Bessel function is:
|
| 259 |
+
* @f[
|
| 260 |
+
* I_{\nu}(x) = \sum_{k=0}^{\infty}
|
| 261 |
+
* \frac{(x/2)^{\nu + 2k}}{k!\Gamma(\nu+k+1)}
|
| 262 |
+
* @f]
|
| 263 |
+
*
|
| 264 |
+
* @param __nu The order of the regular modified Bessel function.
|
| 265 |
+
* @param __x The argument of the regular modified Bessel function.
|
| 266 |
+
* @return The output regular modified Bessel function.
|
| 267 |
+
*/
|
| 268 |
+
template<typename _Tp>
|
| 269 |
+
_Tp
|
| 270 |
+
__cyl_bessel_i(const _Tp __nu, const _Tp __x)
|
| 271 |
+
{
|
| 272 |
+
if (__nu < _Tp(0) || __x < _Tp(0))
|
| 273 |
+
std::__throw_domain_error(__N("Bad argument "
|
| 274 |
+
"in __cyl_bessel_i."));
|
| 275 |
+
else if (__isnan(__nu) || __isnan(__x))
|
| 276 |
+
return std::numeric_limits<_Tp>::quiet_NaN();
|
| 277 |
+
else if (__x * __x < _Tp(10) * (__nu + _Tp(1)))
|
| 278 |
+
return __cyl_bessel_ij_series(__nu, __x, +_Tp(1), 200);
|
| 279 |
+
else
|
| 280 |
+
{
|
| 281 |
+
_Tp __I_nu, __K_nu, __Ip_nu, __Kp_nu;
|
| 282 |
+
__bessel_ik(__nu, __x, __I_nu, __K_nu, __Ip_nu, __Kp_nu);
|
| 283 |
+
return __I_nu;
|
| 284 |
+
}
|
| 285 |
+
}
|
| 286 |
+
|
| 287 |
+
|
| 288 |
+
/**
|
| 289 |
+
* @brief Return the irregular modified Bessel function
|
| 290 |
+
* \f$ K_{\nu}(x) \f$ of order \f$ \nu \f$.
|
| 291 |
+
*
|
| 292 |
+
* The irregular modified Bessel function is defined by:
|
| 293 |
+
* @f[
|
| 294 |
+
* K_{\nu}(x) = \frac{\pi}{2}
|
| 295 |
+
* \frac{I_{-\nu}(x) - I_{\nu}(x)}{\sin \nu\pi}
|
| 296 |
+
* @f]
|
| 297 |
+
* where for integral \f$ \nu = n \f$ a limit is taken:
|
| 298 |
+
* \f$ lim_{\nu \to n} \f$.
|
| 299 |
+
*
|
| 300 |
+
* @param __nu The order of the irregular modified Bessel function.
|
| 301 |
+
* @param __x The argument of the irregular modified Bessel function.
|
| 302 |
+
* @return The output irregular modified Bessel function.
|
| 303 |
+
*/
|
| 304 |
+
template<typename _Tp>
|
| 305 |
+
_Tp
|
| 306 |
+
__cyl_bessel_k(const _Tp __nu, const _Tp __x)
|
| 307 |
+
{
|
| 308 |
+
if (__nu < _Tp(0) || __x < _Tp(0))
|
| 309 |
+
std::__throw_domain_error(__N("Bad argument "
|
| 310 |
+
"in __cyl_bessel_k."));
|
| 311 |
+
else if (__isnan(__nu) || __isnan(__x))
|
| 312 |
+
return std::numeric_limits<_Tp>::quiet_NaN();
|
| 313 |
+
else
|
| 314 |
+
{
|
| 315 |
+
_Tp __I_nu, __K_nu, __Ip_nu, __Kp_nu;
|
| 316 |
+
__bessel_ik(__nu, __x, __I_nu, __K_nu, __Ip_nu, __Kp_nu);
|
| 317 |
+
return __K_nu;
|
| 318 |
+
}
|
| 319 |
+
}
|
| 320 |
+
|
| 321 |
+
|
| 322 |
+
/**
|
| 323 |
+
* @brief Compute the spherical modified Bessel functions
|
| 324 |
+
* @f$ i_n(x) @f$ and @f$ k_n(x) @f$ and their first
|
| 325 |
+
* derivatives @f$ i'_n(x) @f$ and @f$ k'_n(x) @f$
|
| 326 |
+
* respectively.
|
| 327 |
+
*
|
| 328 |
+
* @param __n The order of the modified spherical Bessel function.
|
| 329 |
+
* @param __x The argument of the modified spherical Bessel function.
|
| 330 |
+
* @param __i_n The output regular modified spherical Bessel function.
|
| 331 |
+
* @param __k_n The output irregular modified spherical
|
| 332 |
+
* Bessel function.
|
| 333 |
+
* @param __ip_n The output derivative of the regular modified
|
| 334 |
+
* spherical Bessel function.
|
| 335 |
+
* @param __kp_n The output derivative of the irregular modified
|
| 336 |
+
* spherical Bessel function.
|
| 337 |
+
*/
|
| 338 |
+
template <typename _Tp>
|
| 339 |
+
void
|
| 340 |
+
__sph_bessel_ik(const unsigned int __n, const _Tp __x,
|
| 341 |
+
_Tp & __i_n, _Tp & __k_n, _Tp & __ip_n, _Tp & __kp_n)
|
| 342 |
+
{
|
| 343 |
+
const _Tp __nu = _Tp(__n) + _Tp(0.5L);
|
| 344 |
+
|
| 345 |
+
_Tp __I_nu, __Ip_nu, __K_nu, __Kp_nu;
|
| 346 |
+
__bessel_ik(__nu, __x, __I_nu, __K_nu, __Ip_nu, __Kp_nu);
|
| 347 |
+
|
| 348 |
+
const _Tp __factor = __numeric_constants<_Tp>::__sqrtpio2()
|
| 349 |
+
/ std::sqrt(__x);
|
| 350 |
+
|
| 351 |
+
__i_n = __factor * __I_nu;
|
| 352 |
+
__k_n = __factor * __K_nu;
|
| 353 |
+
__ip_n = __factor * __Ip_nu - __i_n / (_Tp(2) * __x);
|
| 354 |
+
__kp_n = __factor * __Kp_nu - __k_n / (_Tp(2) * __x);
|
| 355 |
+
|
| 356 |
+
return;
|
| 357 |
+
}
|
| 358 |
+
|
| 359 |
+
|
| 360 |
+
/**
|
| 361 |
+
* @brief Compute the Airy functions
|
| 362 |
+
* @f$ Ai(x) @f$ and @f$ Bi(x) @f$ and their first
|
| 363 |
+
* derivatives @f$ Ai'(x) @f$ and @f$ Bi(x) @f$
|
| 364 |
+
* respectively.
|
| 365 |
+
*
|
| 366 |
+
* @param __n The order of the Airy functions.
|
| 367 |
+
* @param __x The argument of the Airy functions.
|
| 368 |
+
* @param __i_n The output Airy function.
|
| 369 |
+
* @param __k_n The output Airy function.
|
| 370 |
+
* @param __ip_n The output derivative of the Airy function.
|
| 371 |
+
* @param __kp_n The output derivative of the Airy function.
|
| 372 |
+
*/
|
| 373 |
+
template <typename _Tp>
|
| 374 |
+
void
|
| 375 |
+
__airy(const _Tp __x,
|
| 376 |
+
_Tp & __Ai, _Tp & __Bi, _Tp & __Aip, _Tp & __Bip)
|
| 377 |
+
{
|
| 378 |
+
const _Tp __absx = std::abs(__x);
|
| 379 |
+
const _Tp __rootx = std::sqrt(__absx);
|
| 380 |
+
const _Tp __z = _Tp(2) * __absx * __rootx / _Tp(3);
|
| 381 |
+
|
| 382 |
+
if (__isnan(__x))
|
| 383 |
+
return std::numeric_limits<_Tp>::quiet_NaN();
|
| 384 |
+
else if (__x > _Tp(0))
|
| 385 |
+
{
|
| 386 |
+
_Tp __I_nu, __Ip_nu, __K_nu, __Kp_nu;
|
| 387 |
+
|
| 388 |
+
__bessel_ik(_Tp(1) / _Tp(3), __z, __I_nu, __K_nu, __Ip_nu, __Kp_nu);
|
| 389 |
+
__Ai = __rootx * __K_nu
|
| 390 |
+
/ (__numeric_constants<_Tp>::__sqrt3()
|
| 391 |
+
* __numeric_constants<_Tp>::__pi());
|
| 392 |
+
__Bi = __rootx * (__K_nu / __numeric_constants<_Tp>::__pi()
|
| 393 |
+
+ _Tp(2) * __I_nu / __numeric_constants<_Tp>::__sqrt3());
|
| 394 |
+
|
| 395 |
+
__bessel_ik(_Tp(2) / _Tp(3), __z, __I_nu, __K_nu, __Ip_nu, __Kp_nu);
|
| 396 |
+
__Aip = -__x * __K_nu
|
| 397 |
+
/ (__numeric_constants<_Tp>::__sqrt3()
|
| 398 |
+
* __numeric_constants<_Tp>::__pi());
|
| 399 |
+
__Bip = __x * (__K_nu / __numeric_constants<_Tp>::__pi()
|
| 400 |
+
+ _Tp(2) * __I_nu
|
| 401 |
+
/ __numeric_constants<_Tp>::__sqrt3());
|
| 402 |
+
}
|
| 403 |
+
else if (__x < _Tp(0))
|
| 404 |
+
{
|
| 405 |
+
_Tp __J_nu, __Jp_nu, __N_nu, __Np_nu;
|
| 406 |
+
|
| 407 |
+
__bessel_jn(_Tp(1) / _Tp(3), __z, __J_nu, __N_nu, __Jp_nu, __Np_nu);
|
| 408 |
+
__Ai = __rootx * (__J_nu
|
| 409 |
+
- __N_nu / __numeric_constants<_Tp>::__sqrt3()) / _Tp(2);
|
| 410 |
+
__Bi = -__rootx * (__N_nu
|
| 411 |
+
+ __J_nu / __numeric_constants<_Tp>::__sqrt3()) / _Tp(2);
|
| 412 |
+
|
| 413 |
+
__bessel_jn(_Tp(2) / _Tp(3), __z, __J_nu, __N_nu, __Jp_nu, __Np_nu);
|
| 414 |
+
__Aip = __absx * (__N_nu / __numeric_constants<_Tp>::__sqrt3()
|
| 415 |
+
+ __J_nu) / _Tp(2);
|
| 416 |
+
__Bip = __absx * (__J_nu / __numeric_constants<_Tp>::__sqrt3()
|
| 417 |
+
- __N_nu) / _Tp(2);
|
| 418 |
+
}
|
| 419 |
+
else
|
| 420 |
+
{
|
| 421 |
+
// Reference:
|
| 422 |
+
// Abramowitz & Stegun, page 446 section 10.4.4 on Airy functions.
|
| 423 |
+
// The number is Ai(0) = 3^{-2/3}/\Gamma(2/3).
|
| 424 |
+
__Ai = _Tp(0.35502805388781723926L);
|
| 425 |
+
__Bi = __Ai * __numeric_constants<_Tp>::__sqrt3();
|
| 426 |
+
|
| 427 |
+
// Reference:
|
| 428 |
+
// Abramowitz & Stegun, page 446 section 10.4.5 on Airy functions.
|
| 429 |
+
// The number is Ai'(0) = -3^{-1/3}/\Gamma(1/3).
|
| 430 |
+
__Aip = -_Tp(0.25881940379280679840L);
|
| 431 |
+
__Bip = -__Aip * __numeric_constants<_Tp>::__sqrt3();
|
| 432 |
+
}
|
| 433 |
+
|
| 434 |
+
return;
|
| 435 |
+
}
|
| 436 |
+
|
| 437 |
+
} // namespace std::tr1::__detail
|
| 438 |
+
}
|
| 439 |
+
}
|
| 440 |
+
|
| 441 |
+
#endif // _GLIBCXX_TR1_MODIFIED_BESSEL_FUNC_TCC
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/poly_hermite.tcc
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Special functions -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2006, 2007, 2008
|
| 4 |
+
// Free Software Foundation, Inc.
|
| 5 |
+
//
|
| 6 |
+
// This file is part of the GNU ISO C++ Library. This library is free
|
| 7 |
+
// software; you can redistribute it and/or modify it under the
|
| 8 |
+
// terms of the GNU General Public License as published by the
|
| 9 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 10 |
+
// any later version.
|
| 11 |
+
//
|
| 12 |
+
// This library is distributed in the hope that it will be useful,
|
| 13 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
// GNU General Public License for more details.
|
| 16 |
+
//
|
| 17 |
+
// You should have received a copy of the GNU General Public License along
|
| 18 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 19 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 20 |
+
// USA.
|
| 21 |
+
//
|
| 22 |
+
// As a special exception, you may use this file as part of a free software
|
| 23 |
+
// library without restriction. Specifically, if other files instantiate
|
| 24 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 25 |
+
// this file and link it with other files to produce an executable, this
|
| 26 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 27 |
+
// the GNU General Public License. This exception does not however
|
| 28 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 29 |
+
// the GNU General Public License.
|
| 30 |
+
|
| 31 |
+
/** @file tr1/poly_hermite.tcc
|
| 32 |
+
* This is an internal header file, included by other library headers.
|
| 33 |
+
* You should not attempt to use it directly.
|
| 34 |
+
*/
|
| 35 |
+
|
| 36 |
+
//
|
| 37 |
+
// ISO C++ 14882 TR1: 5.2 Special functions
|
| 38 |
+
//
|
| 39 |
+
|
| 40 |
+
// Written by Edward Smith-Rowland based on:
|
| 41 |
+
// (1) Handbook of Mathematical Functions,
|
| 42 |
+
// Ed. Milton Abramowitz and Irene A. Stegun,
|
| 43 |
+
// Dover Publications, Section 22 pp. 773-802
|
| 44 |
+
|
| 45 |
+
#ifndef _GLIBCXX_TR1_POLY_HERMITE_TCC
|
| 46 |
+
#define _GLIBCXX_TR1_POLY_HERMITE_TCC 1
|
| 47 |
+
|
| 48 |
+
namespace std
|
| 49 |
+
{
|
| 50 |
+
namespace tr1
|
| 51 |
+
{
|
| 52 |
+
|
| 53 |
+
// [5.2] Special functions
|
| 54 |
+
|
| 55 |
+
// Implementation-space details.
|
| 56 |
+
namespace __detail
|
| 57 |
+
{
|
| 58 |
+
|
| 59 |
+
/**
|
| 60 |
+
* @brief This routine returns the Hermite polynomial
|
| 61 |
+
* of order n: \f$ H_n(x) \f$ by recursion on n.
|
| 62 |
+
*
|
| 63 |
+
* The Hermite polynomial is defined by:
|
| 64 |
+
* @f[
|
| 65 |
+
* H_n(x) = (-1)^n e^{x^2} \frac{d^n}{dx^n} e^{-x^2}
|
| 66 |
+
* @f]
|
| 67 |
+
*
|
| 68 |
+
* @param __n The order of the Hermite polynomial.
|
| 69 |
+
* @param __x The argument of the Hermite polynomial.
|
| 70 |
+
* @return The value of the Hermite polynomial of order n
|
| 71 |
+
* and argument x.
|
| 72 |
+
*/
|
| 73 |
+
template<typename _Tp>
|
| 74 |
+
_Tp
|
| 75 |
+
__poly_hermite_recursion(const unsigned int __n, const _Tp __x)
|
| 76 |
+
{
|
| 77 |
+
// Compute H_0.
|
| 78 |
+
_Tp __H_0 = 1;
|
| 79 |
+
if (__n == 0)
|
| 80 |
+
return __H_0;
|
| 81 |
+
|
| 82 |
+
// Compute H_1.
|
| 83 |
+
_Tp __H_1 = 2 * __x;
|
| 84 |
+
if (__n == 1)
|
| 85 |
+
return __H_1;
|
| 86 |
+
|
| 87 |
+
// Compute H_n.
|
| 88 |
+
_Tp __H_n, __H_nm1, __H_nm2;
|
| 89 |
+
unsigned int __i;
|
| 90 |
+
for (__H_nm2 = __H_0, __H_nm1 = __H_1, __i = 2; __i <= __n; ++__i)
|
| 91 |
+
{
|
| 92 |
+
__H_n = 2 * (__x * __H_nm1 + (__i - 1) * __H_nm2);
|
| 93 |
+
__H_nm2 = __H_nm1;
|
| 94 |
+
__H_nm1 = __H_n;
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
return __H_n;
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
|
| 101 |
+
/**
|
| 102 |
+
* @brief This routine returns the Hermite polynomial
|
| 103 |
+
* of order n: \f$ H_n(x) \f$.
|
| 104 |
+
*
|
| 105 |
+
* The Hermite polynomial is defined by:
|
| 106 |
+
* @f[
|
| 107 |
+
* H_n(x) = (-1)^n e^{x^2} \frac{d^n}{dx^n} e^{-x^2}
|
| 108 |
+
* @f]
|
| 109 |
+
*
|
| 110 |
+
* @param __n The order of the Hermite polynomial.
|
| 111 |
+
* @param __x The argument of the Hermite polynomial.
|
| 112 |
+
* @return The value of the Hermite polynomial of order n
|
| 113 |
+
* and argument x.
|
| 114 |
+
*/
|
| 115 |
+
template<typename _Tp>
|
| 116 |
+
inline _Tp
|
| 117 |
+
__poly_hermite(const unsigned int __n, const _Tp __x)
|
| 118 |
+
{
|
| 119 |
+
if (__isnan(__x))
|
| 120 |
+
return std::numeric_limits<_Tp>::quiet_NaN();
|
| 121 |
+
else
|
| 122 |
+
return __poly_hermite_recursion(__n, __x);
|
| 123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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Special functions -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2006, 2007, 2008
|
| 4 |
+
// Free Software Foundation, Inc.
|
| 5 |
+
//
|
| 6 |
+
// This file is part of the GNU ISO C++ Library. This library is free
|
| 7 |
+
// software; you can redistribute it and/or modify it under the
|
| 8 |
+
// terms of the GNU General Public License as published by the
|
| 9 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 10 |
+
// any later version.
|
| 11 |
+
//
|
| 12 |
+
// This library is distributed in the hope that it will be useful,
|
| 13 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
// GNU General Public License for more details.
|
| 16 |
+
//
|
| 17 |
+
// You should have received a copy of the GNU General Public License along
|
| 18 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 19 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 20 |
+
// USA.
|
| 21 |
+
//
|
| 22 |
+
// As a special exception, you may use this file as part of a free software
|
| 23 |
+
// library without restriction. Specifically, if other files instantiate
|
| 24 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 25 |
+
// this file and link it with other files to produce an executable, this
|
| 26 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 27 |
+
// the GNU General Public License. This exception does not however
|
| 28 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 29 |
+
// the GNU General Public License.
|
| 30 |
+
|
| 31 |
+
/** @file tr1/poly_laguerre.tcc
|
| 32 |
+
* This is an internal header file, included by other library headers.
|
| 33 |
+
* You should not attempt to use it directly.
|
| 34 |
+
*/
|
| 35 |
+
|
| 36 |
+
//
|
| 37 |
+
// ISO C++ 14882 TR1: 5.2 Special functions
|
| 38 |
+
//
|
| 39 |
+
|
| 40 |
+
// Written by Edward Smith-Rowland based on:
|
| 41 |
+
// (1) Handbook of Mathematical Functions,
|
| 42 |
+
// Ed. Milton Abramowitz and Irene A. Stegun,
|
| 43 |
+
// Dover Publications,
|
| 44 |
+
// Section 13, pp. 509-510, Section 22 pp. 773-802
|
| 45 |
+
// (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl
|
| 46 |
+
|
| 47 |
+
#ifndef _GLIBCXX_TR1_POLY_LAGUERRE_TCC
|
| 48 |
+
#define _GLIBCXX_TR1_POLY_LAGUERRE_TCC 1
|
| 49 |
+
|
| 50 |
+
namespace std
|
| 51 |
+
{
|
| 52 |
+
namespace tr1
|
| 53 |
+
{
|
| 54 |
+
|
| 55 |
+
// [5.2] Special functions
|
| 56 |
+
|
| 57 |
+
// Implementation-space details.
|
| 58 |
+
namespace __detail
|
| 59 |
+
{
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
/**
|
| 63 |
+
* @brief This routine returns the associated Laguerre polynomial
|
| 64 |
+
* of order @f$ n @f$, degree @f$ \alpha @f$ for large n.
|
| 65 |
+
* Abramowitz & Stegun, 13.5.21
|
| 66 |
+
*
|
| 67 |
+
* @param __n The order of the Laguerre function.
|
| 68 |
+
* @param __alpha The degree of the Laguerre function.
|
| 69 |
+
* @param __x The argument of the Laguerre function.
|
| 70 |
+
* @return The value of the Laguerre function of order n,
|
| 71 |
+
* degree @f$ \alpha @f$, and argument x.
|
| 72 |
+
*
|
| 73 |
+
* This is from the GNU Scientific Library.
|
| 74 |
+
*/
|
| 75 |
+
template<typename _Tpa, typename _Tp>
|
| 76 |
+
_Tp
|
| 77 |
+
__poly_laguerre_large_n(const unsigned __n, const _Tpa __alpha1,
|
| 78 |
+
const _Tp __x)
|
| 79 |
+
{
|
| 80 |
+
const _Tp __a = -_Tp(__n);
|
| 81 |
+
const _Tp __b = _Tp(__alpha1) + _Tp(1);
|
| 82 |
+
const _Tp __eta = _Tp(2) * __b - _Tp(4) * __a;
|
| 83 |
+
const _Tp __cos2th = __x / __eta;
|
| 84 |
+
const _Tp __sin2th = _Tp(1) - __cos2th;
|
| 85 |
+
const _Tp __th = std::acos(std::sqrt(__cos2th));
|
| 86 |
+
const _Tp __pre_h = __numeric_constants<_Tp>::__pi_2()
|
| 87 |
+
* __numeric_constants<_Tp>::__pi_2()
|
| 88 |
+
* __eta * __eta * __cos2th * __sin2th;
|
| 89 |
+
|
| 90 |
+
#if _GLIBCXX_USE_C99_MATH_TR1
|
| 91 |
+
const _Tp __lg_b = std::tr1::lgamma(_Tp(__n) + __b);
|
| 92 |
+
const _Tp __lnfact = std::tr1::lgamma(_Tp(__n + 1));
|
| 93 |
+
#else
|
| 94 |
+
const _Tp __lg_b = __log_gamma(_Tp(__n) + __b);
|
| 95 |
+
const _Tp __lnfact = __log_gamma(_Tp(__n + 1));
|
| 96 |
+
#endif
|
| 97 |
+
|
| 98 |
+
_Tp __pre_term1 = _Tp(0.5L) * (_Tp(1) - __b)
|
| 99 |
+
* std::log(_Tp(0.25L) * __x * __eta);
|
| 100 |
+
_Tp __pre_term2 = _Tp(0.25L) * std::log(__pre_h);
|
| 101 |
+
_Tp __lnpre = __lg_b - __lnfact + _Tp(0.5L) * __x
|
| 102 |
+
+ __pre_term1 - __pre_term2;
|
| 103 |
+
_Tp __ser_term1 = std::sin(__a * __numeric_constants<_Tp>::__pi());
|
| 104 |
+
_Tp __ser_term2 = std::sin(_Tp(0.25L) * __eta
|
| 105 |
+
* (_Tp(2) * __th
|
| 106 |
+
- std::sin(_Tp(2) * __th))
|
| 107 |
+
+ __numeric_constants<_Tp>::__pi_4());
|
| 108 |
+
_Tp __ser = __ser_term1 + __ser_term2;
|
| 109 |
+
|
| 110 |
+
return std::exp(__lnpre) * __ser;
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
|
| 114 |
+
/**
|
| 115 |
+
* @brief Evaluate the polynomial based on the confluent hypergeometric
|
| 116 |
+
* function in a safe way, with no restriction on the arguments.
|
| 117 |
+
*
|
| 118 |
+
* The associated Laguerre function is defined by
|
| 119 |
+
* @f[
|
| 120 |
+
* L_n^\alpha(x) = \frac{(\alpha + 1)_n}{n!}
|
| 121 |
+
* _1F_1(-n; \alpha + 1; x)
|
| 122 |
+
* @f]
|
| 123 |
+
* where @f$ (\alpha)_n @f$ is the Pochhammer symbol and
|
| 124 |
+
* @f$ _1F_1(a; c; x) @f$ is the confluent hypergeometric function.
|
| 125 |
+
*
|
| 126 |
+
* This function assumes x != 0.
|
| 127 |
+
*
|
| 128 |
+
* This is from the GNU Scientific Library.
|
| 129 |
+
*/
|
| 130 |
+
template<typename _Tpa, typename _Tp>
|
| 131 |
+
_Tp
|
| 132 |
+
__poly_laguerre_hyperg(const unsigned int __n, const _Tpa __alpha1,
|
| 133 |
+
const _Tp __x)
|
| 134 |
+
{
|
| 135 |
+
const _Tp __b = _Tp(__alpha1) + _Tp(1);
|
| 136 |
+
const _Tp __mx = -__x;
|
| 137 |
+
const _Tp __tc_sgn = (__x < _Tp(0) ? _Tp(1)
|
| 138 |
+
: ((__n % 2 == 1) ? -_Tp(1) : _Tp(1)));
|
| 139 |
+
// Get |x|^n/n!
|
| 140 |
+
_Tp __tc = _Tp(1);
|
| 141 |
+
const _Tp __ax = std::abs(__x);
|
| 142 |
+
for (unsigned int __k = 1; __k <= __n; ++__k)
|
| 143 |
+
__tc *= (__ax / __k);
|
| 144 |
+
|
| 145 |
+
_Tp __term = __tc * __tc_sgn;
|
| 146 |
+
_Tp __sum = __term;
|
| 147 |
+
for (int __k = int(__n) - 1; __k >= 0; --__k)
|
| 148 |
+
{
|
| 149 |
+
__term *= ((__b + _Tp(__k)) / _Tp(int(__n) - __k))
|
| 150 |
+
* _Tp(__k + 1) / __mx;
|
| 151 |
+
__sum += __term;
|
| 152 |
+
}
|
| 153 |
+
|
| 154 |
+
return __sum;
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
|
| 158 |
+
/**
|
| 159 |
+
* @brief This routine returns the associated Laguerre polynomial
|
| 160 |
+
* of order @f$ n @f$, degree @f$ \alpha @f$: @f$ L_n^\alpha(x) @f$
|
| 161 |
+
* by recursion.
|
| 162 |
+
*
|
| 163 |
+
* The associated Laguerre function is defined by
|
| 164 |
+
* @f[
|
| 165 |
+
* L_n^\alpha(x) = \frac{(\alpha + 1)_n}{n!}
|
| 166 |
+
* _1F_1(-n; \alpha + 1; x)
|
| 167 |
+
* @f]
|
| 168 |
+
* where @f$ (\alpha)_n @f$ is the Pochhammer symbol and
|
| 169 |
+
* @f$ _1F_1(a; c; x) @f$ is the confluent hypergeometric function.
|
| 170 |
+
*
|
| 171 |
+
* The associated Laguerre polynomial is defined for integral
|
| 172 |
+
* @f$ \alpha = m @f$ by:
|
| 173 |
+
* @f[
|
| 174 |
+
* L_n^m(x) = (-1)^m \frac{d^m}{dx^m} L_{n + m}(x)
|
| 175 |
+
* @f]
|
| 176 |
+
* where the Laguerre polynomial is defined by:
|
| 177 |
+
* @f[
|
| 178 |
+
* L_n(x) = \frac{e^x}{n!} \frac{d^n}{dx^n} (x^ne^{-x})
|
| 179 |
+
* @f]
|
| 180 |
+
*
|
| 181 |
+
* @param __n The order of the Laguerre function.
|
| 182 |
+
* @param __alpha The degree of the Laguerre function.
|
| 183 |
+
* @param __x The argument of the Laguerre function.
|
| 184 |
+
* @return The value of the Laguerre function of order n,
|
| 185 |
+
* degree @f$ \alpha @f$, and argument x.
|
| 186 |
+
*/
|
| 187 |
+
template<typename _Tpa, typename _Tp>
|
| 188 |
+
_Tp
|
| 189 |
+
__poly_laguerre_recursion(const unsigned int __n,
|
| 190 |
+
const _Tpa __alpha1, const _Tp __x)
|
| 191 |
+
{
|
| 192 |
+
// Compute l_0.
|
| 193 |
+
_Tp __l_0 = _Tp(1);
|
| 194 |
+
if (__n == 0)
|
| 195 |
+
return __l_0;
|
| 196 |
+
|
| 197 |
+
// Compute l_1^alpha.
|
| 198 |
+
_Tp __l_1 = -__x + _Tp(1) + _Tp(__alpha1);
|
| 199 |
+
if (__n == 1)
|
| 200 |
+
return __l_1;
|
| 201 |
+
|
| 202 |
+
// Compute l_n^alpha by recursion on n.
|
| 203 |
+
_Tp __l_n2 = __l_0;
|
| 204 |
+
_Tp __l_n1 = __l_1;
|
| 205 |
+
_Tp __l_n = _Tp(0);
|
| 206 |
+
for (unsigned int __nn = 2; __nn <= __n; ++__nn)
|
| 207 |
+
{
|
| 208 |
+
__l_n = (_Tp(2 * __nn - 1) + _Tp(__alpha1) - __x)
|
| 209 |
+
* __l_n1 / _Tp(__nn)
|
| 210 |
+
- (_Tp(__nn - 1) + _Tp(__alpha1)) * __l_n2 / _Tp(__nn);
|
| 211 |
+
__l_n2 = __l_n1;
|
| 212 |
+
__l_n1 = __l_n;
|
| 213 |
+
}
|
| 214 |
+
|
| 215 |
+
return __l_n;
|
| 216 |
+
}
|
| 217 |
+
|
| 218 |
+
|
| 219 |
+
/**
|
| 220 |
+
* @brief This routine returns the associated Laguerre polynomial
|
| 221 |
+
* of order n, degree @f$ \alpha @f$: @f$ L_n^alpha(x) @f$.
|
| 222 |
+
*
|
| 223 |
+
* The associated Laguerre function is defined by
|
| 224 |
+
* @f[
|
| 225 |
+
* L_n^\alpha(x) = \frac{(\alpha + 1)_n}{n!}
|
| 226 |
+
* _1F_1(-n; \alpha + 1; x)
|
| 227 |
+
* @f]
|
| 228 |
+
* where @f$ (\alpha)_n @f$ is the Pochhammer symbol and
|
| 229 |
+
* @f$ _1F_1(a; c; x) @f$ is the confluent hypergeometric function.
|
| 230 |
+
*
|
| 231 |
+
* The associated Laguerre polynomial is defined for integral
|
| 232 |
+
* @f$ \alpha = m @f$ by:
|
| 233 |
+
* @f[
|
| 234 |
+
* L_n^m(x) = (-1)^m \frac{d^m}{dx^m} L_{n + m}(x)
|
| 235 |
+
* @f]
|
| 236 |
+
* where the Laguerre polynomial is defined by:
|
| 237 |
+
* @f[
|
| 238 |
+
* L_n(x) = \frac{e^x}{n!} \frac{d^n}{dx^n} (x^ne^{-x})
|
| 239 |
+
* @f]
|
| 240 |
+
*
|
| 241 |
+
* @param __n The order of the Laguerre function.
|
| 242 |
+
* @param __alpha The degree of the Laguerre function.
|
| 243 |
+
* @param __x The argument of the Laguerre function.
|
| 244 |
+
* @return The value of the Laguerre function of order n,
|
| 245 |
+
* degree @f$ \alpha @f$, and argument x.
|
| 246 |
+
*/
|
| 247 |
+
template<typename _Tpa, typename _Tp>
|
| 248 |
+
inline _Tp
|
| 249 |
+
__poly_laguerre(const unsigned int __n, const _Tpa __alpha1,
|
| 250 |
+
const _Tp __x)
|
| 251 |
+
{
|
| 252 |
+
if (__x < _Tp(0))
|
| 253 |
+
std::__throw_domain_error(__N("Negative argument "
|
| 254 |
+
"in __poly_laguerre."));
|
| 255 |
+
// Return NaN on NaN input.
|
| 256 |
+
else if (__isnan(__x))
|
| 257 |
+
return std::numeric_limits<_Tp>::quiet_NaN();
|
| 258 |
+
else if (__n == 0)
|
| 259 |
+
return _Tp(1);
|
| 260 |
+
else if (__n == 1)
|
| 261 |
+
return _Tp(1) + _Tp(__alpha1) - __x;
|
| 262 |
+
else if (__x == _Tp(0))
|
| 263 |
+
{
|
| 264 |
+
_Tp __prod = _Tp(__alpha1) + _Tp(1);
|
| 265 |
+
for (unsigned int __k = 2; __k <= __n; ++__k)
|
| 266 |
+
__prod *= (_Tp(__alpha1) + _Tp(__k)) / _Tp(__k);
|
| 267 |
+
return __prod;
|
| 268 |
+
}
|
| 269 |
+
else if (__n > 10000000 && _Tp(__alpha1) > -_Tp(1)
|
| 270 |
+
&& __x < _Tp(2) * (_Tp(__alpha1) + _Tp(1)) + _Tp(4 * __n))
|
| 271 |
+
return __poly_laguerre_large_n(__n, __alpha1, __x);
|
| 272 |
+
else if (_Tp(__alpha1) >= _Tp(0)
|
| 273 |
+
|| (__x > _Tp(0) && _Tp(__alpha1) < -_Tp(__n + 1)))
|
| 274 |
+
return __poly_laguerre_recursion(__n, __alpha1, __x);
|
| 275 |
+
else
|
| 276 |
+
return __poly_laguerre_hyperg(__n, __alpha1, __x);
|
| 277 |
+
}
|
| 278 |
+
|
| 279 |
+
|
| 280 |
+
/**
|
| 281 |
+
* @brief This routine returns the associated Laguerre polynomial
|
| 282 |
+
* of order n, degree m: @f$ L_n^m(x) @f$.
|
| 283 |
+
*
|
| 284 |
+
* The associated Laguerre polynomial is defined for integral
|
| 285 |
+
* @f$ \alpha = m @f$ by:
|
| 286 |
+
* @f[
|
| 287 |
+
* L_n^m(x) = (-1)^m \frac{d^m}{dx^m} L_{n + m}(x)
|
| 288 |
+
* @f]
|
| 289 |
+
* where the Laguerre polynomial is defined by:
|
| 290 |
+
* @f[
|
| 291 |
+
* L_n(x) = \frac{e^x}{n!} \frac{d^n}{dx^n} (x^ne^{-x})
|
| 292 |
+
* @f]
|
| 293 |
+
*
|
| 294 |
+
* @param __n The order of the Laguerre polynomial.
|
| 295 |
+
* @param __m The degree of the Laguerre polynomial.
|
| 296 |
+
* @param __x The argument of the Laguerre polynomial.
|
| 297 |
+
* @return The value of the associated Laguerre polynomial of order n,
|
| 298 |
+
* degree m, and argument x.
|
| 299 |
+
*/
|
| 300 |
+
template<typename _Tp>
|
| 301 |
+
inline _Tp
|
| 302 |
+
__assoc_laguerre(const unsigned int __n, const unsigned int __m,
|
| 303 |
+
const _Tp __x)
|
| 304 |
+
{
|
| 305 |
+
return __poly_laguerre<unsigned int, _Tp>(__n, __m, __x);
|
| 306 |
+
}
|
| 307 |
+
|
| 308 |
+
|
| 309 |
+
/**
|
| 310 |
+
* @brief This routine returns the Laguerre polynomial
|
| 311 |
+
* of order n: @f$ L_n(x) @f$.
|
| 312 |
+
*
|
| 313 |
+
* The Laguerre polynomial is defined by:
|
| 314 |
+
* @f[
|
| 315 |
+
* L_n(x) = \frac{e^x}{n!} \frac{d^n}{dx^n} (x^ne^{-x})
|
| 316 |
+
* @f]
|
| 317 |
+
*
|
| 318 |
+
* @param __n The order of the Laguerre polynomial.
|
| 319 |
+
* @param __x The argument of the Laguerre polynomial.
|
| 320 |
+
* @return The value of the Laguerre polynomial of order n
|
| 321 |
+
* and argument x.
|
| 322 |
+
*/
|
| 323 |
+
template<typename _Tp>
|
| 324 |
+
inline _Tp
|
| 325 |
+
__laguerre(const unsigned int __n, const _Tp __x)
|
| 326 |
+
{
|
| 327 |
+
return __poly_laguerre<unsigned int, _Tp>(__n, 0, __x);
|
| 328 |
+
}
|
| 329 |
+
|
| 330 |
+
} // namespace std::tr1::__detail
|
| 331 |
+
}
|
| 332 |
+
}
|
| 333 |
+
|
| 334 |
+
#endif // _GLIBCXX_TR1_POLY_LAGUERRE_TCC
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/random
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// random number generation -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2006, 2007 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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
|
| 7 |
+
// terms of the GNU General Public License as published by the
|
| 8 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 9 |
+
// any later version.
|
| 10 |
+
|
| 11 |
+
// This library is distributed in the hope that it will be useful,
|
| 12 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 13 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 14 |
+
// GNU General Public License for more details.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License along
|
| 17 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 18 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 19 |
+
// USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free software
|
| 22 |
+
// library without restriction. Specifically, if other files instantiate
|
| 23 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 24 |
+
// this file and link it with other files to produce an executable, this
|
| 25 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 26 |
+
// the GNU General Public License. This exception does not however
|
| 27 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 28 |
+
// the GNU General Public License.
|
| 29 |
+
|
| 30 |
+
/**
|
| 31 |
+
* @file tr1/random
|
| 32 |
+
* This is a TR1 C++ Library header.
|
| 33 |
+
*/
|
| 34 |
+
|
| 35 |
+
#ifndef _GLIBCXX_TR1_RANDOM
|
| 36 |
+
#define _GLIBCXX_TR1_RANDOM 1
|
| 37 |
+
|
| 38 |
+
#pragma GCC system_header
|
| 39 |
+
|
| 40 |
+
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
| 41 |
+
# error TR1 header cannot be included from C++0x header
|
| 42 |
+
#endif
|
| 43 |
+
|
| 44 |
+
#include <cmath>
|
| 45 |
+
#include <cstdio>
|
| 46 |
+
#include <cstdlib>
|
| 47 |
+
#include <string>
|
| 48 |
+
#include <iosfwd>
|
| 49 |
+
#include <limits>
|
| 50 |
+
#include <ext/type_traits.h>
|
| 51 |
+
#include <ext/numeric_traits.h>
|
| 52 |
+
#include <bits/concept_check.h>
|
| 53 |
+
#include <debug/debug.h>
|
| 54 |
+
#include <tr1/type_traits>
|
| 55 |
+
#include <tr1/cmath>
|
| 56 |
+
|
| 57 |
+
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
| 58 |
+
# include <tr1_impl/random>
|
| 59 |
+
#else
|
| 60 |
+
# define _GLIBCXX_INCLUDE_AS_TR1
|
| 61 |
+
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
|
| 62 |
+
# define _GLIBCXX_END_NAMESPACE_TR1 }
|
| 63 |
+
# define _GLIBCXX_TR1 tr1::
|
| 64 |
+
# include <tr1_impl/random>
|
| 65 |
+
# undef _GLIBCXX_TR1
|
| 66 |
+
# undef _GLIBCXX_END_NAMESPACE_TR1
|
| 67 |
+
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
| 68 |
+
# undef _GLIBCXX_INCLUDE_AS_TR1
|
| 69 |
+
#endif
|
| 70 |
+
|
| 71 |
+
#endif // _GLIBCXX_TR1_RANDOM
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/regex
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// class template regex -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2007 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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
|
| 7 |
+
// terms of the GNU General Public License as published by the
|
| 8 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 9 |
+
// any later version.
|
| 10 |
+
|
| 11 |
+
// This library is distributed in the hope that it will be useful,
|
| 12 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 13 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 14 |
+
// GNU General Public License for more details.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License along
|
| 17 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 18 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 19 |
+
// USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free software
|
| 22 |
+
// library without restriction. Specifically, if other files instantiate
|
| 23 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 24 |
+
// this file and link it with other files to produce an executable, this
|
| 25 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 26 |
+
// the GNU General Public License. This exception does not however
|
| 27 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 28 |
+
// the GNU General Public License.
|
| 29 |
+
|
| 30 |
+
/**
|
| 31 |
+
* @file tr1/regex
|
| 32 |
+
* @author Stephen M. Webb <stephen.webb@bregmasoft.ca>
|
| 33 |
+
* This is a TR1 C++ Library header.
|
| 34 |
+
*/
|
| 35 |
+
|
| 36 |
+
#ifndef _GLIBCXX_TR1_REGEX
|
| 37 |
+
#define _GLIBCXX_TR1_REGEX 1
|
| 38 |
+
|
| 39 |
+
#pragma GCC system_header
|
| 40 |
+
|
| 41 |
+
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
| 42 |
+
# error TR1 header cannot be included from C++0x header
|
| 43 |
+
#endif
|
| 44 |
+
|
| 45 |
+
#include <algorithm>
|
| 46 |
+
#include <bitset>
|
| 47 |
+
#include <iterator>
|
| 48 |
+
#include <locale>
|
| 49 |
+
#include <stdexcept>
|
| 50 |
+
#include <string>
|
| 51 |
+
#include <vector>
|
| 52 |
+
#include <utility>
|
| 53 |
+
|
| 54 |
+
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
| 55 |
+
# include <tr1_impl/regex>
|
| 56 |
+
#else
|
| 57 |
+
# define _GLIBCXX_INCLUDE_AS_TR1
|
| 58 |
+
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
|
| 59 |
+
# define _GLIBCXX_END_NAMESPACE_TR1 }
|
| 60 |
+
# define _GLIBCXX_TR1 tr1::
|
| 61 |
+
# include <tr1_impl/regex>
|
| 62 |
+
# undef _GLIBCXX_TR1
|
| 63 |
+
# undef _GLIBCXX_END_NAMESPACE_TR1
|
| 64 |
+
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
| 65 |
+
# undef _GLIBCXX_INCLUDE_AS_TR1
|
| 66 |
+
#endif
|
| 67 |
+
|
| 68 |
+
#endif // _GLIBCXX_TR1_REGEX
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/riemann_zeta.tcc
ADDED
|
@@ -0,0 +1,440 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Special functions -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2006, 2007, 2008
|
| 4 |
+
// Free Software Foundation, Inc.
|
| 5 |
+
//
|
| 6 |
+
// This file is part of the GNU ISO C++ Library. This library is free
|
| 7 |
+
// software; you can redistribute it and/or modify it under the
|
| 8 |
+
// terms of the GNU General Public License as published by the
|
| 9 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 10 |
+
// any later version.
|
| 11 |
+
//
|
| 12 |
+
// This library is distributed in the hope that it will be useful,
|
| 13 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
// GNU General Public License for more details.
|
| 16 |
+
//
|
| 17 |
+
// You should have received a copy of the GNU General Public License along
|
| 18 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 19 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 20 |
+
// USA.
|
| 21 |
+
//
|
| 22 |
+
// As a special exception, you may use this file as part of a free software
|
| 23 |
+
// library without restriction. Specifically, if other files instantiate
|
| 24 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 25 |
+
// this file and link it with other files to produce an executable, this
|
| 26 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 27 |
+
// the GNU General Public License. This exception does not however
|
| 28 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 29 |
+
// the GNU General Public License.
|
| 30 |
+
|
| 31 |
+
/** @file tr1/riemann_zeta.tcc
|
| 32 |
+
* This is an internal header file, included by other library headers.
|
| 33 |
+
* You should not attempt to use it directly.
|
| 34 |
+
*/
|
| 35 |
+
|
| 36 |
+
//
|
| 37 |
+
// ISO C++ 14882 TR1: 5.2 Special functions
|
| 38 |
+
//
|
| 39 |
+
|
| 40 |
+
// Written by Edward Smith-Rowland based on:
|
| 41 |
+
// (1) Handbook of Mathematical Functions,
|
| 42 |
+
// Ed. by Milton Abramowitz and Irene A. Stegun,
|
| 43 |
+
// Dover Publications, New-York, Section 5, pp. 807-808.
|
| 44 |
+
// (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl
|
| 45 |
+
// (3) Gamma, Exploring Euler's Constant, Julian Havil,
|
| 46 |
+
// Princeton, 2003.
|
| 47 |
+
|
| 48 |
+
#ifndef _GLIBCXX_TR1_RIEMANN_ZETA_TCC
|
| 49 |
+
#define _GLIBCXX_TR1_RIEMANN_ZETA_TCC 1
|
| 50 |
+
|
| 51 |
+
#include "special_function_util.h"
|
| 52 |
+
|
| 53 |
+
namespace std
|
| 54 |
+
{
|
| 55 |
+
namespace tr1
|
| 56 |
+
{
|
| 57 |
+
|
| 58 |
+
// [5.2] Special functions
|
| 59 |
+
|
| 60 |
+
// Implementation-space details.
|
| 61 |
+
namespace __detail
|
| 62 |
+
{
|
| 63 |
+
|
| 64 |
+
/**
|
| 65 |
+
* @brief Compute the Riemann zeta function @f$ \zeta(s) @f$
|
| 66 |
+
* by summation for s > 1.
|
| 67 |
+
*
|
| 68 |
+
* The Riemann zeta function is defined by:
|
| 69 |
+
* \f[
|
| 70 |
+
* \zeta(s) = \sum_{k=1}^{\infty} \frac{1}{k^{s}} for s > 1
|
| 71 |
+
* \f]
|
| 72 |
+
* For s < 1 use the reflection formula:
|
| 73 |
+
* \f[
|
| 74 |
+
* \zeta(s) = 2^s \pi^{s-1} \Gamma(1-s) \zeta(1-s)
|
| 75 |
+
* \f]
|
| 76 |
+
*/
|
| 77 |
+
template<typename _Tp>
|
| 78 |
+
_Tp
|
| 79 |
+
__riemann_zeta_sum(const _Tp __s)
|
| 80 |
+
{
|
| 81 |
+
// A user shouldn't get to this.
|
| 82 |
+
if (__s < _Tp(1))
|
| 83 |
+
std::__throw_domain_error(__N("Bad argument in zeta sum."));
|
| 84 |
+
|
| 85 |
+
const unsigned int max_iter = 10000;
|
| 86 |
+
_Tp __zeta = _Tp(0);
|
| 87 |
+
for (unsigned int __k = 1; __k < max_iter; ++__k)
|
| 88 |
+
{
|
| 89 |
+
_Tp __term = std::pow(static_cast<_Tp>(__k), -__s);
|
| 90 |
+
if (__term < std::numeric_limits<_Tp>::epsilon())
|
| 91 |
+
{
|
| 92 |
+
break;
|
| 93 |
+
}
|
| 94 |
+
__zeta += __term;
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
return __zeta;
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
|
| 101 |
+
/**
|
| 102 |
+
* @brief Evaluate the Riemann zeta function @f$ \zeta(s) @f$
|
| 103 |
+
* by an alternate series for s > 0.
|
| 104 |
+
*
|
| 105 |
+
* The Riemann zeta function is defined by:
|
| 106 |
+
* \f[
|
| 107 |
+
* \zeta(s) = \sum_{k=1}^{\infty} \frac{1}{k^{s}} for s > 1
|
| 108 |
+
* \f]
|
| 109 |
+
* For s < 1 use the reflection formula:
|
| 110 |
+
* \f[
|
| 111 |
+
* \zeta(s) = 2^s \pi^{s-1} \Gamma(1-s) \zeta(1-s)
|
| 112 |
+
* \f]
|
| 113 |
+
*/
|
| 114 |
+
template<typename _Tp>
|
| 115 |
+
_Tp
|
| 116 |
+
__riemann_zeta_alt(const _Tp __s)
|
| 117 |
+
{
|
| 118 |
+
_Tp __sgn = _Tp(1);
|
| 119 |
+
_Tp __zeta = _Tp(0);
|
| 120 |
+
for (unsigned int __i = 1; __i < 10000000; ++__i)
|
| 121 |
+
{
|
| 122 |
+
_Tp __term = __sgn / std::pow(__i, __s);
|
| 123 |
+
if (std::abs(__term) < std::numeric_limits<_Tp>::epsilon())
|
| 124 |
+
break;
|
| 125 |
+
__zeta += __term;
|
| 126 |
+
__sgn *= _Tp(-1);
|
| 127 |
+
}
|
| 128 |
+
__zeta /= _Tp(1) - std::pow(_Tp(2), _Tp(1) - __s);
|
| 129 |
+
|
| 130 |
+
return __zeta;
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
|
| 134 |
+
/**
|
| 135 |
+
* @brief Evaluate the Riemann zeta function by series for all s != 1.
|
| 136 |
+
* Convergence is great until largish negative numbers.
|
| 137 |
+
* Then the convergence of the > 0 sum gets better.
|
| 138 |
+
*
|
| 139 |
+
* The series is:
|
| 140 |
+
* \f[
|
| 141 |
+
* \zeta(s) = \frac{1}{1-2^{1-s}}
|
| 142 |
+
* \sum_{n=0}^{\infty} \frac{1}{2^{n+1}}
|
| 143 |
+
* \sum_{k=0}^{n} (-1)^k \frac{n!}{(n-k)!k!} (k+1)^{-s}
|
| 144 |
+
* \f]
|
| 145 |
+
* Havil 2003, p. 206.
|
| 146 |
+
*
|
| 147 |
+
* The Riemann zeta function is defined by:
|
| 148 |
+
* \f[
|
| 149 |
+
* \zeta(s) = \sum_{k=1}^{\infty} \frac{1}{k^{s}} for s > 1
|
| 150 |
+
* \f]
|
| 151 |
+
* For s < 1 use the reflection formula:
|
| 152 |
+
* \f[
|
| 153 |
+
* \zeta(s) = 2^s \pi^{s-1} \Gamma(1-s) \zeta(1-s)
|
| 154 |
+
* \f]
|
| 155 |
+
*/
|
| 156 |
+
template<typename _Tp>
|
| 157 |
+
_Tp
|
| 158 |
+
__riemann_zeta_glob(const _Tp __s)
|
| 159 |
+
{
|
| 160 |
+
_Tp __zeta = _Tp(0);
|
| 161 |
+
|
| 162 |
+
const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
|
| 163 |
+
// Max e exponent before overflow.
|
| 164 |
+
const _Tp __max_bincoeff = std::numeric_limits<_Tp>::max_exponent10
|
| 165 |
+
* std::log(_Tp(10)) - _Tp(1);
|
| 166 |
+
|
| 167 |
+
// This series works until the binomial coefficient blows up
|
| 168 |
+
// so use reflection.
|
| 169 |
+
if (__s < _Tp(0))
|
| 170 |
+
{
|
| 171 |
+
#if _GLIBCXX_USE_C99_MATH_TR1
|
| 172 |
+
if (std::tr1::fmod(__s,_Tp(2)) == _Tp(0))
|
| 173 |
+
return _Tp(0);
|
| 174 |
+
else
|
| 175 |
+
#endif
|
| 176 |
+
{
|
| 177 |
+
_Tp __zeta = __riemann_zeta_glob(_Tp(1) - __s);
|
| 178 |
+
__zeta *= std::pow(_Tp(2)
|
| 179 |
+
* __numeric_constants<_Tp>::__pi(), __s)
|
| 180 |
+
* std::sin(__numeric_constants<_Tp>::__pi_2() * __s)
|
| 181 |
+
#if _GLIBCXX_USE_C99_MATH_TR1
|
| 182 |
+
* std::exp(std::tr1::lgamma(_Tp(1) - __s))
|
| 183 |
+
#else
|
| 184 |
+
* std::exp(__log_gamma(_Tp(1) - __s))
|
| 185 |
+
#endif
|
| 186 |
+
/ __numeric_constants<_Tp>::__pi();
|
| 187 |
+
return __zeta;
|
| 188 |
+
}
|
| 189 |
+
}
|
| 190 |
+
|
| 191 |
+
_Tp __num = _Tp(0.5L);
|
| 192 |
+
const unsigned int __maxit = 10000;
|
| 193 |
+
for (unsigned int __i = 0; __i < __maxit; ++__i)
|
| 194 |
+
{
|
| 195 |
+
bool __punt = false;
|
| 196 |
+
_Tp __sgn = _Tp(1);
|
| 197 |
+
_Tp __term = _Tp(0);
|
| 198 |
+
for (unsigned int __j = 0; __j <= __i; ++__j)
|
| 199 |
+
{
|
| 200 |
+
#if _GLIBCXX_USE_C99_MATH_TR1
|
| 201 |
+
_Tp __bincoeff = std::tr1::lgamma(_Tp(1 + __i))
|
| 202 |
+
- std::tr1::lgamma(_Tp(1 + __j))
|
| 203 |
+
- std::tr1::lgamma(_Tp(1 + __i - __j));
|
| 204 |
+
#else
|
| 205 |
+
_Tp __bincoeff = __log_gamma(_Tp(1 + __i))
|
| 206 |
+
- __log_gamma(_Tp(1 + __j))
|
| 207 |
+
- __log_gamma(_Tp(1 + __i - __j));
|
| 208 |
+
#endif
|
| 209 |
+
if (__bincoeff > __max_bincoeff)
|
| 210 |
+
{
|
| 211 |
+
// This only gets hit for x << 0.
|
| 212 |
+
__punt = true;
|
| 213 |
+
break;
|
| 214 |
+
}
|
| 215 |
+
__bincoeff = std::exp(__bincoeff);
|
| 216 |
+
__term += __sgn * __bincoeff * std::pow(_Tp(1 + __j), -__s);
|
| 217 |
+
__sgn *= _Tp(-1);
|
| 218 |
+
}
|
| 219 |
+
if (__punt)
|
| 220 |
+
break;
|
| 221 |
+
__term *= __num;
|
| 222 |
+
__zeta += __term;
|
| 223 |
+
if (std::abs(__term/__zeta) < __eps)
|
| 224 |
+
break;
|
| 225 |
+
__num *= _Tp(0.5L);
|
| 226 |
+
}
|
| 227 |
+
|
| 228 |
+
__zeta /= _Tp(1) - std::pow(_Tp(2), _Tp(1) - __s);
|
| 229 |
+
|
| 230 |
+
return __zeta;
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
|
| 234 |
+
/**
|
| 235 |
+
* @brief Compute the Riemann zeta function @f$ \zeta(s) @f$
|
| 236 |
+
* using the product over prime factors.
|
| 237 |
+
* \f[
|
| 238 |
+
* \zeta(s) = \Pi_{i=1}^\infty \frac{1}{1 - p_i^{-s}}
|
| 239 |
+
* \f]
|
| 240 |
+
* where @f$ {p_i} @f$ are the prime numbers.
|
| 241 |
+
*
|
| 242 |
+
* The Riemann zeta function is defined by:
|
| 243 |
+
* \f[
|
| 244 |
+
* \zeta(s) = \sum_{k=1}^{\infty} \frac{1}{k^{s}} for s > 1
|
| 245 |
+
* \f]
|
| 246 |
+
* For s < 1 use the reflection formula:
|
| 247 |
+
* \f[
|
| 248 |
+
* \zeta(s) = 2^s \pi^{s-1} \Gamma(1-s) \zeta(1-s)
|
| 249 |
+
* \f]
|
| 250 |
+
*/
|
| 251 |
+
template<typename _Tp>
|
| 252 |
+
_Tp
|
| 253 |
+
__riemann_zeta_product(const _Tp __s)
|
| 254 |
+
{
|
| 255 |
+
static const _Tp __prime[] = {
|
| 256 |
+
_Tp(2), _Tp(3), _Tp(5), _Tp(7), _Tp(11), _Tp(13), _Tp(17), _Tp(19),
|
| 257 |
+
_Tp(23), _Tp(29), _Tp(31), _Tp(37), _Tp(41), _Tp(43), _Tp(47),
|
| 258 |
+
_Tp(53), _Tp(59), _Tp(61), _Tp(67), _Tp(71), _Tp(73), _Tp(79),
|
| 259 |
+
_Tp(83), _Tp(89), _Tp(97), _Tp(101), _Tp(103), _Tp(107), _Tp(109)
|
| 260 |
+
};
|
| 261 |
+
static const unsigned int __num_primes = sizeof(__prime) / sizeof(_Tp);
|
| 262 |
+
|
| 263 |
+
_Tp __zeta = _Tp(1);
|
| 264 |
+
for (unsigned int __i = 0; __i < __num_primes; ++__i)
|
| 265 |
+
{
|
| 266 |
+
const _Tp __fact = _Tp(1) - std::pow(__prime[__i], -__s);
|
| 267 |
+
__zeta *= __fact;
|
| 268 |
+
if (_Tp(1) - __fact < std::numeric_limits<_Tp>::epsilon())
|
| 269 |
+
break;
|
| 270 |
+
}
|
| 271 |
+
|
| 272 |
+
__zeta = _Tp(1) / __zeta;
|
| 273 |
+
|
| 274 |
+
return __zeta;
|
| 275 |
+
}
|
| 276 |
+
|
| 277 |
+
|
| 278 |
+
/**
|
| 279 |
+
* @brief Return the Riemann zeta function @f$ \zeta(s) @f$.
|
| 280 |
+
*
|
| 281 |
+
* The Riemann zeta function is defined by:
|
| 282 |
+
* \f[
|
| 283 |
+
* \zeta(s) = \sum_{k=1}^{\infty} k^{-s} for s > 1
|
| 284 |
+
* \frac{(2\pi)^s}{pi} sin(\frac{\pi s}{2})
|
| 285 |
+
* \Gamma (1 - s) \zeta (1 - s) for s < 1
|
| 286 |
+
* \f]
|
| 287 |
+
* For s < 1 use the reflection formula:
|
| 288 |
+
* \f[
|
| 289 |
+
* \zeta(s) = 2^s \pi^{s-1} \Gamma(1-s) \zeta(1-s)
|
| 290 |
+
* \f]
|
| 291 |
+
*/
|
| 292 |
+
template<typename _Tp>
|
| 293 |
+
_Tp
|
| 294 |
+
__riemann_zeta(const _Tp __s)
|
| 295 |
+
{
|
| 296 |
+
if (__isnan(__s))
|
| 297 |
+
return std::numeric_limits<_Tp>::quiet_NaN();
|
| 298 |
+
else if (__s == _Tp(1))
|
| 299 |
+
return std::numeric_limits<_Tp>::infinity();
|
| 300 |
+
else if (__s < -_Tp(19))
|
| 301 |
+
{
|
| 302 |
+
_Tp __zeta = __riemann_zeta_product(_Tp(1) - __s);
|
| 303 |
+
__zeta *= std::pow(_Tp(2) * __numeric_constants<_Tp>::__pi(), __s)
|
| 304 |
+
* std::sin(__numeric_constants<_Tp>::__pi_2() * __s)
|
| 305 |
+
#if _GLIBCXX_USE_C99_MATH_TR1
|
| 306 |
+
* std::exp(std::tr1::lgamma(_Tp(1) - __s))
|
| 307 |
+
#else
|
| 308 |
+
* std::exp(__log_gamma(_Tp(1) - __s))
|
| 309 |
+
#endif
|
| 310 |
+
/ __numeric_constants<_Tp>::__pi();
|
| 311 |
+
return __zeta;
|
| 312 |
+
}
|
| 313 |
+
else if (__s < _Tp(20))
|
| 314 |
+
{
|
| 315 |
+
// Global double sum or McLaurin?
|
| 316 |
+
bool __glob = true;
|
| 317 |
+
if (__glob)
|
| 318 |
+
return __riemann_zeta_glob(__s);
|
| 319 |
+
else
|
| 320 |
+
{
|
| 321 |
+
if (__s > _Tp(1))
|
| 322 |
+
return __riemann_zeta_sum(__s);
|
| 323 |
+
else
|
| 324 |
+
{
|
| 325 |
+
_Tp __zeta = std::pow(_Tp(2)
|
| 326 |
+
* __numeric_constants<_Tp>::__pi(), __s)
|
| 327 |
+
* std::sin(__numeric_constants<_Tp>::__pi_2() * __s)
|
| 328 |
+
#if _GLIBCXX_USE_C99_MATH_TR1
|
| 329 |
+
* std::tr1::tgamma(_Tp(1) - __s)
|
| 330 |
+
#else
|
| 331 |
+
* std::exp(__log_gamma(_Tp(1) - __s))
|
| 332 |
+
#endif
|
| 333 |
+
* __riemann_zeta_sum(_Tp(1) - __s);
|
| 334 |
+
return __zeta;
|
| 335 |
+
}
|
| 336 |
+
}
|
| 337 |
+
}
|
| 338 |
+
else
|
| 339 |
+
return __riemann_zeta_product(__s);
|
| 340 |
+
}
|
| 341 |
+
|
| 342 |
+
|
| 343 |
+
/**
|
| 344 |
+
* @brief Return the Hurwitz zeta function @f$ \zeta(x,s) @f$
|
| 345 |
+
* for all s != 1 and x > -1.
|
| 346 |
+
*
|
| 347 |
+
* The Hurwitz zeta function is defined by:
|
| 348 |
+
* @f[
|
| 349 |
+
* \zeta(x,s) = \sum_{n=0}^{\infty} \frac{1}{(n + x)^s}
|
| 350 |
+
* @f]
|
| 351 |
+
* The Riemann zeta function is a special case:
|
| 352 |
+
* @f[
|
| 353 |
+
* \zeta(s) = \zeta(1,s)
|
| 354 |
+
* @f]
|
| 355 |
+
*
|
| 356 |
+
* This functions uses the double sum that converges for s != 1
|
| 357 |
+
* and x > -1:
|
| 358 |
+
* @f[
|
| 359 |
+
* \zeta(x,s) = \frac{1}{s-1}
|
| 360 |
+
* \sum_{n=0}^{\infty} \frac{1}{n + 1}
|
| 361 |
+
* \sum_{k=0}^{n} (-1)^k \frac{n!}{(n-k)!k!} (x+k)^{-s}
|
| 362 |
+
* @f]
|
| 363 |
+
*/
|
| 364 |
+
template<typename _Tp>
|
| 365 |
+
_Tp
|
| 366 |
+
__hurwitz_zeta_glob(const _Tp __a, const _Tp __s)
|
| 367 |
+
{
|
| 368 |
+
_Tp __zeta = _Tp(0);
|
| 369 |
+
|
| 370 |
+
const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
|
| 371 |
+
// Max e exponent before overflow.
|
| 372 |
+
const _Tp __max_bincoeff = std::numeric_limits<_Tp>::max_exponent10
|
| 373 |
+
* std::log(_Tp(10)) - _Tp(1);
|
| 374 |
+
|
| 375 |
+
const unsigned int __maxit = 10000;
|
| 376 |
+
for (unsigned int __i = 0; __i < __maxit; ++__i)
|
| 377 |
+
{
|
| 378 |
+
bool __punt = false;
|
| 379 |
+
_Tp __sgn = _Tp(1);
|
| 380 |
+
_Tp __term = _Tp(0);
|
| 381 |
+
for (unsigned int __j = 0; __j <= __i; ++__j)
|
| 382 |
+
{
|
| 383 |
+
#if _GLIBCXX_USE_C99_MATH_TR1
|
| 384 |
+
_Tp __bincoeff = std::tr1::lgamma(_Tp(1 + __i))
|
| 385 |
+
- std::tr1::lgamma(_Tp(1 + __j))
|
| 386 |
+
- std::tr1::lgamma(_Tp(1 + __i - __j));
|
| 387 |
+
#else
|
| 388 |
+
_Tp __bincoeff = __log_gamma(_Tp(1 + __i))
|
| 389 |
+
- __log_gamma(_Tp(1 + __j))
|
| 390 |
+
- __log_gamma(_Tp(1 + __i - __j));
|
| 391 |
+
#endif
|
| 392 |
+
if (__bincoeff > __max_bincoeff)
|
| 393 |
+
{
|
| 394 |
+
// This only gets hit for x << 0.
|
| 395 |
+
__punt = true;
|
| 396 |
+
break;
|
| 397 |
+
}
|
| 398 |
+
__bincoeff = std::exp(__bincoeff);
|
| 399 |
+
__term += __sgn * __bincoeff * std::pow(_Tp(__a + __j), -__s);
|
| 400 |
+
__sgn *= _Tp(-1);
|
| 401 |
+
}
|
| 402 |
+
if (__punt)
|
| 403 |
+
break;
|
| 404 |
+
__term /= _Tp(__i + 1);
|
| 405 |
+
if (std::abs(__term / __zeta) < __eps)
|
| 406 |
+
break;
|
| 407 |
+
__zeta += __term;
|
| 408 |
+
}
|
| 409 |
+
|
| 410 |
+
__zeta /= __s - _Tp(1);
|
| 411 |
+
|
| 412 |
+
return __zeta;
|
| 413 |
+
}
|
| 414 |
+
|
| 415 |
+
|
| 416 |
+
/**
|
| 417 |
+
* @brief Return the Hurwitz zeta function @f$ \zeta(x,s) @f$
|
| 418 |
+
* for all s != 1 and x > -1.
|
| 419 |
+
*
|
| 420 |
+
* The Hurwitz zeta function is defined by:
|
| 421 |
+
* @f[
|
| 422 |
+
* \zeta(x,s) = \sum_{n=0}^{\infty} \frac{1}{(n + x)^s}
|
| 423 |
+
* @f]
|
| 424 |
+
* The Riemann zeta function is a special case:
|
| 425 |
+
* @f[
|
| 426 |
+
* \zeta(s) = \zeta(1,s)
|
| 427 |
+
* @f]
|
| 428 |
+
*/
|
| 429 |
+
template<typename _Tp>
|
| 430 |
+
inline _Tp
|
| 431 |
+
__hurwitz_zeta(const _Tp __a, const _Tp __s)
|
| 432 |
+
{
|
| 433 |
+
return __hurwitz_zeta_glob(__a, __s);
|
| 434 |
+
}
|
| 435 |
+
|
| 436 |
+
} // namespace std::tr1::__detail
|
| 437 |
+
}
|
| 438 |
+
}
|
| 439 |
+
|
| 440 |
+
#endif // _GLIBCXX_TR1_RIEMANN_ZETA_TCC
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/special_function_util.h
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Special functions -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2006
|
| 4 |
+
// Free Software Foundation, Inc.
|
| 5 |
+
//
|
| 6 |
+
// This file is part of the GNU ISO C++ Library. This library is free
|
| 7 |
+
// software; you can redistribute it and/or modify it under the
|
| 8 |
+
// terms of the GNU General Public License as published by the
|
| 9 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 10 |
+
// any later version.
|
| 11 |
+
|
| 12 |
+
// This library is distributed in the hope that it will be useful,
|
| 13 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
+
// GNU General Public License for more details.
|
| 16 |
+
|
| 17 |
+
// You should have received a copy of the GNU General Public License along
|
| 18 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 19 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 20 |
+
// USA.
|
| 21 |
+
|
| 22 |
+
// As a special exception, you may use this file as part of a free software
|
| 23 |
+
// library without restriction. Specifically, if other files instantiate
|
| 24 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 25 |
+
// this file and link it with other files to produce an executable, this
|
| 26 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 27 |
+
// the GNU General Public License. This exception does not however
|
| 28 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 29 |
+
// the GNU General Public License.
|
| 30 |
+
|
| 31 |
+
/** @file tr1/special_function_util.h
|
| 32 |
+
* This is an internal header file, included by other library headers.
|
| 33 |
+
* You should not attempt to use it directly.
|
| 34 |
+
*/
|
| 35 |
+
|
| 36 |
+
//
|
| 37 |
+
// ISO C++ 14882 TR1: 5.2 Special functions
|
| 38 |
+
//
|
| 39 |
+
|
| 40 |
+
// Written by Edward Smith-Rowland based on numerous mathematics books.
|
| 41 |
+
|
| 42 |
+
#ifndef _GLIBCXX_TR1_SPECIAL_FUNCTION_UTIL_H
|
| 43 |
+
#define _GLIBCXX_TR1_SPECIAL_FUNCTION_UTIL_H 1
|
| 44 |
+
|
| 45 |
+
namespace std
|
| 46 |
+
{
|
| 47 |
+
namespace tr1
|
| 48 |
+
{
|
| 49 |
+
|
| 50 |
+
namespace __detail
|
| 51 |
+
{
|
| 52 |
+
|
| 53 |
+
/// A class to encapsulate type dependent floating point
|
| 54 |
+
/// constants. Not everything will be able to be expressed as
|
| 55 |
+
/// type logic.
|
| 56 |
+
template<typename _Tp>
|
| 57 |
+
struct __floating_point_constant
|
| 58 |
+
{
|
| 59 |
+
static const _Tp __value;
|
| 60 |
+
};
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
/// A structure for numeric constants.
|
| 64 |
+
template<typename _Tp>
|
| 65 |
+
struct __numeric_constants
|
| 66 |
+
{
|
| 67 |
+
/// Constant @f$ \pi @f$.
|
| 68 |
+
static _Tp __pi() throw()
|
| 69 |
+
{ return static_cast<_Tp>(3.1415926535897932384626433832795029L); }
|
| 70 |
+
/// Constant @f$ \pi / 2 @f$.
|
| 71 |
+
static _Tp __pi_2() throw()
|
| 72 |
+
{ return static_cast<_Tp>(1.5707963267948966192313216916397514L); }
|
| 73 |
+
/// Constant @f$ \pi / 3 @f$.
|
| 74 |
+
static _Tp __pi_3() throw()
|
| 75 |
+
{ return static_cast<_Tp>(1.0471975511965977461542144610931676L); }
|
| 76 |
+
/// Constant @f$ \pi / 4 @f$.
|
| 77 |
+
static _Tp __pi_4() throw()
|
| 78 |
+
{ return static_cast<_Tp>(0.7853981633974483096156608458198757L); }
|
| 79 |
+
/// Constant @f$ 1 / \pi @f$.
|
| 80 |
+
static _Tp __1_pi() throw()
|
| 81 |
+
{ return static_cast<_Tp>(0.3183098861837906715377675267450287L); }
|
| 82 |
+
/// Constant @f$ 2 / \sqrt(\pi) @f$.
|
| 83 |
+
static _Tp __2_sqrtpi() throw()
|
| 84 |
+
{ return static_cast<_Tp>(1.1283791670955125738961589031215452L); }
|
| 85 |
+
/// Constant @f$ \sqrt(2) @f$.
|
| 86 |
+
static _Tp __sqrt2() throw()
|
| 87 |
+
{ return static_cast<_Tp>(1.4142135623730950488016887242096981L); }
|
| 88 |
+
/// Constant @f$ \sqrt(3) @f$.
|
| 89 |
+
static _Tp __sqrt3() throw()
|
| 90 |
+
{ return static_cast<_Tp>(1.7320508075688772935274463415058723L); }
|
| 91 |
+
/// Constant @f$ \sqrt(\pi/2) @f$.
|
| 92 |
+
static _Tp __sqrtpio2() throw()
|
| 93 |
+
{ return static_cast<_Tp>(1.2533141373155002512078826424055226L); }
|
| 94 |
+
/// Constant @f$ 1 / sqrt(2) @f$.
|
| 95 |
+
static _Tp __sqrt1_2() throw()
|
| 96 |
+
{ return static_cast<_Tp>(0.7071067811865475244008443621048490L); }
|
| 97 |
+
/// Constant @f$ \log(\pi) @f$.
|
| 98 |
+
static _Tp __lnpi() throw()
|
| 99 |
+
{ return static_cast<_Tp>(1.1447298858494001741434273513530587L); }
|
| 100 |
+
/// Constant Euler's constant @f$ \gamma_E @f$.
|
| 101 |
+
static _Tp __gamma_e() throw()
|
| 102 |
+
{ return static_cast<_Tp>(0.5772156649015328606065120900824024L); }
|
| 103 |
+
/// Constant Euler-Mascheroni @f$ e @f$
|
| 104 |
+
static _Tp __euler() throw()
|
| 105 |
+
{ return static_cast<_Tp>(2.7182818284590452353602874713526625L); }
|
| 106 |
+
};
|
| 107 |
+
|
| 108 |
+
|
| 109 |
+
#if _GLIBCXX_USE_C99_MATH && !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
|
| 110 |
+
|
| 111 |
+
/// This is a wrapper for the isnan function. Otherwise, for NaN,
|
| 112 |
+
/// all comparisons result in false. If/when we build a std::isnan
|
| 113 |
+
/// out of intrinsics, this will disappear completely in favor of
|
| 114 |
+
/// std::isnan.
|
| 115 |
+
template<typename _Tp>
|
| 116 |
+
inline bool __isnan(const _Tp __x)
|
| 117 |
+
{
|
| 118 |
+
return std::isnan(__x);
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
#else
|
| 122 |
+
|
| 123 |
+
template<typename _Tp>
|
| 124 |
+
inline bool __isnan(const _Tp __x)
|
| 125 |
+
{
|
| 126 |
+
return __builtin_isnan(__x);
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
template<>
|
| 130 |
+
inline bool __isnan<float>(const float __x)
|
| 131 |
+
{
|
| 132 |
+
return __builtin_isnanf(__x);
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
template<>
|
| 136 |
+
inline bool __isnan<long double>(const long double __x)
|
| 137 |
+
{
|
| 138 |
+
return __builtin_isnanl(__x);
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
#endif
|
| 142 |
+
|
| 143 |
+
} // namespace __detail
|
| 144 |
+
|
| 145 |
+
}
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
#endif // _GLIBCXX_TR1_SPECIAL_FUNCTION_UTIL_H
|
| 149 |
+
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/stdarg.h
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// TR1 stdarg.h -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2006 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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
|
| 7 |
+
// terms of the GNU General Public License as published by the
|
| 8 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 9 |
+
// any later version.
|
| 10 |
+
|
| 11 |
+
// This library is distributed in the hope that it will be useful,
|
| 12 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 13 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 14 |
+
// GNU General Public License for more details.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License along
|
| 17 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 18 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 19 |
+
// USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free software
|
| 22 |
+
// library without restriction. Specifically, if other files instantiate
|
| 23 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 24 |
+
// this file and link it with other files to produce an executable, this
|
| 25 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 26 |
+
// the GNU General Public License. This exception does not however
|
| 27 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 28 |
+
// the GNU General Public License.
|
| 29 |
+
|
| 30 |
+
/** @file tr1/stdarg.h
|
| 31 |
+
* This is a TR1 C++ Library header.
|
| 32 |
+
*/
|
| 33 |
+
|
| 34 |
+
#ifndef _TR1_STDARG_H
|
| 35 |
+
#define _TR1_STDARG_H 1
|
| 36 |
+
|
| 37 |
+
#include <tr1/cstdarg>
|
| 38 |
+
|
| 39 |
+
#endif
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/stdbool.h
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// TR1 stdbool.h -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2006 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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
|
| 7 |
+
// terms of the GNU General Public License as published by the
|
| 8 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 9 |
+
// any later version.
|
| 10 |
+
|
| 11 |
+
// This library is distributed in the hope that it will be useful,
|
| 12 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 13 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 14 |
+
// GNU General Public License for more details.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License along
|
| 17 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 18 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 19 |
+
// USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free software
|
| 22 |
+
// library without restriction. Specifically, if other files instantiate
|
| 23 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 24 |
+
// this file and link it with other files to produce an executable, this
|
| 25 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 26 |
+
// the GNU General Public License. This exception does not however
|
| 27 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 28 |
+
// the GNU General Public License.
|
| 29 |
+
|
| 30 |
+
/** @file tr1/stdbool.h
|
| 31 |
+
* This is a TR1 C++ Library header.
|
| 32 |
+
*/
|
| 33 |
+
|
| 34 |
+
#ifndef _TR1_STDBOOL_H
|
| 35 |
+
#define _TR1_STDBOOL_H 1
|
| 36 |
+
|
| 37 |
+
#include <tr1/cstdbool>
|
| 38 |
+
|
| 39 |
+
#endif
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/stdint.h
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// TR1 stdint.h -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2006 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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
|
| 7 |
+
// terms of the GNU General Public License as published by the
|
| 8 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 9 |
+
// any later version.
|
| 10 |
+
|
| 11 |
+
// This library is distributed in the hope that it will be useful,
|
| 12 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 13 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 14 |
+
// GNU General Public License for more details.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License along
|
| 17 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 18 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 19 |
+
// USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free software
|
| 22 |
+
// library without restriction. Specifically, if other files instantiate
|
| 23 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 24 |
+
// this file and link it with other files to produce an executable, this
|
| 25 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 26 |
+
// the GNU General Public License. This exception does not however
|
| 27 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 28 |
+
// the GNU General Public License.
|
| 29 |
+
|
| 30 |
+
/** @file tr1/stdint.h
|
| 31 |
+
* This is a TR1 C++ Library header.
|
| 32 |
+
*/
|
| 33 |
+
|
| 34 |
+
#ifndef _TR1_STDINT_H
|
| 35 |
+
#define _TR1_STDINT_H 1
|
| 36 |
+
|
| 37 |
+
#include <tr1/cstdint>
|
| 38 |
+
|
| 39 |
+
#endif
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/stdio.h
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// TR1 stdio.h -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2006 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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
|
| 7 |
+
// terms of the GNU General Public License as published by the
|
| 8 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 9 |
+
// any later version.
|
| 10 |
+
|
| 11 |
+
// This library is distributed in the hope that it will be useful,
|
| 12 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 13 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 14 |
+
// GNU General Public License for more details.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License along
|
| 17 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 18 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 19 |
+
// USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free software
|
| 22 |
+
// library without restriction. Specifically, if other files instantiate
|
| 23 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 24 |
+
// this file and link it with other files to produce an executable, this
|
| 25 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 26 |
+
// the GNU General Public License. This exception does not however
|
| 27 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 28 |
+
// the GNU General Public License.
|
| 29 |
+
|
| 30 |
+
/** @file tr1/stdio.h
|
| 31 |
+
* This is a TR1 C++ Library header.
|
| 32 |
+
*/
|
| 33 |
+
|
| 34 |
+
#ifndef _TR1_STDIO_H
|
| 35 |
+
#define _TR1_STDIO_H 1
|
| 36 |
+
|
| 37 |
+
#include <tr1/cstdio>
|
| 38 |
+
|
| 39 |
+
#endif
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/stdlib.h
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// TR1 stdlib.h -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2006, 2007 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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
|
| 7 |
+
// terms of the GNU General Public License as published by the
|
| 8 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 9 |
+
// any later version.
|
| 10 |
+
|
| 11 |
+
// This library is distributed in the hope that it will be useful,
|
| 12 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 13 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 14 |
+
// GNU General Public License for more details.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License along
|
| 17 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 18 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 19 |
+
// USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free software
|
| 22 |
+
// library without restriction. Specifically, if other files instantiate
|
| 23 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 24 |
+
// this file and link it with other files to produce an executable, this
|
| 25 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 26 |
+
// the GNU General Public License. This exception does not however
|
| 27 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 28 |
+
// the GNU General Public License.
|
| 29 |
+
|
| 30 |
+
/** @file tr1/stdlib.h
|
| 31 |
+
* This is a TR1 C++ Library header.
|
| 32 |
+
*/
|
| 33 |
+
|
| 34 |
+
#ifndef _GLIBCXX_TR1_STDLIB_H
|
| 35 |
+
#define _GLIBCXX_TR1_STDLIB_H 1
|
| 36 |
+
|
| 37 |
+
#include <tr1/cstdlib>
|
| 38 |
+
|
| 39 |
+
#if _GLIBCXX_HOSTED
|
| 40 |
+
|
| 41 |
+
#if _GLIBCXX_USE_C99
|
| 42 |
+
|
| 43 |
+
using std::tr1::atoll;
|
| 44 |
+
using std::tr1::strtoll;
|
| 45 |
+
using std::tr1::strtoull;
|
| 46 |
+
|
| 47 |
+
using std::tr1::abs;
|
| 48 |
+
#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
|
| 49 |
+
using std::tr1::div;
|
| 50 |
+
#endif
|
| 51 |
+
|
| 52 |
+
#endif
|
| 53 |
+
|
| 54 |
+
#endif
|
| 55 |
+
|
| 56 |
+
#endif // _GLIBCXX_TR1_STDLIB_H
|
| 57 |
+
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/tgmath.h
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// TR1 tgmath.h -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2006, 2007 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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
|
| 7 |
+
// terms of the GNU General Public License as published by the
|
| 8 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 9 |
+
// any later version.
|
| 10 |
+
|
| 11 |
+
// This library is distributed in the hope that it will be useful,
|
| 12 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 13 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 14 |
+
// GNU General Public License for more details.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License along
|
| 17 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 18 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 19 |
+
// USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free software
|
| 22 |
+
// library without restriction. Specifically, if other files instantiate
|
| 23 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 24 |
+
// this file and link it with other files to produce an executable, this
|
| 25 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 26 |
+
// the GNU General Public License. This exception does not however
|
| 27 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 28 |
+
// the GNU General Public License.
|
| 29 |
+
|
| 30 |
+
/** @file tr1/tgmath.h
|
| 31 |
+
* This is a TR1 C++ Library header.
|
| 32 |
+
*/
|
| 33 |
+
|
| 34 |
+
#ifndef _GLIBCXX_TR1_TGMATH_H
|
| 35 |
+
#define _GLIBCXX_TR1_TGMATH_H 1
|
| 36 |
+
|
| 37 |
+
#include <tr1/ctgmath>
|
| 38 |
+
|
| 39 |
+
#endif // _GLIBCXX_TR1_TGMATH_H
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/tuple
ADDED
|
@@ -0,0 +1,427 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// class template tuple -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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
|
| 7 |
+
// terms of the GNU General Public License as published by the
|
| 8 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 9 |
+
// any later version.
|
| 10 |
+
|
| 11 |
+
// This library is distributed in the hope that it will be useful,
|
| 12 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 13 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 14 |
+
// GNU General Public License for more details.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License along
|
| 17 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 18 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 19 |
+
// USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free software
|
| 22 |
+
// library without restriction. Specifically, if other files instantiate
|
| 23 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 24 |
+
// this file and link it with other files to produce an executable, this
|
| 25 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 26 |
+
// the GNU General Public License. This exception does not however
|
| 27 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 28 |
+
// the GNU General Public License.
|
| 29 |
+
|
| 30 |
+
/** @file tr1/tuple
|
| 31 |
+
* This is a TR1 C++ Library header.
|
| 32 |
+
*/
|
| 33 |
+
|
| 34 |
+
// Chris Jefferson <chris@bubblescope.net>
|
| 35 |
+
// Variadic Templates support by Douglas Gregor <doug.gregor@gmail.com>
|
| 36 |
+
|
| 37 |
+
#ifndef _GLIBCXX_TR1_TUPLE
|
| 38 |
+
#define _GLIBCXX_TR1_TUPLE 1
|
| 39 |
+
|
| 40 |
+
#pragma GCC system_header
|
| 41 |
+
|
| 42 |
+
#include <utility>
|
| 43 |
+
|
| 44 |
+
namespace std
|
| 45 |
+
{
|
| 46 |
+
namespace tr1
|
| 47 |
+
{
|
| 48 |
+
// Adds a const reference to a non-reference type.
|
| 49 |
+
template<typename _Tp>
|
| 50 |
+
struct __add_c_ref
|
| 51 |
+
{ typedef const _Tp& type; };
|
| 52 |
+
|
| 53 |
+
template<typename _Tp>
|
| 54 |
+
struct __add_c_ref<_Tp&>
|
| 55 |
+
{ typedef _Tp& type; };
|
| 56 |
+
|
| 57 |
+
// Adds a reference to a non-reference type.
|
| 58 |
+
template<typename _Tp>
|
| 59 |
+
struct __add_ref
|
| 60 |
+
{ typedef _Tp& type; };
|
| 61 |
+
|
| 62 |
+
template<typename _Tp>
|
| 63 |
+
struct __add_ref<_Tp&>
|
| 64 |
+
{ typedef _Tp& type; };
|
| 65 |
+
|
| 66 |
+
/**
|
| 67 |
+
* Contains the actual implementation of the @c tuple template, stored
|
| 68 |
+
* as a recursive inheritance hierarchy from the first element (most
|
| 69 |
+
* derived class) to the last (least derived class). The @c Idx
|
| 70 |
+
* parameter gives the 0-based index of the element stored at this
|
| 71 |
+
* point in the hierarchy; we use it to implement a constant-time
|
| 72 |
+
* get() operation.
|
| 73 |
+
*/
|
| 74 |
+
template<int _Idx, typename... _Elements>
|
| 75 |
+
struct _Tuple_impl;
|
| 76 |
+
|
| 77 |
+
/**
|
| 78 |
+
* Zero-element tuple implementation. This is the basis case for the
|
| 79 |
+
* inheritance recursion.
|
| 80 |
+
*/
|
| 81 |
+
template<int _Idx>
|
| 82 |
+
struct _Tuple_impl<_Idx> { };
|
| 83 |
+
|
| 84 |
+
/**
|
| 85 |
+
* Recursive tuple implementation. Here we store the @c Head element
|
| 86 |
+
* and derive from a @c Tuple_impl containing the remaining elements
|
| 87 |
+
* (which contains the @c Tail).
|
| 88 |
+
*/
|
| 89 |
+
template<int _Idx, typename _Head, typename... _Tail>
|
| 90 |
+
struct _Tuple_impl<_Idx, _Head, _Tail...>
|
| 91 |
+
: public _Tuple_impl<_Idx + 1, _Tail...>
|
| 92 |
+
{
|
| 93 |
+
typedef _Tuple_impl<_Idx + 1, _Tail...> _Inherited;
|
| 94 |
+
|
| 95 |
+
_Head _M_head;
|
| 96 |
+
|
| 97 |
+
_Inherited& _M_tail() { return *this; }
|
| 98 |
+
const _Inherited& _M_tail() const { return *this; }
|
| 99 |
+
|
| 100 |
+
_Tuple_impl() : _Inherited(), _M_head() { }
|
| 101 |
+
|
| 102 |
+
explicit
|
| 103 |
+
_Tuple_impl(typename __add_c_ref<_Head>::type __head,
|
| 104 |
+
typename __add_c_ref<_Tail>::type... __tail)
|
| 105 |
+
: _Inherited(__tail...), _M_head(__head) { }
|
| 106 |
+
|
| 107 |
+
template<typename... _UElements>
|
| 108 |
+
_Tuple_impl(const _Tuple_impl<_Idx, _UElements...>& __in)
|
| 109 |
+
: _Inherited(__in._M_tail()), _M_head(__in._M_head) { }
|
| 110 |
+
|
| 111 |
+
_Tuple_impl(const _Tuple_impl& __in)
|
| 112 |
+
: _Inherited(__in._M_tail()), _M_head(__in._M_head) { }
|
| 113 |
+
|
| 114 |
+
template<typename... _UElements>
|
| 115 |
+
_Tuple_impl&
|
| 116 |
+
operator=(const _Tuple_impl<_Idx, _UElements...>& __in)
|
| 117 |
+
{
|
| 118 |
+
_M_head = __in._M_head;
|
| 119 |
+
_M_tail() = __in._M_tail();
|
| 120 |
+
return *this;
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
_Tuple_impl&
|
| 124 |
+
operator=(const _Tuple_impl& __in)
|
| 125 |
+
{
|
| 126 |
+
_M_head = __in._M_head;
|
| 127 |
+
_M_tail() = __in._M_tail();
|
| 128 |
+
return *this;
|
| 129 |
+
}
|
| 130 |
+
};
|
| 131 |
+
|
| 132 |
+
template<typename... _Elements>
|
| 133 |
+
class tuple : public _Tuple_impl<0, _Elements...>
|
| 134 |
+
{
|
| 135 |
+
typedef _Tuple_impl<0, _Elements...> _Inherited;
|
| 136 |
+
|
| 137 |
+
public:
|
| 138 |
+
tuple() : _Inherited() { }
|
| 139 |
+
|
| 140 |
+
explicit
|
| 141 |
+
tuple(typename __add_c_ref<_Elements>::type... __elements)
|
| 142 |
+
: _Inherited(__elements...) { }
|
| 143 |
+
|
| 144 |
+
template<typename... _UElements>
|
| 145 |
+
tuple(const tuple<_UElements...>& __in)
|
| 146 |
+
: _Inherited(__in) { }
|
| 147 |
+
|
| 148 |
+
tuple(const tuple& __in)
|
| 149 |
+
: _Inherited(__in) { }
|
| 150 |
+
|
| 151 |
+
template<typename... _UElements>
|
| 152 |
+
tuple&
|
| 153 |
+
operator=(const tuple<_UElements...>& __in)
|
| 154 |
+
{
|
| 155 |
+
static_cast<_Inherited&>(*this) = __in;
|
| 156 |
+
return *this;
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
tuple&
|
| 160 |
+
operator=(const tuple& __in)
|
| 161 |
+
{
|
| 162 |
+
static_cast<_Inherited&>(*this) = __in;
|
| 163 |
+
return *this;
|
| 164 |
+
}
|
| 165 |
+
};
|
| 166 |
+
|
| 167 |
+
template<> class tuple<> { };
|
| 168 |
+
|
| 169 |
+
// 2-element tuple, with construction and assignment from a pair.
|
| 170 |
+
template<typename _T1, typename _T2>
|
| 171 |
+
class tuple<_T1, _T2> : public _Tuple_impl<0, _T1, _T2>
|
| 172 |
+
{
|
| 173 |
+
typedef _Tuple_impl<0, _T1, _T2> _Inherited;
|
| 174 |
+
|
| 175 |
+
public:
|
| 176 |
+
tuple() : _Inherited() { }
|
| 177 |
+
|
| 178 |
+
explicit
|
| 179 |
+
tuple(typename __add_c_ref<_T1>::type __a1,
|
| 180 |
+
typename __add_c_ref<_T2>::type __a2)
|
| 181 |
+
: _Inherited(__a1, __a2) { }
|
| 182 |
+
|
| 183 |
+
template<typename _U1, typename _U2>
|
| 184 |
+
tuple(const tuple<_U1, _U2>& __in)
|
| 185 |
+
: _Inherited(__in) { }
|
| 186 |
+
|
| 187 |
+
tuple(const tuple& __in)
|
| 188 |
+
: _Inherited(__in) { }
|
| 189 |
+
|
| 190 |
+
template<typename _U1, typename _U2>
|
| 191 |
+
tuple(const pair<_U1, _U2>& __in)
|
| 192 |
+
: _Inherited(_Tuple_impl<0,
|
| 193 |
+
typename __add_c_ref<_U1>::type,
|
| 194 |
+
typename __add_c_ref<_U2>::type>(__in.first,
|
| 195 |
+
__in.second))
|
| 196 |
+
{ }
|
| 197 |
+
|
| 198 |
+
template<typename _U1, typename _U2>
|
| 199 |
+
tuple&
|
| 200 |
+
operator=(const tuple<_U1, _U2>& __in)
|
| 201 |
+
{
|
| 202 |
+
static_cast<_Inherited&>(*this) = __in;
|
| 203 |
+
return *this;
|
| 204 |
+
}
|
| 205 |
+
|
| 206 |
+
tuple&
|
| 207 |
+
operator=(const tuple& __in)
|
| 208 |
+
{
|
| 209 |
+
static_cast<_Inherited&>(*this) = __in;
|
| 210 |
+
return *this;
|
| 211 |
+
}
|
| 212 |
+
|
| 213 |
+
template<typename _U1, typename _U2>
|
| 214 |
+
tuple&
|
| 215 |
+
operator=(const pair<_U1, _U2>& __in)
|
| 216 |
+
{
|
| 217 |
+
this->_M_head = __in.first;
|
| 218 |
+
this->_M_tail()._M_head = __in.second;
|
| 219 |
+
return *this;
|
| 220 |
+
}
|
| 221 |
+
};
|
| 222 |
+
|
| 223 |
+
|
| 224 |
+
/// Gives the type of the ith element of a given tuple type.
|
| 225 |
+
template<int __i, typename _Tp>
|
| 226 |
+
struct tuple_element;
|
| 227 |
+
|
| 228 |
+
/**
|
| 229 |
+
* Recursive case for tuple_element: strip off the first element in
|
| 230 |
+
* the tuple and retrieve the (i-1)th element of the remaining tuple.
|
| 231 |
+
*/
|
| 232 |
+
template<int __i, typename _Head, typename... _Tail>
|
| 233 |
+
struct tuple_element<__i, tuple<_Head, _Tail...> >
|
| 234 |
+
: tuple_element<__i - 1, tuple<_Tail...> > { };
|
| 235 |
+
|
| 236 |
+
/**
|
| 237 |
+
* Basis case for tuple_element: The first element is the one we're seeking.
|
| 238 |
+
*/
|
| 239 |
+
template<typename _Head, typename... _Tail>
|
| 240 |
+
struct tuple_element<0, tuple<_Head, _Tail...> >
|
| 241 |
+
{
|
| 242 |
+
typedef _Head type;
|
| 243 |
+
};
|
| 244 |
+
|
| 245 |
+
/// Finds the size of a given tuple type.
|
| 246 |
+
template<typename _Tp>
|
| 247 |
+
struct tuple_size;
|
| 248 |
+
|
| 249 |
+
/// class tuple_size
|
| 250 |
+
template<typename... _Elements>
|
| 251 |
+
struct tuple_size<tuple<_Elements...> >
|
| 252 |
+
{
|
| 253 |
+
static const int value = sizeof...(_Elements);
|
| 254 |
+
};
|
| 255 |
+
|
| 256 |
+
template<typename... _Elements>
|
| 257 |
+
const int tuple_size<tuple<_Elements...> >::value;
|
| 258 |
+
|
| 259 |
+
template<int __i, typename _Head, typename... _Tail>
|
| 260 |
+
inline typename __add_ref<_Head>::type
|
| 261 |
+
__get_helper(_Tuple_impl<__i, _Head, _Tail...>& __t)
|
| 262 |
+
{
|
| 263 |
+
return __t._M_head;
|
| 264 |
+
}
|
| 265 |
+
|
| 266 |
+
template<int __i, typename _Head, typename... _Tail>
|
| 267 |
+
inline typename __add_c_ref<_Head>::type
|
| 268 |
+
__get_helper(const _Tuple_impl<__i, _Head, _Tail...>& __t)
|
| 269 |
+
{
|
| 270 |
+
return __t._M_head;
|
| 271 |
+
}
|
| 272 |
+
|
| 273 |
+
// Return a reference (const reference) to the ith element of a tuple.
|
| 274 |
+
// Any const or non-const ref elements are returned with their original type.
|
| 275 |
+
template<int __i, typename... _Elements>
|
| 276 |
+
inline typename __add_ref<
|
| 277 |
+
typename tuple_element<__i, tuple<_Elements...> >::type
|
| 278 |
+
>::type
|
| 279 |
+
get(tuple<_Elements...>& __t)
|
| 280 |
+
{
|
| 281 |
+
return __get_helper<__i>(__t);
|
| 282 |
+
}
|
| 283 |
+
|
| 284 |
+
template<int __i, typename... _Elements>
|
| 285 |
+
inline typename __add_c_ref<
|
| 286 |
+
typename tuple_element<__i, tuple<_Elements...> >::type
|
| 287 |
+
>::type
|
| 288 |
+
get(const tuple<_Elements...>& __t)
|
| 289 |
+
{
|
| 290 |
+
return __get_helper<__i>(__t);
|
| 291 |
+
}
|
| 292 |
+
|
| 293 |
+
// This class helps construct the various comparison operations on tuples
|
| 294 |
+
template<int __check_equal_size, int __i, int __j,
|
| 295 |
+
typename _Tp, typename _Up>
|
| 296 |
+
struct __tuple_compare;
|
| 297 |
+
|
| 298 |
+
template<int __i, int __j, typename _Tp, typename _Up>
|
| 299 |
+
struct __tuple_compare<0, __i, __j, _Tp, _Up>
|
| 300 |
+
{
|
| 301 |
+
static bool __eq(const _Tp& __t, const _Up& __u)
|
| 302 |
+
{
|
| 303 |
+
return (get<__i>(__t) == get<__i>(__u) &&
|
| 304 |
+
__tuple_compare<0, __i+1, __j, _Tp, _Up>::__eq(__t, __u));
|
| 305 |
+
}
|
| 306 |
+
|
| 307 |
+
static bool __less(const _Tp& __t, const _Up& __u)
|
| 308 |
+
{
|
| 309 |
+
return ((get<__i>(__t) < get<__i>(__u))
|
| 310 |
+
|| !(get<__i>(__u) < get<__i>(__t)) &&
|
| 311 |
+
__tuple_compare<0, __i+1, __j, _Tp, _Up>::__less(__t, __u));
|
| 312 |
+
}
|
| 313 |
+
};
|
| 314 |
+
|
| 315 |
+
template<int __i, typename _Tp, typename _Up>
|
| 316 |
+
struct __tuple_compare<0, __i, __i, _Tp, _Up>
|
| 317 |
+
{
|
| 318 |
+
static bool __eq(const _Tp&, const _Up&)
|
| 319 |
+
{ return true; }
|
| 320 |
+
|
| 321 |
+
static bool __less(const _Tp&, const _Up&)
|
| 322 |
+
{ return false; }
|
| 323 |
+
};
|
| 324 |
+
|
| 325 |
+
template<typename... _TElements, typename... _UElements>
|
| 326 |
+
bool
|
| 327 |
+
operator==(const tuple<_TElements...>& __t,
|
| 328 |
+
const tuple<_UElements...>& __u)
|
| 329 |
+
{
|
| 330 |
+
typedef tuple<_TElements...> _Tp;
|
| 331 |
+
typedef tuple<_UElements...> _Up;
|
| 332 |
+
return (__tuple_compare<tuple_size<_Tp>::value - tuple_size<_Up>::value,
|
| 333 |
+
0, tuple_size<_Tp>::value, _Tp, _Up>::__eq(__t, __u));
|
| 334 |
+
}
|
| 335 |
+
|
| 336 |
+
template<typename... _TElements, typename... _UElements>
|
| 337 |
+
bool
|
| 338 |
+
operator<(const tuple<_TElements...>& __t,
|
| 339 |
+
const tuple<_UElements...>& __u)
|
| 340 |
+
{
|
| 341 |
+
typedef tuple<_TElements...> _Tp;
|
| 342 |
+
typedef tuple<_UElements...> _Up;
|
| 343 |
+
return (__tuple_compare<tuple_size<_Tp>::value - tuple_size<_Up>::value,
|
| 344 |
+
0, tuple_size<_Tp>::value, _Tp, _Up>::__less(__t, __u));
|
| 345 |
+
}
|
| 346 |
+
|
| 347 |
+
template<typename... _TElements, typename... _UElements>
|
| 348 |
+
inline bool
|
| 349 |
+
operator!=(const tuple<_TElements...>& __t,
|
| 350 |
+
const tuple<_UElements...>& __u)
|
| 351 |
+
{ return !(__t == __u); }
|
| 352 |
+
|
| 353 |
+
template<typename... _TElements, typename... _UElements>
|
| 354 |
+
inline bool
|
| 355 |
+
operator>(const tuple<_TElements...>& __t,
|
| 356 |
+
const tuple<_UElements...>& __u)
|
| 357 |
+
{ return __u < __t; }
|
| 358 |
+
|
| 359 |
+
template<typename... _TElements, typename... _UElements>
|
| 360 |
+
inline bool
|
| 361 |
+
operator<=(const tuple<_TElements...>& __t,
|
| 362 |
+
const tuple<_UElements...>& __u)
|
| 363 |
+
{ return !(__u < __t); }
|
| 364 |
+
|
| 365 |
+
template<typename... _TElements, typename... _UElements>
|
| 366 |
+
inline bool
|
| 367 |
+
operator>=(const tuple<_TElements...>& __t,
|
| 368 |
+
const tuple<_UElements...>& __u)
|
| 369 |
+
{ return !(__t < __u); }
|
| 370 |
+
|
| 371 |
+
template<typename _Tp>
|
| 372 |
+
class reference_wrapper;
|
| 373 |
+
|
| 374 |
+
// Helper which adds a reference to a type when given a reference_wrapper
|
| 375 |
+
template<typename _Tp>
|
| 376 |
+
struct __strip_reference_wrapper
|
| 377 |
+
{
|
| 378 |
+
typedef _Tp __type;
|
| 379 |
+
};
|
| 380 |
+
|
| 381 |
+
template<typename _Tp>
|
| 382 |
+
struct __strip_reference_wrapper<reference_wrapper<_Tp> >
|
| 383 |
+
{
|
| 384 |
+
typedef _Tp& __type;
|
| 385 |
+
};
|
| 386 |
+
|
| 387 |
+
template<typename _Tp>
|
| 388 |
+
struct __strip_reference_wrapper<const reference_wrapper<_Tp> >
|
| 389 |
+
{
|
| 390 |
+
typedef _Tp& __type;
|
| 391 |
+
};
|
| 392 |
+
|
| 393 |
+
template<typename... _Elements>
|
| 394 |
+
inline tuple<typename __strip_reference_wrapper<_Elements>::__type...>
|
| 395 |
+
make_tuple(_Elements... __args)
|
| 396 |
+
{
|
| 397 |
+
typedef tuple<typename __strip_reference_wrapper<_Elements>::__type...>
|
| 398 |
+
__result_type;
|
| 399 |
+
return __result_type(__args...);
|
| 400 |
+
}
|
| 401 |
+
|
| 402 |
+
template<typename... _Elements>
|
| 403 |
+
inline tuple<_Elements&...>
|
| 404 |
+
tie(_Elements&... __args)
|
| 405 |
+
{
|
| 406 |
+
return tuple<_Elements&...>(__args...);
|
| 407 |
+
}
|
| 408 |
+
|
| 409 |
+
// A class (and instance) which can be used in 'tie' when an element
|
| 410 |
+
// of a tuple is not required
|
| 411 |
+
struct _Swallow_assign
|
| 412 |
+
{
|
| 413 |
+
template<class _Tp>
|
| 414 |
+
_Swallow_assign&
|
| 415 |
+
operator=(const _Tp&)
|
| 416 |
+
{ return *this; }
|
| 417 |
+
};
|
| 418 |
+
|
| 419 |
+
// TODO: Put this in some kind of shared file.
|
| 420 |
+
namespace
|
| 421 |
+
{
|
| 422 |
+
_Swallow_assign ignore;
|
| 423 |
+
}; // anonymous namespace
|
| 424 |
+
}
|
| 425 |
+
}
|
| 426 |
+
|
| 427 |
+
#endif // _GLIBCXX_TR1_TUPLE
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/type_traits
ADDED
|
@@ -0,0 +1,249 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// TR1 type_traits -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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
|
| 7 |
+
// terms of the GNU General Public License as published by the
|
| 8 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 9 |
+
// any later version.
|
| 10 |
+
|
| 11 |
+
// This library is distributed in the hope that it will be useful,
|
| 12 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 13 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 14 |
+
// GNU General Public License for more details.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License along
|
| 17 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 18 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 19 |
+
// USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free software
|
| 22 |
+
// library without restriction. Specifically, if other files instantiate
|
| 23 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 24 |
+
// this file and link it with other files to produce an executable, this
|
| 25 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 26 |
+
// the GNU General Public License. This exception does not however
|
| 27 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 28 |
+
// the GNU General Public License.
|
| 29 |
+
|
| 30 |
+
/** @file tr1/type_traits
|
| 31 |
+
* This is a TR1 C++ Library header.
|
| 32 |
+
*/
|
| 33 |
+
|
| 34 |
+
#ifndef _GLIBCXX_TR1_TYPE_TRAITS
|
| 35 |
+
#define _GLIBCXX_TR1_TYPE_TRAITS 1
|
| 36 |
+
|
| 37 |
+
#pragma GCC system_header
|
| 38 |
+
|
| 39 |
+
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
| 40 |
+
# error TR1 header cannot be included from C++0x header
|
| 41 |
+
#endif
|
| 42 |
+
|
| 43 |
+
#include <cstddef>
|
| 44 |
+
|
| 45 |
+
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
| 46 |
+
# include <tr1_impl/type_traits>
|
| 47 |
+
#else
|
| 48 |
+
# define _GLIBCXX_INCLUDE_AS_TR1
|
| 49 |
+
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
|
| 50 |
+
# define _GLIBCXX_END_NAMESPACE_TR1 }
|
| 51 |
+
# define _GLIBCXX_TR1 tr1::
|
| 52 |
+
# include <tr1_impl/type_traits>
|
| 53 |
+
# undef _GLIBCXX_TR1
|
| 54 |
+
# undef _GLIBCXX_END_NAMESPACE_TR1
|
| 55 |
+
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
| 56 |
+
# undef _GLIBCXX_INCLUDE_AS_TR1
|
| 57 |
+
#endif
|
| 58 |
+
|
| 59 |
+
namespace std
|
| 60 |
+
{
|
| 61 |
+
namespace tr1
|
| 62 |
+
{
|
| 63 |
+
#define _DEFINE_SPEC_HELPER(_Spec) \
|
| 64 |
+
template<> \
|
| 65 |
+
struct _Spec \
|
| 66 |
+
: public true_type { };
|
| 67 |
+
|
| 68 |
+
#define _DEFINE_SPEC(_Trait, _Type) \
|
| 69 |
+
_DEFINE_SPEC_HELPER(_Trait<_Type>) \
|
| 70 |
+
_DEFINE_SPEC_HELPER(_Trait<_Type const>) \
|
| 71 |
+
_DEFINE_SPEC_HELPER(_Trait<_Type volatile>) \
|
| 72 |
+
_DEFINE_SPEC_HELPER(_Trait<_Type const volatile>)
|
| 73 |
+
|
| 74 |
+
template<typename>
|
| 75 |
+
struct is_reference
|
| 76 |
+
: public false_type { };
|
| 77 |
+
|
| 78 |
+
template<typename _Tp>
|
| 79 |
+
struct is_reference<_Tp&>
|
| 80 |
+
: public true_type { };
|
| 81 |
+
|
| 82 |
+
template<typename _Tp>
|
| 83 |
+
struct is_pod
|
| 84 |
+
: public integral_constant<bool, __is_pod(_Tp) || is_void<_Tp>::value>
|
| 85 |
+
{ };
|
| 86 |
+
|
| 87 |
+
template<typename _Tp>
|
| 88 |
+
struct has_trivial_constructor
|
| 89 |
+
: public integral_constant<bool, is_pod<_Tp>::value>
|
| 90 |
+
{ };
|
| 91 |
+
|
| 92 |
+
template<typename _Tp>
|
| 93 |
+
struct has_trivial_copy
|
| 94 |
+
: public integral_constant<bool, is_pod<_Tp>::value>
|
| 95 |
+
{ };
|
| 96 |
+
|
| 97 |
+
template<typename _Tp>
|
| 98 |
+
struct has_trivial_assign
|
| 99 |
+
: public integral_constant<bool, is_pod<_Tp>::value>
|
| 100 |
+
{ };
|
| 101 |
+
|
| 102 |
+
template<typename _Tp>
|
| 103 |
+
struct has_trivial_destructor
|
| 104 |
+
: public integral_constant<bool, is_pod<_Tp>::value>
|
| 105 |
+
{ };
|
| 106 |
+
|
| 107 |
+
template<typename _Tp>
|
| 108 |
+
struct has_nothrow_constructor
|
| 109 |
+
: public integral_constant<bool, is_pod<_Tp>::value>
|
| 110 |
+
{ };
|
| 111 |
+
|
| 112 |
+
template<typename _Tp>
|
| 113 |
+
struct has_nothrow_copy
|
| 114 |
+
: public integral_constant<bool, is_pod<_Tp>::value>
|
| 115 |
+
{ };
|
| 116 |
+
|
| 117 |
+
template<typename _Tp>
|
| 118 |
+
struct has_nothrow_assign
|
| 119 |
+
: public integral_constant<bool, is_pod<_Tp>::value>
|
| 120 |
+
{ };
|
| 121 |
+
|
| 122 |
+
template<typename>
|
| 123 |
+
struct is_signed
|
| 124 |
+
: public false_type { };
|
| 125 |
+
_DEFINE_SPEC(is_signed, signed char)
|
| 126 |
+
_DEFINE_SPEC(is_signed, short)
|
| 127 |
+
_DEFINE_SPEC(is_signed, int)
|
| 128 |
+
_DEFINE_SPEC(is_signed, long)
|
| 129 |
+
_DEFINE_SPEC(is_signed, long long)
|
| 130 |
+
|
| 131 |
+
template<typename>
|
| 132 |
+
struct is_unsigned
|
| 133 |
+
: public false_type { };
|
| 134 |
+
_DEFINE_SPEC(is_unsigned, unsigned char)
|
| 135 |
+
_DEFINE_SPEC(is_unsigned, unsigned short)
|
| 136 |
+
_DEFINE_SPEC(is_unsigned, unsigned int)
|
| 137 |
+
_DEFINE_SPEC(is_unsigned, unsigned long)
|
| 138 |
+
_DEFINE_SPEC(is_unsigned, unsigned long long)
|
| 139 |
+
|
| 140 |
+
template<typename _Base, typename _Derived>
|
| 141 |
+
struct __is_base_of_helper
|
| 142 |
+
{
|
| 143 |
+
typedef typename remove_cv<_Base>::type _NoCv_Base;
|
| 144 |
+
typedef typename remove_cv<_Derived>::type _NoCv_Derived;
|
| 145 |
+
static const bool __value = (is_same<_Base, _Derived>::value
|
| 146 |
+
|| (__is_base_of(_Base, _Derived)
|
| 147 |
+
&& !is_same<_NoCv_Base,
|
| 148 |
+
_NoCv_Derived>::value));
|
| 149 |
+
};
|
| 150 |
+
|
| 151 |
+
template<typename _Base, typename _Derived>
|
| 152 |
+
struct is_base_of
|
| 153 |
+
: public integral_constant<bool,
|
| 154 |
+
__is_base_of_helper<_Base, _Derived>::__value>
|
| 155 |
+
{ };
|
| 156 |
+
|
| 157 |
+
template<typename _From, typename _To>
|
| 158 |
+
struct __is_convertible_simple
|
| 159 |
+
: public __sfinae_types
|
| 160 |
+
{
|
| 161 |
+
private:
|
| 162 |
+
static __one __test(_To);
|
| 163 |
+
static __two __test(...);
|
| 164 |
+
static _From __makeFrom();
|
| 165 |
+
|
| 166 |
+
public:
|
| 167 |
+
static const bool __value = sizeof(__test(__makeFrom())) == 1;
|
| 168 |
+
};
|
| 169 |
+
|
| 170 |
+
template<typename _Tp>
|
| 171 |
+
struct add_reference;
|
| 172 |
+
|
| 173 |
+
template<typename _Tp>
|
| 174 |
+
struct __is_int_or_cref
|
| 175 |
+
{
|
| 176 |
+
typedef typename remove_reference<_Tp>::type __rr_Tp;
|
| 177 |
+
static const bool __value = (is_integral<_Tp>::value
|
| 178 |
+
|| (is_integral<__rr_Tp>::value
|
| 179 |
+
&& is_const<__rr_Tp>::value
|
| 180 |
+
&& !is_volatile<__rr_Tp>::value));
|
| 181 |
+
};
|
| 182 |
+
|
| 183 |
+
template<typename _From, typename _To,
|
| 184 |
+
bool = (is_void<_From>::value || is_void<_To>::value
|
| 185 |
+
|| is_function<_To>::value || is_array<_To>::value
|
| 186 |
+
// This special case is here only to avoid warnings.
|
| 187 |
+
|| (is_floating_point<typename
|
| 188 |
+
remove_reference<_From>::type>::value
|
| 189 |
+
&& __is_int_or_cref<_To>::__value))>
|
| 190 |
+
struct __is_convertible_helper
|
| 191 |
+
{
|
| 192 |
+
// "An imaginary lvalue of type From...".
|
| 193 |
+
static const bool __value = (__is_convertible_simple<typename
|
| 194 |
+
add_reference<_From>::type, _To>::__value);
|
| 195 |
+
};
|
| 196 |
+
|
| 197 |
+
template<typename _From, typename _To>
|
| 198 |
+
struct __is_convertible_helper<_From, _To, true>
|
| 199 |
+
{ static const bool __value = (is_void<_To>::value
|
| 200 |
+
|| (__is_int_or_cref<_To>::__value
|
| 201 |
+
&& !is_void<_From>::value)); };
|
| 202 |
+
|
| 203 |
+
template<typename _From, typename _To>
|
| 204 |
+
struct is_convertible
|
| 205 |
+
: public integral_constant<bool,
|
| 206 |
+
__is_convertible_helper<_From, _To>::__value>
|
| 207 |
+
{ };
|
| 208 |
+
|
| 209 |
+
// reference modifications [4.7.2].
|
| 210 |
+
template<typename _Tp>
|
| 211 |
+
struct remove_reference
|
| 212 |
+
{ typedef _Tp type; };
|
| 213 |
+
|
| 214 |
+
template<typename _Tp>
|
| 215 |
+
struct remove_reference<_Tp&>
|
| 216 |
+
{ typedef _Tp type; };
|
| 217 |
+
|
| 218 |
+
// NB: Careful with reference to void.
|
| 219 |
+
template<typename _Tp, bool = (is_void<_Tp>::value
|
| 220 |
+
|| is_reference<_Tp>::value)>
|
| 221 |
+
struct __add_reference_helper
|
| 222 |
+
{ typedef _Tp& type; };
|
| 223 |
+
|
| 224 |
+
template<typename _Tp>
|
| 225 |
+
struct __add_reference_helper<_Tp, true>
|
| 226 |
+
{ typedef _Tp type; };
|
| 227 |
+
|
| 228 |
+
template<typename _Tp>
|
| 229 |
+
struct add_reference
|
| 230 |
+
: public __add_reference_helper<_Tp>
|
| 231 |
+
{ };
|
| 232 |
+
|
| 233 |
+
// other transformations [4.8].
|
| 234 |
+
template<std::size_t _Len, std::size_t _Align>
|
| 235 |
+
struct aligned_storage
|
| 236 |
+
{
|
| 237 |
+
union type
|
| 238 |
+
{
|
| 239 |
+
unsigned char __data[_Len];
|
| 240 |
+
struct __attribute__((__aligned__((_Align)))) { } __align;
|
| 241 |
+
};
|
| 242 |
+
};
|
| 243 |
+
|
| 244 |
+
#undef _DEFINE_SPEC_HELPER
|
| 245 |
+
#undef _DEFINE_SPEC
|
| 246 |
+
}
|
| 247 |
+
}
|
| 248 |
+
|
| 249 |
+
#endif // _GLIBCXX_TR1_TYPE_TRAITS
|
mingw/lib/gcc/mingw32/4.3.3/include/c++/tr1/unordered_map
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// TR1 unordered_map -*- C++ -*-
|
| 2 |
+
|
| 3 |
+
// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
|
| 4 |
+
//
|
| 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
|
| 7 |
+
// terms of the GNU General Public License as published by the
|
| 8 |
+
// Free Software Foundation; either version 2, or (at your option)
|
| 9 |
+
// any later version.
|
| 10 |
+
|
| 11 |
+
// This library is distributed in the hope that it will be useful,
|
| 12 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 13 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 14 |
+
// GNU General Public License for more details.
|
| 15 |
+
|
| 16 |
+
// You should have received a copy of the GNU General Public License along
|
| 17 |
+
// with this library; see the file COPYING. If not, write to the Free
|
| 18 |
+
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
| 19 |
+
// USA.
|
| 20 |
+
|
| 21 |
+
// As a special exception, you may use this file as part of a free software
|
| 22 |
+
// library without restriction. Specifically, if other files instantiate
|
| 23 |
+
// templates or use macros or inline functions from this file, or you compile
|
| 24 |
+
// this file and link it with other files to produce an executable, this
|
| 25 |
+
// file does not by itself cause the resulting executable to be covered by
|
| 26 |
+
// the GNU General Public License. This exception does not however
|
| 27 |
+
// invalidate any other reasons why the executable file might be covered by
|
| 28 |
+
// the GNU General Public License.
|
| 29 |
+
|
| 30 |
+
/** @file tr1/unordered_map
|
| 31 |
+
* This is a TR1 C++ Library header.
|
| 32 |
+
*/
|
| 33 |
+
|
| 34 |
+
#ifndef _GLIBCXX_TR1_UNORDERED_MAP
|
| 35 |
+
#define _GLIBCXX_TR1_UNORDERED_MAP 1
|
| 36 |
+
|
| 37 |
+
#pragma GCC system_header
|
| 38 |
+
|
| 39 |
+
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
| 40 |
+
# error TR1 header cannot be included from C++0x header
|
| 41 |
+
#endif
|
| 42 |
+
|
| 43 |
+
#include <utility>
|
| 44 |
+
#include <bits/stl_algobase.h>
|
| 45 |
+
#include <bits/allocator.h>
|
| 46 |
+
#include <bits/stl_function.h> // equal_to, _Identity, _Select1st
|
| 47 |
+
#include <bits/stringfwd.h>
|
| 48 |
+
#include <tr1/type_traits>
|
| 49 |
+
#include <tr1/functional_hash.h>
|
| 50 |
+
#include <tr1/hashtable.h>
|
| 51 |
+
|
| 52 |
+
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
| 53 |
+
# include <tr1_impl/unordered_map>
|
| 54 |
+
#else
|
| 55 |
+
# define _GLIBCXX_INCLUDE_AS_TR1
|
| 56 |
+
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
|
| 57 |
+
# define _GLIBCXX_END_NAMESPACE_TR1 }
|
| 58 |
+
# define _GLIBCXX_TR1 tr1::
|
| 59 |
+
# include <tr1_impl/unordered_map>
|
| 60 |
+
# undef _GLIBCXX_TR1
|
| 61 |
+
# undef _GLIBCXX_END_NAMESPACE_TR1
|
| 62 |
+
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
| 63 |
+
# undef _GLIBCXX_INCLUDE_AS_TR1
|
| 64 |
+
#endif
|
| 65 |
+
|
| 66 |
+
#endif // _GLIBCXX_TR1_UNORDERED_MAP
|