File: pcaPP_init.c

package info (click to toggle)
r-cran-pcapp 1.9-73-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 800 kB
  • sloc: cpp: 5,961; ansic: 917; sh: 13; makefile: 2
file content (121 lines) | stat: -rw-r--r-- 5,603 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
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
//  VT::27.06.2017 - this file was added to fix the warning "Found no calls to: �R_registerRoutines�, �R_useDynamicSymbols�"
//
//  About registration of native symbols see for example: https://www.r-bloggers.com/1-easy-package-registration/
//      also here http://r.789695.n4.nabble.com/Registration-of-native-routines-td4728874.html
//      - about Windows - take the 64 bit version of mingw!
//

#include <stdlib.h> // for NULL
#include <R_ext/Rdynload.h>

#include <R.h>              
#include <Rinternals.h>

/*
	EXPORT void C_kendallNlogN (double* arr1, double* arr2, int *pnPar, double *dRet) ;
	EXPORT void C_l1median_BFGS (int *pnParam_In, int *pnParam_Out, double *pdParam_In, double *pdParam_Out, double *pdData, double *pdMRet) ;
	EXPORT void C_l1median_CG(int *pnParam, int *pnParam_Out, double *pdParam, double *pdParam_Out, double *pdData, double *pdMRet) ;
	EXPORT void C_l1median_HoCr	(int *pnParIn, int *pnParOut, double *pdParIn, double *pdX, double *pdMed) ;
	EXPORT void C_l1median_NLM (int *pnParam, double *pdParam, double *pdData, double *pdMRet) ;
	EXPORT void C_l1median_NLM_Hess (int *pnParam, double *pdParam, double *pdData, double *pdMRet) ;
	EXPORT void C_l1median_NM(int *pnParam, double *pdParam, double *pdData, double *pdMRet) ;
	EXPORT void C_l1Median_VZ		(int *pnParIn, int *pnParOut, double *pdParIn, double *pdX, double *pdMed) ;
	EXPORT void C_PCAgrid (int *pnParamIn, int *pnParamOut, double *pdParamIn, double *pdData, double *pdLoadings, double *pdSDev, double *pdObj) ;
	EXPORT void C_sPCAgrid (int *pnParamIn, int *pnParamOut, double *pdParamIn, double *pdData, double *pdLoadings, double *pdSDev, double *pdObj, double *pdLambda, double *pdBackTransHD) ;
	EXPORT void C_pcaProj (int *pnParIn, double *pdParIn, double *pdX, double *pdZ, double *pdL, double *pdSDev) ;
	EXPORT void C_pcaProj_up (int *pnParIn, double *pdParIn, double *pdX, double *pdZ, double *pdL, double *pdSDev) ;
	EXPORT void C_qn (int *pnParIn, double *pdParIn, double *pdParOut, double *pdX) ;

*/
 
/* .C calls */
extern void C_kendallNlogN(void *, void *, void *, void *);
extern void C_l1median_BFGS(void *, void *, void *, void *, void *, void *);
extern void C_l1median_CG(void *, void *, void *, void *, void *, void *);
extern void C_l1median_HoCr(void *, void *, void *, void *, void *);
extern void C_l1median_NLM(void *, void *, void *, void *);
extern void C_l1median_NLM_Hess(void *, void *, void *, void *);
extern void C_l1median_NM(void *, void *, void *, void *);
extern void C_l1Median_VZ(void *, void *, void *, void *, void *);
extern void C_PCAgrid(void *, void *, void *, void *, void *, void *, void *);
extern void C_pcaProj(void *, void *, void *, void *, void *, void *);
extern void C_pcaProj_up(void *, void *, void *, void *, void *, void *);
extern void C_qn(void *, void *, void *, void *);
extern void C_sPCAgrid(void *, void *, void *, void *, void *, void *, void *, void *, void *);

static R_NativePrimitiveArgType C_kendallNlogN_t[] = {
    REALSXP, REALSXP, INTSXP, REALSXP
};

