forked from jMotif/jmotif-R
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRcppExports.cpp
More file actions
336 lines (331 loc) · 15.2 KB
/
RcppExports.cpp
File metadata and controls
336 lines (331 loc) · 15.2 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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
// Generated by using Rcpp::compileAttributes() -> do not edit by hand
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
#include "../inst/include/jmotif.h"
#include <RcppArmadillo.h>
#include <Rcpp.h>
using namespace Rcpp;
// find_discords_brute_force
Rcpp::DataFrame find_discords_brute_force(NumericVector ts, int w_size, int discords_num);
RcppExport SEXP _jmotif_find_discords_brute_force(SEXP tsSEXP, SEXP w_sizeSEXP, SEXP discords_numSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< NumericVector >::type ts(tsSEXP);
Rcpp::traits::input_parameter< int >::type w_size(w_sizeSEXP);
Rcpp::traits::input_parameter< int >::type discords_num(discords_numSEXP);
rcpp_result_gen = Rcpp::wrap(find_discords_brute_force(ts, w_size, discords_num));
return rcpp_result_gen;
END_RCPP
}
// euclidean_dist
double euclidean_dist(NumericVector seq1, NumericVector seq2);
RcppExport SEXP _jmotif_euclidean_dist(SEXP seq1SEXP, SEXP seq2SEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< NumericVector >::type seq1(seq1SEXP);
Rcpp::traits::input_parameter< NumericVector >::type seq2(seq2SEXP);
rcpp_result_gen = Rcpp::wrap(euclidean_dist(seq1, seq2));
return rcpp_result_gen;
END_RCPP
}
// early_abandoned_dist
double early_abandoned_dist(NumericVector seq1, NumericVector seq2, double upper_limit);
RcppExport SEXP _jmotif_early_abandoned_dist(SEXP seq1SEXP, SEXP seq2SEXP, SEXP upper_limitSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< NumericVector >::type seq1(seq1SEXP);
Rcpp::traits::input_parameter< NumericVector >::type seq2(seq2SEXP);
Rcpp::traits::input_parameter< double >::type upper_limit(upper_limitSEXP);
rcpp_result_gen = Rcpp::wrap(early_abandoned_dist(seq1, seq2, upper_limit));
return rcpp_result_gen;
END_RCPP
}
// find_discords_hotsax
Rcpp::DataFrame find_discords_hotsax(NumericVector ts, int w_size, int paa_size, int a_size, double n_threshold, int discords_num);
RcppExport SEXP _jmotif_find_discords_hotsax(SEXP tsSEXP, SEXP w_sizeSEXP, SEXP paa_sizeSEXP, SEXP a_sizeSEXP, SEXP n_thresholdSEXP, SEXP discords_numSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< NumericVector >::type ts(tsSEXP);
Rcpp::traits::input_parameter< int >::type w_size(w_sizeSEXP);
Rcpp::traits::input_parameter< int >::type paa_size(paa_sizeSEXP);
Rcpp::traits::input_parameter< int >::type a_size(a_sizeSEXP);
Rcpp::traits::input_parameter< double >::type n_threshold(n_thresholdSEXP);
Rcpp::traits::input_parameter< int >::type discords_num(discords_numSEXP);
rcpp_result_gen = Rcpp::wrap(find_discords_hotsax(ts, w_size, paa_size, a_size, n_threshold, discords_num));
return rcpp_result_gen;
END_RCPP
}
// paa
NumericVector paa(NumericVector ts, int paa_num);
RcppExport SEXP _jmotif_paa(SEXP tsSEXP, SEXP paa_numSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< NumericVector >::type ts(tsSEXP);
Rcpp::traits::input_parameter< int >::type paa_num(paa_numSEXP);
rcpp_result_gen = Rcpp::wrap(paa(ts, paa_num));
return rcpp_result_gen;
END_RCPP
}
// str_to_repair_grammar
Rcpp::List str_to_repair_grammar(CharacterVector str);
RcppExport SEXP _jmotif_str_to_repair_grammar(SEXP strSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< CharacterVector >::type str(strSEXP);
rcpp_result_gen = Rcpp::wrap(str_to_repair_grammar(str));
return rcpp_result_gen;
END_RCPP
}
// find_discords_rra
Rcpp::DataFrame find_discords_rra(NumericVector series, int w_size, int paa_size, int a_size, CharacterVector nr_strategy, double n_threshold, int discords_num);
RcppExport SEXP _jmotif_find_discords_rra(SEXP seriesSEXP, SEXP w_sizeSEXP, SEXP paa_sizeSEXP, SEXP a_sizeSEXP, SEXP nr_strategySEXP, SEXP n_thresholdSEXP, SEXP discords_numSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< NumericVector >::type series(seriesSEXP);
Rcpp::traits::input_parameter< int >::type w_size(w_sizeSEXP);
Rcpp::traits::input_parameter< int >::type paa_size(paa_sizeSEXP);
Rcpp::traits::input_parameter< int >::type a_size(a_sizeSEXP);
Rcpp::traits::input_parameter< CharacterVector >::type nr_strategy(nr_strategySEXP);
Rcpp::traits::input_parameter< double >::type n_threshold(n_thresholdSEXP);
Rcpp::traits::input_parameter< int >::type discords_num(discords_numSEXP);
rcpp_result_gen = Rcpp::wrap(find_discords_rra(series, w_size, paa_size, a_size, nr_strategy, n_threshold, discords_num));
return rcpp_result_gen;
END_RCPP
}
// series_to_wordbag
Rcpp::DataFrame series_to_wordbag(NumericVector ts, int w_size, int paa_size, int a_size, CharacterVector nr_strategy, double n_threshold);
RcppExport SEXP _jmotif_series_to_wordbag(SEXP tsSEXP, SEXP w_sizeSEXP, SEXP paa_sizeSEXP, SEXP a_sizeSEXP, SEXP nr_strategySEXP, SEXP n_thresholdSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< NumericVector >::type ts(tsSEXP);
Rcpp::traits::input_parameter< int >::type w_size(w_sizeSEXP);
Rcpp::traits::input_parameter< int >::type paa_size(paa_sizeSEXP);
Rcpp::traits::input_parameter< int >::type a_size(a_sizeSEXP);
Rcpp::traits::input_parameter< CharacterVector >::type nr_strategy(nr_strategySEXP);
Rcpp::traits::input_parameter< double >::type n_threshold(n_thresholdSEXP);
rcpp_result_gen = Rcpp::wrap(series_to_wordbag(ts, w_size, paa_size, a_size, nr_strategy, n_threshold));
return rcpp_result_gen;
END_RCPP
}
// manyseries_to_wordbag
Rcpp::DataFrame manyseries_to_wordbag(NumericMatrix data, int w_size, int paa_size, int a_size, CharacterVector nr_strategy, double n_threshold);
RcppExport SEXP _jmotif_manyseries_to_wordbag(SEXP dataSEXP, SEXP w_sizeSEXP, SEXP paa_sizeSEXP, SEXP a_sizeSEXP, SEXP nr_strategySEXP, SEXP n_thresholdSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< NumericMatrix >::type data(dataSEXP);
Rcpp::traits::input_parameter< int >::type w_size(w_sizeSEXP);
Rcpp::traits::input_parameter< int >::type paa_size(paa_sizeSEXP);
Rcpp::traits::input_parameter< int >::type a_size(a_sizeSEXP);
Rcpp::traits::input_parameter< CharacterVector >::type nr_strategy(nr_strategySEXP);
Rcpp::traits::input_parameter< double >::type n_threshold(n_thresholdSEXP);
rcpp_result_gen = Rcpp::wrap(manyseries_to_wordbag(data, w_size, paa_size, a_size, nr_strategy, n_threshold));
return rcpp_result_gen;
END_RCPP
}
// bags_to_tfidf
Rcpp::DataFrame bags_to_tfidf(Rcpp::List data);
RcppExport SEXP _jmotif_bags_to_tfidf(SEXP dataSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< Rcpp::List >::type data(dataSEXP);
rcpp_result_gen = Rcpp::wrap(bags_to_tfidf(data));
return rcpp_result_gen;
END_RCPP
}
// cosine_sim
Rcpp::DataFrame cosine_sim(Rcpp::List data);
RcppExport SEXP _jmotif_cosine_sim(SEXP dataSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< Rcpp::List >::type data(dataSEXP);
rcpp_result_gen = Rcpp::wrap(cosine_sim(data));
return rcpp_result_gen;
END_RCPP
}
// alphabet_to_cuts
NumericVector alphabet_to_cuts(int a_size);
RcppExport SEXP _jmotif_alphabet_to_cuts(SEXP a_sizeSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< int >::type a_size(a_sizeSEXP);
rcpp_result_gen = Rcpp::wrap(alphabet_to_cuts(a_size));
return rcpp_result_gen;
END_RCPP
}
// series_to_chars
CharacterVector series_to_chars(NumericVector ts, int a_size);
RcppExport SEXP _jmotif_series_to_chars(SEXP tsSEXP, SEXP a_sizeSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< NumericVector >::type ts(tsSEXP);
Rcpp::traits::input_parameter< int >::type a_size(a_sizeSEXP);
rcpp_result_gen = Rcpp::wrap(series_to_chars(ts, a_size));
return rcpp_result_gen;
END_RCPP
}
// series_to_string
CharacterVector series_to_string(NumericVector ts, int a_size);
RcppExport SEXP _jmotif_series_to_string(SEXP tsSEXP, SEXP a_sizeSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< NumericVector >::type ts(tsSEXP);
Rcpp::traits::input_parameter< int >::type a_size(a_sizeSEXP);
rcpp_result_gen = Rcpp::wrap(series_to_string(ts, a_size));
return rcpp_result_gen;
END_RCPP
}
// sax_via_window
std::map<int, std::string> sax_via_window(NumericVector ts, int w_size, int paa_size, int a_size, CharacterVector nr_strategy, double n_threshold);
RcppExport SEXP _jmotif_sax_via_window(SEXP tsSEXP, SEXP w_sizeSEXP, SEXP paa_sizeSEXP, SEXP a_sizeSEXP, SEXP nr_strategySEXP, SEXP n_thresholdSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< NumericVector >::type ts(tsSEXP);
Rcpp::traits::input_parameter< int >::type w_size(w_sizeSEXP);
Rcpp::traits::input_parameter< int >::type paa_size(paa_sizeSEXP);
Rcpp::traits::input_parameter< int >::type a_size(a_sizeSEXP);
Rcpp::traits::input_parameter< CharacterVector >::type nr_strategy(nr_strategySEXP);
Rcpp::traits::input_parameter< double >::type n_threshold(n_thresholdSEXP);
rcpp_result_gen = Rcpp::wrap(sax_via_window(ts, w_size, paa_size, a_size, nr_strategy, n_threshold));
return rcpp_result_gen;
END_RCPP
}
// sax_by_chunking
std::map<int, CharacterVector> sax_by_chunking(NumericVector ts, int paa_size, int a_size, double n_threshold);
RcppExport SEXP _jmotif_sax_by_chunking(SEXP tsSEXP, SEXP paa_sizeSEXP, SEXP a_sizeSEXP, SEXP n_thresholdSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< NumericVector >::type ts(tsSEXP);
Rcpp::traits::input_parameter< int >::type paa_size(paa_sizeSEXP);
Rcpp::traits::input_parameter< int >::type a_size(a_sizeSEXP);
Rcpp::traits::input_parameter< double >::type n_threshold(n_thresholdSEXP);
rcpp_result_gen = Rcpp::wrap(sax_by_chunking(ts, paa_size, a_size, n_threshold));
return rcpp_result_gen;
END_RCPP
}
// idx_to_letter
char idx_to_letter(int idx);
RcppExport SEXP _jmotif_idx_to_letter(SEXP idxSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< int >::type idx(idxSEXP);
rcpp_result_gen = Rcpp::wrap(idx_to_letter(idx));
return rcpp_result_gen;
END_RCPP
}
// letter_to_idx
int letter_to_idx(char letter);
RcppExport SEXP _jmotif_letter_to_idx(SEXP letterSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< char >::type letter(letterSEXP);
rcpp_result_gen = Rcpp::wrap(letter_to_idx(letter));
return rcpp_result_gen;
END_RCPP
}
// letters_to_idx
IntegerVector letters_to_idx(CharacterVector str);
RcppExport SEXP _jmotif_letters_to_idx(SEXP strSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< CharacterVector >::type str(strSEXP);
rcpp_result_gen = Rcpp::wrap(letters_to_idx(str));
return rcpp_result_gen;
END_RCPP
}
// is_equal_str
bool is_equal_str(CharacterVector a, CharacterVector b);
RcppExport SEXP _jmotif_is_equal_str(SEXP aSEXP, SEXP bSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< CharacterVector >::type a(aSEXP);
Rcpp::traits::input_parameter< CharacterVector >::type b(bSEXP);
rcpp_result_gen = Rcpp::wrap(is_equal_str(a, b));
return rcpp_result_gen;
END_RCPP
}
// is_equal_mindist
bool is_equal_mindist(CharacterVector a, CharacterVector b);
RcppExport SEXP _jmotif_is_equal_mindist(SEXP aSEXP, SEXP bSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< CharacterVector >::type a(aSEXP);
Rcpp::traits::input_parameter< CharacterVector >::type b(bSEXP);
rcpp_result_gen = Rcpp::wrap(is_equal_mindist(a, b));
return rcpp_result_gen;
END_RCPP
}
// subseries
NumericVector subseries(NumericVector ts, int start, int end);
RcppExport SEXP _jmotif_subseries(SEXP tsSEXP, SEXP startSEXP, SEXP endSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< NumericVector >::type ts(tsSEXP);
Rcpp::traits::input_parameter< int >::type start(startSEXP);
Rcpp::traits::input_parameter< int >::type end(endSEXP);
rcpp_result_gen = Rcpp::wrap(subseries(ts, start, end));
return rcpp_result_gen;
END_RCPP
}
// znorm
NumericVector znorm(NumericVector ts, double threshold);
RcppExport SEXP _jmotif_znorm(SEXP tsSEXP, SEXP thresholdSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< NumericVector >::type ts(tsSEXP);
Rcpp::traits::input_parameter< double >::type threshold(thresholdSEXP);
rcpp_result_gen = Rcpp::wrap(znorm(ts, threshold));
return rcpp_result_gen;
END_RCPP
}
static const R_CallMethodDef CallEntries[] = {
{"_jmotif_find_discords_brute_force", (DL_FUNC) &_jmotif_find_discords_brute_force, 3},
{"_jmotif_euclidean_dist", (DL_FUNC) &_jmotif_euclidean_dist, 2},
{"_jmotif_early_abandoned_dist", (DL_FUNC) &_jmotif_early_abandoned_dist, 3},
{"_jmotif_find_discords_hotsax", (DL_FUNC) &_jmotif_find_discords_hotsax, 6},
{"_jmotif_paa", (DL_FUNC) &_jmotif_paa, 2},
{"_jmotif_str_to_repair_grammar", (DL_FUNC) &_jmotif_str_to_repair_grammar, 1},
{"_jmotif_find_discords_rra", (DL_FUNC) &_jmotif_find_discords_rra, 7},
{"_jmotif_series_to_wordbag", (DL_FUNC) &_jmotif_series_to_wordbag, 6},
{"_jmotif_manyseries_to_wordbag", (DL_FUNC) &_jmotif_manyseries_to_wordbag, 6},
{"_jmotif_bags_to_tfidf", (DL_FUNC) &_jmotif_bags_to_tfidf, 1},
{"_jmotif_cosine_sim", (DL_FUNC) &_jmotif_cosine_sim, 1},
{"_jmotif_alphabet_to_cuts", (DL_FUNC) &_jmotif_alphabet_to_cuts, 1},
{"_jmotif_series_to_chars", (DL_FUNC) &_jmotif_series_to_chars, 2},
{"_jmotif_series_to_string", (DL_FUNC) &_jmotif_series_to_string, 2},
{"_jmotif_sax_via_window", (DL_FUNC) &_jmotif_sax_via_window, 6},
{"_jmotif_sax_by_chunking", (DL_FUNC) &_jmotif_sax_by_chunking, 4},
{"_jmotif_idx_to_letter", (DL_FUNC) &_jmotif_idx_to_letter, 1},
{"_jmotif_letter_to_idx", (DL_FUNC) &_jmotif_letter_to_idx, 1},
{"_jmotif_letters_to_idx", (DL_FUNC) &_jmotif_letters_to_idx, 1},
{"_jmotif_is_equal_str", (DL_FUNC) &_jmotif_is_equal_str, 2},
{"_jmotif_is_equal_mindist", (DL_FUNC) &_jmotif_is_equal_mindist, 2},
{"_jmotif_subseries", (DL_FUNC) &_jmotif_subseries, 3},
{"_jmotif_znorm", (DL_FUNC) &_jmotif_znorm, 2},
{NULL, NULL, 0}
};
RcppExport void R_init_jmotif(DllInfo *dll) {
R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
R_useDynamicSymbols(dll, FALSE);
}