changeset 19303:65554f5847ac

don't include oct-locbuf.h in header files unnecessarily * oct-stream.h: Don't include oct-locbuf.h. * Sparse-op-decls.h: New file. * module.mk (OPERATORS_INC): Include it in the list. * Sparse-op-defs.h: Move decls to Sparse-op-decls.h. * CSparse.h, boolSparse.h, dSparse.h: Include Sparse-op-decls.h instead of Sparse-op-defs.h. * help.cc, oct-map.cc, oct-stream.cc, quadcc.cc, strfind.cc, sub2ind.cc, utils.cc, xpow.cc, __delaunayn__.cc, __ichol__.cc, __ilu__.cc, __voronoi__.cc, convhulln.cc, ov-base-mat.cc, op-dm-scm.cc, op-dm-template.cc, op-fcm-fs.cc, op-fcs-fm.cc, op-i16-i16.cc, op-i32-i32.cc, op-i64-i64.cc, op-i8-i8.cc, op-pm-template.cc, op-ui16-ui16.cc, op-ui32-ui32.cc, op-ui64-ui64.cc, op-ui8-ui8.cc, pt-mat.cc, CMatrix.cc, CNDArray.cc, CSparse.cc, MatrixType.cc, boolMatrix.cc, boolNDArray.cc, boolSparse.cc, dMatrix.cc, dSparse.cc, fCMatrix.cc, fCNDArray.cc, fMatrix.cc, eigs-base.cc, oct-norm.cc, sparse-base-lu.cc, * mx-op-defs.h: Update list of include files accordingly. * sparse-mk-ops.awk: Update emitted list of include files accordingly.
author John W. Eaton <jwe@octave.org>
date Sun, 19 Oct 2014 08:42:58 -0400
parents e5a1e7951908
children efccb2a65b9a
files libinterp/corefcn/help.cc libinterp/corefcn/oct-map.cc libinterp/corefcn/oct-stream.cc libinterp/corefcn/oct-stream.h libinterp/corefcn/quadcc.cc libinterp/corefcn/strfind.cc libinterp/corefcn/sub2ind.cc libinterp/corefcn/utils.cc libinterp/corefcn/xpow.cc libinterp/dldfcn/__delaunayn__.cc libinterp/dldfcn/__ichol__.cc libinterp/dldfcn/__ilu__.cc libinterp/dldfcn/__voronoi__.cc libinterp/dldfcn/convhulln.cc libinterp/octave-value/ov-base-mat.cc libinterp/operators/op-dm-scm.cc libinterp/operators/op-dm-template.cc libinterp/operators/op-fcm-fs.cc libinterp/operators/op-fcs-fm.cc libinterp/operators/op-i16-i16.cc libinterp/operators/op-i32-i32.cc libinterp/operators/op-i64-i64.cc libinterp/operators/op-i8-i8.cc libinterp/operators/op-pm-template.cc libinterp/operators/op-ui16-ui16.cc libinterp/operators/op-ui32-ui32.cc libinterp/operators/op-ui64-ui64.cc libinterp/operators/op-ui8-ui8.cc libinterp/parse-tree/pt-mat.cc liboctave/array/CMatrix.cc liboctave/array/CNDArray.cc liboctave/array/CSparse.cc liboctave/array/CSparse.h liboctave/array/MatrixType.cc liboctave/array/boolMatrix.cc liboctave/array/boolNDArray.cc liboctave/array/boolSparse.cc liboctave/array/boolSparse.h liboctave/array/dMatrix.cc liboctave/array/dSparse.cc liboctave/array/dSparse.h liboctave/array/fCMatrix.cc liboctave/array/fCNDArray.cc liboctave/array/fMatrix.cc liboctave/numeric/eigs-base.cc liboctave/numeric/oct-norm.cc liboctave/numeric/sparse-base-lu.cc liboctave/operators/Sparse-op-decls.h liboctave/operators/Sparse-op-defs.h liboctave/operators/module.mk liboctave/operators/mx-op-defs.h liboctave/operators/sparse-mk-ops.awk
diffstat 52 files changed, 380 insertions(+), 176 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/help.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/corefcn/help.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -40,6 +40,7 @@
 #include "file-ops.h"
 #include "file-stat.h"
 #include "oct-env.h"
+#include "oct-locbuf.h"
 #include "str-vec.h"
 
 #include <defaults.h>
--- a/libinterp/corefcn/oct-map.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/corefcn/oct-map.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -25,7 +25,9 @@
 #include <config.h>
 #endif
 
+#include "Array-util.h"
 #include "error.h"
+#include "oct-locbuf.h"
 #include "str-vec.h"
 
 #include "oct-map.h"
--- a/libinterp/corefcn/oct-stream.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/corefcn/oct-stream.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -34,12 +34,12 @@
 #include <sstream>
 #include <string>
 
-#include <Array.h>
-
+#include "Array.h"
 #include "byte-swap.h"
 #include "lo-ieee.h"
 #include "lo-mappers.h"
 #include "lo-utils.h"
+#include "oct-locbuf.h"
 #include "quit.h"
 #include "singleton-cleanup.h"
 #include "str-vec.h"
--- a/libinterp/corefcn/oct-stream.h	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/corefcn/oct-stream.h	Sun Oct 19 08:42:58 2014 -0400
@@ -38,7 +38,6 @@
 #include "data-conv.h"
 #include "lo-utils.h"
 #include "mach-info.h"
-#include "oct-locbuf.h"
 #include "oct-refcount.h"
 
 class
--- a/libinterp/corefcn/quadcc.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/corefcn/quadcc.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -25,14 +25,14 @@
 #endif
 
 #include "lo-ieee.h"
-#include "parse.h"
-#include "variables.h"
+#include "oct-locbuf.h"
 
 #include "defun.h"
 #include "error.h"
 #include "oct-obj.h"
+#include "parse.h"
 #include "utils.h"
-
+#include "variables.h"
 
 /* Extended debugging */
 #define DEBUG_QUADCC 0
--- a/libinterp/corefcn/strfind.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/corefcn/strfind.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -30,6 +30,8 @@
 #include <limits>
 #include <string>
 
+#include "oct-locbuf.h"
+
 #include "Cell.h"
 #include "ov.h"
 #include "defun.h"
--- a/libinterp/corefcn/sub2ind.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/corefcn/sub2ind.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -24,6 +24,8 @@
 #include <config.h>
 #endif
 
+#include "Array-util.h"
+#include "oct-locbuf.h"
 #include "quit.h"
 
 #include "defun.h"
--- a/libinterp/corefcn/utils.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/corefcn/utils.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -38,8 +38,6 @@
 
 #include "vasnprintf.h"
 
-#include "quit.h"
-
 #include "dir-ops.h"
 #include "file-ops.h"
 #include "file-stat.h"
@@ -47,7 +45,9 @@
 #include "lo-utils.h"
 #include "oct-cmplx.h"
 #include "oct-env.h"
+#include "oct-locbuf.h"
 #include "pathsearch.h"
+#include "quit.h"
 #include "str-vec.h"
 
 #include "Cell.h"
