typedef DistType Word;
-#define LOOP while(true)
+#define LOOP while(TRUE)
/* This heap class is suited to the Dijkstra alg.
data[i]=vertexNum <==> index[vertexNum]=i
heapify(h, j, index, dist);
}
-static bool extractMax(heap * h, int *max, int index[], Word dist[])
+static boolean extractMax(heap * h, int *max, int index[], Word dist[])
{
if (h->heapSize == 0)
- return false;
+ return FALSE;
*max = h->data[0];
h->data[0] = h->data[h->heapSize - 1];
h->heapSize--;
heapify(h, 0, index, dist);
- return true;
+ return TRUE;
}
static void
{
int num_visited_nodes;
int i;
- static bool *node_in_neighborhood = NULL;
+ static boolean *node_in_neighborhood = NULL;
static int size = 0;
static int *index;
Queue Q;
bfs_bounded(vertex, graph, n, dist, &Q, bound, visited_nodes);
if (size < n) {
node_in_neighborhood =
- (bool *) realloc(node_in_neighborhood, n * sizeof(bool));
+ (boolean *) realloc(node_in_neighborhood, n * sizeof(boolean));
for (i = size; i < n; i++) {
- node_in_neighborhood[i] = false;
+ node_in_neighborhood[i] = FALSE;
}
size = n;
}
for (i = 0; i < num_visited_nodes; i++) {
- node_in_neighborhood[visited_nodes[i]] = true;
+ node_in_neighborhood[visited_nodes[i]] = TRUE;
}
/* restore initial false-status of 'node_in_neighborhood' */
for (i = 0; i < num_visited_nodes; i++) {
- node_in_neighborhood[visited_nodes[i]] = false;
+ node_in_neighborhood[visited_nodes[i]] = FALSE;
}
freeHeap(&H);
freeQueue(&Q);
heapify_f(h, j, index, dist);
}
-static bool extractMax_f(heap * h, int *max, int index[], float dist[])
+static boolean extractMax_f(heap * h, int *max, int index[], float dist[])
{
if (h->heapSize == 0)
- return false;
+ return FALSE;
*max = h->data[0];
h->data[0] = h->data[h->heapSize - 1];
h->heapSize--;
heapify_f(h, 0, index, dist);
- return true;
+ return TRUE;
}
static void
void PCA(DistType ** coords, int dim, int n, double **(&new_coords),
int new_dim);
void PCA(DistType ** coords, int dim, int n, double **(&new_coords),
- int dim1, int dim2, bool recompute);
+ int dim1, int dim2, boolean recompute);
void PCA_orthog(DistType ** coords, int dim, int n,
double **(&new_coords), int new_dim, double *orthog);
void iterativePCA(DistType ** coords, int dim, int n,