static R_NativePrimitiveArgType C_l1median_BFGS_t[] = {
    INTSXP, INTSXP, REALSXP, REALSXP, REALSXP, REALSXP
};

static R_NativePrimitiveArgType C_l1median_CG_t[] = {
    INTSXP, INTSXP, REALSXP, REALSXP, REALSXP, REALSXP
};

static R_NativePrimitiveArgType C_l1median_HoCr_t[] = {
    INTSXP, INTSXP, REALSXP, REALSXP, REALSXP
};

static R_NativePrimitiveArgType C_l1median_NLM_t[] = {
    INTSXP, REALSXP, REALSXP, REALSXP
};

static R_NativePrimitiveArgType C_l1median_NLM_Hess_t[] = {
    INTSXP, REALSXP, REALSXP, REALSXP
};

static R_NativePrimitiveArgType C_l1median_NM_t[] = {
    INTSXP, REALSXP, REALSXP, REALSXP
};

static R_NativePrimitiveArgType C_l1median_VZ_t[] = {
    INTSXP, INTSXP, REALSXP, REALSXP, REALSXP
};

static R_NativePrimitiveArgType C_PCAgrid_t[] = {
    INTSXP, INTSXP, REALSXP, REALSXP, REALSXP, REALSXP, REALSXP
};

static R_NativePrimitiveArgType C_sPCAgrid_t[] = {
    INTSXP, INTSXP, REALSXP, REALSXP, REALSXP, REALSXP, REALSXP, REALSXP, REALSXP
};

static R_NativePrimitiveArgType C_pcaProj_t[] = {
    INTSXP, REALSXP, REALSXP, REALSXP, REALSXP, REALSXP
};

static R_NativePrimitiveArgType C_pcaProj_up_t[] = {
    INTSXP, REALSXP, REALSXP, REALSXP, REALSXP, REALSXP
};

static R_NativePrimitiveArgType C_qn_t[] = {
    INTSXP, REALSXP, REALSXP, REALSXP
};

static const R_CMethodDef CEntries[] = {
    {"C_kendallNlogN",      (DL_FUNC) &C_kendallNlogN,      4, C_kendallNlogN_t},
    {"C_l1median_BFGS",     (DL_FUNC) &C_l1median_BFGS,     6, C_l1median_BFGS_t},
    {"C_l1median_CG",       (DL_FUNC) &C_l1median_CG,       6, C_l1median_CG_t},
    {"C_l1median_HoCr",     (DL_FUNC) &C_l1median_HoCr,     5, C_l1median_HoCr_t},
    {"C_l1median_NLM",      (DL_FUNC) &C_l1median_NLM,      4, C_l1median_NLM_t},
    {"C_l1median_NLM_Hess", (DL_FUNC) &C_l1median_NLM_Hess, 4, C_l1median_NLM_Hess_t},
    {"C_l1median_NM",       (DL_FUNC) &C_l1median_NM,       4, C_l1median_NM_t},
    {"C_l1Median_VZ",       (DL_FUNC) &C_l1Median_VZ,       5, C_l1median_VZ_t},
    {"C_PCAgrid",           (DL_FUNC) &C_PCAgrid,           7, C_PCAgrid_t},
    {"C_pcaProj",           (DL_FUNC) &C_pcaProj,           6, C_pcaProj_t},
    {"C_pcaProj_up",        (DL_FUNC) &C_pcaProj_up,        6, C_pcaProj_up_t},
    {"C_qn",                (DL_FUNC) &C_qn,                4, C_qn_t},
    {"C_sPCAgrid",          (DL_FUNC) &C_sPCAgrid,          9, C_sPCAgrid_t},
    {NULL, NULL, 0}
};

void R_init_pcaPP(DllInfo *dll)
{
    R_registerRoutines(dll, CEntries, NULL, NULL, NULL);
    R_useDynamicSymbols(dll, FALSE);
    R_forceSymbols(dll, TRUE);
}