diff -N -r -u octave-2.1.34/src/DLD-FUNCTIONS/kron.cc octave-2.1.34/src/DLD-FUNCTIONS/kron.cc.orig --- octave-2.1.34/src/DLD-FUNCTIONS/kron.cc Thu Jan 1 01:00:00 1970 +++ octave-2.1.34/src/DLD-FUNCTIONS/kron.cc.orig Fri Jun 30 20:16:34 2000 @@ -0,0 +1,117 @@ +/* + +Copyright (C) 1996, 1997 John W. Eaton + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include "lo-ieee.h" +#include "lo-mappers.h" + +#include "defun-dld.h" +#include "error.h" +#include "gripes.h" +#include "oct-obj.h" + +// This macro defines the Kronecker product. +// Thanks, Heber Farnsworth , for this code. +#define kronmacro(eltype1) \ + for (int i=0; i 1) + { + print_usage ("kron"); + return retval; + } + + octave_value arg1; + octave_value arg2; + arg1 = args(0); arg2 = args(1); + // Assume is_real_type()||is_complex_type() + if( arg1.is_real_type () ) { + if( arg2.is_real_type () ) { + + kroninit(Matrix,matrix_value,Matrix,matrix_value,Matrix) ; + kronmacro(double) ; + + } else if( arg2.is_complex_type () ) { + + kroninit(Matrix,matrix_value,ComplexMatrix,complex_matrix_value,ComplexMatrix) ; + kronmacro(Complex) ; + + } else { + gripe_wrong_type_arg ("kron", arg2); + } + } else if ( arg1.is_complex_type () ) { + if( arg2.is_real_type () ) { + + kroninit(ComplexMatrix,complex_matrix_value,ComplexMatrix,complex_matrix_value,ComplexMatrix) ; + kronmacro(Complex) ; + + } else if( arg2.is_complex_type () ) { + + kroninit(ComplexMatrix,complex_matrix_value,ComplexMatrix,complex_matrix_value,ComplexMatrix) ; + kronmacro(Complex) ; + + } else { + gripe_wrong_type_arg ("kron", arg2); + } + } else { + gripe_wrong_type_arg ("kron", arg1); + } + return retval; +} + +/* +;;; Local Variables: *** +;;; mode: C++ *** +;;; End: *** +*/ diff -N -r -u octave-2.1.34/src/Makefile.in octave-2.1.34/src/Makefile.in.orig --- octave-2.1.34/src/Makefile.in Fri Mar 24 10:36:26 2000 +++ octave-2.1.34/src/Makefile.in.orig Fri Jun 30 20:02:50 2000 @@ -39,12 +39,12 @@ endif endif -DLD_XSRC := balance.cc besselj.cc betainc.cc chol.cc colloc.cc dassl.cc \ - det.cc eig.cc expm.cc fft.cc fft2.cc filter.cc find.cc \ - fsolve.cc gammainc.cc getgrent.cc getpwent.cc getrusage.cc \ - givens.cc hess.cc ifft.cc ifft2.cc inv.cc log.cc lpsolve.cc \ - lsode.cc lu.cc minmax.cc pinv.cc qr.cc quad.cc qz.cc rand.cc \ - schur.cc sort.cc svd.cc syl.cc time.cc +DLD_XSRC := balance.cc besselj.cc betainc.cc chol.cc colloc.cc dassl.cc \ + det.cc eig.cc expm.cc fft.cc fft2.cc filter.cc find.cc \ + fsolve.cc gammainc.cc getgrent.cc getpwent.cc getrusage.cc \ + givens.cc hess.cc ifft.cc ifft2.cc inv.cc kron.cc log.cc \ + lpsolve.cc lsode.cc lu.cc minmax.cc pinv.cc qr.cc quad.cc \ + qz.cc rand.cc schur.cc sort.cc svd.cc syl.cc time.cc DLD_SRC := $(addprefix DLD-FUNCTIONS/, $(DLD_XSRC))