From help-octave-request at bevo dot che dot wisc dot edu Mon Dec 6 10:15:12 1999 Subject: [Fwd: Dot product (nx1).*(nxm)] From: Joao Cardoso To: help-octave at bevo dot che dot wisc dot edu Date: Mon, 06 Dec 1999 16:14:20 +0000 This is a multi-part message in MIME format. --------------64290399B48731DDACD1BC44 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi again It seems that my previous results does not rule, as the following message show. Joao -- Joao Cardoso | e-mail: jcardoso at inescn dot pt INESC, R. Jose Falcao 110 | tel: + 351 2 2094322 4050 Porto, Portugal | fax: + 351 2 2008487 --------------64290399B48731DDACD1BC44 Content-Type: message/rfc822 Content-Transfer-Encoding: 7bit Content-Disposition: inline Return-Path: hanke at nada dot kth dot se Received: from correio.inescn.pt (correio.inescn.pt [192.35.246.2]) by merlin.inescn.pt (8.8.5/SCO5) with ESMTP id HAA17603 for ; Mon, 6 Dec 1999 07:59:51 GMT Received: from bart.inescn.pt (root at bart dot inescn dot pt [192.35.246.9]) by correio.inescn.pt (8.9.1/8.9.1/10) with ESMTP id HAA09942 for ; Mon, 6 Dec 1999 07:59:51 GMT Received: from correio.inescn.pt (correio.inescn.pt [192.35.246.2]) by bart.inescn.pt (8.6.9/INESCP-V2.7) with ESMTP id HAA06822 for ; Mon, 6 Dec 1999 07:59:46 GMT Received: from c2m2-17.nada.kth.se (c2m2-17.nada.kth.se [130.237.224.117]) by correio.inescn.pt (8.9.1/8.9.1/10) with ESMTP id HAA09935 for ; Mon, 6 Dec 1999 07:59:46 GMT Received: from c2m2-17.nada.kth.se (localhost [127.0.0.1]) by c2m2-17.nada.kth.se (8.8.7/8.8.7) with SMTP id IAA00570 for ; Mon, 6 Dec 1999 08:59:40 +0100 (MET) From: Michael Hanke To: Joao Cardoso Subject: Re: Dot product (nx1).*(nxm) Date: Mon, 6 Dec 1999 08:49:23 +0100 X-Mailer: KMail [version 1.0.28] Content-Type: text/plain References: <384AC8DA.7B7A08CF@inescn.pt> In-Reply-To: <384AC8DA dot 7B7A08CF at inescn dot pt> MIME-Version: 1.0 Message-Id: <99120608594001 dot 00532 at c2m2-17 dot nada dot kth dot se> Content-Transfer-Encoding: 8bit X-Mozilla-Status2: 00000000 On Sun, 05 Dec 1999, Joao Cardoso wrote: >The first method scales as 1.4*N^2, obviously, and the last one seems to >scale as 3.7*N*log(N), so I must learn the second method syntax! >Contributions? I'm using Octave-2.1.14 on a 500MHz PIII. > >Joao Here are my results: Octave, version 2.0.13 (sparc-sun-solaris2.5.1). Copyright (C) 1996, 1997, 1998 John W. Eaton. This is free software with ABSOLUTELY NO WARRANTY. For details, type `warranty'. octave:1> p=rand(100,1); octave:2> q=ones(1,50); octave:3> p2=p*q; octave:4> t0=cputime; for i=1:1000, p2=p*q; end , cputime-t0 ans = 0.34773 octave:5> t0=cputime; for i=1:1000, p2=p(:,q); end , cputime-t0 ans = 2.5304 octave:6> p=rand(500,1); octave:7> q=ones(1,250); octave:8> p2=p*q; octave:9> t0=cputime; for i=1:1000, p2=p*q; end , cputime-t0 ans = 12.381 octave:10> t0=cputime; for i=1:1000, p2=p(:,q); end , cputime-t0 ans = 57.984 octave:11> p=rand(1000,1); octave:12> q=ones(1,500); octave:13> p2=p*q; octave:14> t0=cputime; for i=1:1000, p2=p*q; end , cputime-t0 ans = 58.200 octave:15> t0=cputime; for i=1:1000, p2=p(:,q); end , cputime-t0 ans = 236.52 They differe completely from the previously observed. Hardware: Sun Ultra I, 170MHz, Solaris 2.5.1 Octave: The Fortran stuff is completely replaced by the Sun Performance Library which is well tuned to the hardware. So the break-even appears at rather high dimensions. Caching effects? Regards, Michael -- +---------------------------------------------------------------+ | Michael Hanke Royal Institute of Technology | | NADA | | S-10044 Stockholm | | Sweden | +---------------------------------------------------------------+ | Visiting address: Lindstedtsvaegen 3 | | Phone: + (46) (8) 790 6278 | | Fax: + (46) (8) 790 0930 | | Email: hanke at nada dot kth dot se| | | na dot mhanke at na-net dot ornl dot gov| | +---------------------------------------------------------------+ --------------64290399B48731DDACD1BC44-- ----------------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.che.wisc.edu/octave/octave.html How to fund new projects: http://www.che.wisc.edu/octave/funding.html Subscription information: http://www.che.wisc.edu/octave/archive.html -----------------------------------------------------------------------