19double _statistics[10];
23 return rand()/(double) RAND_MAX;
29 for (i = 0; i < n; i++) y[i] = x[i] - y[i];
35 for (i = 0; i < n; i++) res += x[i]*y[i];
42 for (i = 0; i < n; i++) y[i] = x[i] + beta*y[i];
49 for (i = 0; i < n; i++) x[i] = x[i] + beta*y[i];
57 if (!*u) *u =
gv_calloc(m,
sizeof(
float));
59 for (i = 0; i < m; i++) {
60 assert(p[i] < n && p[i] >= 0);
68 const double *ss1 =
s1;
69 const double *ss2 = s2;
73 }
else if (ss1[0] < ss2[0]){
85 }
else if (ss1[0] < ss2[0]){
99 double *u =
gv_calloc(2 * n,
sizeof(
double));
101 for (i = 0; i < n; i++) {
108 for (i = 0; i < n; i++) (*p)[i] = (int) u[2*i+1];
133 for (i = 0; i <
dim; i++)
dist += (p1[i] - p2[i])*(p1[i] - p2[i]);
140 for (
size_t i = strlen(
s); ; i--) {
141 if (first &&
s[i] ==
'.') {
145 if (
s[i] ==
'/')
return &
s[i+1];
Memory allocation wrappers that exit on failure.
static void * gv_calloc(size_t nmemb, size_t size)
static double dist(int dim, double *x, double *y)
double * vector_saxpy(int n, double *x, double *y, double beta)
double * vector_saxpy2(int n, double *x, double *y, double beta)
char * strip_dir(char *s)
void vector_ordering(int n, double *v, int **p)
double distance(double *x, int dim, int i, int j)
double vector_product(int n, double *x, double *y)
static int comp_ascend_int(const void *s1, const void *s2)
void vector_float_take(int n, float *v, int m, int *p, float **u)
void vector_sort_int(int n, int *v)
double * vector_subtract_to(int n, double *x, double *y)
double distance_cropped(double *x, int dim, int i, int j)
double point_distance(double *p1, double *p2, int dim)
static int comp_ascend(const void *s1, const void *s2)
NEATOPROCS_API void s1(graph_t *, node_t *)