Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #10914 > unrolled thread

Re: Algorithm Analysis Course: Should I use Mathematica for projects? //oops, typos

Started byRichard Fateman <fateman@cs.berkeley.edu>
First post2012-07-14 05:31 +0000
Last post2012-07-14 05:31 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: Algorithm Analysis Course: Should I use Mathematica for projects? //oops, typos Richard Fateman <fateman@cs.berkeley.edu> - 2012-07-14 05:31 +0000

#10914 — Re: Algorithm Analysis Course: Should I use Mathematica for projects? //oops, typos

FromRichard Fateman <fateman@cs.berkeley.edu>
Date2012-07-14 05:31 +0000
SubjectRe: 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

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web