[Top][All Lists]

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

Re: Contributing a kron function

From: etienne grossmann
Subject: Re: Contributing a kron function
Date: Sat, 23 Oct 1999 19:36:58 +0100 (WEST)


> |   Since yesterday, I have written a "src/DLD-FUNCTIONS/kron.cc" that
> | implements the Kronecker product for real and complex matrices.
> | 
> |   I also wrote two test scripts "test/octave.test/linalg/kron-1.m" and
> | "test/octave.test/linalg/kron-2.m" and modified src/Makefile.in and
> | test/octave.test/linalg/linalg.exp, the later so that "make check"
> | checks the new function too.
> | 
> |   May I send a patch? To octave-source?

> Sure.


> BTW, a better way to implement this might be to put the code for the
> real and complex versions of kron in liboctave, then make your DLD
> function a simple wrapper.  That way, the code would be useful from
> other C++ code, not just from the Octave interpreter.  In other words,
> people who already have Matrix objects would not have to do stuff like
> this to use the new code:

>   octave_value_list tmp_args;
>   tmp_args(1) = b_mat;
>   tmp_args(0) = a_mat;
>   octave_value_list kron_result = feval ("kron", tmp_args);
>   Matrix result = kron_result(0);

> Instead, they could just use

>   Matrix result = kron (a_mat, b_mat);

> Wouldn't that be better?

  Yes. Let's see if I can understand how the "liboctave" part of the
source tree works (not right now, though). 

> | ps : Silly question : how does one do a nice patch when not only are
> |      files modified, but also created? 

> Use -N.

  But then I need to have a "clean" copy of the source tree (no
problem), right?



reply via email to

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