25 va_start(argp, f_str);
26 vsprintf(out1, f_str, argp);
29 sprintf(out2,
"Error! %s", out1);
31 fprintf(stdout, out2);
47 return (
int *)
GKmalloc(
sizeof(
int)*n, msg);
71 return (
float *)
GKmalloc(
sizeof(
float)*n, msg);
83 return iset(n, ival, (
int *)
GKmalloc(
sizeof(
int)*n, msg));
110 ptr = (
void *)malloc(nbytes);
112 errexit(
"***Memory allocation failed for %s. Requested size: %d bytes", msg, nbytes);
130 va_start(plist, ptr1);
133 while ((ptr = va_arg(plist,
void **)) !=
LTERM) {
174 float *
sset(
int n,
float val,
float *
x)
194 max = (x[i] > x[max] ? i : max);
208 max = (x[i] > x[max] ? i : max);
221 for (i=incx; i<n; i+=incx)
222 max = (x[i] > x[max] ? i : max);
237 max = (x[i] > x[max] ? i : max);
258 for (i=2; i<n; i++) {
259 if (x[i] > x[max1]) {
263 else if (x[i] > x[max2])
279 min = (x[i] < x[min] ? i : min);
293 min = (x[i] < x[min] ? i : min);
320 for (i=0; i<n; i++, x+=incx) {
386 for (i=0; i<n; i++, x+=incx)
412 for (i = 0; i<n; i++)
413 partial += v[i] * v[i];
415 return sqrt(partial);
428 for (i = 0; i<n; i++)
429 partial += x[i] * y[i];
438 void saxpy(
int n,
float alpha,
float *
x,
int incx,
float *
y,
int incy)
442 for (i=0; i<n; i++, x+=incx, y+=incy)
467 for (i=0; i<n; i+=16) {
470 SWAP(p[v], p[u], tmp);
471 SWAP(p[v+1], p[u+1], tmp);
472 SWAP(p[v+2], p[u+2], tmp);
473 SWAP(p[v+3], p[u+3], tmp);
484 for (; a%2 != 1; a = a>>1);
485 return (a > 1 ? 0 : 1);
515 for (i=1; a > 1; i++, a = a>>1);
#define RandomInRangeFast(u)
void GKfree(void **ptr1,...)