[Top][All Lists]

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

Dynamic types question

From: adler
Subject: Dynamic types question
Date: Thu, 29 Mar 2001 23:43:01 -0500 (EST)

While I've been writing my sparse functions,
I've noticed that octave does not prevent
you from nonconformant args for multiplication
like it does for addition.

   octave-2.1.32:1> a=eye(3);
   octave-2.1.32:2> b=sparse(eye(4));
   octave-2.1.32:3> a+b
   error: operator +: nonconformant arguments (op1 is 3x3, op2 is 4x4)
   error: evaluating binary operator `+' near line 3, column 2

Good - octave protects us here

   octave-2.1.32:3> a.*b
   octave-2.1.32: class octave_value
   oct_binop_f_s_el_mul(const class octave_value &,
      const class octave_value &): Assertion `Anr == Bnr' failed.
   panic: Aborted -- stopping myself...

Problem - no protection here - my assert is catching the error   


1.  I recall some previous version of octave doing this correctly.
    However, I tried 2.1.30 and it gives the same error.

2.  Is this a bug?

3.  If not, how should I handle it gracefully in my code?

In order to try this one probably needs a 
copy of my sparse functions. The
example does not have sized matrices
 - one could use
which only has real matrix support.

Or, get it from
for complex sparse support. (not fully tested)

Andy Adler,                address@hidden

Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

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