help-octave
[Top][All Lists]
Advanced

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

Re: Failure to compile Octave 3.0.2 on AIX 5.3


From: John W. Eaton
Subject: Re: Failure to compile Octave 3.0.2 on AIX 5.3
Date: Mon, 06 Oct 2008 11:09:23 -0400

On  6-Oct-2008, Alisdair Tullo wrote:

| On Fri, 3 Oct 2008, John W. Eaton wrote:
| > Oh, if you generate the preprocessed source, it will likely be a large
| > file, so please just send it directly to me rather than to the list.
| 
| Attached -- thanks again for looking at this.

Thanks.  Using that, I think I found the source of the problem.
Please try the following patch.

jwe


# HG changeset patch
# User John W. Eaton <address@hidden>
# Date 1223305674 14400
# Node ID da43d2138837283a9f3f7f43b3b64d4364435da6
# Parent  6c08e3921d3e1931e3e201f958de59fe1db51dc2
fix sparse-matrix bool/cmp op instantiation problem

diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog
--- a/liboctave/ChangeLog
+++ b/liboctave/ChangeLog
@@ -1,3 +1,10 @@
+2008-10-06  John W. Eaton  <address@hidden>
+
+       * Sparse.h (Sparse<T>::elt_type): New typedef.
+       * Sparse-op-defs.h (SPARSE_SMSM_BOOL_OP, SPARSE_MSM_CMP_OP):
+       Use it to call sparse-matrix/scalar operator instead of attempting
+       to instantiate mixed-type sparse-matrix/scalar operators.
+
 2008-10-03  Jaroslav Hajek  <address@hidden>
 
        * Array.h (Array<T>::maybe_delete_elements): Remove rfv argument from
diff --git a/liboctave/Sparse-op-defs.h b/liboctave/Sparse-op-defs.h
--- a/liboctave/Sparse-op-defs.h
+++ b/liboctave/Sparse-op-defs.h
@@ -749,15 +749,11 @@
     \
     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); \
+        r = F (m1.elem(0,0) != M1::elt_type (), 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)); \
+        r = F (m1, m2.elem(0,0) != M2::elt_type ()); \
       } \
     else if (m1_nr == m2_nr && m1_nc == m2_nc) \
       { \
@@ -883,15 +879,11 @@
     \
     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); \
+        r = F (m1.elem(0,0) != M1::elt_type (), 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)); \
+        r = F (m1, m2.elem(0,0) != M2::elt_type ()); \
       } \
     else if (m1_nr == m2_nr && m1_nc == m2_nc) \
       { \
diff --git a/liboctave/Sparse.h b/liboctave/Sparse.h
--- a/liboctave/Sparse.h
+++ b/liboctave/Sparse.h
@@ -46,6 +46,10 @@
 class
 Sparse
 {
+public:
+
+  typedef T elt_type;
+
 protected:
   //--------------------------------------------------------------------
   // The real representation of all Sparse arrays.

reply via email to

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