Subject: Telling Maxima to Cache results of evaluations
From: Jaime Villate
Date: Thu, 04 Apr 2013 22:38:58 +0100
I thought I learned about array functions from the manual, several years
ago, but now that I look at it again, I doubt I learned anything from
that section 36.2.2 of the manual :(
Let me tell you then: the idea is that you use H[Q,s] := .... instead
of H(Q,s)
And the results will be cached in the array H. Of course, that array may
grow large and you may modify the definition of the function later on
and still get the old results, but kill(H) can be used to deleted the
array and
the function definition and kill(H[2,3]) to deleted only one element in
the array forcing it to be recalculated next time.
Regards,
Jaime
On 04/04/2013 10:25 PM, Jaime Villate wrote:
> Perhaps H2[Q,s] is what you want? Look at "Array functions" (section
> 36.2.2 in
> http://maxima.sourceforge.net/docs/manual/en/maxima_36.html#SEC192)
>
> Jaime
>
> On 04/04/2013 09:56 PM, Adrian Brown wrote:
>> Hi all,
>>
>> I have a numerical integration that takes about 4 seconds to run, I
>> have to call it 1700 times, Maxima knows the function as H2(Q,s) but
>> very often the input parameters are the same and I was hoping maxima
>> would not evaluate the numerical integration again, but just use a
>> cached result.
>>
>> Does Maxima have this capability and how do I enable it? I have
>> searched through the manual and mailing list but surprisingly to no
>> avail.
>>
>> Any help gratfully appreciated.
>>
>> Adrian
>>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima