help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: stack and append


From: Eduardo Gallestey
Subject: Re: stack and append
Date: Wed, 16 Jun 1999 11:19:52 +1000

heberf wrote:
> 
> I need a faster implementation of the kronecker product.  The one that comes
> with octave is in linear-algebra/kron.m and it's not suitable for me because 
> my
> problem involves many large matrices.  I'm trying to rewrite it as an oct 
> file.
> 
> A few weeks ago there was some discussion on this list of using stack and 
> append
> as defined in dMatrix.h.  I'm pretty poor at C++ and I can't tell from reading
> that file how to implement it.  Could someone point out a function where 
> either
> of these are used or send a few lines of an oct file so I can see how to do 
> it?
> 
> Much thanks,
> Heber Farnsworth
> 
> ---------------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.  To ensure
> that development continues, see www.che.wisc.edu/octave/giftform.html
> Instructions for unsubscribing: www.che.wisc.edu/octave/archive.html
> ---------------------------------------------------------------------


This small test seems to give me reason. I have put the following in a
file named "kron_test.m"

%%%%%%%%%%%%%%%%%%%%%

a=2*ones(250,250);
b=[1 1;3 4];

tic
kron(a,b);
toc

tic
mykron(a,b);
toc           

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

This is the octave output:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Octave, version 2.1.13 (i686-pc-linux-gnulibc1).
Copyright (C) 1996, 1997, 1998 John W. Eaton.
This is free software with ABSOLUTELY NO WARRANTY.
For details, type `warranty'.

*** This is a development version of Octave.  Development releases
*** are provided for people who want to help test, debug, and improve
*** Octave.
***
*** If you want a stable, well-tested version of Octave, you should be
*** using one of the stable releases (when this development release
*** was made, the latest stable version was 2.0.13).

octave:1> kron_test
ans = 25.964
ans = 10.973
octave:2>         

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Eduardo



---------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.  To ensure
that development continues, see www.che.wisc.edu/octave/giftform.html
Instructions for unsubscribing: www.che.wisc.edu/octave/archive.html
---------------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]