--- a/libinterp/corefcn/xpow.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/corefcn/xpow.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -33,6 +33,7 @@
 #include "CColVector.h"
 #include "CDiagMatrix.h"
 #include "fCDiagMatrix.h"
+#include "fCMatrix.h"
 #include "CMatrix.h"
 #include "EIG.h"
 #include "fEIG.h"
@@ -41,6 +42,7 @@
 #include "dMatrix.h"
 #include "PermMatrix.h"
 #include "mx-cm-cdm.h"
+#include "mx-fcm-fcdm.h"
 #include "oct-cmplx.h"
 #include "Range.h"
 #include "quit.h"
--- a/libinterp/dldfcn/__delaunayn__.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/dldfcn/__delaunayn__.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -45,6 +45,8 @@
 #include <iostream>
 #include <string>
 
+#include "oct-locbuf.h"
+
 #include "Cell.h"
 #include "defun-dld.h"
 #include "error.h"
--- a/libinterp/dldfcn/__ichol__.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/dldfcn/__ichol__.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -25,6 +25,8 @@
 #include <config.h>
 #endif
 
+#include "oct-locbuf.h"
+
 #include "defun-dld.h"
 #include "parse.h"
 
--- a/libinterp/dldfcn/__ilu__.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/dldfcn/__ilu__.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -25,6 +25,8 @@
 #include <config.h>
 #endif
 
+#include "oct-locbuf.h"
+
 #include "defun-dld.h"
 #include "parse.h"
 
--- a/libinterp/dldfcn/__voronoi__.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/dldfcn/__voronoi__.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -38,6 +38,7 @@
 
 #include <list>
 
+#include "oct-locbuf.h"
 #include "lo-ieee.h"
 
 #include "Cell.h"
--- a/libinterp/dldfcn/convhulln.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/dldfcn/convhulln.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -33,7 +33,7 @@
 #include <config.h>
 #endif
 
-#include <sstream>
+#include "oct-locbuf.h"
 
 #include "Cell.h"
 #include "defun-dld.h"
--- a/libinterp/octave-value/ov-base-mat.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/octave-value/ov-base-mat.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -27,6 +27,8 @@
 
 #include <iostream>
 
+#include "Array-util.h"
+
 #include "Cell.h"
 #include "oct-obj.h"
 #include "oct-map.h"
--- a/libinterp/operators/op-dm-scm.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/operators/op-dm-scm.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -24,6 +24,15 @@
 #include <config.h>
 #endif
 
+#include "mx-cm-s.h"
+#include "mx-s-cm.h"
+
+#include "mx-dm-cs.h"
+#include "mx-cs-dm.h"
+
+#include "mx-m-cs.h"
+#include "mx-cs-m.h"
+
 #include "gripes.h"
 #include "oct-obj.h"
 #include "ov.h"
--- a/libinterp/operators/op-dm-template.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/operators/op-dm-template.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -24,6 +24,10 @@
 #include <config.h>
 #endif
 
+// FIXME: it might be nice to only include the declarations of the
+// operators that are actually needed instead of including all of them.
+#include "mx-ops.h"
+
 #include "ops.h"
 #include "xdiv.h"
 #include LINCLUDE
--- a/libinterp/operators/op-fcm-fs.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/operators/op-fcm-fs.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -24,8 +24,7 @@
 #include <config.h>
 #endif
 
-#include "mx-cm-s.h"
-#include "mx-cnda-s.h"
+#include "mx-fcnda-fs.h"
 
 #include "gripes.h"
 #include "oct-obj.h"
--- a/libinterp/operators/op-fcs-fm.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/operators/op-fcs-fm.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -24,10 +24,8 @@
 #include <config.h>
 #endif
 
-#include "mx-cs-nda.h"
-#include "mx-nda-cs.h"
-#include "mx-cs-nda.h"
-#include "mx-nda-cs.h"
+#include "mx-fcs-fnda.h"
+#include "mx-fnda-fcs.h"
 
 #include "gripes.h"
 #include "oct-obj.h"
--- a/libinterp/operators/op-i16-i16.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/operators/op-i16-i16.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -57,6 +57,15 @@
 #include "mx-i16-nda.h"
 #include "mx-nda-i16.h"
 
+#include "mx-i16nda-fs.h"
+#include "mx-fs-i16nda.h"
+
+#include "mx-i16nda-fnda.h"
+#include "mx-fnda-i16nda.h"
+
+#include "mx-i16-fnda.h"
+#include "mx-fnda-i16.h"
+
 #include "gripes.h"
 #include "oct-obj.h"
 #include "ov.h"
--- a/libinterp/operators/op-i32-i32.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/operators/op-i32-i32.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -57,6 +57,15 @@
 #include "mx-i32-nda.h"
 #include "mx-nda-i32.h"
 
+#include "mx-i32nda-fs.h"
+#include "mx-fs-i32nda.h"
+
+#include "mx-i32nda-fnda.h"
+#include "mx-fnda-i32nda.h"
+
+#include "mx-i32-fnda.h"
+#include "mx-fnda-i32.h"
+
 #include "gripes.h"
 #include "oct-obj.h"
 #include "ov.h"
--- a/libinterp/operators/op-i64-i64.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/operators/op-i64-i64.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -57,6 +57,15 @@
 #include "mx-i64-nda.h"
 #include "mx-nda-i64.h"
 
+#include "mx-i64nda-fs.h"
+#include "mx-fs-i64nda.h"
+
+#include "mx-i64nda-fnda.h"
+#include "mx-fnda-i64nda.h"
+
+#include "mx-i64-fnda.h"
+#include "mx-fnda-i64.h"
+
 #include "gripes.h"
 #include "oct-obj.h"
 #include "ov.h"
--- a/libinterp/operators/op-i8-i8.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/operators/op-i8-i8.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -57,6 +57,15 @@
 #include "mx-i8-nda.h"
 #include "mx-nda-i8.h"
 
+#include "mx-i8nda-fs.h"
+#include "mx-fs-i8nda.h"
+
+#include "mx-i8nda-fnda.h"
+#include "mx-fnda-i8nda.h"
+
+#include "mx-i8-fnda.h"
+#include "mx-fnda-i8.h"
+
 #include "gripes.h"
 #include "oct-obj.h"
 #include "ov.h"
--- a/libinterp/operators/op-pm-template.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/operators/op-pm-template.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -24,6 +24,10 @@
 #include <config.h>
 #endif
 
+// FIXME: it might be nice to only include the declarations of the
+// operators that are actually needed instead of including all of them.
+#include "mx-ops.h"
+
 #include "ov-perm.h"
 #include MINCLUDE
 #include "ops.h"
--- a/libinterp/operators/op-ui16-ui16.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/operators/op-ui16-ui16.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -57,6 +57,15 @@
 #include "mx-ui16-nda.h"
 #include "mx-nda-ui16.h"
 
+#include "mx-ui16nda-fs.h"
+#include "mx-fs-ui16nda.h"
+
+#include "mx-ui16nda-fnda.h"
+#include "mx-fnda-ui16nda.h"
+
+#include "mx-ui16-fnda.h"
+#include "mx-fnda-ui16.h"
+
 #include "gripes.h"
 #include "oct-obj.h"
 #include "ov.h"
