#include <stdlib.h>


double** generate_ugrid(double (*f)(double), int n, double a, double b) {
	double** h = malloc(sizeof(double*) * n);
	for (int i = 0; i < n;i++) {
		h[i] = malloc(sizeof(double) * 2);
		h[i][0] = a + ((b - a) / (n - 1)) * i;
		h[i][1] = (*f)(h[i][0]);
	}
	return h;
}