diff liboctave/Sparse-op-defs.h @ 13731:3b52038e6e6c

Help dumb compilers to resolve template parameters. * boolNDArray.cc (boolNDArray::operator!): Specify second template parameter for do_mx_unary_map_op. * Sparse-op-defs.h (SPARSE_MSM_BIN_OP_2): Specify template parameter for mx_inline_all_infinite. (SPARSE_SMM_BIN_OP_2_CHECK_product): Add argument to macro and use it as template parameter for mx_inline_all_infinite. (SPARSE_SMM_BIN_OP_2_CHECK_quotient): Likewise for mx_inline_all_nan. (SPARSE_SMM_BIN_OP_2): Use new argument for product and quotient macros. * data.cc (Frem): Specify template parameter for xrem. (Fmod): Specify template parameter for xmod.
author Michael Goffioul <michael.goffioul@gmail.com>
date Thu, 20 Oct 2011 12:54:40 +0100
parents fd0a3ac60b0e
children 72c96de7a403
line wrap: on
line diff
--- a/liboctave/Sparse-op-defs.h
+++ b/liboctave/Sparse-op-defs.h
@@ -1119,7 +1119,7 @@
       gripe_nonconformant (#F, m1_nr, m1_nc, m2_nr, m2_nc); \
     else \
       { \
-        if (do_mx_check (m1, mx_inline_all_finite)) \
+        if (do_mx_check (m1, mx_inline_all_finite<M1::element_type>)) \
           { \
             /* Sparsity pattern is preserved. */ \
             octave_idx_type m2_nz = m2.nnz (); \
@@ -1335,12 +1335,12 @@
   }
 
 // sm .* m preserves sparsity if m contains no Infs nor Nans.
-#define SPARSE_SMM_BIN_OP_2_CHECK_product \
-  do_mx_check (m2, mx_inline_all_finite)
+#define SPARSE_SMM_BIN_OP_2_CHECK_product(ET) \
+  do_mx_check (m2, mx_inline_all_finite<ET>)
 
 // sm ./ m preserves sparsity if m contains no NaNs or zeros.
-#define SPARSE_SMM_BIN_OP_2_CHECK_quotient \
-  ! do_mx_check (m2, mx_inline_any_nan) && m2.nnz () == m2.numel ()
+#define SPARSE_SMM_BIN_OP_2_CHECK_quotient(ET) \
+  ! do_mx_check (m2, mx_inline_any_nan<ET>) && m2.nnz () == m2.numel ()
 
 #define SPARSE_SMM_BIN_OP_2(R, F, OP, M1, M2) \
   R \
@@ -1360,7 +1360,7 @@
       gripe_nonconformant (#F, m1_nr, m1_nc, m2_nr, m2_nc); \
     else \
       { \
-        if (SPARSE_SMM_BIN_OP_2_CHECK_ ## F) \
+        if (SPARSE_SMM_BIN_OP_2_CHECK_ ## F(M2::element_type)) \
           { \
             /* Sparsity pattern is preserved. */ \
             octave_idx_type m1_nz = m1.nnz (); \