for i thru 100 do for j thru 100 do for k thru 100 do foo[i,j,k]: i+j+k;
On my machine, this loop takes about 25 seconds, so another level of loop
will take about 40 minutes (and the array will be very large, maybe too
large).
If you really want 100^4 elements, you will probably want to declare the
array (for both time and space efficiency -- undeclared arrays are
hasharrays) and compile any operations on it (for time efficiency). See ?
array, ? compile, and ? mode_declare.
What are you trying to do? Do you really need a 100^4 dense array?
-s
On Thu, Nov 22, 2012 at 10:29 PM, Jianrong Li <lijr07 at gmail.com> wrote:
> Dear all,
>
> I would like to define a multiple array:
>
> for m:0 thru 100 step 1 do
> for k:0 thru 100 step 1 do
> for n:0 thru 100 step 1 do
> for l:0 thru 100 step 1 do
> Character[m][k][n][l]:0;
>
> But it is not correct. How could I define the multiple array
> Character[m][k][n][l] in a correct way?
> Thank you very much.
>
> Best wishes,
> Jianrong.
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>