--- a/libinterp/operators/op-ui32-ui32.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/operators/op-ui32-ui32.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -57,6 +57,15 @@
 #include "mx-ui32-nda.h"
 #include "mx-nda-ui32.h"
 
+#include "mx-ui32nda-fs.h"
+#include "mx-fs-ui32nda.h"
+
+#include "mx-ui32nda-fnda.h"
+#include "mx-fnda-ui32nda.h"
+
+#include "mx-ui32-fnda.h"
+#include "mx-fnda-ui32.h"
+
 #include "gripes.h"
 #include "oct-obj.h"
 #include "ov.h"
--- a/libinterp/operators/op-ui64-ui64.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/operators/op-ui64-ui64.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -57,6 +57,15 @@
 #include "mx-ui64-nda.h"
 #include "mx-nda-ui64.h"
 
+#include "mx-ui64nda-fs.h"
+#include "mx-fs-ui64nda.h"
+
+#include "mx-ui64nda-fnda.h"
+#include "mx-fnda-ui64nda.h"
+
+#include "mx-ui64-fnda.h"
+#include "mx-fnda-ui64.h"
+
 #include "gripes.h"
 #include "oct-obj.h"
 #include "ov.h"
--- a/libinterp/operators/op-ui8-ui8.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/operators/op-ui8-ui8.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -57,6 +57,15 @@
 #include "mx-ui8-nda.h"
 #include "mx-nda-ui8.h"
 
+#include "mx-ui8nda-fs.h"
+#include "mx-fs-ui8nda.h"
+
+#include "mx-ui8nda-fnda.h"
+#include "mx-fnda-ui8nda.h"
+
+#include "mx-ui8-fnda.h"
+#include "mx-fnda-ui8.h"
+
 #include "gripes.h"
 #include "oct-obj.h"
 #include "ov.h"
--- a/libinterp/parse-tree/pt-mat.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/libinterp/parse-tree/pt-mat.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -26,6 +26,7 @@
 
 #include <iostream>
 
+#include "oct-locbuf.h"
 #include "quit.h"
 
 #include "data.h"
--- a/liboctave/array/CMatrix.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/liboctave/array/CMatrix.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -36,8 +36,14 @@
 #include <sys/types.h>
 
 #include "Array-util.h"
+#include "boolMatrix.h"
+#include "chMatrix.h"
+#include "dMatrix.h"
 #include "CMatrix.h"
-#include "CmplxAEPBAL.h"
+#include "CRowVector.h"
+#include "dRowVector.h"
+#include "CDiagMatrix.h"
+#include "dDiagMatrix.h"
 #include "CmplxCHOL.h"
 #include "CmplxSCHUR.h"
 #include "CmplxSVD.h"
@@ -48,7 +54,6 @@
 #include "lo-ieee.h"
 #include "lo-mappers.h"
 #include "lo-utils.h"
-#include "mx-base.h"
 #include "mx-cm-dm.h"
 #include "mx-cm-s.h"
 #include "mx-dm-cm.h"
--- a/liboctave/array/CNDArray.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/liboctave/array/CNDArray.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -39,6 +39,7 @@
 #include "MArray-defs.h"
 #include "mx-base.h"
 #include "mx-op-defs.h"
+#include "mx-cnda-s.h"
 #include "oct-fftw.h"
 #include "oct-locbuf.h"
 
--- a/liboctave/array/CSparse.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/liboctave/array/CSparse.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -36,6 +36,12 @@
 #include "lo-mappers.h"
 #include "f77-fcn.h"
 #include "dRowVector.h"
+#include "mx-m-cs.h"
+#include "mx-cs-m.h"
+#include "mx-cm-s.h"
+#include "mx-fcm-fs.h"
+#include "mx-s-cm.h"
+#include "mx-fs-fcm.h"
 #include "oct-locbuf.h"
 
 #include "dDiagMatrix.h"
@@ -51,10 +57,11 @@
 #include "SparseCmplxCHOL.h"
 #include "SparseCmplxQR.h"
 
+#include "Sparse-op-defs.h"
+
 #include "Sparse-diag-op-defs.h"
 
 #include "Sparse-perm-op-defs.h"
-#include "mx-inlines.cc"
 
 // Define whether to use a basic QR solver or one that uses a Dulmange
 // Mendelsohn factorization to seperate the problem into under-determined,
--- a/liboctave/array/CSparse.h	Mon Oct 20 21:54:59 2014 -0700
+++ b/liboctave/array/CSparse.h	Sun Oct 19 08:42:58 2014 -0400
@@ -34,7 +34,9 @@
 #include "DET.h"
 #include "MSparse.h"
 #include "MSparse-defs.h"
-#include "Sparse-op-defs.h"
+
+#include "Sparse-op-decls.h"
+
 #include "MatrixType.h"
 
 class PermMatrix;
--- a/liboctave/array/MatrixType.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/liboctave/array/MatrixType.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -30,7 +30,9 @@
 
 #include "MatrixType.h"
 #include "dMatrix.h"
+#include "fMatrix.h"
 #include "CMatrix.h"
+#include "fCMatrix.h"
 #include "dSparse.h"
 #include "CSparse.h"
 #include "oct-spparms.h"
--- a/liboctave/array/boolMatrix.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/liboctave/array/boolMatrix.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -29,9 +29,9 @@
 #include <iostream>
 
 #include "Array-util.h"
+#include "boolMatrix.h"
 #include "lo-error.h"
 #include "str-vec.h"
-#include "mx-base.h"
 #include "mx-inlines.cc"
 #include "mx-op-defs.h"
 
--- a/liboctave/array/boolNDArray.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/liboctave/array/boolNDArray.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -27,6 +27,7 @@
 #endif
 
 #include "Array-util.h"
+#include "boolNDArray.h"
 #include "CNDArray.h"
 #include "mx-base.h"
 #include "lo-ieee.h"
--- a/liboctave/array/boolSparse.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/liboctave/array/boolSparse.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -38,6 +38,8 @@
 #include "oct-mem.h"
 #include "oct-locbuf.h"
 
+#include "Sparse-op-defs.h"
+
 // SparseBoolMatrix class.
 
 bool
--- a/liboctave/array/boolSparse.h	Mon Oct 20 21:54:59 2014 -0700
+++ b/liboctave/array/boolSparse.h	Sun Oct 19 08:42:58 2014 -0400
@@ -26,7 +26,12 @@
 
 #include "Sparse.h"
 #include "MSparse-defs.h"
-#include "Sparse-op-defs.h"
+
+#include "boolMatrix.h"
+#include "boolNDArray.h"
+#include "PermMatrix.h"
+
+#include "Sparse-op-decls.h"
 
 class SparseMatrix;
 
--- a/liboctave/array/dMatrix.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/liboctave/array/dMatrix.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -34,8 +34,15 @@
 
 #include "Array-util.h"
 #include "byte-swap.h"
