From: Benjamin Auder Date: Mon, 16 Dec 2019 17:40:30 +0000 (+0100) Subject: Remove debug traces, inline matrix index function X-Git-Url: https://git.auder.net/doc/html/app_dev.php/%7B%7B%20targetUrl%20%7D%7D?a=commitdiff_plain;h=19d893c4554f7f2cc9a75111cec40712c698e7e2;p=morpheus.git Remove debug traces, inline matrix index function --- diff --git a/pkg/R/optimParams.R b/pkg/R/optimParams.R index f06581e..c1d7fe8 100644 --- a/pkg/R/optimParams.R +++ b/pkg/R/optimParams.R @@ -267,8 +267,8 @@ setRefClass( ci=c(-1,rep(0,K-1)) ) if (loop < loopMax) #avoid computing an extra W W <<- computeW(expArgs(op_res$par)) - print(op_res$value) #debug - print(expArgs(op_res$par)) #debug + #print(op_res$value) #debug + #print(expArgs(op_res$par)) #debug } expArgs(op_res$par) diff --git a/pkg/src/functions.c b/pkg/src/functions.c index feea3ad..1c7295a 100644 --- a/pkg/src/functions.c +++ b/pkg/src/functions.c @@ -1,13 +1,13 @@ #include // Index matrix (by columns) -int mi(int i, int j, int d1, int d2) +int inline mi(int i, int j, int d1, int d2) { return j*d1 + i; } // Index 3-tensor (by columns, matrices ordered by last dim) -int ti(int i, int j, int k, int d1, int d2, int d3) +int inline ti(int i, int j, int k, int d1, int d2, int d3) { return k*d1*d2 + j*d1 + i; } @@ -54,62 +54,8 @@ void Moments_M3(double* X, double* Y, int* pn, int* pd, double* M3) } } -#include - // W = 1/N sum( t(g(Zi,theta)) g(Zi,theta) ) // with g(Zi, theta) = i-th contribution to all moments (size dim) - real moments -//void Compute_Omega(double* X, int* Y, double* M, int* pn, int* pd, double* W) -//{ -// int n=*pn, d=*pd; -// int dim = d + d*d + d*d*d; -// //double* W = (double*)malloc(dim*dim*sizeof(double)); -// -// // (Re)Initialize W: -// for (int j=0; j