[OctDev] x86_64 patches

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[OctDev] x86_64 patches

Orion Poplawski
Attached is a patch that allowed me to compile octave-forge-2005.06.13
on octave-2.9.2 x86_64.  Main issue is the changing of octave_idx_type
from int to long, so requiring a change of int variables to octave_idx_type.

--
Orion Poplawski
System Administrator                   303-415-9701 x222
Colorado Research Associates/NWRA      FAX: 303-415-9702
3380 Mitchell Lane, Boulder CO 80301   http://www.co-ra.com

--- octave-forge-2005.06.13/FIXES/rand.cc.orig 2005-09-28 11:20:46.637505709 -0600
+++ octave-forge-2005.06.13/FIXES/rand.cc 2005-09-28 11:21:30.340061418 -0600
@@ -614,7 +614,7 @@
   Matrix lambda(args(0).matrix_value());
   if (error_state) return retval;
 
-  int nr=0, nc=0;
+  octave_idx_type nr=0, nc=0;
   switch (nargin) {
   case 1: nr = lambda.rows(); nc = lambda.columns(); break;
   case 2: get_dimensions(args(1), "randp", nr, nc); break;
@@ -735,7 +735,7 @@
   Matrix alpha(args(0).matrix_value());
   if (error_state) return retval;
 
-  int nr=0, nc=0;
+  octave_idx_type nr=0, nc=0;
   switch (nargin) {
   case 1: nr = alpha.rows(); nc = alpha.columns(); break;
   case 2: get_dimensions(args(1), "randg", nr, nc); break;
--- octave-forge-2005.06.13/extra/linear-algebra/chol.cc.orig 2005-09-28 11:24:07.525866754 -0600
+++ octave-forge-2005.06.13/extra/linear-algebra/chol.cc 2005-09-28 11:24:31.563072423 -0600
@@ -81,7 +81,7 @@
 
       if (! error_state)
  {
-  int info;
+  octave_idx_type info;
   CHOL fact (m, info);
   if (nargout == 2 || info == 0)
     {
@@ -105,7 +105,7 @@
 
       if (! error_state)
  {
-  int info;
+  octave_idx_type info;
   ComplexCHOL fact (m, info);
   if (nargout == 2 || info == 0)
     {
--- octave-forge-2005.06.13/main/fixed/fixedCNDArray.h.orig 2005-09-28 11:41:18.589813461 -0600
+++ octave-forge-2005.06.13/main/fixed/fixedCNDArray.h 2005-09-28 11:45:43.258073287 -0600
@@ -179,41 +179,41 @@
 
   FixedComplexNDArray operator ! (void) const;
 
-  boolNDArray all (int dim = -1) const;
-  boolNDArray any (int dim = -1) const;
+  boolNDArray all (octave_idx_type dim = -1) const;
+  boolNDArray any (octave_idx_type dim = -1) const;
 
 #ifdef HAVE_OLD_OCTAVE_CONCAT
   friend FixedComplexNDArray concat (const FixedComplexNDArray& ra,
      const FixedComplexNDArray& rb,
-     const Array<int>& ra_idx);
+     const Array<octave_idx_type>& ra_idx);
 
   friend FixedComplexNDArray concat (const FixedComplexNDArray& ra,
      const FixedNDArray& rb,
-     const Array<int>& ra_idx);
+     const Array<octave_idx_type>& ra_idx);
 
   friend FixedComplexNDArray concat (const FixedNDArray& ra,
      const FixedComplexNDArray& rb,
-     const Array<int>& ra_idx);
+     const Array<octave_idx_type>& ra_idx);
 #endif
 
 #ifdef HAVE_OCTAVE_CONCAT
   FixedComplexNDArray concat (const FixedComplexNDArray& rb,
-      const Array<int>& ra_idx);
+      const Array<octave_idx_type>& ra_idx);
 
   FixedComplexNDArray concat (const FixedNDArray& rb,
-      const Array<int>& ra_idx);
+      const Array<octave_idx_type>& ra_idx);
 #endif
 
 #if defined (HAVE_OCTAVE_CONCAT) || defined (HAVE_OLD_OCTAVE_CONCAT)
   FixedComplexNDArray& insert (const FixedComplexNDArray& a,
-       const Array<int>& ra_idx);
+       const Array<octave_idx_type>& ra_idx);
 #endif
 
-  FixedComplexNDArray cumprod (int dim = -1) const;
-  FixedComplexNDArray cumsum (int dim = -1) const;
-  FixedComplexNDArray prod (int dim = -1) const;
-  FixedComplexNDArray sum (int dim = -1) const;
-  FixedComplexNDArray sumsq (int dim = -1) const;
+  FixedComplexNDArray cumprod (octave_idx_type dim = -1) const;
+  FixedComplexNDArray cumsum (octave_idx_type dim = -1) const;
+  FixedComplexNDArray prod (octave_idx_type dim = -1) const;
+  FixedComplexNDArray sum (octave_idx_type dim = -1) const;
+  FixedComplexNDArray sumsq (octave_idx_type dim = -1) const;
 
   friend FixedNDArray real (const FixedComplexNDArray &x);
   friend FixedNDArray imag (const FixedComplexNDArray &x);
