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

Bug#387137: [Pkg-octave-devel] Bug#387137: spkron(a, b) not working when arguments are scalar



On 12-Sep-2006, Thomas Weber wrote:

| Hi, 
| 
| Am Dienstag, den 12.09.2006, 14:39 +0200 schrieb Nicolas Guilbert:
| > Package: octave2.9
| > Version: 2.9.8-1
| > 
| > Steps to reproduce:
| > octave-2.9.8:1> spkron(2,3)
| > error: octave_base_value::sparse_matrix_value(): wrong type argument `scalar'
| > error: octave_base_value::sparse_matrix_value(): wrong type argument `scalar'
| > 
| > would expect
| > 
| > ans =  6
| 
| Try
| 	spkron(sparse(2), sparse(3))
| 
| I don't consider this a bug. The overhead for sparse-implementations
| just doesn't make sense for scalars.

Also, why are you using spkron directly?  I think it would be better
to use kron instead.  It will handle both

  kron (2, 3)
  kron (sparse (2), sparse (3))

Once Octave has proper dispatching, spkron may only be available via
kron with sparse arguments rather than being directly callable.

jwe




Reply to: