File: register_routines.c

package info (click to toggle)
r-cran-rspectra 0.16-0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 736 kB
  • sloc: cpp: 4,917; ansic: 256; makefile: 2
file content (72 lines) | stat: -rw-r--r-- 2,387 bytes parent folder | download
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
#include <SpectraC.h>
#include <R.h>
#include <Rinternals.h>
#include <R_ext/Rdynload.h>

/* Exported functions */
SEXP eigs_sym(
    SEXP A_mat_r, SEXP n_scalar_r, SEXP k_scalar_r,
    SEXP params_list_r, SEXP mattype_scalar_r
);

SEXP eigs_shift_sym(
    SEXP A_mat_r, SEXP n_scalar_r, SEXP k_scalar_r,
    SEXP params_list_r, SEXP mattype_scalar_r
);

SEXP eigs_gen(
    SEXP A_mat_r, SEXP n_scalar_r, SEXP k_scalar_r,
    SEXP params_list_r, SEXP mattype_scalar_r
);

SEXP eigs_real_shift_gen(
    SEXP A_mat_r, SEXP n_scalar_r, SEXP k_scalar_r,
    SEXP params_list_r, SEXP mattype_scalar_r
);

SEXP eigs_complex_shift_gen(
    SEXP A_mat_r, SEXP n_scalar_r, SEXP k_scalar_r,
    SEXP params_list_r, SEXP mattype_scalar_r
);

SEXP svds_sym(
    SEXP A_mat_r, SEXP n_scalar_r, SEXP k_scalar_r,
    SEXP nu_scalar_r, SEXP nv_scalar_r,
    SEXP params_list_r, SEXP mattype_scalar_r
);

SEXP svds_gen(
    SEXP A_mat_r, SEXP m_scalar_r, SEXP n_scalar_r,
    SEXP k_scalar_r, SEXP nu_scalar_r, SEXP nv_scalar_r,
    SEXP params_list_r, SEXP mattype_scalar_r
);

SEXP is_sym_dgCMatrix(SEXP mat, SEXP tol);

SEXP is_sym_dgRMatrix(SEXP mat, SEXP tol);

static const R_CallMethodDef CallEntries[] = {
    {"eigs_sym",               (DL_FUNC) &eigs_sym,               5},
    {"eigs_shift_sym",         (DL_FUNC) &eigs_shift_sym,         5},
    {"eigs_gen",               (DL_FUNC) &eigs_gen,               5},
    {"eigs_real_shift_gen",    (DL_FUNC) &eigs_real_shift_gen,    5},
    {"eigs_complex_shift_gen", (DL_FUNC) &eigs_complex_shift_gen, 5},
    {"svds_sym",               (DL_FUNC) &svds_sym,               7},
    {"svds_gen",               (DL_FUNC) &svds_gen,               8},
    {"is_sym_dgCMatrix",       (DL_FUNC) &is_sym_dgCMatrix,       2},
    {"is_sym_dgRMatrix",       (DL_FUNC) &is_sym_dgRMatrix,       2},
    {NULL, NULL, 0}
};

void R_init_RSpectra(DllInfo* info)
{
    /* Register C interface */
    R_RegisterCCallable("RSpectra", "eigs_sym_c",       (DL_FUNC) eigs_sym_c);
    R_RegisterCCallable("RSpectra", "eigs_sym_shift_c", (DL_FUNC) eigs_sym_shift_c);
    R_RegisterCCallable("RSpectra", "eigs_gen_c",       (DL_FUNC) eigs_gen_c);
    R_RegisterCCallable("RSpectra", "eigs_gen_shift_c", (DL_FUNC) eigs_gen_shift_c);

    /* Register R .Call functions */
    R_registerRoutines(info, NULL, CallEntries, NULL, NULL);
    R_useDynamicSymbols(info, FALSE);
}