@@ -252,10 +252,10 @@
   friend ComplexNDArray getnumber (const FixedComplexNDArray& x)
      { return x.getnumber(); }
 
-  FixedComplexNDArray max (int dim = 0) const;
-  FixedComplexNDArray max (ArrayN<int>& index, int dim = 0) const;
-  FixedComplexNDArray min (int dim = 0) const;
-  FixedComplexNDArray min (ArrayN<int>& index, int dim = 0) const;
+  FixedComplexNDArray max (octave_idx_type dim = 0) const;
+  FixedComplexNDArray max (ArrayN<octave_idx_type>& index, octave_idx_type dim = 0) const;
+  FixedComplexNDArray min (octave_idx_type dim = 0) const;
+  FixedComplexNDArray min (ArrayN<octave_idx_type>& index, octave_idx_type dim = 0) const;
 
   FixedNDArray abs (void) const;
 
@@ -264,11 +264,11 @@
   FixedComplexNDArray squeeze (void) const
     { return ArrayN<FixedPointComplex>::squeeze (); }
 
-  static void increment_index (Array<int>& ra_idx,
+  static void increment_index (Array<octave_idx_type>& ra_idx,
        const dim_vector& dimensions,
-       int start_dimension = 0);
+       octave_idx_type start_dimension = 0);
 
-  static int compute_index (Array<int>& ra_idx,
+  static octave_idx_type compute_index (Array<octave_idx_type>& ra_idx,
     const dim_vector& dimensions);
 
   // i/o
--- octave-forge-2005.06.13/main/fixed/fixedCNDArray.cc.orig 2005-09-28 11:40:02.805316167 -0600
+++ octave-forge-2005.06.13/main/fixed/fixedCNDArray.cc 2005-09-28 11:48:58.574623229 -0600
@@ -583,7 +583,7 @@
 }
 
 boolNDArray
-FixedComplexNDArray::all (int dim) const
+FixedComplexNDArray::all (octave_idx_type dim) const
 {
 #define FMX_ND_ALL_EXPR  elem (iter_idx) .fixedpoint () == Complex (0, 0)
   MX_ND_ANY_ALL_REDUCTION (MX_ND_ALL_EVAL (FMX_ND_ALL_EXPR), true);
@@ -591,7 +591,7 @@
 }
 
 boolNDArray
-FixedComplexNDArray::any (int dim) const
+FixedComplexNDArray::any (octave_idx_type dim) const
 {
 #define FMX_ND_ANY_EXPR  elem (iter_idx) .fixedpoint () != Complex (0, 0)
   MX_ND_ANY_ALL_REDUCTION (MX_ND_ANY_EVAL (FMX_ND_ANY_EXPR), false);
@@ -599,21 +599,21 @@
 }
 
 FixedComplexNDArray
-FixedComplexNDArray::cumprod (int dim) const
+FixedComplexNDArray::cumprod (octave_idx_type dim) const
 {
   FixedPointComplex one (1, 0, 1, 0);
   MX_ND_CUMULATIVE_OP (FixedComplexNDArray, FixedPointComplex, one, *);
 }
 
 FixedComplexNDArray
-FixedComplexNDArray::cumsum (int dim) const
+FixedComplexNDArray::cumsum (octave_idx_type dim) const
 {
   FixedPointComplex zero;
   MX_ND_CUMULATIVE_OP (FixedComplexNDArray, FixedPointComplex, zero, +);
 }
 
 FixedComplexNDArray
-FixedComplexNDArray::prod (int dim) const
+FixedComplexNDArray::prod (octave_idx_type dim) const
 {
   FixedPointComplex one(1, 0, 1, 0);
 #if HAVE_6ARG_MX_ND_RED
@@ -629,7 +629,7 @@
 }
 
 FixedComplexNDArray
-FixedComplexNDArray::sum (int dim) const
+FixedComplexNDArray::sum (octave_idx_type dim) const
 {
   FixedPointComplex zero;
 #if HAVE_6ARG_MX_ND_RED
@@ -644,7 +644,7 @@
 }
 
 FixedComplexNDArray
-FixedComplexNDArray::sumsq (int dim) const
+FixedComplexNDArray::sumsq (octave_idx_type dim) const
 {
   FixedPointComplex zero;
 #if HAVE_6ARG_MX_ND_RED
@@ -762,14 +762,14 @@
 }
 
 FixedComplexNDArray
-FixedComplexNDArray::max (int dim) const
+FixedComplexNDArray::max (octave_idx_type dim) const
 {
-  ArrayN<int> dummy_idx;
+  ArrayN<octave_idx_type> dummy_idx;
   return max (dummy_idx, dim);
 }
 
 FixedComplexNDArray
