Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #10914 > unrolled thread
| Started by | Richard Fateman <fateman@cs.berkeley.edu> |
|---|---|
| First post | 2012-07-14 05:31 +0000 |
| Last post | 2012-07-14 05:31 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
Re: Algorithm Analysis Course: Should I use Mathematica for projects? //oops, typos Richard Fateman <fateman@cs.berkeley.edu> - 2012-07-14 05:31 +0000
| From | Richard Fateman <fateman@cs.berkeley.edu> |
|---|---|
| Date | 2012-07-14 05:31 +0000 |
| Subject | Re: Algorithm Analysis Course: Should I use Mathematica for projects? //oops, typos |
| Message-ID | <jtr06t$bcq$1@smc.vnet.net> |
On 7/12/2012 11:57 PM, Richard Fateman wrote:
Sorry, some errors crept into my demo examples as I tried
to simplify them for inclusion in the email...
>
> An example.
>
> Create 3 arrays.
>
> A=Table[i,{i,0,100}];
> B=Table[i,{i,0,1000}];
> Q=Table[i,{i,0,10000}];
>
> Try updating the 50th element of each of these items, which look like
> arrays in Mathematica.
>
> Timing [A[[50]],{i,0,100000}]
Should be Timing[Do[A[[50]]++, {i, 0, 100000}]]. My computer reports
0.281 sec
>
> Timing [B[[50]],{i,0,100000}]
Should be B[[5]]=j; Timing[Do[B[[50]]++, {i, 0, 100000}]]. My computer
reports 1.266 sec
>
> Timing [Q[[50]],{i,0,100000}]
Should be Timing[Do[Q[[50]]++, {i, 0, 100000}]]. My computer reports
0.421 sec
>
Apologies for sowing confusion unnecessarily.
RJF
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web