From 5de1d4d587ab2a655163f52d292a3eb982886331 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Tue, 28 Jul 2015 13:16:42 +1200 Subject: Fixing --- algorithms/burning-ship-lattice.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'algorithms/burning-ship-lattice.c') diff --git a/algorithms/burning-ship-lattice.c b/algorithms/burning-ship-lattice.c index a219537..7c2d1e9 100644 --- a/algorithms/burning-ship-lattice.c +++ b/algorithms/burning-ship-lattice.c @@ -31,27 +31,26 @@ void *generate_burning_ship_lattice_section(void *section) { data_section *d = (data_section*)section; unsigned int x,y,i; - int idx = 0; double a,b; double complex z,c; double size_units = 0.09f; double top = -0.082f; double left = -1.8f; - for (y = d->core, b = (d->core*(size_units/d->size)+top); y < d->size; b+=((d->cores*size_units)/d->size), y+=d->cores) + for (y = d->core, b = (d->core*(size_units/size)+top); y < size; b+=((cores*size_units)/size), y+=cores) { - for (x = 0, a = left; x < d->size; a+=(size_units/d->size), x++) + for (x = 0, a = left; x < size; a+=(size_units/size), x++) { z = 0; c = a+I*b; - for (i = 0; i < d->iterat; i++) + for (i = 0; i < iterat; i++) { if (cabsf(z) >= 2) break; - z = cpow( cabsf(crealf(z)) + I*cabsf(cimagf(z)) , d->power) + c; + z = cpow( cabsf(crealf(z)) + I*cabsf(cimagf(z)) , power) + c; } - d->data[idx++] = (255*i)/d->iterat; + d->data[d->idx++] = (255*i)/iterat; } } return NULL; -- cgit v1.1