From: Benjamin Auder Date: Wed, 13 Sep 2023 14:38:55 +0000 (+0200) Subject: Remove OpenMP dependency (and unused variable) X-Git-Url: https://git.auder.net/game/%7B%7B%20path%28%27mixstore_store_package_view%27%2C%20%7B%20id:%20newsItem.id%20%7D%29%20%7D%7D?a=commitdiff_plain;h=f47183deb252f12d532af81a491083f1411cacc8;p=morpheus.git Remove OpenMP dependency (and unused variable) --- diff --git a/pkg/DESCRIPTION b/pkg/DESCRIPTION index c2833c6..706925c 100644 --- a/pkg/DESCRIPTION +++ b/pkg/DESCRIPTION @@ -6,7 +6,7 @@ Description: Mixture of logistic regressions parameters (H)estimation with (General Linear Model). For more details see chapter 3 in the PhD thesis of Mor-Absa Loum: , available here . -Version: 1.0-3 +Version: 1.0-4 Author: Benjamin Auder [aut,cre], Mor-Absa Loum [aut] Maintainer: Benjamin Auder diff --git a/pkg/src/functions.c b/pkg/src/functions.c index 79deff4..89e84ef 100644 --- a/pkg/src/functions.c +++ b/pkg/src/functions.c @@ -1,5 +1,5 @@ #include -#include +//#include // Index matrix (by columns) #define mi(i, j, d1, d2) (j*d1 + i) @@ -53,7 +53,7 @@ void Moments_M3(double* X, double* Y, int* pn, int* pd, double* M3) // with g(Zi, theta) = i-th contribution to all moments (size dim) - real moments void Compute_Omega(double* X, int* Y, double* M, int* pnc, int* pn, int* pd, double* W) { - int nc=*pnc, n=*pn, d=*pd; + int n=*pn, d=*pd; //,nc=*pnc int dim = d + d*d + d*d*d; //double* W = (double*)malloc(dim*dim*sizeof(double)); @@ -101,7 +101,7 @@ void Compute_Omega(double* X, int* Y, double* M, int* pnc, int* pn, int* pd, dou // This final nested loop is very costly. Some basic optimisations: double gj = g[j]; int baseIdx = j * dim; - #pragma GCC unroll 32 +// #pragma GCC unroll 32 for (int k=j; k>=0; k--) W[baseIdx+k] += gj * g[k]; } diff --git a/pkg/src/hungarian.c b/pkg/src/hungarian.c index 9671a43..3b2a28d 100644 --- a/pkg/src/hungarian.c +++ b/pkg/src/hungarian.c @@ -112,7 +112,7 @@ void hungarian_free(hungarian_problem_t* p) { void hungarian_solve(hungarian_problem_t* p) { int i, j, m, n, k, l, t, q, unmatched; - double cost, s; + double s; //,cost int* col_mate; int* row_mate; int* parent_row; @@ -122,7 +122,7 @@ void hungarian_solve(hungarian_problem_t* p) double* slack; int* slack_row; - cost = 0.; +// cost = 0.; m =p->num_rows; n =p->num_cols; @@ -160,7 +160,7 @@ void hungarian_solve(hungarian_problem_t* p) for (k=1; kcost[k][l]cost[k][l]; - cost+=s; +// cost+=s; if (s!=0.) for (k=0; kcost[k][l]-=s; @@ -335,11 +335,11 @@ done: } /*TRACE("\n");*/ } - for (i=0; i