19inline int int_max2(
int x,
int y) {
return (x > y) ? x : y; }
26 double **array = (
double **)calloc(n,
sizeof(
double *));
28 for (
int i = 0;
i < n;
i++) {
29 array[
i] = (
double *)calloc(m,
sizeof(
double));
36 for (
int i = 0;
i < n;
i++) {
47 for (
int i = 0;
i < n;
i++) {
57 for (
int i = 0;
i < M;
i++) {
58 for (
int j = 0; j < N; j++) {
60 for (
int k = 0; k < K; k++) {
61 sum += A[
i * K + k] * B[k * N + j];
69 double dx = A[0] - B[0];
70 double dy = A[1] - B[1];
71 double dz = A[2] - B[2];
72 return dx * dx + dy * dy + dz * dz;
81 double const thresh = 1e-12;
83 if (fabs(a[0] - b[0]) < thresh && fabs(a[1] - b[1]) < thresh &&
84 fabs(a[2] - b[2]) < thresh) {
static void const int const int i
int int_max3(int x, int y, int z)
void free_2d(double **array, int n)
double distance_squared(double *A, double *B)
int int_max2(int x, int y)
double distance(double *A, double *B)
double * alloc_zeros_1d(int n)
void libgrpp_multiply_matrices(int M, int N, int K, double *A, double *B, double *C)
void libgrpp_daxpy(int n, double a, double *x, double *y)
double ** alloc_zeros_2d(int n, int m)
int points_are_equal(double *a, double *b)