+#include "boolMatrix.h"
+#include "chMatrix.h"
 #include "dMatrix.h"
-#include "dbleAEPBAL.h"
+#include "dDiagMatrix.h"
+#include "CMatrix.h"
+#include "dColVector.h"
+#include "dRowVector.h"
+#include "CColVector.h"
+#include "PermMatrix.h"
 #include "DET.h"
 #include "dbleSCHUR.h"
 #include "dbleSVD.h"
@@ -47,7 +54,6 @@
 #include "lo-ieee.h"
 #include "lo-mappers.h"
 #include "lo-utils.h"
-#include "mx-base.h"
 #include "mx-m-dm.h"
 #include "mx-dm-m.h"
 #include "mx-inlines.cc"
--- a/liboctave/array/dSparse.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/liboctave/array/dSparse.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -52,6 +52,8 @@
 #include "SparsedbleCHOL.h"
 #include "SparseQR.h"
 
+#include "Sparse-op-defs.h"
+
 #include "Sparse-diag-op-defs.h"
 
 #include "Sparse-perm-op-defs.h"
--- a/liboctave/array/dSparse.h	Mon Oct 20 21:54:59 2014 -0700
+++ b/liboctave/array/dSparse.h	Sun Oct 19 08:42:58 2014 -0400
@@ -33,7 +33,9 @@
 #include "DET.h"
 #include "MSparse.h"
 #include "MSparse-defs.h"
-#include "Sparse-op-defs.h"
+
+#include "Sparse-op-decls.h"
+
 #include "MatrixType.h"
 
 class PermMatrix;
--- a/liboctave/array/fCMatrix.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/liboctave/array/fCMatrix.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -38,7 +38,12 @@
 #include "Array-util.h"
 #include "DET.h"
 #include "f77-fcn.h"
+#include "boolMatrix.h"
+#include "chMatrix.h"
 #include "fCMatrix.h"
+#include "fCDiagMatrix.h"
+#include "fCColVector.h"
+#include "fCRowVector.h"
 #include "fCmplxCHOL.h"
 #include "fCmplxSCHUR.h"
 #include "fCmplxSVD.h"
@@ -47,7 +52,6 @@
 #include "lo-ieee.h"
 #include "lo-mappers.h"
 #include "lo-utils.h"
-#include "mx-base.h"
 #include "mx-fcm-fdm.h"
 #include "mx-fcm-fs.h"
 #include "mx-fdm-fcm.h"
--- a/liboctave/array/fCNDArray.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/liboctave/array/fCNDArray.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -39,6 +39,7 @@
 #include "MArray-defs.h"
 #include "mx-base.h"
 #include "mx-op-defs.h"
+#include "mx-fcnda-fs.h"
 #include "oct-fftw.h"
 #include "oct-locbuf.h"
 
--- a/liboctave/array/fMatrix.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/liboctave/array/fMatrix.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -33,6 +33,15 @@
 #include <vector>
 
 #include "Array-util.h"
+#include "boolMatrix.h"
+#include "chMatrix.h"
+#include "fMatrix.h"
+#include "fDiagMatrix.h"
+#include "fCMatrix.h"
+#include "fColVector.h"
+#include "fRowVector.h"
+#include "fCColVector.h"
+#include "PermMatrix.h"
 #include "DET.h"
 #include "byte-swap.h"
 #include "f77-fcn.h"
@@ -45,7 +54,6 @@
 #include "lo-ieee.h"
 #include "lo-mappers.h"
 #include "lo-utils.h"
-#include "mx-base.h"
 #include "mx-fdm-fm.h"
 #include "mx-fm-fdm.h"
 #include "mx-inlines.cc"
--- a/liboctave/numeric/eigs-base.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/liboctave/numeric/eigs-base.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -30,6 +30,7 @@
 #include <iostream>
 
 #include "f77-fcn.h"
+#include "oct-locbuf.h"
 #include "quit.h"
 #include "SparsedbleLU.h"
 #include "SparseCmplxLU.h"
--- a/liboctave/numeric/oct-norm.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/liboctave/numeric/oct-norm.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -36,6 +36,10 @@
 #include "oct-cmplx.h"
 #include "lo-error.h"
 #include "lo-ieee.h"
+#include "mx-cm-s.h"
+#include "mx-s-cm.h"
+#include "mx-fcm-fs.h"
+#include "mx-fs-fcm.h"
 #include "Array.h"
 #include "Array-util.h"
 #include "CMatrix.h"
--- a/liboctave/numeric/sparse-base-lu.cc	Mon Oct 20 21:54:59 2014 -0700
+++ b/liboctave/numeric/sparse-base-lu.cc	Sun Oct 19 08:42:58 2014 -0400
@@ -27,6 +27,8 @@
 
 #include "sparse-base-lu.h"
 
