Hi folks. I am solving some equations and then storing the solutions in a lookup table that also serves as an interpolation table. My questions are: 1) Where is the lookup table stored? (The reason I don't know where the table is stored is because I use the maths package gsl and don't know enough programming myself.)
2) If I make the lookup table in a c file and then use it in a couple of other c files and only de allocate the memory after the program is about to end, will it make my code slow?
Instead of copying the entire code here, I am pasting this link to the gsl example.
The general format seems to be
1) allocate memory 2) use the lookup table for your caculations 3) de allocate the memory. But my problem is that I do the step 2) i.e use the lookup table in other c files. My code would do something like this
in file one 1) allocate memory 2) create a lookup table
in file two 3) use the lookup table in various calculations repeatedly
from which file, one or two should I de allocate the memory? or it does not matter as long as it is done. Here is the link
Interpolation Example programs - GNU Scientific Library -- Reference Manual
Can you please also tell me topics I need to read about that are related to what I am trying to do here. I have some idea that I should read malloc and dynamic memory allocation. I am still a couple of chapters behind in the book, will get there soon. Do I need to know how to store data to cache?