octave-maintainers
[Top][All Lists]
Advanced

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

Re: Sparse matrix problem


From: David Bateman
Subject: Re: Sparse matrix problem
Date: Wed, 03 Jan 2007 12:57:16 +0100
User-agent: Thunderbird 1.5.0.7 (X11/20060921)

David Bateman wrote:
>
> With octave 2.9.9+ I get
>
> octave:1> sparse(1+i)/sparse(0)
> warning: matrix singular to machine precision, rcond = 0
> warning: attempting to find minimum norm solution
> ans = 0
> octave:2> (1+i)/0
> warning: division by zero
> ans = NaN - NaNi
> octave:3> (1+i)/0
> warning: division by zero
> ans = NaN - NaNi
> octave:4> 1/0
> warning: division by zero
> ans = Inf
>
>
> with matlab R2006b I get
>
> >> 1/0
> Warning: Divide by zero.
>
> ans =
>
>   Inf
>
> >> (1+1i)/0
> Warning: Divide by zero.
>
> ans =
>
>      Inf +    Infi
>
> >> sparse(1+1i)/sparse(0)
> Warning: Divide by zero.
>
> ans =
>
>   (1,1)         Inf +    Infi
>
> I believe the (1+1i)/0 issue is the fault of my c++ complex class
> implementation and not in octave at all. However, the sparse issue is
> different. The problem here is there is no sparse scalar class (it
> doesn't make sense), and so the standard matrix "/" operator is used.
> So I'm get the answer back from CXSparse's QR solver. To get this
> right will need care to be taken in the "\" and "/" operator that the
> size of the sparse matrix passed isn't in fact a scalar, and if it is
> to convert to scalar before the operators. However if we do that, then
> something like "speye(5)*sparse(2)" should also be valid and in fact
> is in matlab. This is a bit of a mess and easier would be to have
> "sparse(2)" return a scalar rather than a sparse matrix, though that
> will break other things.
>
> I'll make a possible patch for consideration, but there are lots of
> files to touch to get this right..

Ok, this was a lot more work than I though it would be, but here is the
patch. Basically it allows scalars to be stored in a sparse matrix
container and to be treated as if they were scalars. This is necessary
as Mathworks chose the path of letting the user store scalars as sparse
matrices rather than automatically reconverting these to scalars. In any
case the attached patch makes octave matlab compatible for scalars
stored as sparse matrices for all operators...

D.



-- 
David Bateman                                address@hidden
Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob) 
91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax) 

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary

*** ./liboctave/MSparse.cc.orig17       2007-01-02 23:28:38.156693217 +0100
--- ./liboctave/MSparse.cc      2007-01-03 11:30:08.717350882 +0100
***************
*** 288,294 ****
      octave_idx_type b_nr = b.rows (); \
      octave_idx_type b_nc = b.cols (); \
   \
