Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1998
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: Re: Making a large matrix

  • To: mathgroup at smc.vnet.net
  • Subject: [mg14881] RE: [mg14844] Re: [mg14832] Making a large matrix
  • From: "Jean-Marie THOMAS" <jmthomas at agat.net>
  • Date: Mon, 23 Nov 1998 10:11:59 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

What about:

t1=Timing[Table[Table[Random[],{1000}],{1000}];];
t2=Timing[Table[Random[],{1000},{1000}];];

{26.278 Second,22.091 Second}

The second form is nevertheless a little faster!


**************************************** 
Jean-Marie THOMAS
mailto:jmthomas at agat.net
Conseil et Audit en Ingenierie de Calcul Strasbourg, France
http://www.agat.net
****************************************

-----Original Message-----
From: Clemens Frey [mailto:clemens.frey at bitoek.uni-bayreuth.de] To:
mathgroup at smc.vnet.net
Subject: [mg14881] [mg14844] Re: [mg14832] Making a large matrix


> Date: Wed, 18 Nov 1998 01:29:37 -0500
> From: "Ersek, Ted R" <ErsekTR at navair.navy.mil>
> To: mathgroup at smc.vnet.net
> Subject: [mg14881] [mg14844] [mg14832] Making a large matrix
>
> Consider the timing experiments below for making a large matrix of
> random real numbers.
>
> In[1]:=
> Table[Table[Random[],{1000}],{500}];//Timing Out[1]=
> {17.47 Second,Null}
>
> In[2]:=
> Table[Range[Random[],1000],{500}];//Timing Out[2]=
> {9.56 Second,Null}

Ted,

I don't think that these timings are comparable since the things they do
are different.

This produces 10 random numbers between 0 and 1:

Table[Random[],{10}]

{0.132055,0.668036,0.527731,0.35746,0.0925349,
0.0799395,0.946264,0.037643, 0.224293,0.827124}


...but this produces 10 successive numbers, starting at a random number
between 0 and 1 :

Range[Random[],10]

{0.530468,1.53047,2.53047,3.53047,4.53047,
5.53047,6.53047,7.53047,8.53047,  9.53047}

Clemens



  • Prev by Date: Re: Sqrt and Listability
  • Next by Date: non-linear regression
  • Previous by thread: Re: Making a large matrix
  • Next by thread: Exact value of Cos[Pi/17]