diff src/OPERATORS/op-scm-sm.cc @ 5322:22994a5730f9

[project @ 2005-04-29 13:04:24 by dbateman]
author dbateman
date Fri, 29 Apr 2005 13:04:25 +0000
parents 4c8a2e4e0717
children 8d7162924bd3
line wrap: on
line diff
--- a/src/OPERATORS/op-scm-sm.cc	Fri Apr 29 05:20:01 2005 +0000
+++ b/src/OPERATORS/op-scm-sm.cc	Fri Apr 29 13:04:25 2005 +0000
@@ -44,7 +44,16 @@
 
 DEFBINOP_OP (mul, sparse_complex_matrix, sparse_matrix, *)
 
-DEFBINOP_FN (div, sparse_complex_matrix, sparse_matrix, xdiv)
+DEFBINOP (div, sparse_complex_matrix, sparse_matrix)
+{
+  CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, octave_sparse_matrix&);
+  SparseType typ = v2.sparse_type ();
+  SparseComplexMatrix ret = xdiv (v1.sparse_complex_matrix_value (), 
+				  v2.sparse_matrix_value (), typ);
+  
+  v2.sparse_type (typ);
+  return ret;
+}
 
 DEFBINOPX (pow, sparse_complex_matrix, sparse_matrix)
 {
@@ -52,7 +61,17 @@
   return octave_value ();
 }
 
-DEFBINOP_FN (ldiv, sparse_complex_matrix, sparse_matrix, xleftdiv)
+DEFBINOP (ldiv, sparse_complex_matrix, sparse_matrix)
+{
+  CAST_BINOP_ARGS (octave_sparse_complex_matrix&, const octave_sparse_matrix&);
+  SparseType typ = v1.sparse_type ();
+
+  SparseComplexMatrix ret = xleftdiv (v1.sparse_complex_matrix_value (), 
+				      v2.sparse_matrix_value (), typ);
+
+  v1.sparse_type (typ);
+  return ret;
+}
 
 DEFBINOP_FN (lt, sparse_complex_matrix, sparse_matrix, mx_el_lt)
 DEFBINOP_FN (le, sparse_complex_matrix, sparse_matrix, mx_el_le)