Calculate the first time, not each time (?)
- To: mathgroup at smc.vnet.net
- Subject: [mg94548] Calculate the first time, not each time (?)
- From: Michael Young <michaelcharlesyoung at earthlink.net>
- Date: Tue, 16 Dec 2008 02:33:12 -0500 (EST)
Hello, I'm doing some engineering which will involve a large number of points -- and I anticipate time problems if all steps are repeated for each one. Here's an outline of the way I'd like to approach it. shapeprimativeXvalues := N[Table[functionpX[v], {v, vlimit}]] shapeprimativeYvalues := N[Table[functionpY[v], {v, vlimit}]] Arriving at these will involve some calculation, and once the results are in, it is unnecessary that the this be repeated when the values are used. adaptshapetoitslocation[v_] := (various operations on or including) shapeprimativeXvalues[[v]] (and or) shapeprimativeYvalues[[v]] Is there a way I can instruct Mathematica to evaluate a table, (value or function), once, when it is first called; then not to evaluate it again, but to pass numerical results on request?