+#include "PermMatrix.h"
+
 template <class lu_type, class lu_elt_type, class p_type, class p_elt_type>
 lu_type
 sparse_base_lu <lu_type, lu_elt_type, p_type, p_elt_type> :: Y (void) const
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/liboctave/operators/Sparse-op-decls.h	Sun Oct 19 08:42:58 2014 -0400
@@ -0,0 +1,184 @@
+/*
+
+Copyright (C) 2004-2013 David Bateman
+Copyright (C) 1998-2004 Andy Adler
+Copyright (C) 2008 Jaroslav Hajek
+
+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 3 of the License, 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, see
+<http://www.gnu.org/licenses/>.
+
+*/
+
+#if !defined (octave_Sparse_op_decls_h)
+#define octave_Sparse_op_decls_h 1
+
+class SparseBoolMatrix;
+
+#define SPARSE_BIN_OP_DECL(R, OP, X, Y, API) \
+  extern API R OP (const X&, const Y&)
+
+#define SPARSE_CMP_OP_DECL(OP, X, Y, API) \
+  extern API SparseBoolMatrix OP (const X&, const Y&)
+
+#define SPARSE_BOOL_OP_DECL(OP, X, Y, API) \
+  extern API SparseBoolMatrix OP (const X&, const Y&)
+
+// sparse matrix by scalar operations.
+
+#define SPARSE_SMS_BIN_OP_DECLS(R1, R2, M, S, API)  \
+  SPARSE_BIN_OP_DECL (R1, operator +, M, S, API); \
+  SPARSE_BIN_OP_DECL (R1, operator -, M, S, API); \
+  SPARSE_BIN_OP_DECL (R2, operator *, M, S, API); \
+  SPARSE_BIN_OP_DECL (R2, operator /, M, S, API);
+
+#define SPARSE_SMS_CMP_OP_DECLS(M, S, API) \
+  SPARSE_CMP_OP_DECL (mx_el_lt, M, S, API); \
+  SPARSE_CMP_OP_DECL (mx_el_le, M, S, API); \
+  SPARSE_CMP_OP_DECL (mx_el_ge, M, S, API); \
+  SPARSE_CMP_OP_DECL (mx_el_gt, M, S, API); \
+  SPARSE_CMP_OP_DECL (mx_el_eq, M, S, API); \
+  SPARSE_CMP_OP_DECL (mx_el_ne, M, S, API);
+
+#define SPARSE_SMS_EQNE_OP_DECLS(M, S, API) \
+  SPARSE_CMP_OP_DECL (mx_el_eq, M, S, API); \
+  SPARSE_CMP_OP_DECL (mx_el_ne, M, S, API);
+
+#define SPARSE_SMS_BOOL_OP_DECLS(M, S, API) \
+  SPARSE_BOOL_OP_DECL (mx_el_and, M, S, API); \
+  SPARSE_BOOL_OP_DECL (mx_el_or,  M, S, API);
+
+#define SPARSE_SMS_OP_DECLS(R1, R2, M, S, API) \
+  SPARSE_SMS_BIN_OP_DECLS (R1, R2, M, S, API)    \
+  SPARSE_SMS_CMP_OP_DECLS (M, S, API) \
+  SPARSE_SMS_BOOL_OP_DECLS (M, S, API)
+
+// scalar by sparse matrix operations.
+
+#define SPARSE_SSM_BIN_OP_DECLS(R1, R2, S, M, API)    \
+  SPARSE_BIN_OP_DECL (R1, operator +, S, M, API); \
+  SPARSE_BIN_OP_DECL (R1, operator -, S, M, API); \
+  SPARSE_BIN_OP_DECL (R2, operator *, S, M, API); \
+  SPARSE_BIN_OP_DECL (R2, operator /, S, M, API);
+
+#define SPARSE_SSM_CMP_OP_DECLS(S, M, API) \
+  SPARSE_CMP_OP_DECL (mx_el_lt, S, M, API); \
+  SPARSE_CMP_OP_DECL (mx_el_le, S, M, API); \
+  SPARSE_CMP_OP_DECL (mx_el_ge, S, M, API); \
+  SPARSE_CMP_OP_DECL (mx_el_gt, S, M, API); \
+  SPARSE_CMP_OP_DECL (mx_el_eq, S, M, API); \
+  SPARSE_CMP_OP_DECL (mx_el_ne, S, M, API);
+
+#define SPARSE_SSM_EQNE_OP_DECLS(S, M, API) \
+  SPARSE_CMP_OP_DECL (mx_el_eq, S, M, API); \
+  SPARSE_CMP_OP_DECL (mx_el_ne, S, M, API);
+
+#define SPARSE_SSM_BOOL_OP_DECLS(S, M, API) \
+  SPARSE_BOOL_OP_DECL (mx_el_and, S, M, API); \
+  SPARSE_BOOL_OP_DECL (mx_el_or,  S, M, API); \
+
+#define SPARSE_SSM_OP_DECLS(R1, R2, S, M, API) \
+  SPARSE_SSM_BIN_OP_DECLS (R1, R2, S, M, API)    \
+  SPARSE_SSM_CMP_OP_DECLS (S, M, API) \
+  SPARSE_SSM_BOOL_OP_DECLS (S, M, API) \
+
+// sparse matrix by sparse matrix operations.
+
+#define SPARSE_SMSM_BIN_OP_DECLS(R1, R2, M1, M2, API)   \
+  SPARSE_BIN_OP_DECL (R1, operator +, M1, M2, API); \
+  SPARSE_BIN_OP_DECL (R1, operator -, M1, M2, API); \
+  SPARSE_BIN_OP_DECL (R2, product,    M1, M2, API); \
+  SPARSE_BIN_OP_DECL (R2, quotient,   M1, M2, API);
+
+#define SPARSE_SMSM_CMP_OP_DECLS(M1, M2, API) \
+  SPARSE_CMP_OP_DECL (mx_el_lt, M1, M2, API); \
+  SPARSE_CMP_OP_DECL (mx_el_le, M1, M2, API); \
+  SPARSE_CMP_OP_DECL (mx_el_ge, M1, M2, API); \
+  SPARSE_CMP_OP_DECL (mx_el_gt, M1, M2, API); \
+  SPARSE_CMP_OP_DECL (mx_el_eq, M1, M2, API); \
+  SPARSE_CMP_OP_DECL (mx_el_ne, M1, M2, API);
+
+#define SPARSE_SMSM_EQNE_OP_DECLS(M1, M2, API) \
+  SPARSE_CMP_OP_DECL (mx_el_eq, M1, M2, API); \
+  SPARSE_CMP_OP_DECL (mx_el_ne, M1, M2, API);
+
+#define SPARSE_SMSM_BOOL_OP_DECLS(M1, M2, API) \
+  SPARSE_BOOL_OP_DECL (mx_el_and, M1, M2, API); \
+  SPARSE_BOOL_OP_DECL (mx_el_or,  M1, M2, API);
+
+#define SPARSE_SMSM_OP_DECLS(R1, R2, M1, M2, API) \
+  SPARSE_SMSM_BIN_OP_DECLS (R1, R2, M1, M2, API) \
+  SPARSE_SMSM_CMP_OP_DECLS (M1, M2, API) \
+  SPARSE_SMSM_BOOL_OP_DECLS (M1, M2, API)
+
+// matrix by sparse matrix operations.
+
+#define SPARSE_MSM_BIN_OP_DECLS(R1, R2, M1, M2, API)    \
+  SPARSE_BIN_OP_DECL (R1, operator +, M1, M2, API); \
+  SPARSE_BIN_OP_DECL (R1, operator -, M1, M2, API); \
+  SPARSE_BIN_OP_DECL (R2, product,    M1, M2, API); \
+  SPARSE_BIN_OP_DECL (R2, quotient,   M1, M2, API);
+
+#define SPARSE_MSM_CMP_OP_DECLS(M1, M2, API) \
+  SPARSE_CMP_OP_DECL (mx_el_lt, M1, M2, API); \
+  SPARSE_CMP_OP_DECL (mx_el_le, M1, M2, API); \
+  SPARSE_CMP_OP_DECL (mx_el_ge, M1, M2, API); \
+  SPARSE_CMP_OP_DECL (mx_el_gt, M1, M2, API); \
+  SPARSE_CMP_OP_DECL (mx_el_eq, M1, M2, API); \
+  SPARSE_CMP_OP_DECL (mx_el_ne, M1, M2, API);
+
+#define SPARSE_MSM_EQNE_OP_DECLS(M1, M2, API) \
+  SPARSE_CMP_OP_DECL (mx_el_eq, M1, M2, API); \
+  SPARSE_CMP_OP_DECL (mx_el_ne, M1, M2, API);
+
+#define SPARSE_MSM_BOOL_OP_DECLS(M1, M2, API) \
+  SPARSE_BOOL_OP_DECL (mx_el_and, M1, M2, API); \
+  SPARSE_BOOL_OP_DECL (mx_el_or,  M1, M2, API);
+
+#define SPARSE_MSM_OP_DECLS(R1, R2, M1, M2, API) \
+  SPARSE_MSM_BIN_OP_DECLS (R1, R2, M1, M2, API) \
+  SPARSE_MSM_CMP_OP_DECLS (M1, M2, API) \
+  SPARSE_MSM_BOOL_OP_DECLS (M1, M2, API)
+
+// sparse matrix by matrix operations.
+
+#define SPARSE_SMM_BIN_OP_DECLS(R1, R2, M1, M2, API)    \
+  SPARSE_BIN_OP_DECL (R1, operator +, M1, M2, API); \
+  SPARSE_BIN_OP_DECL (R1, operator -, M1, M2, API); \
+  SPARSE_BIN_OP_DECL (R2, product,    M1, M2, API); \
+  SPARSE_BIN_OP_DECL (R2, quotient,   M1, M2, API);
+
+#define SPARSE_SMM_CMP_OP_DECLS(M1, M2, API) \
+  SPARSE_CMP_OP_DECL (mx_el_lt, M1, M2, API); \
+  SPARSE_CMP_OP_DECL (mx_el_le, M1, M2, API); \
+  SPARSE_CMP_OP_DECL (mx_el_ge, M1, M2, API); \
+  SPARSE_CMP_OP_DECL (mx_el_gt, M1, M2, API); \
+  SPARSE_CMP_OP_DECL (mx_el_eq, M1, M2, API); \
+  SPARSE_CMP_OP_DECL (mx_el_ne, M1, M2, API);
+
+#define SPARSE_SMM_EQNE_OP_DECLS(M1, M2, API) \
+  SPARSE_CMP_OP_DECL (mx_el_eq, M1, M2, API); \
+  SPARSE_CMP_OP_DECL (mx_el_ne, M1, M2, API);
+
+#define SPARSE_SMM_BOOL_OP_DECLS(M1, M2, API) \
+  SPARSE_BOOL_OP_DECL (mx_el_and, M1, M2, API); \
+  SPARSE_BOOL_OP_DECL (mx_el_or,  M1, M2, API);
+
+#define SPARSE_SMM_OP_DECLS(R1, R2, M1, M2, API) \
+  SPARSE_SMM_BIN_OP_DECLS (R1, R2, M1, M2, API) \
+  SPARSE_SMM_CMP_OP_DECLS (M1, M2, API) \
+  SPARSE_SMM_BOOL_OP_DECLS (M1, M2, API)
+
+#endif
--- a/liboctave/operators/Sparse-op-defs.h	Mon Oct 20 21:54:59 2014 -0700
+++ b/liboctave/operators/Sparse-op-defs.h	Sun Oct 19 08:42:58 2014 -0400
@@ -26,26 +26,10 @@
 #define octave_Sparse_op_defs_h 1
 
 #include "Array-util.h"
