fix typos
authorBenjamin Auder <benjamin.auder@somewhere>
Fri, 6 Jan 2017 15:47:50 +0000 (16:47 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Fri, 6 Jan 2017 15:47:50 +0000 (16:47 +0100)
R/main.R
src/sources/EMGLLF.c
src/sources/selectiontotale.c

index 059843f..6633be2 100644 (file)
--- a/R/main.R
+++ b/R/main.R
@@ -6,10 +6,10 @@ Valse = setRefClass(
 
                # regression data (size n*p, where n is the number of observations,
                # and p is the number of regressors)
 
                # regression data (size n*p, where n is the number of observations,
                # and p is the number of regressors)
-               X = "numeric",
+               X = "matrix",
                # response data (size n*m, where n is the number of observations,
                # and m is the number of responses)
                # response data (size n*m, where n is the number of observations,
                # and m is the number of responses)
-               Y = "numeric",
+               Y = "matrix",
 
                # Optionally user defined (some default values)
 
 
                # Optionally user defined (some default values)
 
index b305641..42419ac 100644 (file)
@@ -281,7 +281,7 @@ void EMGLLF_core(
                                {
                                        YiRhoR[u] = 0.0;
                                        for (int v=0; v<m; v++)
                                {
                                        YiRhoR[u] = 0.0;
                                        for (int v=0; v<m; v++)
-                                               YiRhoR[u] += Y[imi(i,v,n,m)] * rho[ai(v,u,r,m,m,k)];
+                                               YiRhoR[u] += Y[mi(i,v,n,m)] * rho[ai(v,u,r,m,m,k)];
                                }
 
                                //compute X(i,:)*phi(:,:,r)
                                }
 
                                //compute X(i,:)*phi(:,:,r)
index d3e2dc4..04ec0a4 100644 (file)
@@ -1,5 +1,6 @@
 #include <stdlib.h>
 #include <omp.h>
 #include <stdlib.h>
 #include <omp.h>
+#include <math.h>
 #include "EMGLLF.h"
 #include "utils.h"
 
 #include "EMGLLF.h"
 #include "utils.h"
 
@@ -55,7 +56,7 @@ void selectiontotale_core(
                double* pi = (double*)malloc(k*sizeof(double));
                double* LLF = (double*)malloc(maxi*sizeof(double));
                double* S = (double*)malloc(p*m*k*sizeof(double));
                double* pi = (double*)malloc(k*sizeof(double));
                double* LLF = (double*)malloc(maxi*sizeof(double));
                double* S = (double*)malloc(p*m*k*sizeof(double));
-               EMGLLF(phiInit,rhoInit,piInit,gamInit,mini,maxi,gamma,glambda[lambdaIndex],X,Y,tau,
+               EMGLLF_core(phiInit,rhoInit,piInit,gamInit,mini,maxi,gamma,glambda[lambdaIndex],X,Y,tau,
                        phi,rho,pi,LLF,S,
                        n,p,m,k);
                free(LLF);
                        phi,rho,pi,LLF,S,
                        n,p,m,k);
                free(LLF);