From 232c6fb22a388b9fcaae525cc4c083c8c509677c Mon Sep 17 00:00:00 2001 From: anapt Date: Thu, 18 Jan 2018 20:41:10 +0200 Subject: [PATCH] test code, old functions --- testers/prefactor_code.c | 38 +++++++++++++ testers/test_code.c | 114 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 152 insertions(+) create mode 100644 testers/prefactor_code.c create mode 100644 testers/test_code.c diff --git a/testers/prefactor_code.c b/testers/prefactor_code.c new file mode 100644 index 0000000..cbacecd --- /dev/null +++ b/testers/prefactor_code.c @@ -0,0 +1,38 @@ +// +// Created by anapt on 18/1/2018. +// + +// compute kernel matrix +// // apply function to non zero elements of a sparse matrix +// for (int i=0; i +#include +#include +#include +#include +#include +#define X "data/X.bin" +#define Y "data/X.bin" +#define COLUMNS 2 +#define ROWS 6 +#define N 4 + + +// allocates a 2d array in continuous memory positions +double **alloc_2d_double(int rows, int cols) { + double *data = (double *)malloc(rows*cols*sizeof(double)); + double **array= (double **)malloc(rows*sizeof(double*)); + for (int i=0; i