printf debugging. The while loop executes, the 1st for loop executes, the 2nd for loop does not.
while (size > 0){
printf("in the while loop!\n");
VertexPointer current = graph[0];
int i;
for (i = 1; i < size; i++){
float dist = 0;
printf("in the first for loop for i = %d \n", i);
int j;
for(j = 0; j++; j < dimension){
printf("dist loop: %d\n", j);
printf("current: %f\n", (*current).loc[0]);
printf("unvisited: %f\n", (*graph[j]).loc[0]);
dist = dist + pow((*current).loc[0] + (*graph[j]).loc[0], 2);
printf("distance: %f", dist);
dist = sqrt(dist);
if (dist < (*graph[i]).key){
decreaseKey(graph, i, dist);
}
}
}
extractMin(graph, size);
size = size - 1;
mst_length = mst_length + (*current).key;
}
j++; j < dimensionshould be:j < dimension; j++