-#include "mx-ops.h"
 #include "oct-locbuf.h"
 #include "mx-inlines.cc"
 
-#define SPARSE_BIN_OP_DECL(R, OP, X, Y, API) \
-  extern API R OP (const X&, const Y&)
-
-#define SPARSE_CMP_OP_DECL(OP, X, Y, API) \
-  extern API SparseBoolMatrix OP (const X&, const Y&)
-
-#define SPARSE_BOOL_OP_DECL(OP, X, Y, API) \
-  extern API SparseBoolMatrix OP (const X&, const Y&)
-
-// matrix by scalar operations.
-
-#define SPARSE_SMS_BIN_OP_DECLS(R1, R2, M, S, API)  \
-  SPARSE_BIN_OP_DECL (R1, operator +, M, S, API); \
-  SPARSE_BIN_OP_DECL (R1, operator -, M, S, API); \
-  SPARSE_BIN_OP_DECL (R2, operator *, M, S, API); \
-  SPARSE_BIN_OP_DECL (R2, operator /, M, S, API);
+// sparse matrix by scalar operations.
 
 #define SPARSE_SMS_BIN_OP_1(R, F, OP, M, S)     \
   R \
@@ -90,18 +74,6 @@
   SPARSE_SMS_BIN_OP_2 (R2, operator *, *, M, S) \
   SPARSE_SMS_BIN_OP_2 (R2, operator /, /, M, S)
 
-#define SPARSE_SMS_CMP_OP_DECLS(M, S, API) \
-  SPARSE_CMP_OP_DECL (mx_el_lt, M, S, API); \
-  SPARSE_CMP_OP_DECL (mx_el_le, M, S, API); \
-  SPARSE_CMP_OP_DECL (mx_el_ge, M, S, API); \
-  SPARSE_CMP_OP_DECL (mx_el_gt, M, S, API); \
-  SPARSE_CMP_OP_DECL (mx_el_eq, M, S, API); \
-  SPARSE_CMP_OP_DECL (mx_el_ne, M, S, API);
-
-#define SPARSE_SMS_EQNE_OP_DECLS(M, S, API) \
-  SPARSE_CMP_OP_DECL (mx_el_eq, M, S, API); \
-  SPARSE_CMP_OP_DECL (mx_el_ne, M, S, API);
-
 #define SPARSE_SMS_CMP_OP(F, OP, M, MZ, MC, S, SZ, SC)  \
   SparseBoolMatrix \
   F (const M& m, const S& s) \
@@ -151,10 +123,6 @@
   SPARSE_SMS_CMP_OP (mx_el_eq, ==, M, MZ,   , S, SZ,   )        \
   SPARSE_SMS_CMP_OP (mx_el_ne, !=, M, MZ,   , S, SZ,   )
 
-#define SPARSE_SMS_BOOL_OP_DECLS(M, S, API) \
-  SPARSE_BOOL_OP_DECL (mx_el_and, M, S, API); \
-  SPARSE_BOOL_OP_DECL (mx_el_or,  M, S, API);
-
 #define SPARSE_SMS_BOOL_OP(F, OP, M, S, LHS_ZERO, RHS_ZERO) \
   SparseBoolMatrix \
   F (const M& m, const S& s) \
@@ -202,18 +170,7 @@
 #define SPARSE_SMS_BOOL_OPS(M, S, ZERO) \
   SPARSE_SMS_BOOL_OPS2(M, S, ZERO, ZERO)
 
-#define SPARSE_SMS_OP_DECLS(R1, R2, M, S, API) \
-  SPARSE_SMS_BIN_OP_DECLS (R1, R2, M, S, API)    \
-  SPARSE_SMS_CMP_OP_DECLS (M, S, API) \
-  SPARSE_SMS_BOOL_OP_DECLS (M, S, API)
-
-// scalar by matrix operations.
-
-#define SPARSE_SSM_BIN_OP_DECLS(R1, R2, S, M, API)    \
-  SPARSE_BIN_OP_DECL (R1, operator +, S, M, API); \
-  SPARSE_BIN_OP_DECL (R1, operator -, S, M, API); \
-  SPARSE_BIN_OP_DECL (R2, operator *, S, M, API); \
-  SPARSE_BIN_OP_DECL (R2, operator /, S, M, API);
+// scalar by sparse matrix operations.
 
 #define SPARSE_SSM_BIN_OP_1(R, F, OP, S, M) \
   R \
@@ -259,18 +216,6 @@
   SPARSE_SSM_BIN_OP_2 (R2, operator *, *, S, M) \
   SPARSE_SSM_BIN_OP_2 (R2, operator /, /, S, M)
 
