#include #include #include float* read_points(const char* filename, int rows, int cols) { float* data; float *p; FILE* fin; int i,j; fin = fopen(filename,"r"); if (!fin) { printf("Cannot open input file.\n"); exit(1); } data = (float*) malloc(rows*cols*sizeof(float)); if (!data) { printf("Cannot allocate memory.\n"); exit(1); } p = data; for (i=0;i