diff liboctave/CmplxQRP.cc @ 5275:23b37da9fd5b

[project @ 2005-04-08 16:07:35 by jwe]
author jwe
date Fri, 08 Apr 2005 16:07:37 +0000
parents e35b034d3523
children 4c8a2e4e0717
line wrap: on
line diff
--- a/liboctave/CmplxQRP.cc	Thu Apr 07 21:51:37 2005 +0000
+++ b/liboctave/CmplxQRP.cc	Fri Apr 08 16:07:37 2005 +0000
@@ -33,14 +33,14 @@
 extern "C"
 {
   F77_RET_T
-  F77_FUNC (zgeqpf, ZGEQPF) (const int&, const int&, Complex*,
-			     const int&, int*, Complex*, Complex*,
-			     double*, int&);
+  F77_FUNC (zgeqpf, ZGEQPF) (const octave_idx_type&, const octave_idx_type&, Complex*,
+			     const octave_idx_type&, octave_idx_type*, Complex*, Complex*,
+			     double*, octave_idx_type&);
 
   F77_RET_T
-  F77_FUNC (zungqr, ZUNGQR) (const int&, const int&, const int&,
-			     Complex*, const int&, Complex*,
-			     Complex*, const int&, int&);
+  F77_FUNC (zungqr, ZUNGQR) (const octave_idx_type&, const octave_idx_type&, const octave_idx_type&,
+			     Complex*, const octave_idx_type&, Complex*,
+			     Complex*, const octave_idx_type&, octave_idx_type&);
 }
 
 // It would be best to share some of this code with ComplexQR class...
@@ -56,8 +56,8 @@
 {
   assert (qr_type != QR::raw);
 
-  int m = a.rows ();
-  int n = a.cols ();
+  octave_idx_type m = a.rows ();
+  octave_idx_type n = a.cols ();
 
   if (m == 0 || n == 0)
     {
@@ -66,15 +66,15 @@
       return;
     }
 
-  int min_mn = m < n ? m : n;
+  octave_idx_type min_mn = m < n ? m : n;
   Array<Complex> tau (min_mn);
   Complex *ptau = tau.fortran_vec ();
 
-  int lwork = 3*n > 32*m ? 3*n : 32*m;
+  octave_idx_type lwork = 3*n > 32*m ? 3*n : 32*m;
   Array<Complex> work (lwork);
   Complex *pwork = work.fortran_vec ();
 
-  int info = 0;
+  octave_idx_type info = 0;
 
   ComplexMatrix A_fact = a;
   if (m > n && qr_type != QR::economy)
@@ -85,8 +85,8 @@
   Array<double> rwork (2*n);
   double *prwork = rwork.fortran_vec ();
 
-  Array<int> jpvt (n, 0);
-  int *pjpvt = jpvt.fortran_vec ();
+  Array<octave_idx_type> jpvt (n, 0);
+  octave_idx_type *pjpvt = jpvt.fortran_vec ();
 
   // Code to enforce a certain permutation could go here...
 
@@ -103,27 +103,27 @@
       if (qr_type == QR::economy)
 	{
 	  p.resize (1, n, 0.0);
-	  for (int j = 0; j < n; j++)
+	  for (octave_idx_type j = 0; j < n; j++)
 	    p.elem (0, j) = jpvt.elem (j);
 	}
       else
 	{
 	  p.resize (n, n, 0.0);
-	  for (int j = 0; j < n; j++)
+	  for (octave_idx_type j = 0; j < n; j++)
 	    p.elem (jpvt.elem (j) - 1, j) = 1.0;
 	}
 
-      int n2 = (qr_type == QR::economy) ? min_mn : m;
+      octave_idx_type n2 = (qr_type == QR::economy) ? min_mn : m;
 
       if (qr_type == QR::economy && m > n)
 	r.resize (n, n, 0.0);
       else
 	r.resize (m, n, 0.0);
 
-      for (int j = 0; j < n; j++)
+      for (octave_idx_type j = 0; j < n; j++)
 	{
-	  int limit = j < min_mn-1 ? j : min_mn-1;
-	  for (int i = 0; i <= limit; i++)
+	  octave_idx_type limit = j < min_mn-1 ? j : min_mn-1;
+	  for (octave_idx_type i = 0; i <= limit; i++)
 	    r.elem (i, j) = A_fact.elem (i, j);
 	}