-#define SPARSE_SSM_CMP_OP_DECLS(S, M, API) \
-  SPARSE_CMP_OP_DECL (mx_el_lt, S, M, API); \
-  SPARSE_CMP_OP_DECL (mx_el_le, S, M, API); \
-  SPARSE_CMP_OP_DECL (mx_el_ge, S, M, API); \
-  SPARSE_CMP_OP_DECL (mx_el_gt, S, M, API); \
-  SPARSE_CMP_OP_DECL (mx_el_eq, S, M, API); \
-  SPARSE_CMP_OP_DECL (mx_el_ne, S, M, API);
-
-#define SPARSE_SSM_EQNE_OP_DECLS(S, M, API) \
-  SPARSE_CMP_OP_DECL (mx_el_eq, S, M, API); \
-  SPARSE_CMP_OP_DECL (mx_el_ne, S, M, API);
-
 #define SPARSE_SSM_CMP_OP(F, OP, S, SZ, SC, M, MZ, MC)  \
   SparseBoolMatrix \
   F (const S& s, const M& m) \
@@ -320,10 +265,6 @@
   SPARSE_SSM_CMP_OP (mx_el_eq, ==, S, SZ,   , M, MZ,   )        \
   SPARSE_SSM_CMP_OP (mx_el_ne, !=, S, SZ,   , M, MZ,   )
 
-#define SPARSE_SSM_BOOL_OP_DECLS(S, M, API) \
-  SPARSE_BOOL_OP_DECL (mx_el_and, S, M, API); \
-  SPARSE_BOOL_OP_DECL (mx_el_or,  S, M, API); \
-
 #define SPARSE_SSM_BOOL_OP(F, OP, S, M, LHS_ZERO, RHS_ZERO) \
   SparseBoolMatrix \
   F (const S& s, const M& m) \
@@ -371,18 +312,7 @@
 #define SPARSE_SSM_BOOL_OPS(S, M, ZERO) \
   SPARSE_SSM_BOOL_OPS2(S, M, ZERO, ZERO)
 
-#define SPARSE_SSM_OP_DECLS(R1, R2, S, M, API) \
-  SPARSE_SSM_BIN_OP_DECLS (R1, R2, S, M, API)    \
-  SPARSE_SSM_CMP_OP_DECLS (S, M, API) \
-  SPARSE_SSM_BOOL_OP_DECLS (S, M, API) \
-
-// matrix by matrix operations.
-
-#define SPARSE_SMSM_BIN_OP_DECLS(R1, R2, M1, M2, API)   \
-  SPARSE_BIN_OP_DECL (R1, operator +, M1, M2, API); \
-  SPARSE_BIN_OP_DECL (R1, operator -, M1, M2, API); \
-  SPARSE_BIN_OP_DECL (R2, product,    M1, M2, API); \
-  SPARSE_BIN_OP_DECL (R2, quotient,   M1, M2, API);
+// sparse matrix by sparse matrix operations.
 
 #define SPARSE_SMSM_BIN_OP_1(R, F, OP, M1, M2)  \
   R \
@@ -724,18 +654,6 @@
   SPARSE_SMSM_BIN_OP_2 (R2, product,     *, M1, M2) \
   SPARSE_SMSM_BIN_OP_3 (R2, quotient,    /, M1, M2)
 
-#define SPARSE_SMSM_CMP_OP_DECLS(M1, M2, API) \
-  SPARSE_CMP_OP_DECL (mx_el_lt, M1, M2, API); \
-  SPARSE_CMP_OP_DECL (mx_el_le, M1, M2, API); \
-  SPARSE_CMP_OP_DECL (mx_el_ge, M1, M2, API); \
-  SPARSE_CMP_OP_DECL (mx_el_gt, M1, M2, API); \
-  SPARSE_CMP_OP_DECL (mx_el_eq, M1, M2, API); \
-  SPARSE_CMP_OP_DECL (mx_el_ne, M1, M2, API);
-
-#define SPARSE_SMSM_EQNE_OP_DECLS(M1, M2, API) \
-  SPARSE_CMP_OP_DECL (mx_el_eq, M1, M2, API); \
-  SPARSE_CMP_OP_DECL (mx_el_ne, M1, M2, API);
-
 // FIXME: this macro duplicates the bodies of the template functions
 // defined in the SPARSE_SSM_CMP_OP and SPARSE_SMS_CMP_OP macros.
 
@@ -915,10 +833,6 @@
   SPARSE_SMSM_CMP_OP (mx_el_eq, ==, M1, Z1,   , M2, Z2,   ) \
   SPARSE_SMSM_CMP_OP (mx_el_ne, !=, M1, Z1,   , M2, Z2,   )
 
-#define SPARSE_SMSM_BOOL_OP_DECLS(M1, M2, API) \
-  SPARSE_BOOL_OP_DECL (mx_el_and, M1, M2, API); \
-  SPARSE_BOOL_OP_DECL (mx_el_or,  M1, M2, API);
-
 // FIXME: this macro duplicates the bodies of the template functions
 // defined in the SPARSE_SSM_BOOL_OP and SPARSE_SMS_BOOL_OP macros.
 
@@ -1062,18 +976,7 @@
 #define SPARSE_SMSM_BOOL_OPS(M1, M2, ZERO) \
   SPARSE_SMSM_BOOL_OPS2(M1, M2, ZERO, ZERO)
 
-#define SPARSE_SMSM_OP_DECLS(R1, R2, M1, M2, API) \
-  SPARSE_SMSM_BIN_OP_DECLS (R1, R2, M1, M2, API) \
-  SPARSE_SMSM_CMP_OP_DECLS (M1, M2, API) \
-  SPARSE_SMSM_BOOL_OP_DECLS (M1, M2, API)
-
-// matrix by matrix operations.
-
-#define SPARSE_MSM_BIN_OP_DECLS(R1, R2, M1, M2, API)    \
-  SPARSE_BIN_OP_DECL (R1, operator +, M1, M2, API); \
-  SPARSE_BIN_OP_DECL (R1, operator -, M1, M2, API); \
-  SPARSE_BIN_OP_DECL (R2, product,    M1, M2, API); \
-  SPARSE_BIN_OP_DECL (R2, quotient,   M1, M2, API);
+// matrix by sparse matrix operations.
 
 #define SPARSE_MSM_BIN_OP_1(R, F, OP, M1, M2)   \
   R \
@@ -1154,18 +1057,6 @@
   SPARSE_MSM_BIN_OP_2 (R2, product,     *, M1, M2) \
   SPARSE_MSM_BIN_OP_1 (R2, quotient,    /, M1, M2)
 
