qp->end = 1;
}
-bool deQueue(Queue * qp, int *vertex)
+boolean deQueue(Queue * qp, int *vertex)
{
if (qp->start >= qp->end)
- return false; /* underflow */
+ return FALSE; /* underflow */
*vertex = qp->data[qp->start++];
- return true;
+ return TRUE;
}
-bool enQueue(Queue * qp, int vertex)
+boolean enQueue(Queue * qp, int vertex)
{
if (qp->end >= qp->queueSize)
- return false; /* overflow */
+ return FALSE; /* overflow */
qp->data[qp->end++] = vertex;
- return true;
+ return TRUE;
}
#endif
extern void mkQueue(Queue *, int);
extern void freeQueue(Queue *);
extern void initQueue(Queue *, int startVertex);
- extern bool deQueue(Queue *, int *);
- extern bool enQueue(Queue *, int);
+ extern boolean deQueue(Queue *, int *);
+ extern boolean enQueue(Queue *, int);
extern void bfs(int, vtx_data *, int, DistType *, Queue *);
extern int bfs_bounded(int, vtx_data *, int, DistType *, Queue *, int,
s->data[s->top++] = x; \
}
-#define pop(s,x) ((s->top==0) ? false : (s->top--, x = s->data[s->top], true))
+#define pop(s,x) ((s->top==0) ? FALSE : (s->top--, x = s->data[s->top], TRUE))
-#define read_top(h,x) ((s->top==0) ? false : (x = s->data[s->top-1], true))
+#define read_top(h,x) ((s->top==0) ? FALSE : (x = s->data[s->top-1], TRUE))
#define sub(h,i) (h->data[i])
}
}
-static bool extractMax(PairHeap * h, Pair * max)
+static boolean extractMax(PairHeap * h, Pair * max)
{
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);
- return true;
+ return TRUE;
}
static void insert(PairHeap * h, Pair edge)
for (i=0; i<h->heapSize; i++) {
l=left(i); r=right(i);
if (insideHeap(h,l) && greaterPriority(h,l,i))
- return false;
+ return FALSE;
if (insideHeap(h,r) && greaterPriority(h,r,i))
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
*/
void conjugate_gradient_f
(float **A, double *x, double *b, int n, double tol,
- int max_iterations, bool ortho1) {
+ int max_iterations, boolean ortho1) {
/* Solves Ax=b using Conjugate-Gradients method */
/* 'x' and 'b' are orthogonalized against 1 if 'ortho1=true' */
************************/
extern void conjugate_gradient_f(float **, double *, double *, int,
- double, int, bool);
+ double, int, boolean);
extern void conjugate_gradient_mkernel(float *, float *, float *, int,
double, int);