-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRcpp.h
More file actions
239 lines (186 loc) · 6.01 KB
/
Copy pathRcpp.h
File metadata and controls
239 lines (186 loc) · 6.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
#ifndef Rcpp14_h
#define Rcpp14_h
// minimum size for parallel features to kick in
#ifndef RCPP14_PARALLEL_MINIMUM_SIZE
#define RCPP14_PARALLEL_MINIMUM_SIZE 10000
#endif
#ifndef RCPP14_PARALLEL_NTHREADS
#define RCPP14_PARALLEL_NTHREADS std::thread::hardware_concurrency()
#endif
#include <Rcpp/platform.h>
#include <cmath>
#include <csetjmp>
#include <initializer_list>
#include <unordered_map>
#include <unordered_set>
#include <climits>
#include <map>
#include <Rcpp/macros/macros.h>
#include <Rcpp/internal/library.h>
#include <Rcpp/R.h>
#include <Rcpp/routines.h>
#include <Rcpp/wrap/forward.h>
#include <Rcpp/protection/protection.h>
#include <cstdint>
#include <array>
#include <type_traits>
#include <iterator>
#include <exception>
#include <iostream>
#include <sstream>
#include <string>
#include <list>
#include <forward_list>
#include <stack>
#include <queue>
#include <cxxabi.h>
#include <set>
#include <stdexcept>
#include <vector>
#include <deque>
#include <functional>
#include <numeric>
#include <algorithm>
#include <complex>
#include <climits>
#include <typeinfo>
#include <tuple>
#include <utility>
#include <future>
#include <chrono>
#include <Rcpp/api/CRTP.h>
#include <Rcpp/complex.h>
#include <Rcpp/utils/tinyformat.h>
#include <Rcpp/exceptions.h>
#include <Rcpp/internal/interrupt.h>
#include <Rcpp/Demangler.h>
#include <Rcpp/utils/describe.h>
#include <thread>
#include <Rcpp/utils/parallel/parallel.h>
namespace Rcpp{
inline bool is_null(SEXP x){
return Rf_isNull(x) ;
}
inline bool is_object(SEXP x){
return Rf_isObject(x) ;
}
inline bool inherits(SEXP x, const char* klass){
return Rf_inherits(x, klass) ;
}
inline std::string short_file_name(const char* file) {
std::string f(file) ;
size_t pos = f.find_last_of("/") ;
if( pos == std::string::npos ) return f ;
return f.substr( pos + 1 ) ;
}
inline bool derives_from( SEXP cl, const std::string& clazz ){
if(cl == R_NilValue) return false ;
// simple test for exact match
if( ! clazz.compare( CHAR(STRING_ELT(cl, 0)) ) ) return true ;
SEXP containsSym = Rf_install("contains");
Shield<SEXP> contains = R_do_slot(R_getClassDef(CHAR(Rf_asChar(cl))),containsSym);
SEXP res = Rf_getAttrib(contains,R_NamesSymbol );
if(res == R_NilValue) return false ;
return std::any_of(
VECTOR_PTR(res), VECTOR_PTR(res) + LENGTH(res),
[&](SEXP s){ return clazz == CHAR(s) ; }
) ;
}
class String ;
class PreserveStorage ;
class NoProtectStorage ;
template <int RTYPE, typename Storage = PreserveStorage> class Vector ;
template <int RTYPE, typename Storage = PreserveStorage> class Matrix ;
template <int RTYPE, typename Storage = PreserveStorage> class SquareMatrix ;
typedef Vector<STRSXP> CharacterVector ;
typedef Vector<VECSXP> List ;
typedef Vector<EXPRSXP> ExpressionVector ;
template <typename Storage> class RObject_Impl ;
template <typename Storage> class Language_Impl ;
template <typename Storage> class Pairlist_Impl ;
template <typename Storage> class Environment_Impl ;
template <typename Storage> class Promise_Impl ;
template <typename Storage> class WeakReference_Impl ;
template <typename Storage> class S4_Impl ;
template <typename Storage> class Formula_Impl ;
template <typename Storage> class Reference_Impl ;
template <typename Storage> class Function_Impl ;
template <typename Storage> class DataFrame_Impl ;
template <typename Storage> class Symbol_Impl ;
typedef RObject_Impl<PreserveStorage> RObject ;
typedef Language_Impl<PreserveStorage> Language ;
typedef Pairlist_Impl<PreserveStorage> Pairlist ;
typedef Environment_Impl<PreserveStorage> Environment ;
typedef Promise_Impl<PreserveStorage> Promise ;
typedef WeakReference_Impl<PreserveStorage> WeakReference ;
typedef S4_Impl<PreserveStorage> S4 ;
typedef Formula_Impl<PreserveStorage> Formula ;
typedef Reference_Impl<PreserveStorage> Reference ;
typedef Function_Impl<PreserveStorage> Function ;
typedef DataFrame_Impl<PreserveStorage> DataFrame ;
typedef Symbol_Impl<NoProtectStorage> Symbol ;
}
namespace Rcpp{
class Na_Proxy ;
template <typename T> T as( SEXP ) ;
}
#include <Rcpp/internal/na.h>
#include <Rcpp/traits/traits.h>
#include <Rcpp/sugar/functional/functional.h>
#include <Rcpp/Named.h>
#include <Rcpp/internal/caster.h>
#include <Rcpp/internal/r_vector.h>
#include <Rcpp/r_cast.h>
#include <Rcpp/internal/r_coerce.h>
#include <Rcpp/as/forward.h>
#include <Rcpp/InputParameter.h>
#include <Rcpp/is.h>
#include <Rcpp/wrap/wrap.h>
#include <Rcpp/internal/Proxy_Iterator.h>
#include <Rcpp/longlong.h>
#include <Rcpp/transient_vector.h>
#include <Rcpp/registration/registration.h>
#include <Rcpp/storage/storage.h>
#include <Rcpp/proxy/GenericProxy.h>
#include <Rcpp/proxy/proxy.h>
#include <Rcpp/Symbol.h>
#include <Rcpp/storage/storage.h>
#include <Rcpp/Node.h>
#include <Rcpp/grow.h>
#include <Rcpp/DottedPairImpl.h>
#include <Rcpp/structure.h>
#include <Rcpp/RObject.h>
#include <Rcpp/Promise.h>
#include <Rcpp/S4.h>
#include <Rcpp/Reference.h>
#include <Rcpp/clone.h>
#include <Rcpp/Environment.h>
#include <Rcpp/Evaluator.h>
#include <Rcpp/Vector.h>
#include <Rcpp/ListOf.h>
#include <Rcpp/sugar/nona/nona.h>
#include <Rcpp/XPtr.h>
#include <Rcpp/Function.h>
#include <Rcpp/Language.h>
#include <Rcpp/Pairlist.h>
#include <Rcpp/StretchyList.h>
#include <Rcpp/WeakReference.h>
#include <Rcpp/Formula.h>
#include <Rcpp/DataFrame.h>
#include <Rcpp/Index.h>
#include <Rcpp/Array.h>
#include <Rcpp/Dots.h>
#include <Rcpp/NamedDots.h>
#include <Rcpp/Context.h>
#include <Rcpp/Condition.h>
#include <Rmath.h>
#include <Rcpp/sugar/undoRmath.h>
#include <Rcpp/sugar/sugar.h>
#include <Rcpp/stats/stats.h>
#include <Rcpp/Rmath.h>
#include <Rcpp/api/meat/meat.h>
#include <Rcpp/Timer.h>
#include <Rcpp/vector/dimnames.h>
#include <Rcpp/Strict.h>
namespace Rcpp14 = Rcpp ;
#endif