-FixedComplexNDArray::max (ArrayN<int>& idx_arg, int dim) const
+FixedComplexNDArray::max (ArrayN<octave_idx_type>& idx_arg, octave_idx_type dim) const
 {
   dim_vector dv = dims ();
   dim_vector dr = dims ();
@@ -782,19 +782,19 @@
   FixedComplexNDArray result (dr);
   idx_arg.resize (dr);
 
-  int x_stride = 1;
-  int x_len = dv(dim);
-  for (int i = 0; i < dim; i++)
+  octave_idx_type x_stride = 1;
+  octave_idx_type x_len = dv(dim);
+  for (octave_idx_type i = 0; i < dim; i++)
     x_stride *= dv(i);
 
-  for (int i = 0; i < dr.numel (); i++)
+  for (octave_idx_type i = 0; i < dr.numel (); i++)
     {
-      int x_offset;
+      octave_idx_type x_offset;
       if (x_stride == 1)
  x_offset = i * x_len;
       else
  {
-  int x_offset2 = 0;
+  octave_idx_type x_offset2 = 0;
   x_offset = i;
   while (x_offset >= x_stride)
     {
@@ -804,11 +804,11 @@
   x_offset += x_offset2 * x_stride * x_len;
  }
 
-      int idx_j = 0;
+      octave_idx_type idx_j = 0;
       FixedPointComplex tmp_max = elem (x_offset);
       FixedPoint abs_max = ::abs (tmp_max);
 
-      for (int j = 1; j < x_len; j++)
+      for (octave_idx_type j = 1; j < x_len; j++)
  {
   FixedPointComplex tmp = elem (j * x_stride + x_offset);
   FixedPoint abs_tmp = ::abs (tmp);
@@ -829,14 +829,14 @@
 }
 
 FixedComplexNDArray
-FixedComplexNDArray::min (int dim) const
+FixedComplexNDArray::min (octave_idx_type dim) const
 {
-  ArrayN<int> dummy_idx;
+  ArrayN<octave_idx_type> dummy_idx;
   return min (dummy_idx, dim);
 }
 
 FixedComplexNDArray
-FixedComplexNDArray::min (ArrayN<int>& idx_arg, int dim) const
+FixedComplexNDArray::min (ArrayN<octave_idx_type>& idx_arg, octave_idx_type dim) const
 {
   dim_vector dv = dims ();
   dim_vector dr = dims ();
@@ -849,19 +849,19 @@
   FixedComplexNDArray result (dr);
   idx_arg.resize (dr);
 
-  int x_stride = 1;
-  int x_len = dv(dim);
-  for (int i = 0; i < dim; i++)
+  octave_idx_type x_stride = 1;
+  octave_idx_type x_len = dv(dim);
+  for (octave_idx_type i = 0; i < dim; i++)
     x_stride *= dv(i);
 
-  for (int i = 0; i < dr.numel (); i++)
+  for (octave_idx_type i = 0; i < dr.numel (); i++)
     {
-      int x_offset;
+      octave_idx_type x_offset;
       if (x_stride == 1)
  x_offset = i * x_len;
       else
  {
-  int x_offset2 = 0;
+  octave_idx_type x_offset2 = 0;
   x_offset = i;
   while (x_offset >= x_stride)
     {
@@ -871,11 +871,11 @@
   x_offset += x_offset2 * x_stride * x_len;
  }
 
-      int idx_j = 0;
+      octave_idx_type idx_j = 0;
       FixedPointComplex tmp_min = elem (x_offset);
       FixedPoint abs_min = ::abs (tmp_min);
 
-      for (int j = 1; j < x_len; j++)
+      for (octave_idx_type j = 1; j < x_len; j++)
  {
   FixedPointComplex tmp = elem (j * x_stride + x_offset);
   FixedPoint abs_tmp = ::abs (tmp);
@@ -900,7 +900,7 @@
 {
   FixedComplexMatrix retval;
 
-  int nd = ndims ();
+  octave_idx_type nd = ndims ();
 
   switch (nd)
     {
@@ -926,7 +926,7 @@
 #ifdef HAVE_OCTAVE_CONCAT
 FixedComplexNDArray
 concat (const FixedComplexNDArray& ra, const FixedComplexNDArray& rb,
- const Array<int>& ra_idx)
+ const Array<octave_idx_type>& ra_idx)
 {
   FixedComplexNDArray retval (ra);
   if (ra.numel () > 0)
@@ -936,7 +936,7 @@
 
 FixedComplexNDArray
 concat (const FixedComplexNDArray& ra, const FixedNDArray& rb,
- const Array<int>& ra_idx)
+ const Array<octave_idx_type>& ra_idx)
 {
   FixedComplexNDArray retval (ra);
   if (ra.numel () > 0) {
@@ -948,7 +948,7 @@
 
 FixedComplexNDArray
 concat (const FixedNDArray& ra, const FixedComplexNDArray& rb,
- const Array<int>& ra_idx)
+ const Array<octave_idx_type>& ra_idx)
 {
   FixedComplexNDArray retval (ra);
   if (ra.numel () > 0)
@@ -960,7 +960,7 @@
 #ifdef HAVE_OCTAVE_CONCAT
 FixedComplexNDArray
 FixedComplexNDArray ::concat (const FixedComplexNDArray& rb,
-      const Array<int>& ra_idx)
+      const Array<octave_idx_type>& ra_idx)
 {
   if (rb.numel () > 0)
     insert (rb, ra_idx);
@@ -969,7 +969,7 @@
 
 FixedComplexNDArray
 FixedComplexNDArray::concat (const FixedNDArray& rb,
-     const Array<int>& ra_idx)
+     const Array<octave_idx_type>& ra_idx)
 {
   if (rb.numel () > 0)
     insert (FixedComplexNDArray (rb), ra_idx);
@@ -980,7 +980,7 @@
 #if defined (HAVE_OCTAVE_CONCAT) || defined (HAVE_OLD_OCTAVE_CONCAT)
 FixedComplexNDArray&
 FixedComplexNDArray::insert (const FixedComplexNDArray& a,
-     const Array<int>& ra_idx)
+     const Array<octave_idx_type>& ra_idx)
 {
   Array<FixedPointComplex>::insert (a, ra_idx);
   return *this;
@@ -988,9 +988,9 @@
 #endif
 
 void
-FixedComplexNDArray::increment_index (Array<int>& ra_idx,
+FixedComplexNDArray::increment_index (Array<octave_idx_type>& ra_idx,
  const dim_vector& dimensions,
- int start_dimension)
+ octave_idx_type start_dimension)
 {
 #ifdef HAVE_OCTAVE_CONCAT
   ::increment_index (ra_idx, dimensions, start_dimension);
@@ -999,8 +999,8 @@
 #endif
 }
 
-int
-FixedComplexNDArray::compute_index (Array<int>& ra_idx,
+octave_idx_type
+FixedComplexNDArray::compute_index (Array<octave_idx_type>& ra_idx,
        const dim_vector& dimensions)
 {
 #ifdef HAVE_OCTAVE_CONCAT
@@ -1016,9 +1016,9 @@
 std::ostream&
 operator << (std::ostream& os, const FixedComplexNDArray& a)
 {
-  int nel = a.nelem ();
+  octave_idx_type nel = a.nelem ();
 
-  for (int i = 0; i < nel; i++)
+  for (octave_idx_type i = 0; i < nel; i++)
     {
       os << " " << a.elem (i);
     }
@@ -1029,14 +1029,14 @@
 std::istream&
 operator >> (std::istream& is, FixedComplexNDArray& a)
 {
-  int nel = a.nelem ();
+  octave_idx_type nel = a.nelem ();
 
   if (nel < 1 )
     is.clear (std::ios::badbit);
   else
     {
       FixedPointComplex tmp;
-      for (int i = 0; i < nel; i++)
+      for (octave_idx_type i = 0; i < nel; i++)
   {
     is >> tmp;
     if (is)
@@ -1059,14 +1059,14 @@
 min (const FixedPointComplex& c, const FixedComplexNDArray& m)
 {
   dim_vector dv = m.dims ();
-  int nel = dv.numel ();
+  octave_idx_type nel = dv.numel ();
   FixedPoint cabs = ::abs(c);
 
   EMPTY_RETURN_CHECK (FixedComplexNDArray);
 
   FixedComplexNDArray result (dv);
 
-  for (int i = 0; i < nel; i++)
+  for (octave_idx_type i = 0; i < nel; i++)
     {
       OCTAVE_QUIT;
       result (i) = ::abs(m(i)) < cabs ? m(i) : c;
@@ -1079,14 +1079,14 @@
 min (const FixedComplexNDArray& m, const FixedPointComplex& c)
 {
   dim_vector dv = m.dims ();
-  int nel = dv.numel ();
+  octave_idx_type nel = dv.numel ();
   FixedPoint cabs = ::abs(c);
 
   EMPTY_RETURN_CHECK (FixedComplexNDArray);
 
   FixedComplexNDArray result (dv);
 
-  for (int i = 0; i < nel; i++)
+  for (octave_idx_type i = 0; i < nel; i++)
     {
       OCTAVE_QUIT;
       result (i) = ::abs(m(i)) < cabs ? m(i) : c;
@@ -1099,7 +1099,7 @@
 min (const FixedComplexNDArray& a, const FixedComplexNDArray& b)
 {
   dim_vector dv = a.dims ();
-  int nel = dv.numel ();
+  octave_idx_type nel = dv.numel ();
 
   if (dv != b.dims ())
     {
@@ -1112,7 +1112,7 @@
 
   FixedComplexNDArray result (dv);
 
-  for (int i = 0; i < nel; i++)
+  for (octave_idx_type i = 0; i < nel; i++)
     {
       OCTAVE_QUIT;
       result (i) = ::abs(a(i)) < ::abs(b(i)) ? a(i) : b(i);
@@ -1125,14 +1125,14 @@
 max (const FixedPointComplex& c, const FixedComplexNDArray& m)
 {
   dim_vector dv = m.dims ();
-  int nel = dv.numel ();
+  octave_idx_type nel = dv.numel ();
   FixedPoint cabs = ::abs(c);
 
   EMPTY_RETURN_CHECK (FixedComplexNDArray);
 
   FixedComplexNDArray result (dv);
 
-  for (int i = 0; i < nel; i++)
+  for (octave_idx_type i = 0; i < nel; i++)
     {
       OCTAVE_QUIT;
       result (i) = ::abs(m(i)) > cabs ? m(i) : c;
@@ -1145,14 +1145,14 @@
 max (const FixedComplexNDArray& m, const FixedPointComplex& c)
 {
   dim_vector dv = m.dims ();
-  int nel = dv.numel ();
+  octave_idx_type nel = dv.numel ();
   FixedPoint cabs = ::abs(c);
 
   EMPTY_RETURN_CHECK (FixedComplexNDArray);
 
   FixedComplexNDArray result (dv);
 
-  for (int i = 0; i < nel; i++)
+  for (octave_idx_type i = 0; i < nel; i++)
     {
       OCTAVE_QUIT;
       result (i) = ::abs(m(i)) > cabs ? m(i) : c;
@@ -1165,7 +1165,7 @@
 max (const FixedComplexNDArray& a, const FixedComplexNDArray& b)
 {
   dim_vector dv = a.dims ();
-  int nel = dv.numel ();
+  octave_idx_type nel = dv.numel ();
 
   if (dv != b.dims ())
     {
@@ -1178,7 +1178,7 @@
 
   FixedComplexNDArray result (dv);
 
-  for (int i = 0; i < nel; i++)
+  for (octave_idx_type i = 0; i < nel; i++)
     {
       OCTAVE_QUIT;
       result (i) = ::abs(a(i)) < ::abs(b(i)) ? a(i) : b(i);
--- octave-forge-2005.06.13/main/fixed/fixedNDArray.cc.orig 2005-09-28 11:26:11.235780195 -0600
+++ octave-forge-2005.06.13/main/fixed/fixedNDArray.cc 2005-09-28 11:38:49.120749511 -0600
@@ -192,7 +192,7 @@
     return;
   }
 
-  for (int i = 0; i < nelem (); i++)
+  for (octave_idx_type i = 0; i < nelem (); i++)
     elem (i) = FixedPoint((unsigned int)is(i), (unsigned int)ds(i),
        (unsigned int)a.elem (i),
        (unsigned int)b.elem (i));
@@ -201,14 +201,14 @@
 FixedNDArray::FixedNDArray (const MArrayN<int> &a)
   : MArrayN<FixedPoint> (a.dims())
 {
-  for (int i = 0; i < nelem (); i++)
+  for (octave_idx_type i = 0; i < nelem (); i++)
     elem (i) = FixedPoint(a.elem (i));
 }
 
 FixedNDArray::FixedNDArray (const NDArray &a)
   : MArrayN<FixedPoint> (a.dims())
 {
-  for (int i = 0; i < nelem (); i++)
+  for (octave_idx_type i = 0; i < nelem (); i++)
     elem (i) = FixedPoint(a.elem (i));
 }
 
@@ -366,7 +366,7 @@
 // other operations.
 
 boolNDArray
-FixedNDArray::all (int dim) const
+FixedNDArray::all (octave_idx_type dim) const
 {
 #define FMX_ND_ALL_EXPR  elem (iter_idx) .fixedpoint () == 0.0
   MX_ND_ANY_ALL_REDUCTION (MX_ND_ALL_EVAL (FMX_ND_ALL_EXPR), true);
@@ -374,7 +374,7 @@
 }
 
 boolNDArray
-FixedNDArray::any (int dim) const
+FixedNDArray::any (octave_idx_type dim) const
 {
 #define FMX_ND_ANY_EXPR  elem (iter_idx) .fixedpoint () != 0.0
   MX_ND_ANY_ALL_REDUCTION (MX_ND_ANY_EVAL (FMX_ND_ANY_EXPR), false);
@@ -382,21 +382,21 @@
 }
 
 FixedNDArray
-FixedNDArray::cumprod (int dim) const
+FixedNDArray::cumprod (octave_idx_type dim) const
 {
   FixedPoint one(1,0,1,0);
   MX_ND_CUMULATIVE_OP (FixedNDArray, FixedPoint, one, *);
 }
 
 FixedNDArray
-FixedNDArray::cumsum (int dim) const
+FixedNDArray::cumsum (octave_idx_type dim) const
 {
   FixedPoint zero;
   MX_ND_CUMULATIVE_OP (FixedNDArray, FixedPoint, zero, +);
 }
 
 FixedNDArray
-FixedNDArray::prod (int dim) const
+FixedNDArray::prod (octave_idx_type dim) const
 {
   FixedPoint one(1,0,1,0);
 #if HAVE_6ARG_MX_ND_RED
@@ -410,7 +410,7 @@
 }
 
 FixedNDArray
-FixedNDArray::sum (int dim) const
+FixedNDArray::sum (octave_idx_type dim) const
 {
   FixedPoint zero;
 #if HAVE_6ARG_MX_ND_RED
@@ -423,7 +423,7 @@
 }
 
 FixedNDArray
-FixedNDArray::sumsq (int dim) const
+FixedNDArray::sumsq (octave_idx_type dim) const
 {
   FixedPoint zero;
 #if HAVE_6ARG_MX_ND_RED
@@ -438,14 +438,14 @@
 }
 
 FixedNDArray
-FixedNDArray::max (int dim) const
+FixedNDArray::max (octave_idx_type dim) const
 {
-  ArrayN<int> dummy_idx;
+  ArrayN<octave_idx_type> dummy_idx;
   return max (dummy_idx, dim);
 }
 
 FixedNDArray
-FixedNDArray::max (ArrayN<int>& idx_arg, int dim) const
+FixedNDArray::max (ArrayN<octave_idx_type>& idx_arg, octave_idx_type dim) const
 {
   dim_vector dv = dims ();
   dim_vector dr = dims ();
@@ -458,19 +458,19 @@
   FixedNDArray result (dr);
   idx_arg.resize (dr);
 
-  int x_stride = 1;
-  int x_len = dv(dim);
-  for (int i = 0; i < dim; i++)
+  octave_idx_type x_stride = 1;
+  octave_idx_type x_len = dv(dim);
+  for (octave_idx_type i = 0; i < dim; i++)
     x_stride *= dv(i);
 
-  for (int i = 0; i < dr.numel (); i++)
+  for (octave_idx_type i = 0; i < dr.numel (); i++)
     {
-      int x_offset;
+      octave_idx_type x_offset;
       if (x_stride == 1)
  x_offset = i * x_len;
       else
  {
-  int x_offset2 = 0;
+  octave_idx_type x_offset2 = 0;
   x_offset = i;
   while (x_offset >= x_stride)
     {
@@ -480,10 +480,10 @@
   x_offset += x_offset2 * x_stride * x_len;
  }
 
-      int idx_j = 0;
+      octave_idx_type idx_j = 0;
       FixedPoint tmp_max = elem (x_offset);;
 
-      for (int j = 1; j < x_len; j++)
+      for (octave_idx_type j = 1; j < x_len; j++)
  {
   FixedPoint tmp = elem (j * x_stride + x_offset);
 
@@ -502,14 +502,14 @@
 }
 
 FixedNDArray
-FixedNDArray::min (int dim) const
+FixedNDArray::min (octave_idx_type dim) const
 {
-  ArrayN<int> dummy_idx;
+  ArrayN<octave_idx_type> dummy_idx;
   return min (dummy_idx, dim);
 }
 
 FixedNDArray
-FixedNDArray::min (ArrayN<int>& idx_arg, int dim) const
+FixedNDArray::min (ArrayN<octave_idx_type>& idx_arg, octave_idx_type dim) const
 {
   dim_vector dv = dims ();
   dim_vector dr = dims ();
@@ -522,19 +522,19 @@
   FixedNDArray result (dr);
   idx_arg.resize (dr);
 
-  int x_stride = 1;
-  int x_len = dv(dim);
-  for (int i = 0; i < dim; i++)
+  octave_idx_type x_stride = 1;
+  octave_idx_type x_len = dv(dim);
+  for (octave_idx_type i = 0; i < dim; i++)
     x_stride *= dv(i);
 
-  for (int i = 0; i < dr.numel (); i++)
+  for (octave_idx_type i = 0; i < dr.numel (); i++)
     {
-      int x_offset;
+      octave_idx_type x_offset;
       if (x_stride == 1)
  x_offset = i * x_len;
       else
  {
-  int x_offset2 = 0;
+  octave_idx_type x_offset2 = 0;
   x_offset = i;
   while (x_offset >= x_stride)
     {
@@ -544,10 +544,10 @@
   x_offset += x_offset2 * x_stride * x_len;
  }
 
-      int idx_j = 0;
+      octave_idx_type idx_j = 0;
       FixedPoint tmp_min = elem (x_offset);
 
-      for (int j = 1; j < x_len; j++)
+      for (octave_idx_type j = 1; j < x_len; j++)
  {
   FixedPoint tmp = elem (j * x_stride + x_offset);
 
@@ -568,11 +568,11 @@
 FixedNDArray
 FixedNDArray::abs (void) const
 {
-  int nel = nelem ();
+  octave_idx_type nel = nelem ();
 
   FixedNDArray retval (dims());
 
-  for (int i = 0; i < nel; i++)
+  for (octave_idx_type i = 0; i < nel; i++)
     retval (i) = ::abs(elem (i));
 
   return retval;
@@ -583,7 +583,7 @@
 {
   FixedMatrix retval;
 
-  int nd = ndims ();
+  octave_idx_type nd = ndims ();
 
   switch (nd)
     {
@@ -608,9 +608,9 @@
 #define DO_FIXED_ND_FUNC(FUNC) \
   FixedNDArray FUNC (const FixedNDArray& x) \
   {  \
-    int nel = x.nelem (); \
+    octave_idx_type nel = x.nelem (); \
     FixedNDArray retval ( x.dims()); \
-    for (int i = 0; i < nel; i++) \
+    for (octave_idx_type i = 0; i < nel; i++) \
       retval(i) = FUNC ( x (i) ); \
     return retval; \
   }
@@ -694,7 +694,7 @@
 #ifdef HAVE_OLD_OCTAVE_CONCAT
 FixedNDArray
 concat (const FixedNDArray& ra, const FixedNDArray& rb,
- const Array<int>& ra_idx)
+ const Array<octave_idx_type>& ra_idx)
 {
   FixedNDArray retval (ra);
   if (rb.numel () > 0)
@@ -705,7 +705,7 @@
 
 #ifdef HAVE_OCTAVE_CONCAT
 FixedNDArray
-FixedNDArray::concat (const FixedNDArray& rb, const Array<int>& ra_idx)
+FixedNDArray::concat (const FixedNDArray& rb, const Array<octave_idx_type>& ra_idx)
 {
   if (rb.numel () > 0)
     insert (rb, ra_idx);
@@ -714,7 +714,7 @@
 
 FixedComplexNDArray
 FixedNDArray::concat (const FixedComplexNDArray& rb,
-      const Array<int>& ra_idx)
+      const Array<octave_idx_type>& ra_idx)
 {
   FixedComplexNDArray retval (*this);
   if (rb.numel () > 0)
@@ -725,7 +725,7 @@
 
 #if defined (HAVE_OCTAVE_CONCAT) || defined (HAVE_OLD_OCTAVE_CONCAT)
 FixedNDArray&
-FixedNDArray::insert (const FixedNDArray& a, const Array<int>& ra_idx)
+FixedNDArray::insert (const FixedNDArray& a, const Array<octave_idx_type>& ra_idx)
 {
   Array<FixedPoint>::insert (a, ra_idx);
   return *this;
@@ -733,9 +733,9 @@
 #endif
 
 void
-FixedNDArray::increment_index (Array<int>& ra_idx,
+FixedNDArray::increment_index (Array<octave_idx_type>& ra_idx,
        const dim_vector& dimensions,
-       int start_dimension)
+       octave_idx_type start_dimension)
 {
 #ifdef HAVE_OCTAVE_CONCAT
   ::increment_index (ra_idx, dimensions, start_dimension);
@@ -744,8 +744,8 @@
 #endif
 }
 
-int
-FixedNDArray::compute_index (Array<int>& ra_idx,
+octave_idx_type
+FixedNDArray::compute_index (Array<octave_idx_type>& ra_idx,
      const dim_vector& dimensions)
 {
 #ifdef HAVE_OCTAVE_CONCAT
--- octave-forge-2005.06.13/main/fixed/fixedNDArray.h.orig 2004-11-09 16:34:49.000000000 -0700
+++ octave-forge-2005.06.13/main/fixed/fixedNDArray.h 2005-09-28 12:00:25.959913973 -0600
@@ -120,34 +120,34 @@
 
   FixedNDArray operator ! (void) const;
 
-  boolNDArray all (int dim = -1) const;
-  boolNDArray any (int dim = -1) const;
+  boolNDArray all (octave_idx_type dim = -1) const;
+  boolNDArray any (octave_idx_type dim = -1) const;
 
 #ifdef HAVE_OLD_OCTAVE_CONCAT
   friend FixedNDArray concat (const FixedNDArray& ra, const FixedNDArray& rb,
-      const Array<int>& ra_idx);
+      const Array<octave_idx_type>& ra_idx);
 #endif
 
 #ifdef HAVE_OCTAVE_CONCAT
-  FixedNDArray concat (const FixedNDArray& rb, const Array<int>& ra_idx);
+  FixedNDArray concat (const FixedNDArray& rb, const Array<octave_idx_type>& ra_idx);
   FixedComplexNDArray concat (const FixedComplexNDArray& rb,
-      const Array<int>& ra_idx);
+      const Array<octave_idx_type>& ra_idx);
 #endif
 
 #if defined (HAVE_OCTAVE_CONCAT) || (HAVE_OLD_OCTAVE_CONCAT)
-  FixedNDArray& insert (const FixedNDArray& a, const Array<int>& ra_idx);
+  FixedNDArray& insert (const FixedNDArray& a, const Array<octave_idx_type>& ra_idx);
 #endif
 
-  FixedNDArray cumprod (int dim = -1) const;
-  FixedNDArray cumsum (int dim = -1) const;
-  FixedNDArray prod (int dim = -1) const;
-  FixedNDArray sum (int dim = -1) const;  
-  FixedNDArray sumsq (int dim = -1) const;
-
-  FixedNDArray max (int dim = 0) const;
-  FixedNDArray max (ArrayN<int>& index, int dim = 0) const;
-  FixedNDArray min (int dim = 0) const;
-  FixedNDArray min (ArrayN<int>& index, int dim = 0) const;
+  FixedNDArray cumprod (octave_idx_type dim = -1) const;
+  FixedNDArray cumsum (octave_idx_type dim = -1) const;
+  FixedNDArray prod (octave_idx_type dim = -1) const;
+  FixedNDArray sum (octave_idx_type dim = -1) const;  
+  FixedNDArray sumsq (octave_idx_type dim = -1) const;
+
+  FixedNDArray max (octave_idx_type dim = 0) const;
+  FixedNDArray max (ArrayN<octave_idx_type>& index, octave_idx_type dim = 0) const;
+  FixedNDArray min (octave_idx_type dim = 0) const;
+  FixedNDArray min (ArrayN<octave_idx_type>& index, octave_idx_type dim = 0) const;
   
   FixedNDArray abs (void) const;
   friend FixedNDArray cos  (const FixedNDArray &x);
@@ -177,11 +177,11 @@
 
   FixedNDArray squeeze (void) const { return ArrayN<FixedPoint>::squeeze (); }
 
-  static void increment_index (Array<int>& ra_idx,
+  static void increment_index (Array<octave_idx_type>& ra_idx,
        const dim_vector& dimensions,
-       int start_dimension = 0);
+       octave_idx_type start_dimension = 0);
 
-  static int compute_index (Array<int>& ra_idx,
+  static octave_idx_type compute_index (Array<octave_idx_type>& ra_idx,
     const dim_vector& dimensions);
 
   friend NDArray fixedpoint (const FixedNDArray& x) { return x.fixedpoint(); }
--- octave-forge-2005.06.13/main/optim/bfgsmin.cc.orig 2005-09-28 12:10:09.316616066 -0600
+++ octave-forge-2005.06.13/main/optim/bfgsmin.cc 2005-09-28 12:11:07.152700617 -0600
@@ -388,7 +388,7 @@
  return octave_value_list();
  }
  tempmatrix = f_return(0).matrix_value();
- g = tempmatrix.row(0).transpose();
+ g = tempmatrix.row((octave_idx_type)0).transpose();
  }
 
  // check that gradient is ok
@@ -507,7 +507,7 @@
  g_args(1) = f_args;
  f_return = feval("numgradient", g_args);
  tempmatrix = f_return(0).matrix_value();
- g_new = tempmatrix.row(0).transpose();
+ g_new = tempmatrix.row((octave_idx_type)0).transpose();
  }
 
  // Check that gradient is ok
--- octave-forge-2005.06.13/main/specfun/ellipj.cc.orig 2005-09-28 12:14:14.649490356 -0600
+++ octave-forge-2005.06.13/main/specfun/ellipj.cc 2005-09-28 12:15:06.258778554 -0600
@@ -372,8 +372,8 @@
                 int uc = u.cols ();
 
               if (mr == 1 && uc == 1) {  // u column, m row
-                RowVector rm = m.row (0);
-                ColumnVector cu = u.column (0);
+                RowVector rm = m.row ((octave_idx_type)0);
+                ColumnVector cu = u.column ((octave_idx_type)0);
 
                 Matrix sn (ur, mc), cn (ur, mc), dn (ur, mc);
                 Matrix err(ur,mc);
@@ -411,8 +411,8 @@
                 int uc = u.cols ();
 
               if (mr == 1 && uc == 1) {
-                RowVector rm = m.row (0);
-                ComplexColumnVector cu = u.column (0);
+                RowVector rm = m.row ((octave_idx_type)0);
+                ComplexColumnVector cu = u.column ((octave_idx_type)0);
 
                 ComplexMatrix sn (ur, mc), cn (ur, mc), dn (ur, mc);
                 Matrix err(ur,mc);
--- octave-forge-2005.06.13/main/sparse/complex_sparse_ops.cc.orig 2005-09-28 12:16:27.152095403 -0600
+++ octave-forge-2005.06.13/main/sparse/complex_sparse_ops.cc 2005-09-28 12:17:31.223969914 -0600
@@ -573,9 +573,9 @@
        extract_keyword (is, "columns", cols) ) {
      ComplexMatrix tmp( nnz, 3);
      is >> tmp;
-     ColumnVector ridxA= real( tmp.column(0) );
-     ColumnVector cidxA= real( tmp.column(1) );
-     ComplexColumnVector coefA= tmp.column(2);
+     ColumnVector ridxA= real( tmp.column((octave_idx_type)0) );
+     ColumnVector cidxA= real( tmp.column((octave_idx_type)1) );
+     ComplexColumnVector coefA= tmp.column((octave_idx_type)2);
      X= assemble_sparse( cols, rows, coefA, ridxA, cidxA, 0);
   }
   else {
--- octave-forge-2005.06.13/main/sparse/sparse_ops.cc.orig 2005-09-28 12:22:34.253926519 -0600
+++ octave-forge-2005.06.13/main/sparse/sparse_ops.cc 2005-09-28 12:22:48.556452606 -0600
@@ -641,9 +641,9 @@
        extract_keyword (is, "columns", cols) ) {
      Matrix tmp( nnz, 3);
      is >> tmp;
-     ColumnVector ridxA= tmp.column(0);
-     ColumnVector cidxA= tmp.column(1);
-     ColumnVector coefA= tmp.column(2);
+     ColumnVector ridxA= tmp.column((octave_idx_type)0);
+     ColumnVector cidxA= tmp.column((octave_idx_type)1);
+     ColumnVector coefA= tmp.column((octave_idx_type)2);
      X= assemble_sparse( cols, rows, coefA, ridxA, cidxA, 0);
   }
   else {
Reply | Threaded
Open this post in threaded view
|

Re: [OctDev] x86_64 patches

Paul Kienzle-3

On Sep 28, 2005, at 3:40 PM, Orion Poplawski wrote:

> Attached is a patch that allowed me to compile octave-forge-2005.06.13
> on octave-2.9.2 x86_64.  Main issue is the changing of octave_idx_type
> from int to long, so requiring a change of int variables to
> octave_idx_type.
>

I'm surprised you needed to explicitly type constants such as 0,1,2
which were parameters to functions, but I applied the changes anyway.  
With a minor tweak to octave-forge/configure.base, it even compiles for
octave without octave_idx_type.

        - Paul



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Octave-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/octave-dev