summaryrefslogtreecommitdiff
path: root/lib/convex.c
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2018-02-02 18:33:22 -0500
committerJaron Kent-Dobias <jaron@kent-dobias.com>2018-02-02 18:33:22 -0500
commit2af9351db3aa97da9b0d3f23d53a593bc96c8a8e (patch)
tree684dfccba8d295c42ef6e2e070c8d6caca45f590 /lib/convex.c
parent181db84a8ffb26e436a43bb268fe5ef060206e66 (diff)
downloadc++-2af9351db3aa97da9b0d3f23d53a593bc96c8a8e.tar.gz
c++-2af9351db3aa97da9b0d3f23d53a593bc96c8a8e.tar.bz2
c++-2af9351db3aa97da9b0d3f23d53a593bc96c8a8e.zip
does potts now, no external libraries
Diffstat (limited to 'lib/convex.c')
-rw-r--r--lib/convex.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/convex.c b/lib/convex.c
index 096504d..df506f9 100644
--- a/lib/convex.c
+++ b/lib/convex.c
@@ -5,7 +5,7 @@ double slope(point_t *P, point_t *Q) {
return (Q->y - P->y) / ((double)(Q->x) - (double)(P->x));
}
-double *get_convex_minorant(uint64_t n, double *Gammas) {
+double *get_convex_minorant(count_t n, double *Gammas) {
if (n < 2) {
return Gammas;
}
@@ -17,7 +17,7 @@ double *get_convex_minorant(uint64_t n, double *Gammas) {
list_t *pos = L;
- for (uint64_t i = 1; i < n; i++) {
+ for (count_t i = 1; i < n; i++) {
pos->next = (list_t *)calloc(1, sizeof(list_t));
pos->next->p = (point_t *)calloc(1, sizeof(point_t));
pos->next->p->x = i;
@@ -69,7 +69,7 @@ double *get_convex_minorant(uint64_t n, double *Gammas) {
double *g = (double *)calloc(n + 1, sizeof(double));
double rho = 0;
- for (uint64_t i = 0; i < n + 1; i++) {
+ for (count_t i = 0; i < n + 1; i++) {
if (i > pos->next->p->x) {
pos = pos->next;
}
@@ -87,7 +87,7 @@ double *get_convex_minorant(uint64_t n, double *Gammas) {
}
}
- for (uint64_t i = 0; i < n + 1; i++) {
+ for (count_t i = 0; i < n + 1; i++) {
g[i] += rho / 2;
}