Mercurial > hg > qm-dsp
comparison dsp/segmentation/cluster_melt.c @ 414:7e8d1f26b098
Fix compiler warnings with -Wall -Wextra
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Mon, 28 Sep 2015 12:33:17 +0100 |
parents | d5014ab8b0e5 |
children | 175e51ae78eb |
comparison
equal
deleted
inserted
replaced
413:ec7318974497 | 414:7e8d1f26b098 |
---|---|
41 return d; | 41 return d; |
42 } | 42 } |
43 | 43 |
44 void cluster_melt(double *h, int m, int n, double *Bsched, int t, int k, int l, int *c) { | 44 void cluster_melt(double *h, int m, int n, double *Bsched, int t, int k, int l, int *c) { |
45 double lambda, sum, beta, logsumexp, maxlp; | 45 double lambda, sum, beta, logsumexp, maxlp; |
46 int i, j, a, b, b0, b1, limit, B, it, maxiter, maxiter0, maxiter1; | 46 int i, j, a, b, b0, b1, limit, /* B, */ it, maxiter, maxiter0, maxiter1; |
47 double** cl; /* reference histograms for each cluster */ | 47 double** cl; /* reference histograms for each cluster */ |
48 int** nc; /* neighbour counts for each histogram */ | 48 int** nc; /* neighbour counts for each histogram */ |
49 double** lp; /* soft assignment probs for each histogram */ | 49 double** lp; /* soft assignment probs for each histogram */ |
50 int* oldc; /* previous hard assignments (to check convergence) */ | 50 int* oldc; /* previous hard assignments (to check convergence) */ |
51 | 51 |
55 lambda = DEFAULT_LAMBDA; | 55 lambda = DEFAULT_LAMBDA; |
56 if (l > 0) | 56 if (l > 0) |
57 limit = l; | 57 limit = l; |
58 else | 58 else |
59 limit = DEFAULT_LIMIT; /* use default if no valid neighbourhood limit supplied */ | 59 limit = DEFAULT_LIMIT; /* use default if no valid neighbourhood limit supplied */ |
60 B = 2 * limit + 1; | 60 // B = 2 * limit + 1; |
61 maxiter0 = 20; /* number of iterations at initial temperature */ | 61 maxiter0 = 20; /* number of iterations at initial temperature */ |
62 maxiter1 = 5; /* number of iterations at subsequent temperatures */ | 62 maxiter1 = 5; /* number of iterations at subsequent temperatures */ |
63 | 63 |
64 /* allocate memory */ | 64 /* allocate memory */ |
65 cl = (double**) malloc(k*sizeof(double*)); | 65 cl = (double**) malloc(k*sizeof(double*)); |