isotree 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -1
- data/LICENSE.txt +2 -2
- data/README.md +32 -14
- data/ext/isotree/ext.cpp +144 -31
- data/ext/isotree/extconf.rb +7 -7
- data/lib/isotree/isolation_forest.rb +110 -30
- data/lib/isotree/version.rb +1 -1
- data/vendor/isotree/LICENSE +1 -1
- data/vendor/isotree/README.md +165 -27
- data/vendor/isotree/include/isotree.hpp +2111 -0
- data/vendor/isotree/include/isotree_oop.hpp +394 -0
- data/vendor/isotree/inst/COPYRIGHTS +62 -0
- data/vendor/isotree/src/RcppExports.cpp +525 -52
- data/vendor/isotree/src/Rwrapper.cpp +1931 -268
- data/vendor/isotree/src/c_interface.cpp +953 -0
- data/vendor/isotree/src/crit.hpp +4232 -0
- data/vendor/isotree/src/dist.hpp +1886 -0
- data/vendor/isotree/src/exp_depth_table.hpp +134 -0
- data/vendor/isotree/src/extended.hpp +1444 -0
- data/vendor/isotree/src/external_facing_generic.hpp +399 -0
- data/vendor/isotree/src/fit_model.hpp +2401 -0
- data/vendor/isotree/src/{dealloc.cpp → headers_joined.hpp} +38 -22
- data/vendor/isotree/src/helpers_iforest.hpp +813 -0
- data/vendor/isotree/src/{impute.cpp → impute.hpp} +353 -122
- data/vendor/isotree/src/indexer.cpp +515 -0
- data/vendor/isotree/src/instantiate_template_headers.cpp +118 -0
- data/vendor/isotree/src/instantiate_template_headers.hpp +240 -0
- data/vendor/isotree/src/isoforest.hpp +1659 -0
- data/vendor/isotree/src/isotree.hpp +1804 -392
- data/vendor/isotree/src/isotree_exportable.hpp +99 -0
- data/vendor/isotree/src/merge_models.cpp +159 -16
- data/vendor/isotree/src/mult.hpp +1321 -0
- data/vendor/isotree/src/oop_interface.cpp +842 -0
- data/vendor/isotree/src/oop_interface.hpp +278 -0
- data/vendor/isotree/src/other_helpers.hpp +219 -0
- data/vendor/isotree/src/predict.hpp +1932 -0
- data/vendor/isotree/src/python_helpers.hpp +134 -0
- data/vendor/isotree/src/ref_indexer.hpp +154 -0
- data/vendor/isotree/src/robinmap/LICENSE +21 -0
- data/vendor/isotree/src/robinmap/README.md +483 -0
- data/vendor/isotree/src/robinmap/include/tsl/robin_growth_policy.h +406 -0
- data/vendor/isotree/src/robinmap/include/tsl/robin_hash.h +1620 -0
- data/vendor/isotree/src/robinmap/include/tsl/robin_map.h +807 -0
- data/vendor/isotree/src/robinmap/include/tsl/robin_set.h +660 -0
- data/vendor/isotree/src/serialize.cpp +4300 -139
- data/vendor/isotree/src/sql.cpp +141 -59
- data/vendor/isotree/src/subset_models.cpp +174 -0
- data/vendor/isotree/src/utils.hpp +3808 -0
- data/vendor/isotree/src/xoshiro.hpp +467 -0
- data/vendor/isotree/src/ziggurat.hpp +405 -0
- metadata +38 -104
- data/vendor/cereal/LICENSE +0 -24
- data/vendor/cereal/README.md +0 -85
- data/vendor/cereal/include/cereal/access.hpp +0 -351
- data/vendor/cereal/include/cereal/archives/adapters.hpp +0 -163
- data/vendor/cereal/include/cereal/archives/binary.hpp +0 -169
- data/vendor/cereal/include/cereal/archives/json.hpp +0 -1019
- data/vendor/cereal/include/cereal/archives/portable_binary.hpp +0 -334
- data/vendor/cereal/include/cereal/archives/xml.hpp +0 -956
- data/vendor/cereal/include/cereal/cereal.hpp +0 -1089
- data/vendor/cereal/include/cereal/details/helpers.hpp +0 -422
- data/vendor/cereal/include/cereal/details/polymorphic_impl.hpp +0 -796
- data/vendor/cereal/include/cereal/details/polymorphic_impl_fwd.hpp +0 -65
- data/vendor/cereal/include/cereal/details/static_object.hpp +0 -127
- data/vendor/cereal/include/cereal/details/traits.hpp +0 -1411
- data/vendor/cereal/include/cereal/details/util.hpp +0 -84
- data/vendor/cereal/include/cereal/external/base64.hpp +0 -134
- data/vendor/cereal/include/cereal/external/rapidjson/allocators.h +0 -284
- data/vendor/cereal/include/cereal/external/rapidjson/cursorstreamwrapper.h +0 -78
- data/vendor/cereal/include/cereal/external/rapidjson/document.h +0 -2652
- data/vendor/cereal/include/cereal/external/rapidjson/encodedstream.h +0 -299
- data/vendor/cereal/include/cereal/external/rapidjson/encodings.h +0 -716
- data/vendor/cereal/include/cereal/external/rapidjson/error/en.h +0 -74
- data/vendor/cereal/include/cereal/external/rapidjson/error/error.h +0 -161
- data/vendor/cereal/include/cereal/external/rapidjson/filereadstream.h +0 -99
- data/vendor/cereal/include/cereal/external/rapidjson/filewritestream.h +0 -104
- data/vendor/cereal/include/cereal/external/rapidjson/fwd.h +0 -151
- data/vendor/cereal/include/cereal/external/rapidjson/internal/biginteger.h +0 -290
- data/vendor/cereal/include/cereal/external/rapidjson/internal/diyfp.h +0 -271
- data/vendor/cereal/include/cereal/external/rapidjson/internal/dtoa.h +0 -245
- data/vendor/cereal/include/cereal/external/rapidjson/internal/ieee754.h +0 -78
- data/vendor/cereal/include/cereal/external/rapidjson/internal/itoa.h +0 -308
- data/vendor/cereal/include/cereal/external/rapidjson/internal/meta.h +0 -186
- data/vendor/cereal/include/cereal/external/rapidjson/internal/pow10.h +0 -55
- data/vendor/cereal/include/cereal/external/rapidjson/internal/regex.h +0 -740
- data/vendor/cereal/include/cereal/external/rapidjson/internal/stack.h +0 -232
- data/vendor/cereal/include/cereal/external/rapidjson/internal/strfunc.h +0 -69
- data/vendor/cereal/include/cereal/external/rapidjson/internal/strtod.h +0 -290
- data/vendor/cereal/include/cereal/external/rapidjson/internal/swap.h +0 -46
- data/vendor/cereal/include/cereal/external/rapidjson/istreamwrapper.h +0 -128
- data/vendor/cereal/include/cereal/external/rapidjson/memorybuffer.h +0 -70
- data/vendor/cereal/include/cereal/external/rapidjson/memorystream.h +0 -71
- data/vendor/cereal/include/cereal/external/rapidjson/msinttypes/inttypes.h +0 -316
- data/vendor/cereal/include/cereal/external/rapidjson/msinttypes/stdint.h +0 -300
- data/vendor/cereal/include/cereal/external/rapidjson/ostreamwrapper.h +0 -81
- data/vendor/cereal/include/cereal/external/rapidjson/pointer.h +0 -1414
- data/vendor/cereal/include/cereal/external/rapidjson/prettywriter.h +0 -277
- data/vendor/cereal/include/cereal/external/rapidjson/rapidjson.h +0 -656
- data/vendor/cereal/include/cereal/external/rapidjson/reader.h +0 -2230
- data/vendor/cereal/include/cereal/external/rapidjson/schema.h +0 -2497
- data/vendor/cereal/include/cereal/external/rapidjson/stream.h +0 -223
- data/vendor/cereal/include/cereal/external/rapidjson/stringbuffer.h +0 -121
- data/vendor/cereal/include/cereal/external/rapidjson/writer.h +0 -709
- data/vendor/cereal/include/cereal/external/rapidxml/license.txt +0 -52
- data/vendor/cereal/include/cereal/external/rapidxml/manual.html +0 -406
- data/vendor/cereal/include/cereal/external/rapidxml/rapidxml.hpp +0 -2624
- data/vendor/cereal/include/cereal/external/rapidxml/rapidxml_iterators.hpp +0 -175
- data/vendor/cereal/include/cereal/external/rapidxml/rapidxml_print.hpp +0 -428
- data/vendor/cereal/include/cereal/external/rapidxml/rapidxml_utils.hpp +0 -123
- data/vendor/cereal/include/cereal/macros.hpp +0 -154
- data/vendor/cereal/include/cereal/specialize.hpp +0 -139
- data/vendor/cereal/include/cereal/types/array.hpp +0 -79
- data/vendor/cereal/include/cereal/types/atomic.hpp +0 -55
- data/vendor/cereal/include/cereal/types/base_class.hpp +0 -203
- data/vendor/cereal/include/cereal/types/bitset.hpp +0 -176
- data/vendor/cereal/include/cereal/types/boost_variant.hpp +0 -164
- data/vendor/cereal/include/cereal/types/chrono.hpp +0 -72
- data/vendor/cereal/include/cereal/types/common.hpp +0 -129
- data/vendor/cereal/include/cereal/types/complex.hpp +0 -56
- data/vendor/cereal/include/cereal/types/concepts/pair_associative_container.hpp +0 -73
- data/vendor/cereal/include/cereal/types/deque.hpp +0 -62
- data/vendor/cereal/include/cereal/types/forward_list.hpp +0 -68
- data/vendor/cereal/include/cereal/types/functional.hpp +0 -43
- data/vendor/cereal/include/cereal/types/list.hpp +0 -62
- data/vendor/cereal/include/cereal/types/map.hpp +0 -36
- data/vendor/cereal/include/cereal/types/memory.hpp +0 -425
- data/vendor/cereal/include/cereal/types/optional.hpp +0 -66
- data/vendor/cereal/include/cereal/types/polymorphic.hpp +0 -483
- data/vendor/cereal/include/cereal/types/queue.hpp +0 -132
- data/vendor/cereal/include/cereal/types/set.hpp +0 -103
- data/vendor/cereal/include/cereal/types/stack.hpp +0 -76
- data/vendor/cereal/include/cereal/types/string.hpp +0 -61
- data/vendor/cereal/include/cereal/types/tuple.hpp +0 -123
- data/vendor/cereal/include/cereal/types/unordered_map.hpp +0 -36
- data/vendor/cereal/include/cereal/types/unordered_set.hpp +0 -99
- data/vendor/cereal/include/cereal/types/utility.hpp +0 -47
- data/vendor/cereal/include/cereal/types/valarray.hpp +0 -89
- data/vendor/cereal/include/cereal/types/variant.hpp +0 -109
- data/vendor/cereal/include/cereal/types/vector.hpp +0 -112
- data/vendor/cereal/include/cereal/version.hpp +0 -52
- data/vendor/isotree/src/Makevars +0 -4
- data/vendor/isotree/src/crit.cpp +0 -912
- data/vendor/isotree/src/dist.cpp +0 -749
- data/vendor/isotree/src/extended.cpp +0 -790
- data/vendor/isotree/src/fit_model.cpp +0 -1090
- data/vendor/isotree/src/helpers_iforest.cpp +0 -324
- data/vendor/isotree/src/isoforest.cpp +0 -771
- data/vendor/isotree/src/mult.cpp +0 -607
- data/vendor/isotree/src/predict.cpp +0 -853
- data/vendor/isotree/src/utils.cpp +0 -1566
@@ -1,186 +0,0 @@
|
|
1
|
-
// Tencent is pleased to support the open source community by making RapidJSON available.
|
2
|
-
//
|
3
|
-
// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
|
4
|
-
//
|
5
|
-
// Licensed under the MIT License (the "License"); you may not use this file except
|
6
|
-
// in compliance with the License. You may obtain a copy of the License at
|
7
|
-
//
|
8
|
-
// http://opensource.org/licenses/MIT
|
9
|
-
//
|
10
|
-
// Unless required by applicable law or agreed to in writing, software distributed
|
11
|
-
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
12
|
-
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
13
|
-
// specific language governing permissions and limitations under the License.
|
14
|
-
|
15
|
-
#ifndef CEREAL_RAPIDJSON_INTERNAL_META_H_
|
16
|
-
#define CEREAL_RAPIDJSON_INTERNAL_META_H_
|
17
|
-
|
18
|
-
#include "../rapidjson.h"
|
19
|
-
|
20
|
-
#ifdef __GNUC__
|
21
|
-
CEREAL_RAPIDJSON_DIAG_PUSH
|
22
|
-
CEREAL_RAPIDJSON_DIAG_OFF(effc++)
|
23
|
-
#endif
|
24
|
-
|
25
|
-
#if defined(_MSC_VER) && !defined(__clang__)
|
26
|
-
CEREAL_RAPIDJSON_DIAG_PUSH
|
27
|
-
CEREAL_RAPIDJSON_DIAG_OFF(6334)
|
28
|
-
#endif
|
29
|
-
|
30
|
-
#if CEREAL_RAPIDJSON_HAS_CXX11_TYPETRAITS
|
31
|
-
#include <type_traits>
|
32
|
-
#endif
|
33
|
-
|
34
|
-
//@cond CEREAL_RAPIDJSON_INTERNAL
|
35
|
-
CEREAL_RAPIDJSON_NAMESPACE_BEGIN
|
36
|
-
namespace internal {
|
37
|
-
|
38
|
-
// Helper to wrap/convert arbitrary types to void, useful for arbitrary type matching
|
39
|
-
template <typename T> struct Void { typedef void Type; };
|
40
|
-
|
41
|
-
///////////////////////////////////////////////////////////////////////////////
|
42
|
-
// BoolType, TrueType, FalseType
|
43
|
-
//
|
44
|
-
template <bool Cond> struct BoolType {
|
45
|
-
static const bool Value = Cond;
|
46
|
-
typedef BoolType Type;
|
47
|
-
};
|
48
|
-
typedef BoolType<true> TrueType;
|
49
|
-
typedef BoolType<false> FalseType;
|
50
|
-
|
51
|
-
|
52
|
-
///////////////////////////////////////////////////////////////////////////////
|
53
|
-
// SelectIf, BoolExpr, NotExpr, AndExpr, OrExpr
|
54
|
-
//
|
55
|
-
|
56
|
-
template <bool C> struct SelectIfImpl { template <typename T1, typename T2> struct Apply { typedef T1 Type; }; };
|
57
|
-
template <> struct SelectIfImpl<false> { template <typename T1, typename T2> struct Apply { typedef T2 Type; }; };
|
58
|
-
template <bool C, typename T1, typename T2> struct SelectIfCond : SelectIfImpl<C>::template Apply<T1,T2> {};
|
59
|
-
template <typename C, typename T1, typename T2> struct SelectIf : SelectIfCond<C::Value, T1, T2> {};
|
60
|
-
|
61
|
-
template <bool Cond1, bool Cond2> struct AndExprCond : FalseType {};
|
62
|
-
template <> struct AndExprCond<true, true> : TrueType {};
|
63
|
-
template <bool Cond1, bool Cond2> struct OrExprCond : TrueType {};
|
64
|
-
template <> struct OrExprCond<false, false> : FalseType {};
|
65
|
-
|
66
|
-
template <typename C> struct BoolExpr : SelectIf<C,TrueType,FalseType>::Type {};
|
67
|
-
template <typename C> struct NotExpr : SelectIf<C,FalseType,TrueType>::Type {};
|
68
|
-
template <typename C1, typename C2> struct AndExpr : AndExprCond<C1::Value, C2::Value>::Type {};
|
69
|
-
template <typename C1, typename C2> struct OrExpr : OrExprCond<C1::Value, C2::Value>::Type {};
|
70
|
-
|
71
|
-
|
72
|
-
///////////////////////////////////////////////////////////////////////////////
|
73
|
-
// AddConst, MaybeAddConst, RemoveConst
|
74
|
-
template <typename T> struct AddConst { typedef const T Type; };
|
75
|
-
template <bool Constify, typename T> struct MaybeAddConst : SelectIfCond<Constify, const T, T> {};
|
76
|
-
template <typename T> struct RemoveConst { typedef T Type; };
|
77
|
-
template <typename T> struct RemoveConst<const T> { typedef T Type; };
|
78
|
-
|
79
|
-
|
80
|
-
///////////////////////////////////////////////////////////////////////////////
|
81
|
-
// IsSame, IsConst, IsMoreConst, IsPointer
|
82
|
-
//
|
83
|
-
template <typename T, typename U> struct IsSame : FalseType {};
|
84
|
-
template <typename T> struct IsSame<T, T> : TrueType {};
|
85
|
-
|
86
|
-
template <typename T> struct IsConst : FalseType {};
|
87
|
-
template <typename T> struct IsConst<const T> : TrueType {};
|
88
|
-
|
89
|
-
template <typename CT, typename T>
|
90
|
-
struct IsMoreConst
|
91
|
-
: AndExpr<IsSame<typename RemoveConst<CT>::Type, typename RemoveConst<T>::Type>,
|
92
|
-
BoolType<IsConst<CT>::Value >= IsConst<T>::Value> >::Type {};
|
93
|
-
|
94
|
-
template <typename T> struct IsPointer : FalseType {};
|
95
|
-
template <typename T> struct IsPointer<T*> : TrueType {};
|
96
|
-
|
97
|
-
///////////////////////////////////////////////////////////////////////////////
|
98
|
-
// IsBaseOf
|
99
|
-
//
|
100
|
-
#if CEREAL_RAPIDJSON_HAS_CXX11_TYPETRAITS
|
101
|
-
|
102
|
-
template <typename B, typename D> struct IsBaseOf
|
103
|
-
: BoolType< ::std::is_base_of<B,D>::value> {};
|
104
|
-
|
105
|
-
#else // simplified version adopted from Boost
|
106
|
-
|
107
|
-
template<typename B, typename D> struct IsBaseOfImpl {
|
108
|
-
CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(B) != 0);
|
109
|
-
CEREAL_RAPIDJSON_STATIC_ASSERT(sizeof(D) != 0);
|
110
|
-
|
111
|
-
typedef char (&Yes)[1];
|
112
|
-
typedef char (&No) [2];
|
113
|
-
|
114
|
-
template <typename T>
|
115
|
-
static Yes Check(const D*, T);
|
116
|
-
static No Check(const B*, int);
|
117
|
-
|
118
|
-
struct Host {
|
119
|
-
operator const B*() const;
|
120
|
-
operator const D*();
|
121
|
-
};
|
122
|
-
|
123
|
-
enum { Value = (sizeof(Check(Host(), 0)) == sizeof(Yes)) };
|
124
|
-
};
|
125
|
-
|
126
|
-
template <typename B, typename D> struct IsBaseOf
|
127
|
-
: OrExpr<IsSame<B, D>, BoolExpr<IsBaseOfImpl<B, D> > >::Type {};
|
128
|
-
|
129
|
-
#endif // CEREAL_RAPIDJSON_HAS_CXX11_TYPETRAITS
|
130
|
-
|
131
|
-
|
132
|
-
//////////////////////////////////////////////////////////////////////////
|
133
|
-
// EnableIf / DisableIf
|
134
|
-
//
|
135
|
-
template <bool Condition, typename T = void> struct EnableIfCond { typedef T Type; };
|
136
|
-
template <typename T> struct EnableIfCond<false, T> { /* empty */ };
|
137
|
-
|
138
|
-
template <bool Condition, typename T = void> struct DisableIfCond { typedef T Type; };
|
139
|
-
template <typename T> struct DisableIfCond<true, T> { /* empty */ };
|
140
|
-
|
141
|
-
template <typename Condition, typename T = void>
|
142
|
-
struct EnableIf : EnableIfCond<Condition::Value, T> {};
|
143
|
-
|
144
|
-
template <typename Condition, typename T = void>
|
145
|
-
struct DisableIf : DisableIfCond<Condition::Value, T> {};
|
146
|
-
|
147
|
-
// SFINAE helpers
|
148
|
-
struct SfinaeTag {};
|
149
|
-
template <typename T> struct RemoveSfinaeTag;
|
150
|
-
template <typename T> struct RemoveSfinaeTag<SfinaeTag&(*)(T)> { typedef T Type; };
|
151
|
-
|
152
|
-
#define CEREAL_RAPIDJSON_REMOVEFPTR_(type) \
|
153
|
-
typename ::CEREAL_RAPIDJSON_NAMESPACE::internal::RemoveSfinaeTag \
|
154
|
-
< ::CEREAL_RAPIDJSON_NAMESPACE::internal::SfinaeTag&(*) type>::Type
|
155
|
-
|
156
|
-
#define CEREAL_RAPIDJSON_ENABLEIF(cond) \
|
157
|
-
typename ::CEREAL_RAPIDJSON_NAMESPACE::internal::EnableIf \
|
158
|
-
<CEREAL_RAPIDJSON_REMOVEFPTR_(cond)>::Type * = NULL
|
159
|
-
|
160
|
-
#define CEREAL_RAPIDJSON_DISABLEIF(cond) \
|
161
|
-
typename ::CEREAL_RAPIDJSON_NAMESPACE::internal::DisableIf \
|
162
|
-
<CEREAL_RAPIDJSON_REMOVEFPTR_(cond)>::Type * = NULL
|
163
|
-
|
164
|
-
#define CEREAL_RAPIDJSON_ENABLEIF_RETURN(cond,returntype) \
|
165
|
-
typename ::CEREAL_RAPIDJSON_NAMESPACE::internal::EnableIf \
|
166
|
-
<CEREAL_RAPIDJSON_REMOVEFPTR_(cond), \
|
167
|
-
CEREAL_RAPIDJSON_REMOVEFPTR_(returntype)>::Type
|
168
|
-
|
169
|
-
#define CEREAL_RAPIDJSON_DISABLEIF_RETURN(cond,returntype) \
|
170
|
-
typename ::CEREAL_RAPIDJSON_NAMESPACE::internal::DisableIf \
|
171
|
-
<CEREAL_RAPIDJSON_REMOVEFPTR_(cond), \
|
172
|
-
CEREAL_RAPIDJSON_REMOVEFPTR_(returntype)>::Type
|
173
|
-
|
174
|
-
} // namespace internal
|
175
|
-
CEREAL_RAPIDJSON_NAMESPACE_END
|
176
|
-
//@endcond
|
177
|
-
|
178
|
-
#if defined(_MSC_VER) && !defined(__clang__)
|
179
|
-
CEREAL_RAPIDJSON_DIAG_POP
|
180
|
-
#endif
|
181
|
-
|
182
|
-
#ifdef __GNUC__
|
183
|
-
CEREAL_RAPIDJSON_DIAG_POP
|
184
|
-
#endif
|
185
|
-
|
186
|
-
#endif // CEREAL_RAPIDJSON_INTERNAL_META_H_
|
@@ -1,55 +0,0 @@
|
|
1
|
-
// Tencent is pleased to support the open source community by making RapidJSON available.
|
2
|
-
//
|
3
|
-
// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
|
4
|
-
//
|
5
|
-
// Licensed under the MIT License (the "License"); you may not use this file except
|
6
|
-
// in compliance with the License. You may obtain a copy of the License at
|
7
|
-
//
|
8
|
-
// http://opensource.org/licenses/MIT
|
9
|
-
//
|
10
|
-
// Unless required by applicable law or agreed to in writing, software distributed
|
11
|
-
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
12
|
-
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
13
|
-
// specific language governing permissions and limitations under the License.
|
14
|
-
|
15
|
-
#ifndef CEREAL_RAPIDJSON_POW10_
|
16
|
-
#define CEREAL_RAPIDJSON_POW10_
|
17
|
-
|
18
|
-
#include "../rapidjson.h"
|
19
|
-
|
20
|
-
CEREAL_RAPIDJSON_NAMESPACE_BEGIN
|
21
|
-
namespace internal {
|
22
|
-
|
23
|
-
//! Computes integer powers of 10 in double (10.0^n).
|
24
|
-
/*! This function uses lookup table for fast and accurate results.
|
25
|
-
\param n non-negative exponent. Must <= 308.
|
26
|
-
\return 10.0^n
|
27
|
-
*/
|
28
|
-
inline double Pow10(int n) {
|
29
|
-
static const double e[] = { // 1e-0...1e308: 309 * 8 bytes = 2472 bytes
|
30
|
-
1e+0,
|
31
|
-
1e+1, 1e+2, 1e+3, 1e+4, 1e+5, 1e+6, 1e+7, 1e+8, 1e+9, 1e+10, 1e+11, 1e+12, 1e+13, 1e+14, 1e+15, 1e+16, 1e+17, 1e+18, 1e+19, 1e+20,
|
32
|
-
1e+21, 1e+22, 1e+23, 1e+24, 1e+25, 1e+26, 1e+27, 1e+28, 1e+29, 1e+30, 1e+31, 1e+32, 1e+33, 1e+34, 1e+35, 1e+36, 1e+37, 1e+38, 1e+39, 1e+40,
|
33
|
-
1e+41, 1e+42, 1e+43, 1e+44, 1e+45, 1e+46, 1e+47, 1e+48, 1e+49, 1e+50, 1e+51, 1e+52, 1e+53, 1e+54, 1e+55, 1e+56, 1e+57, 1e+58, 1e+59, 1e+60,
|
34
|
-
1e+61, 1e+62, 1e+63, 1e+64, 1e+65, 1e+66, 1e+67, 1e+68, 1e+69, 1e+70, 1e+71, 1e+72, 1e+73, 1e+74, 1e+75, 1e+76, 1e+77, 1e+78, 1e+79, 1e+80,
|
35
|
-
1e+81, 1e+82, 1e+83, 1e+84, 1e+85, 1e+86, 1e+87, 1e+88, 1e+89, 1e+90, 1e+91, 1e+92, 1e+93, 1e+94, 1e+95, 1e+96, 1e+97, 1e+98, 1e+99, 1e+100,
|
36
|
-
1e+101,1e+102,1e+103,1e+104,1e+105,1e+106,1e+107,1e+108,1e+109,1e+110,1e+111,1e+112,1e+113,1e+114,1e+115,1e+116,1e+117,1e+118,1e+119,1e+120,
|
37
|
-
1e+121,1e+122,1e+123,1e+124,1e+125,1e+126,1e+127,1e+128,1e+129,1e+130,1e+131,1e+132,1e+133,1e+134,1e+135,1e+136,1e+137,1e+138,1e+139,1e+140,
|
38
|
-
1e+141,1e+142,1e+143,1e+144,1e+145,1e+146,1e+147,1e+148,1e+149,1e+150,1e+151,1e+152,1e+153,1e+154,1e+155,1e+156,1e+157,1e+158,1e+159,1e+160,
|
39
|
-
1e+161,1e+162,1e+163,1e+164,1e+165,1e+166,1e+167,1e+168,1e+169,1e+170,1e+171,1e+172,1e+173,1e+174,1e+175,1e+176,1e+177,1e+178,1e+179,1e+180,
|
40
|
-
1e+181,1e+182,1e+183,1e+184,1e+185,1e+186,1e+187,1e+188,1e+189,1e+190,1e+191,1e+192,1e+193,1e+194,1e+195,1e+196,1e+197,1e+198,1e+199,1e+200,
|
41
|
-
1e+201,1e+202,1e+203,1e+204,1e+205,1e+206,1e+207,1e+208,1e+209,1e+210,1e+211,1e+212,1e+213,1e+214,1e+215,1e+216,1e+217,1e+218,1e+219,1e+220,
|
42
|
-
1e+221,1e+222,1e+223,1e+224,1e+225,1e+226,1e+227,1e+228,1e+229,1e+230,1e+231,1e+232,1e+233,1e+234,1e+235,1e+236,1e+237,1e+238,1e+239,1e+240,
|
43
|
-
1e+241,1e+242,1e+243,1e+244,1e+245,1e+246,1e+247,1e+248,1e+249,1e+250,1e+251,1e+252,1e+253,1e+254,1e+255,1e+256,1e+257,1e+258,1e+259,1e+260,
|
44
|
-
1e+261,1e+262,1e+263,1e+264,1e+265,1e+266,1e+267,1e+268,1e+269,1e+270,1e+271,1e+272,1e+273,1e+274,1e+275,1e+276,1e+277,1e+278,1e+279,1e+280,
|
45
|
-
1e+281,1e+282,1e+283,1e+284,1e+285,1e+286,1e+287,1e+288,1e+289,1e+290,1e+291,1e+292,1e+293,1e+294,1e+295,1e+296,1e+297,1e+298,1e+299,1e+300,
|
46
|
-
1e+301,1e+302,1e+303,1e+304,1e+305,1e+306,1e+307,1e+308
|
47
|
-
};
|
48
|
-
CEREAL_RAPIDJSON_ASSERT(n >= 0 && n <= 308);
|
49
|
-
return e[n];
|
50
|
-
}
|
51
|
-
|
52
|
-
} // namespace internal
|
53
|
-
CEREAL_RAPIDJSON_NAMESPACE_END
|
54
|
-
|
55
|
-
#endif // CEREAL_RAPIDJSON_POW10_
|