!     if (a_nr != b_nr || a_nc != b_nc) \
        gripe_nonconformant ("operator " # OP, a_nr, a_nc, b_nr, b_nc); \
      else \
        { \
--- 288,336 ----
      octave_idx_type b_nr = b.rows (); \
      octave_idx_type b_nc = b.cols (); \
   \
!     if (a_nr == 1 && a_nc == 1) \
!       { \
!         if (a.elem(0,0) == 0.) \
!           r = MSparse<T> (b); \
!         else \
!           { \
!           r = MSparse<T> (b_nr, b_nc, a.data(0) OP 0.); \
!             \
!             for (octave_idx_type j = 0 ; j < b_nc ; j++) \
!               { \
!                 OCTAVE_QUIT; \
!                 octave_idx_type idxj = j * b_nr; \
!                 for (octave_idx_type i = b.cidx(j) ; i < b.cidx(j+1) ; i++) \
!                   { \
!                    OCTAVE_QUIT; \
!                    r.data(idxj + b.ridx(i)) = a.data(0) OP b.data(i); \
!                 } \
!               } \
!             r.maybe_compress (); \
!           } \
!       } \
!     else if (b_nr == 1 && b_nc == 1) \
!       { \
!         if (b.elem(0,0) == 0.) \
!           r = MSparse<T> (a); \
!         else \
!           { \
!           r = MSparse<T> (a_nr, a_nc, 0. OP b.data(0)); \
!             \
!             for (octave_idx_type j = 0 ; j < a_nc ; j++) \
!               { \
!                 OCTAVE_QUIT; \
!                 octave_idx_type idxj = j * a_nr; \
!                 for (octave_idx_type i = a.cidx(j) ; i < a.cidx(j+1) ; i++) \
!                   { \
!                     OCTAVE_QUIT; \
!                     r.data(idxj + a.ridx(i)) = a.data(i) OP b.data(0); \
!                 } \
!               } \
!             r.maybe_compress (); \
!           } \
!       } \
!     else if (a_nr != b_nr || a_nc != b_nc) \
        gripe_nonconformant ("operator " # OP, a_nr, a_nc, b_nr, b_nc); \
      else \
        { \
***************
*** 363,369 ****
      octave_idx_type b_nr = b.rows (); \
      octave_idx_type b_nc = b.cols (); \
   \
!     if (a_nr != b_nr || a_nc != b_nc) \
        gripe_nonconformant (#FCN, a_nr, a_nc, b_nr, b_nc); \
      else \
        { \
--- 405,445 ----
      octave_idx_type b_nr = b.rows (); \
      octave_idx_type b_nc = b.cols (); \
   \
!     if (a_nr == 1 && a_nc == 1) \
!       { \
!         if (a.elem(0,0) == 0.) \
!           r = MSparse<T> (b_nr, b_nc); \
!         else \
!           { \
!           r = MSparse<T> (b); \
!             octave_idx_type b_nnz = b.nnz(); \
!             \
!             for (octave_idx_type i = 0 ; i < b_nnz ; i++) \
!               { \
!                 OCTAVE_QUIT; \
!                 r.data (i) = a.data(0) OP r.data(i); \
!               } \
!             r.maybe_compress (); \
!           } \
!       } \
!     else if (b_nr == 1 && b_nc == 1) \
!       { \
!         if (b.elem(0,0) == 0.) \
!           r = MSparse<T> (a_nr, a_nc); \
!         else \
!           { \
!           r = MSparse<T> (a); \
!             octave_idx_type a_nnz = a.nnz(); \
!             \
!             for (octave_idx_type i = 0 ; i < a_nnz ; i++) \
!               { \
!                 OCTAVE_QUIT; \
!                 r.data (i) = r.data(i) OP b.data(0); \
!               } \
!             r.maybe_compress (); \
!           } \
!       } \
!     else if (a_nr != b_nr || a_nc != b_nc) \
        gripe_nonconformant (#FCN, a_nr, a_nc, b_nr, b_nc); \
      else \
        { \
***************
*** 429,435 ****
      octave_idx_type b_nr = b.rows (); \
      octave_idx_type b_nc = b.cols (); \
   \
!     if (a_nr != b_nr || a_nc != b_nc) \
        gripe_nonconformant (#FCN, a_nr, a_nc, b_nr, b_nc); \
      else \
        { \
--- 505,567 ----
      octave_idx_type b_nr = b.rows (); \
      octave_idx_type b_nc = b.cols (); \
   \
!     if (a_nr == 1 && a_nc == 1) \
!       { \
!         T val = a.elem (0,0); \
!         T fill = val OP T(); \
!         if (fill == T()) \
!           { \
!             octave_idx_type b_nnz = b.nnz(); \
!             r = MSparse<T> (b); \
!             for (octave_idx_type i = 0 ; i < b_nnz ; i++) \
!               r.data (i) = val OP r.data(i); \
!             r.maybe_compress (); \
!           } \
!         else \
!           { \
!             r = MSparse<T> (b_nr, b_nc, fill); \
!             for (octave_idx_type j = 0 ; j < b_nc ; j++) \
!               { \
!                 OCTAVE_QUIT; \
!                 octave_idx_type idxj = j * b_nr; \
!                 for (octave_idx_type i = b.cidx(j) ; i < b.cidx(j+1) ; i++) \
!                   { \
!                     OCTAVE_QUIT; \
!                     r.data(idxj + b.ridx(i)) = val OP b.data(i); \
!                 } \
!               } \
!             r.maybe_compress (); \
!           } \
!       } \
!     else if (b_nr == 1 && b_nc == 1) \
!       { \
!         T val = b.elem (0,0); \
!         T fill = T() OP val; \
!         if (fill == T()) \
!           { \
!             octave_idx_type a_nnz = a.nnz(); \
!             r = MSparse<T> (a); \
!             for (octave_idx_type i = 0 ; i < a_nnz ; i++) \
!               r.data (i) = r.data(i) OP val; \
!             r.maybe_compress (); \
!           } \
!         else \
!           { \
!             r = MSparse<T> (a_nr, a_nc, fill); \
!             for (octave_idx_type j = 0 ; j < a_nc ; j++) \
!               { \
!                 OCTAVE_QUIT; \
!                 octave_idx_type idxj = j * a_nr; \
!                 for (octave_idx_type i = a.cidx(j) ; i < a.cidx(j+1) ; i++) \
!                   { \
!                     OCTAVE_QUIT; \
!                     r.data(idxj + a.ridx(i)) = a.data(i) OP val; \
!                 } \
!               } \
!             r.maybe_compress (); \
!           } \
!       } \
!     else if (a_nr != b_nr || a_nc != b_nc) \
        gripe_nonconformant (#FCN, a_nr, a_nc, b_nr, b_nc); \
      else \
        { \
*** ./liboctave/Sparse-op-defs.h.orig17 2007-01-02 17:31:00.889785383 +0100
--- ./liboctave/Sparse-op-defs.h        2007-01-03 11:44:04.315418044 +0100
***************
*** 24,29 ****
--- 24,30 ----
  #define octave_sparse_op_defs_h 1
  
  #include "Array-util.h"
+ #include "mx-ops.h"
  
  #define SPARSE_BIN_OP_DECL(R, OP, X, Y) \
    extern OCTAVE_API R OP (const X&, const Y&)
***************
*** 473,479 ****
      octave_idx_type m2_nr = m2.rows (); \
      octave_idx_type m2_nc = m2.cols (); \
   \
!     if (m1_nr != m2_nr || m1_nc != m2_nc) \
        gripe_nonconformant (#F, m1_nr, m1_nc, m2_nr, m2_nc); \
      else \
        { \
--- 474,522 ----
      octave_idx_type m2_nr = m2.rows (); \
      octave_idx_type m2_nc = m2.cols (); \
   \
!     if (m1_nr == 1 && m1_nc == 1) \
!       { \
!         if (m1.elem(0,0) == 0.) \
!           r = R (m2); \
!         else \
!           { \
!           r = R (m2_nr, m2_nc, m1.data(0) OP 0.); \
!             \
!             for (octave_idx_type j = 0 ; j < m2_nc ; j++) \
!               { \
!                 OCTAVE_QUIT; \
!                 octave_idx_type idxj = j * m2_nr; \
!                 for (octave_idx_type i = m2.cidx(j) ; i < m2.cidx(j+1) ; i++) 
\
!                   { \
!                     OCTAVE_QUIT; \
!                     r.data(idxj + m2.ridx(i)) = m1.data(0) OP m2.data(i); \
!                 } \
!               } \
!             r.maybe_compress (); \
!           } \
!       } \
!     else if (m2_nr == 1 && m2_nc == 1) \
!       { \
!         if (m2.elem(0,0) == 0.) \
!           r = R (m1); \
!         else \
!           { \
!           r = R (m1_nr, m1_nc, 0. OP m2.data(0)); \
!             \
!             for (octave_idx_type j = 0 ; j < m1_nc ; j++) \
!               { \
!                 OCTAVE_QUIT; \
!                 octave_idx_type idxj = j * m1_nr; \
!                 for (octave_idx_type i = m1.cidx(j) ; i < m1.cidx(j+1) ; i++) 
\
!                   { \
!                     OCTAVE_QUIT; \
!                     r.data(idxj + m1.ridx(i)) = m1.data(i) OP m2.data(0); \
!                 } \
!               } \
!             r.maybe_compress (); \
!           } \
!       } \
!     else if (m1_nr != m2_nr || m1_nc != m2_nc) \
        gripe_nonconformant (#F, m1_nr, m1_nc, m2_nr, m2_nc); \
      else \
        { \
***************
*** 547,553 ****
      octave_idx_type m2_nr = m2.rows (); \
      octave_idx_type m2_nc = m2.cols (); \
   \
!     if (m1_nr != m2_nr || m1_nc != m2_nc) \
        gripe_nonconformant (#F, m1_nr, m1_nc, m2_nr, m2_nc); \
      else \
        { \
--- 590,630 ----
      octave_idx_type m2_nr = m2.rows (); \
      octave_idx_type m2_nc = m2.cols (); \
   \
!     if (m1_nr == 1 && m1_nc == 1) \
!       { \
!         if (m1.elem(0,0) == 0.) \
!           r = R (m2_nr, m2_nc); \
!         else \
!           { \
!           r = R (m2); \
!             octave_idx_type m2_nnz = m2.nnz(); \
!             \
!             for (octave_idx_type i = 0 ; i < m2_nnz ; i++) \
!               { \
!                 OCTAVE_QUIT; \
!                 r.data (i) = m1.data(0) OP r.data(i); \
!               } \
!             r.maybe_compress (); \
!           } \
!       } \
!     else if (m2_nr == 1 && m2_nc == 1) \
!       { \
!         if (m2.elem(0,0) == 0.) \
!           r = R (m1_nr, m1_nc); \
!         else \
!           { \
!           r = R (m1); \
!             octave_idx_type m1_nnz = m1.nnz(); \
!             \
!             for (octave_idx_type i = 0 ; i < m1_nnz ; i++) \
!               { \
!                 OCTAVE_QUIT; \
!                 r.data (i) = r.data(i) OP m2.data(0); \
!               } \
!             r.maybe_compress (); \
!           } \
!       } \
!     else if (m1_nr != m2_nr || m1_nc != m2_nc) \
        gripe_nonconformant (#F, m1_nr, m1_nc, m2_nr, m2_nc); \
      else \
        { \
***************
*** 611,617 ****
      octave_idx_type m2_nr = m2.rows (); \
      octave_idx_type m2_nc = m2.cols (); \
   \
!     if (m1_nr != m2_nr || m1_nc != m2_nc) \
        gripe_nonconformant (#F, m1_nr, m1_nc, m2_nr, m2_nc); \
      else \
        { \
--- 688,746 ----
      octave_idx_type m2_nr = m2.rows (); \
      octave_idx_type m2_nc = m2.cols (); \
   \
!     if (m1_nr == 1 && m1_nc == 1) \
!       { \
!         if ((m1.elem (0,0) OP Complex()) == Complex()) \
!           { \
!             octave_idx_type m2_nnz = m2.nnz(); \
!             r = R (m2); \
!             for (octave_idx_type i = 0 ; i < m2_nnz ; i++) \
!               r.data (i) = m1.elem(0,0) OP r.data(i); \
!             r.maybe_compress (); \
!           } \
!         else \
!           { \
!             r = R (m2_nr, m2_nc, m1.elem(0,0) OP Complex ()); \
!             for (octave_idx_type j = 0 ; j < m2_nc ; j++) \
!               { \
!                 OCTAVE_QUIT; \
!                 octave_idx_type idxj = j * m2_nr; \
!                 for (octave_idx_type i = m2.cidx(j) ; i < m2.cidx(j+1) ; i++) 
\
!                   { \
!                     OCTAVE_QUIT; \
!                     r.data(idxj + m2.ridx(i)) = m1.elem(0,0) OP m2.data(i); \
!                 } \
!               } \
!             r.maybe_compress (); \
!           } \
!       } \
!     else if (m2_nr == 1 && m2_nc == 1) \
!       { \
!         if ((Complex() OP m1.elem (0,0)) == Complex()) \
!           { \
!             octave_idx_type m1_nnz = m1.nnz(); \
!             r = R (m1); \
!             for (octave_idx_type i = 0 ; i < m1_nnz ; i++) \
!               r.data (i) = r.data(i) OP m2.elem(0,0); \
!             r.maybe_compress (); \
!           } \
!         else \
!           { \
!             r = R (m1_nr, m1_nc, Complex() OP m2.elem(0,0)); \
!             for (octave_idx_type j = 0 ; j < m1_nc ; j++) \
!               { \
!                 OCTAVE_QUIT; \
!                 octave_idx_type idxj = j * m1_nr; \
!                 for (octave_idx_type i = m1.cidx(j) ; i < m1.cidx(j+1) ; i++) 
\
!                   { \
!                     OCTAVE_QUIT; \
!                     r.data(idxj + m1.ridx(i)) = m1.data(i) OP m2.elem(0,0); \
!                 } \
!               } \
!             r.maybe_compress (); \
!           } \
!       } \
!     else if (m1_nr != m2_nr || m1_nc != m2_nc) \
        gripe_nonconformant (#F, m1_nr, m1_nc, m2_nr, m2_nc); \
      else \
        { \
***************
*** 698,704 ****
      octave_idx_type m2_nr = m2.rows (); \
      octave_idx_type m2_nc = m2.cols (); \
      \
!     if (m1_nr == m2_nr && m1_nc == m2_nc) \
        { \
        if (m1_nr != 0 || m1_nc != 0) \
          { \
--- 827,845 ----
      octave_idx_type m2_nr = m2.rows (); \
      octave_idx_type m2_nc = m2.cols (); \
      \
!     if (m1_nr == 1 && m1_nc == 1) \
!       { \
!         extern OCTAVE_API SparseBoolMatrix F (const double&, const M2&); \
!         extern OCTAVE_API SparseBoolMatrix F (const Complex&, const M2&); \
!         r = F (m1.elem(0,0), m2); \
!       } \
!     else if (m2_nr == 1 && m2_nc == 1) \
!       { \
!         extern OCTAVE_API SparseBoolMatrix F (const M1&, const double&); \
!         extern OCTAVE_API SparseBoolMatrix F (const M1&, const Complex&); \
!         r = F (m1, m2.elem(0,0)); \
!       } \
!     else if (m1_nr == m2_nr && m1_nc == m2_nc) \
        { \
        if (m1_nr != 0 || m1_nc != 0) \
          { \
***************
*** 764,770 ****
      octave_idx_type m2_nr = m2.rows (); \
      octave_idx_type m2_nc = m2.cols (); \
      \
!     if (m1_nr == m2_nr && m1_nc == m2_nc) \
        { \
        if (m1_nr != 0 || m1_nc != 0) \
          { \
--- 905,923 ----
      octave_idx_type m2_nr = m2.rows (); \
      octave_idx_type m2_nc = m2.cols (); \
      \
!     if (m1_nr == 1 && m1_nc == 1) \
!       { \
!         extern OCTAVE_API SparseBoolMatrix F (const double&, const M2&); \
!         extern OCTAVE_API SparseBoolMatrix F (const Complex&, const M2&); \
!         r = F (m1.elem(0,0), m2); \
!       } \
!     else if (m2_nr == 1 && m2_nc == 1) \
!       { \
!         extern OCTAVE_API SparseBoolMatrix F (const M1&, const double&); \
!         extern OCTAVE_API SparseBoolMatrix F (const M1&, const Complex&); \
!         r = F (m1, m2.elem(0,0)); \
!       } \
!     else if (m1_nr == m2_nr && m1_nc == m2_nc) \
        { \
        if (m1_nr != 0 || m1_nc != 0) \
          { \
***************
*** 836,842 ****
      octave_idx_type m2_nr = m2.rows (); \
      octave_idx_type m2_nc = m2.cols (); \
   \
!     if (m1_nr != m2_nr || m1_nc != m2_nc) \
        gripe_nonconformant (#F, m1_nr, m1_nc, m2_nr, m2_nc); \
      else \
        { \
--- 989,997 ----
      octave_idx_type m2_nr = m2.rows (); \
      octave_idx_type m2_nc = m2.cols (); \
   \
!     if (m2_nr == 1 && m2_nc == 1) \
!       r = R (m1 OP m2.elem(0,0)); \
!     else if (m1_nr != m2_nr || m1_nc != m2_nc) \
        gripe_nonconformant (#F, m1_nr, m1_nc, m2_nr, m2_nc); \
      else \
        { \
***************
*** 861,867 ****
      octave_idx_type m2_nr = m2.rows (); \
      octave_idx_type m2_nc = m2.cols (); \
   \
!     if (m1_nr != m2_nr || m1_nc != m2_nc) \
        gripe_nonconformant (#F, m1_nr, m1_nc, m2_nr, m2_nc); \
      else \
        { \
--- 1016,1024 ----
      octave_idx_type m2_nr = m2.rows (); \
      octave_idx_type m2_nc = m2.cols (); \
   \
!     if (m2_nr == 1 && m2_nc == 1) \
!       r = R (m1 OP m2.elem(0,0)); \
!     else if (m1_nr != m2_nr || m1_nc != m2_nc) \
        gripe_nonconformant (#F, m1_nr, m1_nc, m2_nr, m2_nc); \
      else \
        { \
***************
*** 924,930 ****
      octave_idx_type m2_nr = m2.rows (); \
      octave_idx_type m2_nc = m2.cols (); \
      \
!     if (m1_nr == m2_nr && m1_nc == m2_nc) \
        { \
        if (m1_nr != 0 || m1_nc != 0) \
          { \
--- 1081,1089 ----
      octave_idx_type m2_nr = m2.rows (); \
      octave_idx_type m2_nc = m2.cols (); \
      \
!     if (m2_nr == 1 && m2_nc == 1) \
!       r = SparseBoolMatrix (F (m1, m2.elem(0,0))); \
!     else if (m1_nr == m2_nr && m1_nc == m2_nc) \
        { \
        if (m1_nr != 0 || m1_nc != 0) \
          { \
***************
*** 990,996 ****
      octave_idx_type m2_nr = m2.rows (); \
      octave_idx_type m2_nc = m2.cols (); \
      \
!     if (m1_nr == m2_nr && m1_nc == m2_nc) \
        { \
        if (m1_nr != 0 || m1_nc != 0) \
          { \
--- 1149,1157 ----
      octave_idx_type m2_nr = m2.rows (); \
      octave_idx_type m2_nc = m2.cols (); \
      \
!     if (m2_nr == 1 && m2_nc == 1) \
!       r = SparseBoolMatrix  (F (m1, m2.elem(0,0))); \
!     else if (m1_nr == m2_nr && m1_nc == m2_nc) \
        { \
        if (m1_nr != 0 || m1_nc != 0) \
          { \
***************
*** 1062,1068 ****
      octave_idx_type m2_nr = m2.rows (); \
      octave_idx_type m2_nc = m2.cols (); \
   \
!     if (m1_nr != m2_nr || m1_nc != m2_nc) \
        gripe_nonconformant (#F, m1_nr, m1_nc, m2_nr, m2_nc); \
      else \
        { \
--- 1223,1231 ----
      octave_idx_type m2_nr = m2.rows (); \
      octave_idx_type m2_nc = m2.cols (); \
   \
!     if (m1_nr == 1 && m1_nc == 1) \
!       r = R (m1.elem(0,0) OP m2); \
!     else if (m1_nr != m2_nr || m1_nc != m2_nc) \
        gripe_nonconformant (#F, m1_nr, m1_nc, m2_nr, m2_nc); \
      else \
        { \
***************
*** 1087,1093 ****
      octave_idx_type m2_nr = m2.rows (); \
      octave_idx_type m2_nc = m2.cols (); \
   \
!     if (m1_nr != m2_nr || m1_nc != m2_nc) \
        gripe_nonconformant (#F, m1_nr, m1_nc, m2_nr, m2_nc); \
      else \
        { \
--- 1250,1258 ----
      octave_idx_type m2_nr = m2.rows (); \
      octave_idx_type m2_nc = m2.cols (); \
   \
!     if (m1_nr == 1 && m1_nc == 1) \
!       r = R (m1.elem(0,0) OP m2); \
!     else if (m1_nr != m2_nr || m1_nc != m2_nc) \
        gripe_nonconformant (#F, m1_nr, m1_nc, m2_nr, m2_nc); \
      else \
        { \
***************
*** 1150,1156 ****
      octave_idx_type m2_nr = m2.rows (); \
      octave_idx_type m2_nc = m2.cols (); \
      \
!     if (m1_nr == m2_nr && m1_nc == m2_nc) \
        { \
        if (m1_nr != 0 || m1_nc != 0) \
          { \
--- 1315,1323 ----
      octave_idx_type m2_nr = m2.rows (); \
      octave_idx_type m2_nc = m2.cols (); \
      \
!     if (m1_nr == 1 && m1_nc == 1) \
!       r = SparseBoolMatrix (F (m1.elem(0,0), m2)); \
!     else if (m1_nr == m2_nr && m1_nc == m2_nc) \
        { \
        if (m1_nr != 0 || m1_nc != 0) \
          { \
***************
*** 1216,1222 ****
      octave_idx_type m2_nr = m2.rows (); \
      octave_idx_type m2_nc = m2.cols (); \
      \
!     if (m1_nr == m2_nr && m1_nc == m2_nc) \
        { \
        if (m1_nr != 0 || m1_nc != 0) \
          { \
--- 1383,1391 ----
      octave_idx_type m2_nr = m2.rows (); \
      octave_idx_type m2_nc = m2.cols (); \
      \
!     if (m1_nr == 1 && m1_nc == 1) \
!       r = SparseBoolMatrix (F (m1.elem(0,0), m2)); \
!     else if (m1_nr == m2_nr && m1_nc == m2_nc) \
        { \
        if (m1_nr != 0 || m1_nc != 0) \
          { \
***************
*** 1540,1546 ****
    octave_idx_type a_nr = a.rows (); \
    octave_idx_type a_nc = a.cols (); \
    \
!   if (nc != a_nr) \
      { \
        gripe_nonconformant ("operator *", nr, nc, a_nr, a_nc); \
        return RET_TYPE (); \
--- 1709,1757 ----
    octave_idx_type a_nr = a.rows (); \
    octave_idx_type a_nc = a.cols (); \
    \
!   if (nr == 1 && nc == 1) \
!    { \
!      RET_EL_TYPE s = m.elem(0,0); \
!      octave_idx_type nz = a.nnz(); \
!      RET_TYPE r (a_nr, a_nc, nz); \
!      \
!      for (octave_idx_type i = 0; i < nz; i++) \
!        { \
!          OCTAVE_QUIT; \
!        r.data(i) = s * a.data(i); \
!        r.ridx(i) = a.ridx(i); \
!        } \
!      for (octave_idx_type i = 0; i < a_nc + 1; i++) \
!        { \
!          OCTAVE_QUIT; \
!          r.cidx(i) = a.cidx(i); \
!        } \
!      \
!      r.maybe_compress (true); \
!      return r; \
!    } \
!   else if (a_nr == 1 && a_nc == 1) \
!    { \
!      RET_EL_TYPE s = a.elem(0,0); \
!      octave_idx_type nz = m.nnz(); \
!      RET_TYPE r (nr, nc, nz); \
!      \
!      for (octave_idx_type i = 0; i < nz; i++) \
!        { \
!          OCTAVE_QUIT; \
!        r.data(i) = m.data(i) * s; \
!        r.ridx(i) = m.ridx(i); \
!        } \
!      for (octave_idx_type i = 0; i < nc + 1; i++) \
!        { \
!          OCTAVE_QUIT; \
!          r.cidx(i) = m.cidx(i); \
!        } \
!      \
!      r.maybe_compress (true); \
!      return r; \
!    } \
!   else if (nc != a_nr) \
      { \
        gripe_nonconformant ("operator *", nr, nc, a_nr, a_nc); \
        return RET_TYPE (); \
***************
*** 1667,1673 ****
    octave_idx_type a_nr = a.rows (); \
    octave_idx_type a_nc = a.cols (); \
    \
!   if (nc != a_nr) \
      { \
        gripe_nonconformant ("operator *", nr, nc, a_nr, a_nc); \
        return RET_TYPE (); \
--- 1878,1897 ----
    octave_idx_type a_nr = a.rows (); \
    octave_idx_type a_nc = a.cols (); \
    \
!   if (nr == 1 && nc == 1) \
!     { \
!       RET_TYPE retval (a_nr, a_nc, ZERO); \
!       for (octave_idx_type i = 0; i < a_nc ; i++) \
!       { \
!         for (octave_idx_type j = 0; j < a_nr; j++) \
!           { \
!               OCTAVE_QUIT; \
!             retval.elem (j,i) += a.elem(j,i) * m.elem(0,0); \
!           } \
!         } \
!       return retval; \
!     } \
!   else if (nc != a_nr) \
      { \
        gripe_nonconformant ("operator *", nr, nc, a_nr, a_nc); \
        return RET_TYPE (); \
***************
*** 1697,1703 ****
    octave_idx_type a_nr = a.rows (); \
    octave_idx_type a_nc = a.cols (); \
    \
!   if (nc != a_nr) \
      { \
        gripe_nonconformant ("operator *", nr, nc, a_nr, a_nc); \
        return RET_TYPE (); \
--- 1921,1940 ----
    octave_idx_type a_nr = a.rows (); \
    octave_idx_type a_nc = a.cols (); \
    \
!   if (a_nr == 1 && a_nc == 1) \
!     { \
!       RET_TYPE retval (nr, nc, ZERO); \
!       for (octave_idx_type i = 0; i < nc ; i++) \
!       { \
!         for (octave_idx_type j = 0; j < nr; j++) \
!           { \
!               OCTAVE_QUIT; \
!             retval.elem (j,i) += a.elem(0,0) * m.elem(j,i); \
!           } \
!         } \
!       return retval; \
!     } \
!   else if (nc != a_nr) \
      { \
        gripe_nonconformant ("operator *", nr, nc, a_nr, a_nc); \
        return RET_TYPE (); \
*** ./src/OPERATORS/op-scm-cm.cc.orig17 2007-01-02 17:31:36.525997450 +0100
--- ./src/OPERATORS/op-scm-cm.cc        2007-01-02 18:07:29.581398528 +0100
***************
*** 67,79 ****
  DEFBINOP (ldiv, sparse_complex_matrix, complex_matrix)
  {
    CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, const 
octave_complex_matrix&);
-   MatrixType typ = v1.matrix_type ();
  
!   ComplexMatrix ret = xleftdiv (v1.sparse_complex_matrix_value (), 
!                               v2.complex_matrix_value (), typ);
! 
!   v1.matrix_type (typ);
!   return ret;
  }
  
  DEFBINOP_FN (lt, sparse_complex_matrix, complex_matrix, mx_el_lt)
--- 67,92 ----
  DEFBINOP (ldiv, sparse_complex_matrix, complex_matrix)
  {
    CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, const 
octave_complex_matrix&);
  
!   if (v1.rows() == 1 && v1.columns() == 1)
!     {
!       Complex d = v1.complex_value ();
! 
!       if (d == 0.0)
!       gripe_divide_by_zero ();
! 
!       return octave_value (v2.complex_array_value () / d);
!     }
!   else
!     {
!       MatrixType typ = v1.matrix_type ();
! 
!       ComplexMatrix ret = xleftdiv (v1.sparse_complex_matrix_value (), 
!                     v2.complex_matrix_value (), typ);
! 
!       v1.matrix_type (typ);
!       return ret;
!     }
  }
  
  DEFBINOP_FN (lt, sparse_complex_matrix, complex_matrix, mx_el_lt)
*** ./src/OPERATORS/op-scm-cs.cc.orig17 2007-01-02 17:31:47.967422624 +0100
--- ./src/OPERATORS/op-scm-cs.cc        2007-01-02 17:56:32.885995099 +0100
***************
*** 74,86 ****
  {
    CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, const 
octave_complex&);
  
!   MatrixType typ = v1.matrix_type ();
!   SparseComplexMatrix m1 = v1.sparse_complex_matrix_value ();
!   ComplexMatrix m2 = ComplexMatrix (1, 1, v2.complex_value ());
!   ComplexMatrix ret = xleftdiv (m1, m2, typ);
!   v1.matrix_type (typ);
  
!   return ret;
  }
  
  DEFBINOP_FN (lt, sparse_complex_matrix, complex, mx_el_lt)
--- 74,97 ----
  {
    CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, const 
octave_complex&);
  
!   if (v1.rows() == 1 && v1.columns() == 1)
!     {
!       Complex d = v1.complex_value ();
! 
!       if (d == 0.0)
!       gripe_divide_by_zero ();
  
!       return octave_value (v2.complex_value () / d);
!     }
!   else
!     {
!       MatrixType typ = v1.matrix_type ();
!       SparseComplexMatrix m1 = v1.sparse_complex_matrix_value ();
!       ComplexMatrix m2 = ComplexMatrix (1, 1, v2.complex_value ());
!       ComplexMatrix ret = xleftdiv (m1, m2, typ);
!       v1.matrix_type (typ);
!       return ret;
!     }
  }
  
  DEFBINOP_FN (lt, sparse_complex_matrix, complex, mx_el_lt)
*** ./src/OPERATORS/op-scm-m.cc.orig17  2007-01-02 17:32:05.730529445 +0100
--- ./src/OPERATORS/op-scm-m.cc 2007-01-02 17:58:28.309121529 +0100
***************
*** 69,81 ****
  {
    CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, const octave_matrix&);
    
!   MatrixType typ = v1.matrix_type ();
! 
!   ComplexMatrix ret = xleftdiv (v1.sparse_complex_matrix_value (), 
!                               v2.matrix_value (), typ);
! 
!   v1.matrix_type (typ);
!   return ret;
  }
  
  DEFBINOP_FN (lt, sparse_complex_matrix, matrix, mx_el_lt)
--- 69,93 ----
  {
    CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, const octave_matrix&);
    
!   if (v1.rows() == 1 && v1.columns() == 1)
!     {
!       Complex d = v1.complex_value ();
! 
!       if (d == 0.0)
!       gripe_divide_by_zero ();
! 
!       return octave_value (v2.array_value () / d);
!     }
!   else
!     {
!       MatrixType typ = v1.matrix_type ();
! 
!       ComplexMatrix ret = xleftdiv (v1.sparse_complex_matrix_value (), 
!                                   v2.matrix_value (), typ);
! 
!       v1.matrix_type (typ);
!       return ret;
!     }
  }
  
  DEFBINOP_FN (lt, sparse_complex_matrix, matrix, mx_el_lt)
*** ./src/OPERATORS/op-scm-scm.cc.orig17        2007-01-02 18:03:43.968987419 
+0100
--- ./src/OPERATORS/op-scm-scm.cc       2007-01-02 18:03:29.966705168 +0100
***************
*** 97,108 ****
  {
    CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, 
                   const octave_sparse_complex_matrix&);
!   MatrixType typ = v2.matrix_type ();
!   SparseComplexMatrix ret = xdiv (v1.sparse_complex_matrix_value (), 
!                                 v2.sparse_complex_matrix_value (), typ);
    
!   v2.matrix_type (typ);
!   return ret;
  }
  
  DEFBINOPX (pow, sparse_complex_matrix, sparse_complex_matrix)
--- 97,121 ----
  {
    CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, 
                   const octave_sparse_complex_matrix&);
!  
!   if (v2.rows() == 1 && v2.columns() == 1)
!     {
!       Complex d = v2.complex_value ();
! 
!       if (d == 0.0)
!       gripe_divide_by_zero ();
! 
!       return octave_value (v1.sparse_complex_matrix_value () / d);
!     }
!   else
!     {
!       MatrixType typ = v2.matrix_type ();
!       SparseComplexMatrix ret = xdiv (v1.sparse_complex_matrix_value (), 
!                                     v2.sparse_complex_matrix_value (), typ);
    
!       v2.matrix_type (typ);
!       return ret;
!     }
  }
  
  DEFBINOPX (pow, sparse_complex_matrix, sparse_complex_matrix)
***************
*** 115,127 ****
  {
    CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, 
                   const octave_sparse_complex_matrix&);
-   MatrixType typ = v1.matrix_type ();
- 
-   SparseComplexMatrix ret = xleftdiv (v1.sparse_complex_matrix_value (), 
-                                     v2.sparse_complex_matrix_value (), typ);
  
!   v1.matrix_type (typ);
!   return ret;
  }
  
  DEFBINOP_FN (lt, sparse_complex_matrix, sparse_complex_matrix, mx_el_lt)
--- 128,154 ----
  {
    CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, 
                   const octave_sparse_complex_matrix&);
  
!   if (v1.rows() == 1 && v1.columns() == 1)
!     {
!       Complex d = v1.complex_value ();
! 
!       if (d == 0.0)
!       gripe_divide_by_zero ();
! 
!       return octave_value (v2.sparse_complex_matrix_value () / d);
!     }
!   else
!     {
!       MatrixType typ = v1.matrix_type ();
! 
!       SparseComplexMatrix ret = 
!       xleftdiv (v1.sparse_complex_matrix_value (), 
!                 v2.sparse_complex_matrix_value (), typ);
! 
!       v1.matrix_type (typ);
!       return ret;
!     }
  }
  
  DEFBINOP_FN (lt, sparse_complex_matrix, sparse_complex_matrix, mx_el_lt)
*** ./src/OPERATORS/op-sm-cs.cc.orig17  2007-01-02 18:14:12.325609106 +0100
--- ./src/OPERATORS/op-sm-cs.cc 2007-01-02 18:13:30.316783120 +0100
***************
*** 74,86 ****
  {
    CAST_BINOP_ARGS (const octave_sparse_matrix&, const octave_complex&);
  
!   MatrixType typ = v1.matrix_type ();
!   SparseMatrix m1 = v1.sparse_matrix_value ();
!   ComplexMatrix m2 = ComplexMatrix (1, 1, v2.complex_value ());
!   ComplexMatrix ret = xleftdiv (m1, m2, typ);
!   v1.matrix_type (typ);
  
!   return ret;
  }
  
  DEFBINOP_FN (lt, sparse_matrix, complex, mx_el_lt)
--- 74,97 ----
  {
    CAST_BINOP_ARGS (const octave_sparse_matrix&, const octave_complex&);
  
!   if (v1.rows() == 1 && v1.columns() == 1)
!     {
!       double d = v1.scalar_value ();
! 
!       if (d == 0.0)
!       gripe_divide_by_zero ();
  
!       return octave_value (v2.complex_value () / d);
!     }
!   else
!     {
!       MatrixType typ = v1.matrix_type ();
!       SparseMatrix m1 = v1.sparse_matrix_value ();
!       ComplexMatrix m2 = ComplexMatrix (1, 1, v2.complex_value ());
!       ComplexMatrix ret = xleftdiv (m1, m2, typ);
!       v1.matrix_type (typ);
!       return ret;
!     }
  }
  
  DEFBINOP_FN (lt, sparse_matrix, complex, mx_el_lt)
*** ./src/OPERATORS/op-sm-cm.cc.orig17  2007-01-02 18:12:46.489049958 +0100
--- ./src/OPERATORS/op-sm-cm.cc 2007-01-02 18:12:33.206736670 +0100
***************
*** 67,79 ****
  DEFBINOP (ldiv, sparse_matrix, complex_matrix)
  {
    CAST_BINOP_ARGS (const octave_sparse_matrix&, const octave_complex_matrix&);
-   MatrixType typ = v1.matrix_type ();
  
!   ComplexMatrix ret = xleftdiv (v1.sparse_matrix_value (), 
!                               v2.complex_matrix_value (), typ);
! 
!   v1.matrix_type (typ);
!   return ret;
  }
  
  DEFBINOP_FN (lt, sparse_matrix, complex_matrix, mx_el_lt)
--- 67,92 ----
  DEFBINOP (ldiv, sparse_matrix, complex_matrix)
  {
    CAST_BINOP_ARGS (const octave_sparse_matrix&, const octave_complex_matrix&);
  
!   if (v1.rows() == 1 && v1.columns() == 1)
!     {
!       double d = v1.scalar_value ();
! 
!       if (d == 0.0)
!       gripe_divide_by_zero ();
! 
!       return octave_value (v2.complex_array_value () / d);
!     }
!   else
!     {
!       MatrixType typ = v1.matrix_type ();
! 
!       ComplexMatrix ret = xleftdiv (v1.sparse_matrix_value (), 
!                                   v2.complex_matrix_value (), typ);
! 
!       v1.matrix_type (typ);
!       return ret;
!     }
  }
  
  DEFBINOP_FN (lt, sparse_matrix, complex_matrix, mx_el_lt)
*** ./src/OPERATORS/op-sm-m.cc.orig17   2007-01-02 18:15:06.171820744 +0100
--- ./src/OPERATORS/op-sm-m.cc  2007-01-02 18:14:55.049396863 +0100
***************
*** 65,77 ****
  DEFBINOP (ldiv, sparse_matrix, matrix)
  {
    CAST_BINOP_ARGS (const octave_sparse_matrix&, const octave_matrix&);
-   MatrixType typ = v1.matrix_type ();
  
!   Matrix ret = xleftdiv (v1.sparse_matrix_value (), 
!                              v2.matrix_value (), typ);
! 
!   v1.matrix_type (typ);
!   return ret;
  }
  
  DEFBINOP_FN (lt, sparse_matrix, matrix, mx_el_lt)
--- 65,90 ----
  DEFBINOP (ldiv, sparse_matrix, matrix)
  {
    CAST_BINOP_ARGS (const octave_sparse_matrix&, const octave_matrix&);
  
!   if (v1.rows() == 1 && v1.columns() == 1)
!     {
!       double d = v1.scalar_value ();
! 
!       if (d == 0.0)
!       gripe_divide_by_zero ();
! 
!       return octave_value (v2.array_value () / d);
!     }
!   else
!     {
!       MatrixType typ = v1.matrix_type ();
! 
!       Matrix ret = xleftdiv (v1.sparse_matrix_value (), 
!                            v2.matrix_value (), typ);
! 
!       v1.matrix_type (typ);
!       return ret;
!     }
  }
  
  DEFBINOP_FN (lt, sparse_matrix, matrix, mx_el_lt)
*** ./src/OPERATORS/op-sm-sm.cc.orig17  2007-01-02 18:39:04.367168034 +0100
--- ./src/OPERATORS/op-sm-sm.cc 2007-01-02 18:38:52.219775823 +0100
***************
*** 57,68 ****
  DEFBINOP (div, sparse_matrix, sparse_matrix)
  {
    CAST_BINOP_ARGS (const octave_sparse_matrix&, const octave_sparse_matrix&);
!   MatrixType typ = v2.matrix_type ();
!   SparseMatrix ret = xdiv (v1.sparse_matrix_value (), 
!                          v2.sparse_matrix_value (), typ);
    
!   v2.matrix_type (typ);
!   return ret;
  }
  
  DEFBINOPX (pow, sparse_matrix, sparse_matrix)
--- 57,81 ----
  DEFBINOP (div, sparse_matrix, sparse_matrix)
  {
    CAST_BINOP_ARGS (const octave_sparse_matrix&, const octave_sparse_matrix&);
! 
!   if (v2.rows() == 1 && v2.columns() == 1)
!     {
!       double d = v2.scalar_value ();
! 
!       if (d == 0.0)
!       gripe_divide_by_zero ();
! 
!       return octave_value (v1.sparse_matrix_value () / d);
!     }
!   else
!     {
!       MatrixType typ = v2.matrix_type ();
!       SparseMatrix ret = xdiv (v1.sparse_matrix_value (), 
!                              v2.sparse_matrix_value (), typ);
    
!       v2.matrix_type (typ);
!       return ret;
!     }
  }
  
  DEFBINOPX (pow, sparse_matrix, sparse_matrix)
***************
*** 74,86 ****
  DEFBINOP (ldiv, sparse_matrix, sparse_matrix)
  {
    CAST_BINOP_ARGS (const octave_sparse_matrix&, const octave_sparse_matrix&);
-   MatrixType typ = v1.matrix_type ();
- 
-   SparseMatrix ret = xleftdiv (v1.sparse_matrix_value (), 
-                              v2.sparse_matrix_value (), typ);
  
!   v1.matrix_type (typ);
!   return ret;
  }
  
  DEFBINOP_FN (lt, sparse_matrix, sparse_matrix, mx_el_lt)
--- 87,112 ----
  DEFBINOP (ldiv, sparse_matrix, sparse_matrix)
  {
    CAST_BINOP_ARGS (const octave_sparse_matrix&, const octave_sparse_matrix&);
  
!   if (v1.rows() == 1 && v1.columns() == 1)
!     {
!       double d = v1.double_value ();
! 
!       if (d == 0.0)
!       gripe_divide_by_zero ();
! 
!       return octave_value (v2.sparse_matrix_value () / d);
!     }
!   else
!     {
!       MatrixType typ = v1.matrix_type ();
! 
!       SparseMatrix ret = xleftdiv (v1.sparse_matrix_value (), 
!                                  v2.sparse_matrix_value (), typ);
! 
!       v1.matrix_type (typ);
!       return ret;
!     }
  }
  
  DEFBINOP_FN (lt, sparse_matrix, sparse_matrix, mx_el_lt)
*** ./src/OPERATORS/op-sm-s.cc.orig17   2007-01-02 18:21:16.783138825 +0100
--- ./src/OPERATORS/op-sm-s.cc  2007-01-02 18:20:55.722204683 +0100
***************
*** 76,88 ****
  {
    CAST_BINOP_ARGS (const octave_sparse_matrix&, const octave_scalar&);
  
!   MatrixType typ = v1.matrix_type ();
!   SparseMatrix m1 = v1.sparse_matrix_value ();
!   Matrix m2 = Matrix (1, 1, v2.scalar_value ());
!   Matrix ret = xleftdiv (m1, m2, typ);
!   v1.matrix_type (typ);
  
!   return ret;
  }
  
  DEFBINOP_FN (lt, sparse_matrix, scalar, mx_el_lt)
--- 76,99 ----
  {
    CAST_BINOP_ARGS (const octave_sparse_matrix&, const octave_scalar&);
  
!   if (v1.rows() == 1 && v1.columns() == 1)
!     {
!       double d = v1.scalar_value ();
! 
!       if (d == 0.0)
!       gripe_divide_by_zero ();
  
!       return octave_value (v2.scalar_value () / d);
!     }
!   else
!     {
!       MatrixType typ = v1.matrix_type ();
!       SparseMatrix m1 = v1.sparse_matrix_value ();
!       Matrix m2 = Matrix (1, 1, v2.scalar_value ());
!       Matrix ret = xleftdiv (m1, m2, typ);
!       v1.matrix_type (typ);
!       return ret;
!     }
  }
  
  DEFBINOP_FN (lt, sparse_matrix, scalar, mx_el_lt)
*** ./src/OPERATORS/op-sm-scm.cc.orig17 2007-01-02 18:23:10.734362560 +0100
--- ./src/OPERATORS/op-sm-scm.cc        2007-01-02 18:22:57.177050604 +0100
***************
*** 47,58 ****
  DEFBINOP (div, sparse_matrix, sparse_complex_matrix)
  {
    CAST_BINOP_ARGS (const octave_sparse_matrix&, const 
octave_sparse_complex_matrix&);
!   MatrixType typ = v2.matrix_type ();
!   SparseComplexMatrix ret = xdiv (v1.sparse_matrix_value (), 
                                  v2.sparse_complex_matrix_value (), typ);
    
!   v2.matrix_type (typ);
!   return ret;
  }
  
  DEFBINOPX (pow, sparse_matrix, sparse_complex_matrix)
--- 47,71 ----
  DEFBINOP (div, sparse_matrix, sparse_complex_matrix)
  {
    CAST_BINOP_ARGS (const octave_sparse_matrix&, const 
octave_sparse_complex_matrix&);
! 
!   if (v2.rows() == 1 && v2.columns() == 1)
!     {
!       Complex d = v2.complex_value ();
! 
!       if (d == 0.0)
!       gripe_divide_by_zero ();
! 
!       return octave_value (v1.sparse_matrix_value () / d);
!     }
!   else
!     {
!       MatrixType typ = v2.matrix_type ();
!       SparseComplexMatrix ret = xdiv (v1.sparse_matrix_value (), 
                                  v2.sparse_complex_matrix_value (), typ);
    
!       v2.matrix_type (typ);
!       return ret;
!     }
  }
  
  DEFBINOPX (pow, sparse_matrix, sparse_complex_matrix)
***************
*** 64,76 ****
  DEFBINOP (ldiv, sparse_matrix, sparse_complex_matrix)
  {
    CAST_BINOP_ARGS (const octave_sparse_matrix&, const 
octave_sparse_complex_matrix&);
-   MatrixType typ = v1.matrix_type ();
- 
-   SparseComplexMatrix ret = xleftdiv (v1.sparse_matrix_value (), 
-                                     v2.sparse_complex_matrix_value (), typ);
  
!   v1.matrix_type (typ);
!   return ret;
  }
  
  DEFBINOP_FN (lt, sparse_matrix, sparse_complex_matrix, mx_el_lt)
--- 77,103 ----
  DEFBINOP (ldiv, sparse_matrix, sparse_complex_matrix)
  {
    CAST_BINOP_ARGS (const octave_sparse_matrix&, const 
octave_sparse_complex_matrix&);
  
!   if (v1.rows() == 1 && v1.columns() == 1)
!     {
!       double d = v1.scalar_value ();
! 
!       if (d == 0.0)
!       gripe_divide_by_zero ();
! 
!       return octave_value (v2.sparse_complex_matrix_value () / d);
!     }
!   else
!     {
!       MatrixType typ = v1.matrix_type ();
! 
!       SparseComplexMatrix ret = 
!       xleftdiv (v1.sparse_matrix_value (), 
!                 v2.sparse_complex_matrix_value (), typ);
! 
!       v1.matrix_type (typ);
!       return ret;
!     }
  }
  
  DEFBINOP_FN (lt, sparse_matrix, sparse_complex_matrix, mx_el_lt)
*** ./src/OPERATORS/op-s-scm.cc.orig17  2007-01-02 18:40:01.142322030 +0100
--- ./src/OPERATORS/op-s-scm.cc 2007-01-02 18:39:49.859888273 +0100
***************
*** 50,62 ****
  {
    CAST_BINOP_ARGS (const octave_scalar&, const octave_sparse_complex_matrix&);
  
!   MatrixType typ = v2.matrix_type ();
!   Matrix m1 = Matrix (1, 1, v1.scalar_value ());
!   SparseComplexMatrix m2 = v2.sparse_complex_matrix_value ();
!   ComplexMatrix ret = xdiv (m1, m2, typ);
!   v2.matrix_type (typ);
  
!   return ret;
  }
  
  DEFBINOP (pow, scalar, sparse_complex_matrix)
--- 50,73 ----
  {
    CAST_BINOP_ARGS (const octave_scalar&, const octave_sparse_complex_matrix&);
  
!   if (v2.rows() == 1 && v2.columns() == 1)
!     {
!       Complex d = v2.complex_value ();
! 
!       if (d == 0.0)
!       gripe_divide_by_zero ();
  
!       return octave_value (v1.scalar_value () / d);
!     }
!   else
!     {
!       MatrixType typ = v2.matrix_type ();
!       Matrix m1 = Matrix (1, 1, v1.scalar_value ());
!       SparseComplexMatrix m2 = v2.sparse_complex_matrix_value ();
!       ComplexMatrix ret = xdiv (m1, m2, typ);
!       v2.matrix_type (typ);
!       return ret;
!     }
  }
  
  DEFBINOP (pow, scalar, sparse_complex_matrix)
*** ./src/OPERATORS/op-s-sm.cc.orig17   2007-01-02 18:40:45.452095048 +0100
--- ./src/OPERATORS/op-s-sm.cc  2007-01-02 18:40:36.762532172 +0100
***************
*** 46,58 ****
  {
    CAST_BINOP_ARGS (const octave_scalar&, const octave_sparse_matrix&);
  
!   MatrixType typ = v2.matrix_type ();
!   Matrix m1 = Matrix (1, 1, v1.double_value ());
!   SparseMatrix m2 = v2.sparse_matrix_value ();
!   Matrix ret = xdiv (m1, m2, typ);
!   v2.matrix_type (typ);
  
!   return ret;
  }
  
  DEFBINOP (pow, scalar, sparse_matrix)
--- 46,69 ----
  {
    CAST_BINOP_ARGS (const octave_scalar&, const octave_sparse_matrix&);
  
!   if (v2.rows() == 1 && v2.columns() == 1)
!     {
!       double d = v2.scalar_value ();
! 
!       if (d == 0.0)
!       gripe_divide_by_zero ();
  
!       return octave_value (v1.scalar_value () / d);
!     }
!   else
!     {
!       MatrixType typ = v2.matrix_type ();
!       Matrix m1 = Matrix (1, 1, v1.double_value ());
!       SparseMatrix m2 = v2.sparse_matrix_value ();
!       Matrix ret = xdiv (m1, m2, typ);
!       v2.matrix_type (typ);
!       return ret;
!     }
  }
  
  DEFBINOP (pow, scalar, sparse_matrix)
*** ./src/OPERATORS/op-cs-scm.cc.orig17 2007-01-02 17:57:20.685564503 +0100
--- ./src/OPERATORS/op-cs-scm.cc        2007-01-02 17:57:06.586281715 +0100
***************
*** 47,59 ****
  {
    CAST_BINOP_ARGS (const octave_complex&, const 
octave_sparse_complex_matrix&);
  
!   MatrixType typ = v2.matrix_type ();
!   ComplexMatrix m1 = ComplexMatrix (1, 1, v1.complex_value ());
!   SparseComplexMatrix m2 = v2.sparse_complex_matrix_value ();
!   ComplexMatrix ret = xdiv (m1, m2, typ);
!   v2.matrix_type (typ);
  
!   return ret;
  }
  
  DEFBINOP (pow, complex, sparse_complex_matrix)
--- 47,70 ----
  {
    CAST_BINOP_ARGS (const octave_complex&, const 
octave_sparse_complex_matrix&);
  
!   if (v2.rows() == 1 && v2.columns() == 1)
!     {
!       Complex d = v2.complex_value ();
! 
!       if (d == 0.0)
!       gripe_divide_by_zero ();
  
!       return octave_value (v1.complex_value () / d);
!     }
!   else
!     {
!       MatrixType typ = v2.matrix_type ();
!       ComplexMatrix m1 = ComplexMatrix (1, 1, v1.complex_value ());
!       SparseComplexMatrix m2 = v2.sparse_complex_matrix_value ();
!       ComplexMatrix ret = xdiv (m1, m2, typ);
!       v2.matrix_type (typ);
!       return ret;
!     }
  }
  
  DEFBINOP (pow, complex, sparse_complex_matrix)
*** ./src/OPERATORS/op-cs-sm.cc.orig17  2007-01-02 17:58:05.269295136 +0100
--- ./src/OPERATORS/op-cs-sm.cc 2007-01-02 18:06:39.446977560 +0100
***************
*** 49,61 ****
  {
    CAST_BINOP_ARGS (const octave_complex&, const octave_sparse_matrix&);
  
!   MatrixType typ = v2.matrix_type ();
!   ComplexMatrix m1 = ComplexMatrix (1, 1, v1.complex_value ());
!   SparseMatrix m2 = v2.sparse_matrix_value ();
!   ComplexMatrix ret = xdiv (m1, m2, typ);
!   v2.matrix_type (typ);
  
!   return ret;
  }
  
  DEFBINOP (pow, complex, sparse_matrix)
--- 49,72 ----
  {
    CAST_BINOP_ARGS (const octave_complex&, const octave_sparse_matrix&);
  
!   if (v2.rows() == 1 && v2.columns() == 1)
!     {
!       double d = v2.scalar_value ();
! 
!       if (d == 0.0)
!       gripe_divide_by_zero ();
  
!       return octave_value (v1.complex_value () / d);
!     }
!   else
!     {
!       MatrixType typ = v2.matrix_type ();
!       ComplexMatrix m1 = ComplexMatrix (1, 1, v1.complex_value ());
!       SparseMatrix m2 = v2.sparse_matrix_value ();
!       ComplexMatrix ret = xdiv (m1, m2, typ);
!       v2.matrix_type (typ);
!       return ret;
!     }
  }
  
  DEFBINOP (pow, complex, sparse_matrix)
*** ./src/OPERATORS/op-cm-scm.cc.orig17 2007-01-02 17:48:56.507045532 +0100
--- ./src/OPERATORS/op-cm-scm.cc        2007-01-02 17:49:02.809731785 +0100
***************
*** 40,47 ****
  
  // complex matrix by sparse complex matrix ops.
  
! DEFBINOP_OP (add, complex_matrix, sparse_complex_matrix,+)
! DEFBINOP_OP (sub, complex_matrix, sparse_complex_matrix,-)
  
  DEFBINOP_OP (mul, complex_matrix, sparse_complex_matrix, *)
  
--- 40,47 ----
  
  // complex matrix by sparse complex matrix ops.
  
! DEFBINOP_OP (add, complex_matrix, sparse_complex_matrix, +)
! DEFBINOP_OP (sub, complex_matrix, sparse_complex_matrix, -)
  
  DEFBINOP_OP (mul, complex_matrix, sparse_complex_matrix, *)
  
***************
*** 49,62 ****
  {
    CAST_BINOP_ARGS (const octave_complex_matrix&,
                   const octave_sparse_complex_matrix&);
-   
-   MatrixType typ = v2.matrix_type ();
- 
-   ComplexMatrix ret = xdiv (v1.complex_matrix_value (), 
-                           v2.sparse_complex_matrix_value (), typ);
  
!   v2.matrix_type (typ);
!   return ret;
  }
  
  DEFBINOPX (pow, complex_matrix, sparse_complex_matrix)
--- 49,74 ----
  {
    CAST_BINOP_ARGS (const octave_complex_matrix&,
                   const octave_sparse_complex_matrix&);
  
!   if (v2.rows() == 1 && v2.columns() == 1)
!     {
!       Complex d = v2.complex_value ();
! 
!       if (d == 0.0)
!       gripe_divide_by_zero ();
! 
!       return octave_value (v1.complex_array_value () / d);
!     }
!   else
!     {
!       MatrixType typ = v2.matrix_type ();
! 
!       ComplexMatrix ret = xdiv (v1.complex_matrix_value (), 
!                               v2.sparse_complex_matrix_value (), typ);
! 
!       v2.matrix_type (typ);
!       return ret;
!     }
  }
  
  DEFBINOPX (pow, complex_matrix, sparse_complex_matrix)
*** ./src/OPERATORS/op-cm-sm.cc.orig17  2007-01-02 17:50:19.846869580 +0100
--- ./src/OPERATORS/op-cm-sm.cc 2007-01-02 17:52:55.288026042 +0100
***************
*** 49,61 ****
  {
    CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_sparse_matrix&);
    
!   MatrixType typ = v2.matrix_type ();
! 
!   ComplexMatrix ret = xdiv (v1.complex_matrix_value (), 
!                           v2.sparse_matrix_value (), typ);
! 
!   v2.matrix_type (typ);
!   return ret;
  }
  
  DEFBINOPX (pow, complex_matrix, sparse_matrix)
--- 49,73 ----
  {
    CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_sparse_matrix&);
    
!   if (v2.rows() == 1 && v2.columns() == 1)
!     {
!       double d = v2.scalar_value ();
! 
!       if (d == 0.0)
!       gripe_divide_by_zero ();
! 
!       return octave_value (v1.complex_array_value () / d);
!     }
!   else
!     {
!       MatrixType typ = v2.matrix_type ();
! 
!       ComplexMatrix ret = xdiv (v1.complex_matrix_value (), 
!                               v2.sparse_matrix_value (), typ);
! 
!       v2.matrix_type (typ);
!       return ret;
!     }
  }
  
  DEFBINOPX (pow, complex_matrix, sparse_matrix)
*** ./src/OPERATORS/op-scm-s.cc.orig17  2007-01-02 18:00:54.794646705 +0100
--- ./src/OPERATORS/op-scm-s.cc 2007-01-02 18:00:19.091470602 +0100
***************
*** 82,94 ****
  {
    CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, const octave_scalar&);
  
!   MatrixType typ = v1.matrix_type ();
!   SparseComplexMatrix m1 = v1.sparse_complex_matrix_value ();
!   Matrix m2 = Matrix (1, 1, v2.scalar_value ());
!   ComplexMatrix ret = xleftdiv (m1, m2, typ);
!   v1.matrix_type (typ);
  
!   return ret;
  }
  
  DEFBINOP_FN (lt, sparse_complex_matrix, scalar, mx_el_lt)
--- 82,105 ----
  {
    CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, const octave_scalar&);
  
!   if (v1.rows() == 1 && v1.columns() == 1)
!     {
!       Complex d = v1.complex_value ();
! 
!       if (d == 0.0)
!       gripe_divide_by_zero ();
  
!       return octave_value (v2.scalar_value () / d);
!     }
!   else
!     {
!       MatrixType typ = v1.matrix_type ();
!       SparseComplexMatrix m1 = v1.sparse_complex_matrix_value ();
!       Matrix m2 = Matrix (1, 1, v2.scalar_value ());
!       ComplexMatrix ret = xleftdiv (m1, m2, typ);
!       v1.matrix_type (typ);
!       return ret;
!     }
  }
  
  DEFBINOP_FN (lt, sparse_complex_matrix, scalar, mx_el_lt)
*** ./src/OPERATORS/op-m-scm.cc.orig17  2007-01-02 17:52:09.412344215 +0100
--- ./src/OPERATORS/op-m-scm.cc 2007-01-02 17:53:11.242219222 +0100
***************
*** 50,62 ****
  {
    CAST_BINOP_ARGS (const octave_matrix&, const octave_sparse_complex_matrix&);
  
!   MatrixType typ = v2.matrix_type ();
! 
!   ComplexMatrix ret = xdiv (v1.matrix_value (), 
!                           v2.sparse_complex_matrix_value (), typ);
! 
!   v2.matrix_type (typ);
!   return ret;
  }
  
  DEFBINOPX (pow, matrix, sparse_complex_matrix)
--- 50,74 ----
  {
    CAST_BINOP_ARGS (const octave_matrix&, const octave_sparse_complex_matrix&);
  
!   if (v2.rows() == 1 && v2.columns() == 1)
!     {
!       Complex d = v2.complex_value ();
! 
!       if (d == 0.0)
!       gripe_divide_by_zero ();
! 
!       return octave_value (v1.array_value () / d);
!     }
!   else
!     {
!       MatrixType typ = v2.matrix_type ();
! 
!       ComplexMatrix ret = xdiv (v1.matrix_value (), 
!                               v2.sparse_complex_matrix_value (), typ);
! 
!       v2.matrix_type (typ);
!       return ret;
!     }
  }
  
  DEFBINOPX (pow, matrix, sparse_complex_matrix)
*** ./src/OPERATORS/op-scm-sm.cc.orig17 2007-01-02 18:09:43.553496627 +0100
--- ./src/OPERATORS/op-scm-sm.cc        2007-01-02 18:09:24.284490195 +0100
***************
*** 47,58 ****
  DEFBINOP (div, sparse_complex_matrix, sparse_matrix)
  {
    CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, const 
octave_sparse_matrix&);
!   MatrixType typ = v2.matrix_type ();
!   SparseComplexMatrix ret = xdiv (v1.sparse_complex_matrix_value (), 
!                                 v2.sparse_matrix_value (), typ);
    
!   v2.matrix_type (typ);
!   return ret;
  }
  
  DEFBINOPX (pow, sparse_complex_matrix, sparse_matrix)
--- 47,71 ----
  DEFBINOP (div, sparse_complex_matrix, sparse_matrix)
  {
    CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, const 
octave_sparse_matrix&);
! 
!   if (v2.rows() == 1 && v2.columns() == 1)
!     {
!       double d = v2.scalar_value ();
! 
!       if (d == 0.0)
!       gripe_divide_by_zero ();
! 
!       return octave_value (v1.sparse_complex_matrix_value () / d);
!     }
!   else
!     {
!       MatrixType typ = v2.matrix_type ();
!       SparseComplexMatrix ret = xdiv (v1.sparse_complex_matrix_value (), 
!                                     v2.sparse_matrix_value (), typ);
    
!       v2.matrix_type (typ);
!       return ret;
!     }
  }
  
  DEFBINOPX (pow, sparse_complex_matrix, sparse_matrix)
***************
*** 64,76 ****
  DEFBINOP (ldiv, sparse_complex_matrix, sparse_matrix)
  {
    CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, const 
octave_sparse_matrix&);
-   MatrixType typ = v1.matrix_type ();
- 
-   SparseComplexMatrix ret = xleftdiv (v1.sparse_complex_matrix_value (), 
-                                     v2.sparse_matrix_value (), typ);
  
!   v1.matrix_type (typ);
!   return ret;
  }
  
  DEFBINOP_FN (lt, sparse_complex_matrix, sparse_matrix, mx_el_lt)
--- 77,102 ----
  DEFBINOP (ldiv, sparse_complex_matrix, sparse_matrix)
  {
    CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, const 
octave_sparse_matrix&);
  
!   if (v1.rows() == 1 && v1.columns() == 1)
!     {
!       Complex d = v1.complex_value ();
! 
!       if (d == 0.0)
!       gripe_divide_by_zero ();
! 
!       return octave_value (v2.sparse_matrix_value () / d);
!     }
!   else
!     {
!       MatrixType typ = v1.matrix_type ();
! 
!       SparseComplexMatrix ret = xleftdiv (v1.sparse_complex_matrix_value (), 
!                                         v2.sparse_matrix_value (), typ);
! 
!       v1.matrix_type (typ);
!       return ret;
!     }
  }
  
  DEFBINOP_FN (lt, sparse_complex_matrix, sparse_matrix, mx_el_lt)
*** ./src/OPERATORS/op-m-sm.cc.orig17   2007-01-02 17:53:52.770117616 +0100
--- ./src/OPERATORS/op-m-sm.cc  2007-01-02 18:07:19.099937893 +0100
***************
*** 48,59 ****
  DEFBINOP (div, matrix, sparse_matrix)
  {
    CAST_BINOP_ARGS (const octave_matrix&, const octave_sparse_matrix&);
-   MatrixType typ = v2.matrix_type ();
  
!   Matrix ret = xdiv (v1.matrix_value (), v2.sparse_matrix_value (), typ);
! 
!   v2.matrix_type (typ);
!   return ret;
  }
  
  DEFBINOPX (pow, matrix, sparse_matrix)
--- 48,72 ----
  DEFBINOP (div, matrix, sparse_matrix)
  {
    CAST_BINOP_ARGS (const octave_matrix&, const octave_sparse_matrix&);
  
!   if (v2.rows() == 1 && v2.columns() == 1)
!     {
!       double d = v2.scalar_value ();
! 
!       if (d == 0.0)
!       gripe_divide_by_zero ();
! 
!       return octave_value (v1.array_value () / d);
!     }
!   else
!     {
!       MatrixType typ = v2.matrix_type ();
! 
!       Matrix ret = xdiv (v1.matrix_value (), v2.sparse_matrix_value (), typ);
! 
!       v2.matrix_type (typ);
!       return ret;
!     }
  }
  
  DEFBINOPX (pow, matrix, sparse_matrix)
*** ./src/ov-cx-sparse.cc.orig17        2007-01-02 19:09:57.017500717 +0100
--- ./src/ov-cx-sparse.cc       2007-01-02 19:09:11.345791003 +0100
***************
*** 126,133 ****
    // FIXME -- maybe this should be a function, valid_as_scalar()
    if (numel () > 0)
      {
!       gripe_implicit_conversion ("Octave:array-as-scalar",
!                                "complex sparse matrix", "real scalar");
  
        retval = std::real (matrix (0, 0));
      }
--- 126,134 ----
    // FIXME -- maybe this should be a function, valid_as_scalar()
    if (numel () > 0)
      {
!       if (numel () > 1)
!       gripe_implicit_conversion ("Octave:array-as-scalar",
!                                  "complex sparse matrix", "real scalar");
  
        retval = std::real (matrix (0, 0));
      }
***************
*** 161,168 ****
    // FIXME -- maybe this should be a function, valid_as_scalar()
    if (numel () > 0)
      {
!       gripe_implicit_conversion ("Octave:array-as-scalar",
!                                "complex sparse matrix", "real scalar");
  
        retval = matrix (0, 0);
      }
--- 162,170 ----
    // FIXME -- maybe this should be a function, valid_as_scalar()
    if (numel () > 0)
      {
!       if (numel () > 1)
!       gripe_implicit_conversion ("Octave:array-as-scalar",
!                                  "complex sparse matrix", "real scalar");
  
        retval = matrix (0, 0);
      }
*** ./src/ov-bool-sparse.cc.orig17      2007-01-02 19:09:34.725619219 +0100
--- ./src/ov-bool-sparse.cc     2007-01-02 19:08:39.149402422 +0100
***************
*** 100,107 ****
  
    if (numel () > 0)
      {
!       gripe_implicit_conversion ("Octave:array-as-scalar",
!                                "bool sparse matrix", "real scalar");
  
        retval = matrix (0, 0);
      }
--- 100,108 ----
  
    if (numel () > 0)
      {
!       if (numel () > 1)
!       gripe_implicit_conversion ("Octave:array-as-scalar",
!                                  "bool sparse matrix", "real scalar");
  
        retval = matrix (0, 0);
      }
***************
*** 120,127 ****
  
    if (rows () > 0 && columns () > 0)
      {
!       gripe_implicit_conversion ("Octave:array-as-scalar",
!                                "bool sparse matrix", "complex scalar");
  
        retval = matrix (0, 0);
      }
--- 121,129 ----
  
    if (rows () > 0 && columns () > 0)
      {
!       if (numel () > 1)
!       gripe_implicit_conversion ("Octave:array-as-scalar",
!                                  "bool sparse matrix", "complex scalar");
  
        retval = matrix (0, 0);
      }
*** ./src/ov-re-sparse.cc.orig17        2007-01-02 19:09:46.839011575 +0100
--- ./src/ov-re-sparse.cc       2007-01-02 19:07:47.444984569 +0100
***************
*** 98,105 ****
  
    if (numel () > 0)
      {
!       gripe_implicit_conversion ("Octave:array-as-scalar",
!                                "real sparse matrix", "real scalar");
  
        retval = matrix (0, 0);
      }
--- 98,106 ----
  
    if (numel () > 0)
      {
!       if (numel () > 1)
!       gripe_implicit_conversion ("Octave:array-as-scalar",
!                                  "real sparse matrix", "real scalar");
  
        retval = matrix (0, 0);
      }
***************
*** 119,126 ****
    // FIXME -- maybe this should be a function, valid_as_scalar()
    if (rows () > 0 && columns () > 0)
      {
!       gripe_implicit_conversion ("Octave:array-as-scalar",
!                                "real sparse matrix", "complex scalar");
  
        retval = matrix (0, 0);
      }
--- 120,128 ----
    // FIXME -- maybe this should be a function, valid_as_scalar()
    if (rows () > 0 && columns () > 0)
      {
!       if (numel () > 1)
!       gripe_implicit_conversion ("Octave:array-as-scalar",
!                                  "real sparse matrix", "complex scalar");
  
        retval = matrix (0, 0);
      }
2007-01-03  David Bateman  <address@hidden>

        * MSparse.cc (SPARSE_A2A2_OP, SPARSE_A2A2_FCN_1,
        SPARSE_A2A2_FCN_1): Modify macros so that scalars stored as
        sparse matrices are special cased.

        * Sparse-op-defs.h: Include mx-ops.h to have access to mixed
        matrix, sparse matrix operations.
        (SPARSE_SMSM_BIN_OP_1, SPARSE_SMSM_BIN_OP_2, SPARSE_SMSM_BIN_OP_3,
        SPARSE_SMSM_CMP_OP, SPARSE_SMSM_BOOL_OP, SPARSE_MSM_BIN_OP_1,
        SPARSE_MSM_BIN_OP_2, SPARSE_MSM_CMP_OP, SPARSE_MSM_BOOL_OP,
        SPARSE_SMM_BIN_OP_1, SPARSE_SMM_BIN_OP_2, SPARSE_SMM_CMP_OP, 
        SPARSE_SMM_BOOL_OP, SPARSE_SPARSE_MUL, SPARSE_FULL_MUL, 
        FULL_SPARSE_MUL): Modify macros so that scalars stored as
        sparse matrices are special cased.

2007-01-03  David Bateman  <address@hidden>

        * (OPERATORS/op-cm-scm.cc, OPERATORS/op-cm-sm.cc, 
        OPERATORS/op-cs-scm.cc, OPERATORS/op-cs-sm.cc, 
        OPERATORS/op-m-scm.cc, OPERATORS/op-m-sm.cc, 
        OPERATORS/op-scm-cm.cc, OPERATORS/op-scm-cs.cc, 
        OPERATORS/op-scm-m.cc, OPERATORS/op-scm-s.cc, 
        OPERATORS/op-scm-scm.cc, OPERATORS/op-scm-sm.cc, 
        OPERATORS/op-sm-cm.cc, OPERATORS/op-sm-cs.cc, 
        OPERATORS/op-sm-m.cc, OPERATORS/op-sm-s.cc, 
        OPERATORS/op-sm-scm.cc, OPERATORS/op-sm-sm.cc, 
        OPERATORS/op-s-scm.cc, OPERATORS/op-s-sm.cc):
        Modify div and ldiv functions so that scalars stored as sparse 
        matrices are special cased.

        * ov-re-sparse.cc (double_value, complex_value): Scalar can be
        stored as a sparse matrix and so don't warn on implicit conversion
        to a scalar.
        * ov-cx-sparse.cc (double_value, complex_value): ditto.
        * ov-bool-sparse.cc (double_value, complex_value): ditto.

reply via email to

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