-#define SPARSE_MSM_CMP_OP_DECLS(M1, M2, API) \
-  SPARSE_CMP_OP_DECL (mx_el_lt, M1, M2, API); \
-  SPARSE_CMP_OP_DECL (mx_el_le, M1, M2, API); \
-  SPARSE_CMP_OP_DECL (mx_el_ge, M1, M2, API); \
-  SPARSE_CMP_OP_DECL (mx_el_gt, M1, M2, API); \
-  SPARSE_CMP_OP_DECL (mx_el_eq, M1, M2, API); \
-  SPARSE_CMP_OP_DECL (mx_el_ne, M1, M2, API);
-
-#define SPARSE_MSM_EQNE_OP_DECLS(M1, M2, API) \
-  SPARSE_CMP_OP_DECL (mx_el_eq, M1, M2, API); \
-  SPARSE_CMP_OP_DECL (mx_el_ne, M1, M2, API);
-
 #define SPARSE_MSM_CMP_OP(F, OP, M1, C1, M2, C2)        \
   SparseBoolMatrix \
   F (const M1& m1, const M2& m2) \
@@ -1230,10 +1121,6 @@
   SPARSE_MSM_CMP_OP (mx_el_eq, ==, M1,   , M2,   ) \
   SPARSE_MSM_CMP_OP (mx_el_ne, !=, M1,   , M2,   )
 
-#define SPARSE_MSM_BOOL_OP_DECLS(M1, M2, API) \
-  SPARSE_BOOL_OP_DECL (mx_el_and, M1, M2, API); \
-  SPARSE_BOOL_OP_DECL (mx_el_or,  M1, M2, API);
-
 #define SPARSE_MSM_BOOL_OP(F, OP, M1, M2, LHS_ZERO, RHS_ZERO) \
   SparseBoolMatrix \
   F (const M1& m1, const M2& m2) \
@@ -1295,18 +1182,7 @@
 #define SPARSE_MSM_BOOL_OPS(M1, M2, ZERO) \
   SPARSE_MSM_BOOL_OPS2(M1, M2, ZERO, ZERO)
 
-#define SPARSE_MSM_OP_DECLS(R1, R2, M1, M2, API) \
-  SPARSE_MSM_BIN_OP_DECLS (R1, R2, M1, M2, API) \
-  SPARSE_MSM_CMP_OP_DECLS (M1, M2, API) \
-  SPARSE_MSM_BOOL_OP_DECLS (M1, M2, API)
-
-// matrix by matrix operations.
-
-#define SPARSE_SMM_BIN_OP_DECLS(R1, R2, M1, M2, API)    \
-  SPARSE_BIN_OP_DECL (R1, operator +, M1, M2, API); \
-  SPARSE_BIN_OP_DECL (R1, operator -, M1, M2, API); \
-  SPARSE_BIN_OP_DECL (R2, product,    M1, M2, API); \
-  SPARSE_BIN_OP_DECL (R2, quotient,   M1, M2, API);
+// sparse matrix by matrix operations.
 
 #define SPARSE_SMM_BIN_OP_1(R, F, OP, M1, M2)   \
   R \
@@ -1394,18 +1270,6 @@
   SPARSE_SMM_BIN_OP_2 (R2, product,     *, M1, M2) \
   SPARSE_SMM_BIN_OP_2 (R2, quotient,    /, M1, M2)
 
-#define SPARSE_SMM_CMP_OP_DECLS(M1, M2, API) \
-  SPARSE_CMP_OP_DECL (mx_el_lt, M1, M2, API); \
-  SPARSE_CMP_OP_DECL (mx_el_le, M1, M2, API); \
-  SPARSE_CMP_OP_DECL (mx_el_ge, M1, M2, API); \
-  SPARSE_CMP_OP_DECL (mx_el_gt, M1, M2, API); \
-  SPARSE_CMP_OP_DECL (mx_el_eq, M1, M2, API); \
-  SPARSE_CMP_OP_DECL (mx_el_ne, M1, M2, API);
-
-#define SPARSE_SMM_EQNE_OP_DECLS(M1, M2, API) \
-  SPARSE_CMP_OP_DECL (mx_el_eq, M1, M2, API); \
-  SPARSE_CMP_OP_DECL (mx_el_ne, M1, M2, API);
-
 #define SPARSE_SMM_CMP_OP(F, OP, M1, C1, M2, C2)        \
   SparseBoolMatrix \
   F (const M1& m1, const M2& m2) \
@@ -1470,10 +1334,6 @@
   SPARSE_SMM_CMP_OP (mx_el_eq, ==, M1,   , M2,   ) \
   SPARSE_SMM_CMP_OP (mx_el_ne, !=, M1,   , M2,   )
 
-#define SPARSE_SMM_BOOL_OP_DECLS(M1, M2, API) \
-  SPARSE_BOOL_OP_DECL (mx_el_and, M1, M2, API); \
-  SPARSE_BOOL_OP_DECL (mx_el_or,  M1, M2, API);
-
 #define SPARSE_SMM_BOOL_OP(F, OP, M1, M2, LHS_ZERO, RHS_ZERO) \
   SparseBoolMatrix \
   F (const M1& m1, const M2& m2) \
@@ -1535,11 +1395,6 @@
 #define SPARSE_SMM_BOOL_OPS(M1, M2, ZERO) \
   SPARSE_SMM_BOOL_OPS2(M1, M2, ZERO, ZERO)
 
-#define SPARSE_SMM_OP_DECLS(R1, R2, M1, M2, API) \
-  SPARSE_SMM_BIN_OP_DECLS (R1, R2, M1, M2, API) \
-  SPARSE_SMM_CMP_OP_DECLS (M1, M2, API) \
-  SPARSE_SMM_BOOL_OP_DECLS (M1, M2, API)
-
 // Avoid some code duplication.  Maybe we should use templates.
 
 #define SPARSE_CUMSUM(RET_TYPE, ELT_TYPE, FCN)  \
--- a/liboctave/operators/module.mk	Mon Oct 20 21:54:59 2014 -0700
+++ b/liboctave/operators/module.mk	Sun Oct 19 08:42:58 2014 -0400
@@ -33,6 +33,7 @@
   operators/mx-op-decl.h \
   operators/mx-op-defs.h \
   operators/Sparse-diag-op-defs.h \
+  operators/Sparse-op-decls.h \
   operators/Sparse-op-defs.h \
   operators/Sparse-perm-op-defs.h
 
--- a/liboctave/operators/mx-op-defs.h	Mon Oct 20 21:54:59 2014 -0700
+++ b/liboctave/operators/mx-op-defs.h	Sun Oct 19 08:42:58 2014 -0400
@@ -25,6 +25,7 @@
 #if !defined (octave_mx_op_defs_h)
 #define octave_mx_op_defs_h 1
 
+#include "lo-array-gripes.h"
 #include "mx-op-decl.h"
 #include "mx-inlines.cc"
 
--- a/liboctave/operators/sparse-mk-ops.awk	Mon Oct 20 21:54:59 2014 -0700
+++ b/liboctave/operators/sparse-mk-ops.awk	Sun Oct 19 08:42:58 2014 -0400
@@ -170,6 +170,10 @@
                 printf ("#include \"%s\"\n", rhs_header) >> h_file;
             }
 
+          ## FIXME: it might be nice to only include the declarations
+          ## of the operators that are actually needed instead of
+          ## including all of them.
+          printf ("#include \"mx-ops.h\"\n") >> h_file;
           printf ("#include \"Sparse-op-defs.h\"\n") >> h_file;
 
           if (bin_ops)