-
Notifications
You must be signed in to change notification settings - Fork 1
/
cpp11.cpp
83 lines (78 loc) · 3.61 KB
/
cpp11.cpp
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
// Generated by cpp11: do not edit by hand
// clang-format off
#include "cpp11/declarations.hpp"
#include <R_ext/Visibility.h>
// from_file.cpp
cpp11::doubles cpp_fmm_to_vec(const std::string & filename);
extern "C" SEXP _fastMatMR_cpp_fmm_to_vec(SEXP filename) {
BEGIN_CPP11
return cpp11::as_sexp(cpp_fmm_to_vec(cpp11::as_cpp<cpp11::decay_t<const std::string &>>(filename)));
END_CPP11
}
// from_file.cpp
cpp11::doubles_matrix<> cpp_fmm_to_mat(const std::string & filename);
extern "C" SEXP _fastMatMR_cpp_fmm_to_mat(SEXP filename) {
BEGIN_CPP11
return cpp11::as_sexp(cpp_fmm_to_mat(cpp11::as_cpp<cpp11::decay_t<const std::string &>>(filename)));
END_CPP11
}
// from_file.cpp
cpp11::sexp cpp_fmm_to_sparse_Matrix(const std::string & filename);
extern "C" SEXP _fastMatMR_cpp_fmm_to_sparse_Matrix(SEXP filename) {
BEGIN_CPP11
return cpp11::as_sexp(cpp_fmm_to_sparse_Matrix(cpp11::as_cpp<cpp11::decay_t<const std::string &>>(filename)));
END_CPP11
}
// to_file.cpp
bool vec_to_fmm(cpp11::doubles r_vec, std::string filename);
extern "C" SEXP _fastMatMR_vec_to_fmm(SEXP r_vec, SEXP filename) {
BEGIN_CPP11
return cpp11::as_sexp(vec_to_fmm(cpp11::as_cpp<cpp11::decay_t<cpp11::doubles>>(r_vec), cpp11::as_cpp<cpp11::decay_t<std::string>>(filename)));
END_CPP11
}
// to_file.cpp
bool intvec_to_fmm(cpp11::integers r_vec, std::string filename);
extern "C" SEXP _fastMatMR_intvec_to_fmm(SEXP r_vec, SEXP filename) {
BEGIN_CPP11
return cpp11::as_sexp(intvec_to_fmm(cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(r_vec), cpp11::as_cpp<cpp11::decay_t<std::string>>(filename)));
END_CPP11
}
// to_file.cpp
bool mat_to_fmm(cpp11::doubles_matrix<> r_mat, std::string filename);
extern "C" SEXP _fastMatMR_mat_to_fmm(SEXP r_mat, SEXP filename) {
BEGIN_CPP11
return cpp11::as_sexp(mat_to_fmm(cpp11::as_cpp<cpp11::decay_t<cpp11::doubles_matrix<>>>(r_mat), cpp11::as_cpp<cpp11::decay_t<std::string>>(filename)));
END_CPP11
}
// to_file.cpp
bool intmat_to_fmm(cpp11::integers_matrix<> r_mat, std::string filename);
extern "C" SEXP _fastMatMR_intmat_to_fmm(SEXP r_mat, SEXP filename) {
BEGIN_CPP11
return cpp11::as_sexp(intmat_to_fmm(cpp11::as_cpp<cpp11::decay_t<cpp11::integers_matrix<>>>(r_mat), cpp11::as_cpp<cpp11::decay_t<std::string>>(filename)));
END_CPP11
}
// to_file.cpp
bool sparse_Matrix_to_fmm(cpp11::sexp input, std::string filename);
extern "C" SEXP _fastMatMR_sparse_Matrix_to_fmm(SEXP input, SEXP filename) {
BEGIN_CPP11
return cpp11::as_sexp(sparse_Matrix_to_fmm(cpp11::as_cpp<cpp11::decay_t<cpp11::sexp>>(input), cpp11::as_cpp<cpp11::decay_t<std::string>>(filename)));
END_CPP11
}
extern "C" {
static const R_CallMethodDef CallEntries[] = {
{"_fastMatMR_cpp_fmm_to_mat", (DL_FUNC) &_fastMatMR_cpp_fmm_to_mat, 1},
{"_fastMatMR_cpp_fmm_to_sparse_Matrix", (DL_FUNC) &_fastMatMR_cpp_fmm_to_sparse_Matrix, 1},
{"_fastMatMR_cpp_fmm_to_vec", (DL_FUNC) &_fastMatMR_cpp_fmm_to_vec, 1},
{"_fastMatMR_intmat_to_fmm", (DL_FUNC) &_fastMatMR_intmat_to_fmm, 2},
{"_fastMatMR_intvec_to_fmm", (DL_FUNC) &_fastMatMR_intvec_to_fmm, 2},
{"_fastMatMR_mat_to_fmm", (DL_FUNC) &_fastMatMR_mat_to_fmm, 2},
{"_fastMatMR_sparse_Matrix_to_fmm", (DL_FUNC) &_fastMatMR_sparse_Matrix_to_fmm, 2},
{"_fastMatMR_vec_to_fmm", (DL_FUNC) &_fastMatMR_vec_to_fmm, 2},
{NULL, NULL, 0}
};
}
extern "C" attribute_visible void R_init_fastMatMR(DllInfo* dll){
R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
R_useDynamicSymbols(dll, FALSE);
R_forceSymbols(dll, TRUE);
}