int read_cubic(struct cubic_grid *grid, char *infile);This routine reads a textfile generated by generate_cubic(), stores the data in a variable grid of type struct cubic_grid, and passes this structure back. read_cubic() itself returns 0 after successful completion, or 1 if the data file was absent or corrupt (in which case grid is left unchanged).
Note that memory for the coefficient array grid.coef is allocated in this routine; to free this memory, call free_cubic(grid). Allocating and de-allocating this array requires some care: since grid.coef[i][j][k] is necessarily symmetric in the first two indecies, the pointers grid.coef[i][j] and grid.coef[j][i] have been explicitly set to point to the same memory location, in order to save memory.
The arguments are: