00001 #include "lmer.h"
00002 #include <R_ext/Rdynload.h>
00003 #include "Matrix.h"
00004 #include "Syms.h"
00005
00006 static R_CallMethodDef CallEntries[] = {
00007
00008
00009 {"mer_MCMCsamp", (DL_FUNC) &mer_MCMCsamp, 2},
00010 {"mer_ST_chol", (DL_FUNC) &mer_ST_chol, 1},
00011 {"mer_ST_getPars", (DL_FUNC) &mer_ST_getPars, 1},
00012 {"mer_ST_initialize", (DL_FUNC) &mer_ST_initialize, 3},
00013 {"mer_ST_setPars", (DL_FUNC) &mer_ST_setPars, 2},
00014 {"mer_create_L", (DL_FUNC) &mer_create_L, 1},
00015 {"mer_optimize", (DL_FUNC) &mer_optimize, 2},
00016 {"mer_postVar", (DL_FUNC) &mer_postVar, 1},
00017 {"mer_update_L", (DL_FUNC) &mer_update_L, 1},
00018 {"mer_update_RX", (DL_FUNC) &mer_update_RX, 1},
00019 {"mer_update_dev", (DL_FUNC) &mer_update_dev, 1},
00020 {"mer_update_projection", (DL_FUNC) &mer_update_projection, 1},
00021 {"mer_update_ranef", (DL_FUNC) &mer_update_ranef, 1},
00022 {"mer_update_mu", (DL_FUNC) &mer_update_mu, 1},
00023 {"mer_update_u", (DL_FUNC) &mer_update_u, 2},
00024 {"mer_validate", (DL_FUNC) &mer_validate, 1},
00025
00026 {"merMCMC_validate", (DL_FUNC) &merMCMC_validate, 1},
00027 {"merMCMC_VarCorr", (DL_FUNC) &merMCMC_VarCorr, 2},
00028
00029 {"spR_optimize", (DL_FUNC) &spR_optimize, 2},
00030 {"spR_update_mu", (DL_FUNC) &spR_update_mu, 1},
00031
00032
00033 {NULL, NULL, 0}
00034 };
00035
00037 cholmod_common c;
00038
00045 #ifdef HAVE_VISIBILITY_ATTRIBUTE
00046 __attribute__ ((visibility ("default")))
00047 #endif
00048 void R_init_lme4(DllInfo *dll)
00049 {
00050 R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
00051 R_useDynamicSymbols(dll, FALSE);
00052
00053
00054 M_R_cholmod_start(&c);
00055 c.final_ll = 1;
00056
00057 lme4_ASym = install("A");
00058 lme4_CmSym = install("Cm");
00059 lme4_CxSym = install("Cx");
00060 lme4_DimSym = install("Dim");
00061 lme4_GpSym = install("Gp");
00062 lme4_LSym = install("L");
00063 lme4_RXSym = install("RX");
00064 lme4_RZXSym = install("RZX");
00065 lme4_STSym = install("ST");
00066 lme4_VSym = install("V");
00067 lme4_XSym = install("X");
00068 lme4_ZtSym = install("Zt");
00069 lme4_devianceSym = install("deviance");
00070 lme4_dimsSym = install("dims");
00071 lme4_envSym = install("env");
00072 lme4_etaSym = install("eta");
00073 lme4_fixefSym = install("fixef");
00074 lme4_flistSym = install("flist");
00075 lme4_gradientSym = install("gradient");
00076 lme4_iSym = install("i");
00077 lme4_ncSym = install("nc");
00078 lme4_nlmodelSym = install("nlmodel");
00079 lme4_muEtaSym = install("muEta");
00080 lme4_muSym = install("mu");
00081 lme4_offsetSym = install("offset");
00082 lme4_pSym = install("p");
00083 lme4_permSym = install("perm");
00084 lme4_pWtSym = install("pWt");
00085 lme4_ranefSym = install("ranef");
00086 lme4_residSym = install("resid");
00087 lme4_sigmaSym = install("sigma");
00088 lme4_sqrtrWtSym = install("sqrtrWt");
00089 lme4_sqrtXWtSym = install("sqrtXWt");
00090 lme4_uSym = install("u");
00091 lme4_varSym = install("var");
00092 lme4_xSym = install("x");
00093 lme4_ySym = install("y");
00094 }
00095
00099 void R_unload_lme4(DllInfo *dll){
00100 M_cholmod_finish(&c);
00101 }