[Top][All Lists]

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

builtin kron function.

From: etienne grossmann
Subject: builtin kron function.
Date: Sat, 16 Oct 1999 19:18:23 +0100 (WEST)


> The octave-sources mailing list is for posting sources.


> Can you please use the help-octave mailing list for discussion?  Or,
> for the bleeding-edge versions, the octave-maintainers list is
> probably better.                     ^
                                       I did not know about it. In
                                       fact it is not advertized on
                                       the ocave sit.
> Thanks,
> jwe

  so, as I was writing yesterday,


  I added to '' a 'kron2' function that implements the
Kronecker product (assuming real matrices). It came out to be just
barely faster than the 'mykron' function I sent earlier today, I
wonder why.

  The function is built around a double loop, where 'a','b' are the
input and 'c' is the output.

  Matrix c (rc,cc) ;
  for( i=0,ia=-1; i<rc; i++ ) {
    i%rb || ia++ ;
    for( j=0,ja=-1; j<cc; j++ ) {
      j%cb || ja++ ;
      c(i,j) = a(ia,ja) * b( i % rb, j % cb ) ;

  I can use c.elem(i,j) instead of c(i,j), but that does not improve
things. Would there be a way of accessing "more directly" to the



ps : Why does 'make' in "src" cause 'octave' to be rebuilt even if
     nothing has been touched?

pps: Does it sound like a good idea to rewrite the 'reshape' function
     as a builtin?

Octave is freely available under the terms of the GNU GPL.  To ensure
that development continues, see
Instructions for unsubscribing:

reply via email to

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