(General Linear Model). For more details see chapter 3 in the PhD thesis of
Mor-Absa Loum: <https://www.theses.fr/s156435>, available here
<https://theses.hal.science/tel-01877796/document>.
-Version: 1.0-3
+Version: 1.0-4
Author: Benjamin Auder <Benjamin.Auder@u-psud.fr> [aut,cre],
Mor-Absa Loum <Mor-Absa.Loum@u-psud.fr> [aut]
Maintainer: Benjamin Auder <Benjamin.Auder@u-psud.fr>
#include <stdlib.h>
-#include <omp.h>
+//#include <omp.h>
// Index matrix (by columns)
#define mi(i, j, d1, d2) (j*d1 + i)
// 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));
// 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];
}
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;
double* slack;
int* slack_row;
- cost = 0.;
+// cost = 0.;
m =p->num_rows;
n =p->num_cols;
for (k=1; k<m; k++)
if (p->cost[k][l]<s)
s=p->cost[k][l];
- cost+=s;
+// cost+=s;
if (s!=0.)
for (k=0; k<m; k++)
p->cost[k][l]-=s;
}
/*TRACE("\n");*/
}
- for (i=0; i<m; i++)
+/* for (i=0; i<m; i++)
cost+=row_dec[i];
for (i=0; i<n; i++)
cost-=col_inc[i];
-
+*/
free(slack);
free(col_inc);
free(parent_row);