I have been mostly a Table functions user in mathematica. However I have noticed that in several examples where I used Array instead of Table to express the same result, it ran
Without giving some conrete examples, it is difficult to answer your question correctly.
Since Mathematica is a closed source program, the exact implementations behind Table
and Array
cannot be known, unless explained by people that were involved in development of Mathematica.
These factors will hinder your ability to reason which structure you should use in what circumstances. Experimentation will be your best bet, so I would suggest you keep parallel versions of your programs, one using Table
, one using Array
. This way, you'll be able to see which one is faster.
Even better, you could write a wrapper function which depends on a global variable. This function will, depending on the variable, use Table
, or Array
as the underlying implementation, so you will be able to quickly switch from one version to another, without doing many modifications to your code.