3

I'm dealing with large input arrays with Mathematica and it looks like I can't process anything bigger than (or equal to) 1024*1024 and 81*81*81. Is that normal? Should I be able to do computations on such input data? If so, how?

Ricky Robinson
  • 21,798
  • 42
  • 129
  • 185

1 Answers1

3

I think that depends on what calculations you are performing.

For example, in a very modest laptop:

Clear["Global`*"];
k = 2000;
Timing[a = Table[i j + i - j, {i, k}, {j, k}];
 MatrixPlot@a]  

Takes 20 seconds.

Matrix multiplying up to 1000x1000:

f[n_] := Table[RandomInteger[{1, n}], {n}, {n}];
ListLinePlot[
 Table[{n, First@AbsoluteTiming@(#.#) &@f[n]}, {n, 100, 1000, 100}]]  

enter image description here

So, it depends heavily on what you are trying to calculate.

Dr. belisarius
  • 60,527
  • 15
  • 115
  • 190
  • I see. Well, what my program does is evaluate each cell of a 1/2/3 dimensional array and do some computations with it. It's not vital, right now, that I deal with large inputs, but I was just wondering if there was any way to speed up calculations a little bit. – Ricky Robinson Feb 27 '11 at 19:19
  • @Ricky There are a lot of tricks available, from using functional instead of looping constructs, through getting advantage of parallel kernels in your machine, and up to using true monster processing grids. But there is no a silver bullet useful for every situation. You need to tell us more about your specific problem. – Dr. belisarius Feb 27 '11 at 20:59
  • @Ricky Robinson have you checked how long your operation takes for a single element? – acl Feb 28 '11 at 11:41