changeset 22988:cd33c785e80e

put to_f77_int inside octave namespace * f77-fcn.h (to_f77_int): Move inside octave namespace. Change all uses.
author John W. Eaton <jwe@octave.org>
date Fri, 30 Dec 2016 14:03:01 -0500
parents 4643c8bce4e7
children 698c1190d790
files libinterp/corefcn/__pchip_deriv__.cc libinterp/corefcn/dot.cc libinterp/corefcn/ordschur.cc libinterp/corefcn/qz.cc liboctave/array/CColVector.cc liboctave/array/CMatrix.cc liboctave/array/CRowVector.cc liboctave/array/CSparse.cc liboctave/array/dColVector.cc liboctave/array/dMatrix.cc liboctave/array/dRowVector.cc liboctave/array/dSparse.cc liboctave/array/fCColVector.cc liboctave/array/fCMatrix.cc liboctave/array/fCRowVector.cc liboctave/array/fColVector.cc liboctave/array/fMatrix.cc liboctave/array/fRowVector.cc liboctave/cruft/misc/f77-fcn.h liboctave/numeric/DASPK.cc liboctave/numeric/DASRT.cc liboctave/numeric/DASSL.cc liboctave/numeric/EIG.cc liboctave/numeric/LSODE.cc liboctave/numeric/Quad.cc liboctave/numeric/aepbalance.cc liboctave/numeric/chol.cc liboctave/numeric/eigs-base.cc liboctave/numeric/fEIG.cc liboctave/numeric/gepbalance.cc liboctave/numeric/gsvd.cc liboctave/numeric/hess.cc liboctave/numeric/lo-specfun.cc liboctave/numeric/lu.cc liboctave/numeric/oct-convn.cc liboctave/numeric/qr.cc liboctave/numeric/qrp.cc liboctave/numeric/schur.cc liboctave/numeric/svd.cc
diffstat 39 files changed, 1032 insertions(+), 1031 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/__pchip_deriv__.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/libinterp/corefcn/__pchip_deriv__.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -55,7 +55,7 @@
           FloatColumnVector xvec (args(0).float_vector_value ());
           FloatMatrix ymat (args(1).float_matrix_value ());
 
-          F77_INT nx = to_f77_int (xvec.numel ());
+          F77_INT nx = octave::to_f77_int (xvec.numel ());
 
           if (nx < 2)
             error ("__pchip_deriv__: X must be at least of length 2");
@@ -69,7 +69,7 @@
           FloatMatrix dmat (nyr, nyc);
 
           F77_INT ierr;
-          const F77_INT incfd = rows ? to_f77_int (nyr) : 1;
+          const F77_INT incfd = rows ? octave::to_f77_int (nyr) : 1;
           volatile const octave_idx_type inc = rows ? 1 : nyr;
           volatile octave_idx_type k = 0;
 
@@ -93,7 +93,7 @@
           ColumnVector xvec (args(0).vector_value ());
           Matrix ymat (args(1).matrix_value ());
 
-          F77_INT nx = to_f77_int (xvec.numel ());
+          F77_INT nx = octave::to_f77_int (xvec.numel ());
 
           if (nx < 2)
             error ("__pchip_deriv__: X must be at least of length 2");
@@ -107,7 +107,7 @@
           Matrix dmat (nyr, nyc);
 
           F77_INT ierr;
-          const F77_INT incfd = rows ? to_f77_int (nyr) : 1;
+          const F77_INT incfd = rows ? octave::to_f77_int (nyr) : 1;
           volatile const octave_idx_type inc = rows ? 1 : nyr;
           volatile octave_idx_type k = 0;
 
--- a/libinterp/corefcn/dot.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/libinterp/corefcn/dot.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -59,9 +59,9 @@
         }
     }
 
-  m = to_f77_int (tmp_m);
-  n = to_f77_int (tmp_n);
-  k = to_f77_int (tmp_k);
+  m = octave::to_f77_int (tmp_m);
+  n = octave::to_f77_int (tmp_n);
+  k = octave::to_f77_int (tmp_k);
 }
 
 DEFUN (dot, args, ,
@@ -260,9 +260,9 @@
   const dim_vector dimx = argx.dims ();
   const dim_vector dimy = argy.dims ();
   int nd = dimx.ndims ();
-  F77_INT m = to_f77_int (dimx(0));
-  F77_INT k = to_f77_int (dimx(1));
-  F77_INT n = to_f77_int (dimy(1));
+  F77_INT m = octave::to_f77_int (dimx(0));
+  F77_INT k = octave::to_f77_int (dimx(1));
+  F77_INT n = octave::to_f77_int (dimy(1));
   octave_idx_type tmp_np = 1;
   bool match = dimy(0) == k && nd == dimy.ndims ();
   dim_vector dimz = dim_vector::alloc (nd);
@@ -274,7 +274,7 @@
       dimz(i) = dimx(i);
       tmp_np *= dimz(i);
     }
-  F77_INT np = to_f77_int (tmp_np);
+  F77_INT np = octave::to_f77_int (tmp_np);
 
   if (! match)
     error ("blkmm: A and B dimensions don't match: (%s) and (%s)",
--- a/libinterp/corefcn/ordschur.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/libinterp/corefcn/ordschur.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -114,10 +114,10 @@
                                                 \
   retval = ovl (U, S);
 
-  F77_INT n = to_f77_int (sel_n);
+  F77_INT n = octave::to_f77_int (sel_n);
   Array<F77_INT> sel (dim_vector (n, 1));
   for (F77_INT i = 0; i < n; i++)
-    sel.xelem (i) = to_f77_int (sel_arg.xelem (i));
+    sel.xelem (i) = octave::to_f77_int (sel_arg.xelem (i));
 
   if (double_type)
     {
--- a/libinterp/corefcn/qz.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/libinterp/corefcn/qz.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -285,8 +285,8 @@
 #endif
 
   // Argument 1: check if it's okay dimensioned.
-  F77_INT nn = to_f77_int (args(0).rows ());
-  F77_INT nc = to_f77_int (args(0).columns ());
+  F77_INT nn = octave::to_f77_int (args(0).rows ());
+  F77_INT nc = octave::to_f77_int (args(0).columns ());
 
 #if defined (DEBUG)
   std::cout << "argument 1 dimensions: ("
@@ -318,8 +318,8 @@
 #endif
 
   // Extract argument 2 (bb, or cbb if complex).
-  F77_INT b_nr = to_f77_int (args(1).rows ());
-  F77_INT b_nc = to_f77_int (args(1).columns ());
+  F77_INT b_nr = octave::to_f77_int (args(1).rows ());
+  F77_INT b_nc = octave::to_f77_int (args(1).columns ());
 
   if (nn != b_nc || nn != b_nr)
     err_nonconformant ();
--- a/liboctave/array/CColVector.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/array/CColVector.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -300,10 +300,10 @@
 {
   ComplexColumnVector retval;
 
-  F77_INT nr = to_f77_int (m.rows ());
-  F77_INT nc = to_f77_int (m.cols ());
+  F77_INT nr = octave::to_f77_int (m.rows ());
+  F77_INT nc = octave::to_f77_int (m.cols ());
 
-  F77_INT a_len = to_f77_int (a.numel ());
+  F77_INT a_len = octave::to_f77_int (a.numel ());
 
   if (nc != a_len)
     octave::err_nonconformant ("operator *", nr, nc, a_len, 1);
@@ -344,10 +344,10 @@
 ComplexColumnVector
 operator * (const DiagMatrix& m, const ComplexColumnVector& a)
 {
-  F77_INT nr = to_f77_int (m.rows ());
-  F77_INT nc = to_f77_int (m.cols ());
+  F77_INT nr = octave::to_f77_int (m.rows ());
+  F77_INT nc = octave::to_f77_int (m.cols ());
 
-  F77_INT a_len = to_f77_int (a.numel ());
+  F77_INT a_len = octave::to_f77_int (a.numel ());
 
   if (nc != a_len)
     octave::err_nonconformant ("operator *", nr, nc, a_len, 1);
@@ -369,10 +369,10 @@
 ComplexColumnVector
 operator * (const ComplexDiagMatrix& m, const ColumnVector& a)
 {
-  F77_INT nr = to_f77_int (m.rows ());
-  F77_INT nc = to_f77_int (m.cols ());
+  F77_INT nr = octave::to_f77_int (m.rows ());
+  F77_INT nc = octave::to_f77_int (m.cols ());
 
-  F77_INT a_len = to_f77_int (a.numel ());
+  F77_INT a_len = octave::to_f77_int (a.numel ());
 
   if (nc != a_len)
     octave::err_nonconformant ("operator *", nr, nc, a_len, 1);
@@ -394,10 +394,10 @@
 ComplexColumnVector
 operator * (const ComplexDiagMatrix& m, const ComplexColumnVector& a)
 {
-  F77_INT nr = to_f77_int (m.rows ());
-  F77_INT nc = to_f77_int (m.cols ());
+  F77_INT nr = octave::to_f77_int (m.rows ());
+  F77_INT nc = octave::to_f77_int (m.cols ());
 
-  F77_INT a_len = to_f77_int (a.numel ());
+  F77_INT a_len = octave::to_f77_int (a.numel ());
 
   if (nc != a_len)
     octave::err_nonconformant ("operator *", nr, nc, a_len, 1);
--- a/liboctave/array/CMatrix.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/array/CMatrix.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -759,8 +759,8 @@
 {
   ComplexMatrix retval;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
 
   if (nr != nc || nr == 0 || nc == 0)
     (*current_liboctave_error_handler) ("inverse requires square matrix");
@@ -818,8 +818,8 @@
 {
   ComplexMatrix retval;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
 
   if (nr != nc)
     (*current_liboctave_error_handler) ("inverse requires square matrix");
@@ -1098,12 +1098,12 @@
 
   if (nr == 1 || nc == 1)
     {
-      npts = to_f77_int (nr > nc ? nr : nc);
+      npts = octave::to_f77_int (nr > nc ? nr : nc);
       nsamples = 1;
     }
   else
     {
-      npts = to_f77_int (nr);
+      npts = octave::to_f77_int (nr);
       nsamples = nc;
     }
 
@@ -1141,12 +1141,12 @@
 
   if (nr == 1 || nc == 1)
     {
-      npts = to_f77_int (nr > nc ? nr : nc);
+      npts = octave::to_f77_int (nr > nc ? nr : nc);
       nsamples = 1;
     }
   else
     {
-      npts = to_f77_int (nr);
+      npts = octave::to_f77_int (nr);
       nsamples = nc;
     }
 
@@ -1179,8 +1179,8 @@
 {
   ComplexMatrix retval;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
 
   F77_INT npts, nsamples;
 
@@ -1247,8 +1247,8 @@
 {
   ComplexMatrix retval;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
 
   F77_INT npts, nsamples;
 
@@ -1348,8 +1348,8 @@
   info = 0;
   rcon = 0.0;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
 
   if (nr != nc)
     (*current_liboctave_error_handler) ("matrix must be square");
@@ -1501,8 +1501,8 @@
 ComplexMatrix::rcond (MatrixType &mattype) const
 {
   double rcon = octave::numeric_limits<double>::NaN ();
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
 
   if (nr != nc)
     (*current_liboctave_error_handler) ("matrix must be square");
@@ -1675,11 +1675,11 @@
 {
   ComplexMatrix retval;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
-
-  F77_INT b_nr = to_f77_int (b.rows ());
-  F77_INT b_nc = to_f77_int (b.cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
+
+  F77_INT b_nr = octave::to_f77_int (b.rows ());
+  F77_INT b_nc = octave::to_f77_int (b.cols ());
 
   if (nr != b_nr)
     (*current_liboctave_error_handler)
@@ -1773,11 +1773,11 @@
 {
   ComplexMatrix retval;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
-
-  F77_INT b_nr = to_f77_int (b.rows ());
-  F77_INT b_nc = to_f77_int (b.cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
+
+  F77_INT b_nr = octave::to_f77_int (b.rows ());
+  F77_INT b_nc = octave::to_f77_int (b.cols ());
 
   if (nr != b_nr)
     (*current_liboctave_error_handler)
@@ -1871,11 +1871,11 @@
 {
   ComplexMatrix retval;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
-
-  F77_INT b_nr = to_f77_int (b.rows ());
-  F77_INT b_nc = to_f77_int (b.cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
+
+  F77_INT b_nr = octave::to_f77_int (b.rows ());
+  F77_INT b_nc = octave::to_f77_int (b.cols ());
 
   if (nr != nc || nr != b_nr)
     (*current_liboctave_error_handler)
@@ -2423,13 +2423,13 @@
 {
   ComplexMatrix retval;
 
-  F77_INT nrhs = to_f77_int (b.cols ());
-
-  F77_INT m = to_f77_int (rows ());
-  F77_INT n = to_f77_int (cols ());
-
-  F77_INT b_nr = to_f77_int (b.rows ());
-  F77_INT b_nc = to_f77_int (b.cols ());
+  F77_INT nrhs = octave::to_f77_int (b.cols ());
+
+  F77_INT m = octave::to_f77_int (rows ());
+  F77_INT n = octave::to_f77_int (cols ());
+
+  F77_INT b_nr = octave::to_f77_int (b.rows ());
+  F77_INT b_nc = octave::to_f77_int (b.cols ());
 
   if (m != b_nr)
     (*current_liboctave_error_handler)
@@ -2649,10 +2649,10 @@
 
   F77_INT nrhs = 1;
 
-  F77_INT m = to_f77_int (rows ());
-  F77_INT n = to_f77_int (cols ());
-
-  F77_INT b_nel = to_f77_int (b.numel ());
+  F77_INT m = octave::to_f77_int (rows ());
+  F77_INT n = octave::to_f77_int (cols ());
+
+  F77_INT b_nel = octave::to_f77_int (b.numel ());
 
   if (m != b_nel)
     (*current_liboctave_error_handler)
@@ -2779,11 +2779,11 @@
 {
   ComplexMatrix retval;
 
-  F77_INT len = to_f77_int (v.numel ());
+  F77_INT len = octave::to_f77_int (v.numel ());
 
   if (len != 0)
     {
-      F77_INT a_len = to_f77_int (a.numel ());
+      F77_INT a_len = octave::to_f77_int (a.numel ());
 
       retval = ComplexMatrix (len, a_len);
       Complex *c = retval.fortran_vec ();
@@ -3410,8 +3410,8 @@
 
   // Solve the sylvester equation, back-transform, and return the solution.
 
-  F77_INT a_nr = to_f77_int (a.rows ());
-  F77_INT b_nr = to_f77_int (b.rows ());
+  F77_INT a_nr = octave::to_f77_int (a.rows ());
+  F77_INT b_nr = octave::to_f77_int (b.rows ());
 
   double scale;
   F77_INT info;
@@ -3494,11 +3494,11 @@
   bool cja = transa == blas_conj_trans;
   bool cjb = transb == blas_conj_trans;
 
-  F77_INT a_nr = to_f77_int (tra ? a.cols () : a.rows ());
-  F77_INT a_nc = to_f77_int (tra ? a.rows () : a.cols ());
-
-  F77_INT b_nr = to_f77_int (trb ? b.cols () : b.rows ());
-  F77_INT b_nc = to_f77_int (trb ? b.rows () : b.cols ());
+  F77_INT a_nr = octave::to_f77_int (tra ? a.cols () : a.rows ());
+  F77_INT a_nc = octave::to_f77_int (tra ? a.rows () : a.cols ());
+
+  F77_INT b_nr = octave::to_f77_int (trb ? b.cols () : b.rows ());
+  F77_INT b_nc = octave::to_f77_int (trb ? b.rows () : b.cols ());
 
   if (a_nc != b_nr)
     octave::err_nonconformant ("operator *", a_nr, a_nc, b_nr, b_nc);
@@ -3507,7 +3507,7 @@
     retval = ComplexMatrix (a_nr, b_nc, 0.0);
   else if (a.data () == b.data () && a_nr == b_nc && tra != trb)
     {
-      F77_INT lda = to_f77_int (a.rows ());
+      F77_INT lda = octave::to_f77_int (a.rows ());
 
       // FIXME: looking at the reference BLAS, it appears that it
       // should not be necessary to initialize the output matrix if
@@ -3547,10 +3547,10 @@
     }
   else
     {
-      F77_INT lda = to_f77_int (a.rows ());
-      F77_INT tda = to_f77_int (a.cols ());
-      F77_INT ldb = to_f77_int (b.rows ());
-      F77_INT tdb = to_f77_int (b.cols ());
+      F77_INT lda = octave::to_f77_int (a.rows ());
+      F77_INT tda = octave::to_f77_int (a.cols ());
+      F77_INT ldb = octave::to_f77_int (b.rows ());
+      F77_INT tdb = octave::to_f77_int (b.cols ());
 
       retval = ComplexMatrix (a_nr, b_nc, 0.0);
       Complex *c = retval.fortran_vec ();
--- a/liboctave/array/CRowVector.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/array/CRowVector.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -282,10 +282,10 @@
 {
   ComplexRowVector retval;
 
-  F77_INT len = to_f77_int (v.numel ());
+  F77_INT len = octave::to_f77_int (v.numel ());
 
-  F77_INT a_nr = to_f77_int (a.rows ());
-  F77_INT a_nc = to_f77_int (a.cols ());
+  F77_INT a_nr = octave::to_f77_int (a.rows ());
+  F77_INT a_nc = octave::to_f77_int (a.cols ());
 
   if (a_nr != len)
     octave::err_nonconformant ("operator *", 1, len, a_nr, a_nc);
@@ -406,9 +406,9 @@
 {
   Complex retval (0.0, 0.0);
 
-  F77_INT len = to_f77_int (v.numel ());
+  F77_INT len = octave::to_f77_int (v.numel ());
 
-  F77_INT a_len = to_f77_int (a.numel ());
+  F77_INT a_len = octave::to_f77_int (a.numel ());
 
   if (len != a_len)
     octave::err_nonconformant ("operator *", len, a_len);
--- a/liboctave/array/CSparse.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/array/CSparse.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -3683,13 +3683,13 @@
                   }
             }
 
-          F77_INT b_nr = to_f77_int (b.rows ());
-          F77_INT b_nc = to_f77_int (b.cols ());
+          F77_INT b_nr = octave::to_f77_int (b.rows ());
+          F77_INT b_nc = octave::to_f77_int (b.cols ());
 
           retval = ComplexMatrix (b);
           Complex *result = retval.fortran_vec ();
 
-          F77_INT tmp_nr = to_f77_int (nr);
+          F77_INT tmp_nr = octave::to_f77_int (nr);
 
           F77_INT tmp_err = 0;
 
@@ -3749,13 +3749,13 @@
                   }
             }
 
-          F77_INT b_nr = to_f77_int (b.rows ());
-          F77_INT b_nc = to_f77_int (b.cols ());
+          F77_INT b_nr = octave::to_f77_int (b.rows ());
+          F77_INT b_nc = octave::to_f77_int (b.cols ());
 
           retval = ComplexMatrix (b);
           Complex *result = retval.fortran_vec ();
 
-          F77_INT tmp_nr = to_f77_int (nr);
+          F77_INT tmp_nr = octave::to_f77_int (nr);
 
           F77_INT tmp_err = 0;
 
@@ -3861,7 +3861,7 @@
                   }
             }
 
-          F77_INT tmp_nr = to_f77_int (nr);
+          F77_INT tmp_nr = octave::to_f77_int (nr);
 
           F77_INT tmp_err = 0;
 
@@ -3887,7 +3887,7 @@
             {
               char job = 'N';
               volatile octave_idx_type x_nz = b.nnz ();
-              F77_INT b_nr = to_f77_int (b.rows ());
+              F77_INT b_nr = octave::to_f77_int (b.rows ());
               octave_idx_type b_nc = b.cols ();
               retval = SparseComplexMatrix (nr, b_nc, x_nz);
               retval.xcidx (0) = 0;
@@ -4009,15 +4009,15 @@
                   }
             }
 
-          F77_INT b_nr = to_f77_int (b.rows ());
-          F77_INT b_nc = to_f77_int (b.cols ());
+          F77_INT b_nr = octave::to_f77_int (b.rows ());
+          F77_INT b_nc = octave::to_f77_int (b.cols ());
 
           rcond = 1.;
 
           retval = ComplexMatrix (b);
           Complex *result = retval.fortran_vec ();
 
-          F77_INT tmp_nr = to_f77_int (nr);
+          F77_INT tmp_nr = octave::to_f77_int (nr);
 
           F77_INT tmp_err = 0;
 
@@ -4075,15 +4075,15 @@
                   }
             }
 
-          F77_INT b_nr = to_f77_int (b.rows ());
-          F77_INT b_nc = to_f77_int (b.cols ());
+          F77_INT b_nr = octave::to_f77_int (b.rows ());
+          F77_INT b_nc = octave::to_f77_int (b.cols ());
 
           rcond = 1.;
 
           retval = ComplexMatrix (b);
           Complex *result = retval.fortran_vec ();
 
-          F77_INT tmp_nr = to_f77_int (nr);
+          F77_INT tmp_nr = octave::to_f77_int (nr);
 
           F77_INT tmp_err = 0;
 
@@ -4187,7 +4187,7 @@
                   }
             }
 
-          F77_INT tmp_nr = to_f77_int (nr);
+          F77_INT tmp_nr = octave::to_f77_int (nr);
 
           F77_INT tmp_err = 0;
 
@@ -4213,7 +4213,7 @@
             {
               rcond = 1.;
               char job = 'N';
-              F77_INT b_nr = to_f77_int (b.rows ());
+              F77_INT b_nr = octave::to_f77_int (b.rows ());
               octave_idx_type b_nc = b.cols ();
               OCTAVE_LOCAL_BUFFER (Complex, Bx, b_nr);
 
@@ -4311,7 +4311,7 @@
 
       if (typ == MatrixType::Banded_Hermitian)
         {
-          F77_INT n_lower = to_f77_int (mattype.nlower ());
+          F77_INT n_lower = octave::to_f77_int (mattype.nlower ());
           F77_INT ldm = n_lower + 1;
           ComplexMatrix m_band (ldm, nc);
           Complex *tmp_data = m_band.fortran_vec ();
@@ -4338,7 +4338,7 @@
           if (calc_cond)
             anorm = m_band.abs ().sum ().row (0).max ();
 
-          F77_INT tmp_nr = to_f77_int (nr);
+          F77_INT tmp_nr = octave::to_f77_int (nr);
 
           F77_INT tmp_err = 0;
 
@@ -4401,8 +4401,8 @@
                   retval = ComplexMatrix (b);
                   Complex *result = retval.fortran_vec ();
 
-                  F77_INT b_nr = to_f77_int (b.rows ());
-                  F77_INT b_nc = to_f77_int (b.cols ());
+                  F77_INT b_nr = octave::to_f77_int (b.rows ());
+                  F77_INT b_nc = octave::to_f77_int (b.cols ());
 
                   F77_XFCN (zpbtrs, ZPBTRS,
                             (F77_CONST_CHAR_ARG2 (&job, 1),
@@ -4426,8 +4426,8 @@
       if (typ == MatrixType::Banded)
         {
           // Create the storage for the banded form of the sparse matrix
-          F77_INT n_upper = to_f77_int (mattype.nupper ());
-          F77_INT n_lower = to_f77_int (mattype.nlower ());
+          F77_INT n_upper = octave::to_f77_int (mattype.nupper ());
+          F77_INT n_lower = octave::to_f77_int (mattype.nlower ());
           F77_INT ldm = n_upper + 2 * n_lower + 1;
 
           ComplexMatrix m_band (ldm, nc);
@@ -4463,7 +4463,7 @@
           Array<F77_INT> ipvt (dim_vector (nr, 1));
           F77_INT *pipvt = ipvt.fortran_vec ();
 
-          F77_INT tmp_nr = to_f77_int (nr);
+          F77_INT tmp_nr = octave::to_f77_int (nr);
 
           F77_INT tmp_err = 0;
 
@@ -4498,7 +4498,7 @@
                   Array<double> iz (dim_vector (nr, 1));
                   double *piz = iz.fortran_vec ();
 
-                  F77_INT tmp_nc = to_f77_int (nc);
+                  F77_INT tmp_nc = octave::to_f77_int (nc);
 
                   F77_XFCN (zgbcon, ZGBCON,
                             (F77_CONST_CHAR_ARG2 (&job, 1),
@@ -4534,8 +4534,8 @@
                   retval = ComplexMatrix (b);
                   Complex *result = retval.fortran_vec ();
 
-                  F77_INT b_nr = to_f77_int (b.rows ());
-                  F77_INT b_nc = to_f77_int (b.cols ());
+                  F77_INT b_nr = octave::to_f77_int (b.rows ());
+                  F77_INT b_nc = octave::to_f77_int (b.cols ());
 
                   char job = 'N';
                   F77_XFCN (zgbtrs, ZGBTRS,
@@ -4581,7 +4581,7 @@
 
       if (typ == MatrixType::Banded_Hermitian)
         {
-          F77_INT n_lower = to_f77_int (mattype.nlower ());
+          F77_INT n_lower = octave::to_f77_int (mattype.nlower ());
           F77_INT ldm = n_lower + 1;
 
           ComplexMatrix m_band (ldm, nc);
@@ -4609,7 +4609,7 @@
           if (calc_cond)
             anorm = m_band.abs ().sum ().row (0).max ();
 
-          F77_INT tmp_nr = to_f77_int (nr);
+          F77_INT tmp_nr = octave::to_f77_int (nr);
 
           F77_INT tmp_err = 0;
 
@@ -4667,7 +4667,7 @@
 
               if (err == 0)
                 {
-                  F77_INT b_nr = to_f77_int (b.rows ());
+                  F77_INT b_nr = octave::to_f77_int (b.rows ());
                   octave_idx_type b_nc = b.cols ();
                   OCTAVE_LOCAL_BUFFER (Complex, Bx, b_nr);
 
@@ -4729,8 +4729,8 @@
       if (typ == MatrixType::Banded)
         {
           // Create the storage for the banded form of the sparse matrix
-          F77_INT n_upper = to_f77_int (mattype.nupper ());
-          F77_INT n_lower = to_f77_int (mattype.nlower ());
+          F77_INT n_upper = octave::to_f77_int (mattype.nupper ());
+          F77_INT n_lower = octave::to_f77_int (mattype.nlower ());
           F77_INT ldm = n_upper + 2 * n_lower + 1;
 
           ComplexMatrix m_band (ldm, nc);
@@ -4766,7 +4766,7 @@
           Array<F77_INT> ipvt (dim_vector (nr, 1));
           F77_INT *pipvt = ipvt.fortran_vec ();
 
-          F77_INT tmp_nr = to_f77_int (nr);
+          F77_INT tmp_nr = octave::to_f77_int (nr);
 
           F77_INT tmp_err = 0;
 
@@ -4799,7 +4799,7 @@
                   Array<double> iz (dim_vector (nr, 1));
                   double *piz = iz.fortran_vec ();
 
-                  F77_INT tmp_nc = to_f77_int (nc);
+                  F77_INT tmp_nc = octave::to_f77_int (nc);
 
                   F77_XFCN (zgbcon, ZGBCON,
                             (F77_CONST_CHAR_ARG2 (&job, 1),
@@ -4834,7 +4834,7 @@
                 {
                   char job = 'N';
                   volatile octave_idx_type x_nz = b.nnz ();
-                  F77_INT b_nr = to_f77_int (b.rows ());
+                  F77_INT b_nr = octave::to_f77_int (b.rows ());
                   octave_idx_type b_nc = b.cols ();
                   retval = SparseComplexMatrix (nr, b_nc, x_nz);
                   retval.xcidx (0) = 0;
@@ -4919,7 +4919,7 @@
 
       if (typ == MatrixType::Banded_Hermitian)
         {
-          F77_INT n_lower = to_f77_int (mattype.nlower ());
+          F77_INT n_lower = octave::to_f77_int (mattype.nlower ());
           F77_INT ldm = n_lower + 1;
 
           ComplexMatrix m_band (ldm, nc);
@@ -4947,7 +4947,7 @@
           if (calc_cond)
             anorm = m_band.abs ().sum ().row (0).max ();
 
-          F77_INT tmp_nr = to_f77_int (nr);
+          F77_INT tmp_nr = octave::to_f77_int (nr);
 
           F77_INT tmp_err = 0;
 
@@ -5007,8 +5007,8 @@
 
               if (err == 0)
                 {
-                  F77_INT b_nr = to_f77_int (b.rows ());
-                  F77_INT b_nc = to_f77_int (b.cols ());
+                  F77_INT b_nr = octave::to_f77_int (b.rows ());
+                  F77_INT b_nc = octave::to_f77_int (b.cols ());
                   retval = ComplexMatrix (b);
                   Complex *result = retval.fortran_vec ();
 
@@ -5034,8 +5034,8 @@
       if (typ == MatrixType::Banded)
         {
           // Create the storage for the banded form of the sparse matrix
-          F77_INT n_upper = to_f77_int (mattype.nupper ());
-          F77_INT n_lower = to_f77_int (mattype.nlower ());
+          F77_INT n_upper = octave::to_f77_int (mattype.nupper ());
+          F77_INT n_lower = octave::to_f77_int (mattype.nlower ());
           F77_INT ldm = n_upper + 2 * n_lower + 1;
 
           ComplexMatrix m_band (ldm, nc);
@@ -5071,7 +5071,7 @@
           Array<F77_INT> ipvt (dim_vector (nr, 1));
           F77_INT *pipvt = ipvt.fortran_vec ();
 
-          F77_INT tmp_nr = to_f77_int (nr);
+          F77_INT tmp_nr = octave::to_f77_int (nr);
 
           F77_INT tmp_err = 0;
 
@@ -5104,7 +5104,7 @@
                   Array<double> iz (dim_vector (nr, 1));
                   double *piz = iz.fortran_vec ();
 
-                  F77_INT tmp_nc = to_f77_int (nc);
+                  F77_INT tmp_nc = octave::to_f77_int (nc);
 
                   F77_XFCN (zgbcon, ZGBCON,
                             (F77_CONST_CHAR_ARG2 (&job, 1),
@@ -5138,8 +5138,8 @@
               if (err == 0)
                 {
                   char job = 'N';
-                  F77_INT b_nr = to_f77_int (b.rows ());
-                  F77_INT b_nc = to_f77_int (b.cols ());
+                  F77_INT b_nr = octave::to_f77_int (b.rows ());
+                  F77_INT b_nc = octave::to_f77_int (b.cols ());
                   retval = ComplexMatrix (b);
                   Complex *result = retval.fortran_vec ();
 
@@ -5186,7 +5186,7 @@
 
       if (typ == MatrixType::Banded_Hermitian)
         {
-          F77_INT n_lower = to_f77_int (mattype.nlower ());
+          F77_INT n_lower = octave::to_f77_int (mattype.nlower ());
           F77_INT ldm = n_lower + 1;
 
           ComplexMatrix m_band (ldm, nc);
@@ -5214,7 +5214,7 @@
           if (calc_cond)
             anorm = m_band.abs ().sum ().row (0).max ();
 
-          F77_INT tmp_nr = to_f77_int (nr);
+          F77_INT tmp_nr = octave::to_f77_int (nr);
 
           F77_INT tmp_err = 0;
 
@@ -5275,7 +5275,7 @@
 
               if (err == 0)
                 {
-                  F77_INT b_nr = to_f77_int (b.rows ());
+                  F77_INT b_nr = octave::to_f77_int (b.rows ());
                   octave_idx_type b_nc = b.cols ();
                   OCTAVE_LOCAL_BUFFER (Complex, Bx, b_nr);
 
@@ -5342,8 +5342,8 @@
       if (typ == MatrixType::Banded)
         {
           // Create the storage for the banded form of the sparse matrix
-          F77_INT n_upper = to_f77_int (mattype.nupper ());
-          F77_INT n_lower = to_f77_int (mattype.nlower ());
+          F77_INT n_upper = octave::to_f77_int (mattype.nupper ());
+          F77_INT n_lower = octave::to_f77_int (mattype.nlower ());
           F77_INT ldm = n_upper + 2 * n_lower + 1;
 
           ComplexMatrix m_band (ldm, nc);
@@ -5379,7 +5379,7 @@
           Array<F77_INT> ipvt (dim_vector (nr, 1));
           F77_INT *pipvt = ipvt.fortran_vec ();
 
-          F77_INT tmp_nr = to_f77_int (nr);
+          F77_INT tmp_nr = octave::to_f77_int (nr);
 
           F77_INT tmp_err = 0;
 
@@ -5412,7 +5412,7 @@
                   Array<double> iz (dim_vector (nr, 1));
                   double *piz = iz.fortran_vec ();
 
-                  F77_INT tmp_nc = to_f77_int (nc);
+                  F77_INT tmp_nc = octave::to_f77_int (nc);
 
                   F77_XFCN (zgbcon, ZGBCON,
                             (F77_CONST_CHAR_ARG2 (&job, 1),
@@ -5447,7 +5447,7 @@
                 {
                   char job = 'N';
                   volatile octave_idx_type x_nz = b.nnz ();
-                  F77_INT b_nr = to_f77_int (b.rows ());
+                  F77_INT b_nr = octave::to_f77_int (b.rows ());
                   octave_idx_type b_nc = b.cols ();
                   retval = SparseComplexMatrix (nr, b_nc, x_nz);
                   retval.xcidx (0) = 0;
--- a/liboctave/array/dColVector.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/array/dColVector.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -179,10 +179,10 @@
 {
   ColumnVector retval;
 
-  F77_INT nr = to_f77_int (m.rows ());
-  F77_INT nc = to_f77_int (m.cols ());
+  F77_INT nr = octave::to_f77_int (m.rows ());
+  F77_INT nc = octave::to_f77_int (m.cols ());
 
-  F77_INT a_len = to_f77_int (a.numel ());
+  F77_INT a_len = octave::to_f77_int (a.numel ());
 
   if (nc != a_len)
     octave::err_nonconformant ("operator *", nr, nc, a_len, 1);
@@ -214,10 +214,10 @@
 {
   ColumnVector retval;
 
-  F77_INT nr = to_f77_int (m.rows ());
-  F77_INT nc = to_f77_int (m.cols ());
+  F77_INT nr = octave::to_f77_int (m.rows ());
+  F77_INT nc = octave::to_f77_int (m.cols ());
 
-  F77_INT a_len = to_f77_int (a.numel ());
+  F77_INT a_len = octave::to_f77_int (a.numel ());
 
   if (nc != a_len)
     octave::err_nonconformant ("operator *", nr, nc, a_len, 1);
--- a/liboctave/array/dMatrix.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/array/dMatrix.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -471,8 +471,8 @@
 {
   Matrix retval;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
 
   if (nr != nc || nr == 0 || nc == 0)
     (*current_liboctave_error_handler) ("inverse requires square matrix");
@@ -530,8 +530,8 @@
 {
   Matrix retval;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
 
   if (nr != nc || nr == 0 || nc == 0)
     (*current_liboctave_error_handler) ("inverse requires square matrix");
@@ -791,12 +791,12 @@
 
   if (nr == 1 || nc == 1)
     {
-      npts = to_f77_int (nr > nc ? nr : nc);
+      npts = octave::to_f77_int (nr > nc ? nr : nc);
       nsamples = 1;
     }
   else
     {
-      npts = to_f77_int (nr);
+      npts = octave::to_f77_int (nr);
       nsamples = nc;
     }
 
@@ -834,12 +834,12 @@
 
   if (nr == 1 || nc == 1)
     {
-      npts = to_f77_int (nr > nc ? nr : nc);
+      npts = octave::to_f77_int (nr > nc ? nr : nc);
       nsamples = 1;
     }
   else
     {
-      npts = to_f77_int (nr);
+      npts = octave::to_f77_int (nr);
       nsamples = nc;
     }
 
@@ -872,8 +872,8 @@
 {
   ComplexMatrix retval;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
 
   F77_INT npts, nsamples;
 
@@ -940,8 +940,8 @@
 {
   ComplexMatrix retval;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
 
   F77_INT npts, nsamples;
 
@@ -1039,8 +1039,8 @@
   info = 0;
   rcon = 0.0;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
 
   if (nr != nc)
     (*current_liboctave_error_handler) ("matrix must be square");
@@ -1185,8 +1185,8 @@
 Matrix::rcond (MatrixType &mattype) const
 {
   double rcon = octave::numeric_limits<double>::NaN ();
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
 
   if (nr != nc)
     (*current_liboctave_error_handler) ("matrix must be square");
@@ -1352,11 +1352,11 @@
 {
   Matrix retval;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
-
-  F77_INT b_nr = to_f77_int (b.rows ());
-  F77_INT b_nc = to_f77_int (b.cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
+
+  F77_INT b_nr = octave::to_f77_int (b.rows ());
+  F77_INT b_nc = octave::to_f77_int (b.cols ());
 
   if (nr != b_nr)
     (*current_liboctave_error_handler)
@@ -1449,11 +1449,11 @@
 {
   Matrix retval;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
-
-  F77_INT b_nr = to_f77_int (b.rows ());
-  F77_INT b_nc = to_f77_int (b.cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
+
+  F77_INT b_nr = octave::to_f77_int (b.rows ());
+  F77_INT b_nc = octave::to_f77_int (b.cols ());
 
   if (nr != b_nr)
     (*current_liboctave_error_handler)
@@ -1546,8 +1546,8 @@
 {
   Matrix retval;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
 
   if (nr != nc || nr != b.rows ())
     (*current_liboctave_error_handler)
@@ -1626,8 +1626,8 @@
                   retval = b;
                   double *result = retval.fortran_vec ();
 
-                  F77_INT b_nr = to_f77_int (b.rows ());
-                  F77_INT b_nc = to_f77_int (b.cols ());
+                  F77_INT b_nr = octave::to_f77_int (b.rows ());
+                  F77_INT b_nc = octave::to_f77_int (b.cols ());
 
                   F77_XFCN (dpotrs, DPOTRS, (F77_CONST_CHAR_ARG2 (&job, 1),
                                              nr, b_nc, tmp_data, nr,
@@ -1716,8 +1716,8 @@
                   retval = b;
                   double *result = retval.fortran_vec ();
 
-                  F77_INT b_nr = to_f77_int (b.rows ());
-                  F77_INT b_nc = to_f77_int (b.cols ());
+                  F77_INT b_nr = octave::to_f77_int (b.rows ());
+                  F77_INT b_nc = octave::to_f77_int (b.cols ());
 
                   char job = 'N';
                   F77_XFCN (dgetrs, DGETRS, (F77_CONST_CHAR_ARG2 (&job, 1),
@@ -2076,13 +2076,13 @@
 {
   Matrix retval;
 
-  F77_INT nrhs = to_f77_int (b.cols ());
-
-  F77_INT m = to_f77_int (rows ());
-  F77_INT n = to_f77_int (cols ());
-
-  F77_INT b_nr = to_f77_int (b.rows ());
-  F77_INT b_nc = to_f77_int (b.cols ());
+  F77_INT nrhs = octave::to_f77_int (b.cols ());
+
+  F77_INT m = octave::to_f77_int (rows ());
+  F77_INT n = octave::to_f77_int (cols ());
+
+  F77_INT b_nr = octave::to_f77_int (b.rows ());
+  F77_INT b_nc = octave::to_f77_int (b.cols ());
 
   if (m != b_nr)
     (*current_liboctave_error_handler)
@@ -2298,10 +2298,10 @@
 
   F77_INT nrhs = 1;
 
-  F77_INT m = to_f77_int (rows ());
-  F77_INT n = to_f77_int (cols ());
-
-  F77_INT b_nel = to_f77_int (b.numel ());
+  F77_INT m = octave::to_f77_int (rows ());
+  F77_INT n = octave::to_f77_int (cols ());
+
+  F77_INT b_nel = octave::to_f77_int (b.numel ());
 
   if (m != b_nel)
     (*current_liboctave_error_handler)
@@ -2476,11 +2476,11 @@
 {
   Matrix retval;
 
-  F77_INT len = to_f77_int (v.numel ());
+  F77_INT len = octave::to_f77_int (v.numel ());
 
   if (len != 0)
     {
-      F77_INT a_len = to_f77_int (a.numel ());
+      F77_INT a_len = octave::to_f77_int (a.numel ());
 
       retval = Matrix (len, a_len);
       double *c = retval.fortran_vec ();
@@ -2869,8 +2869,8 @@
 
   // Solve the sylvester equation, back-transform, and return the solution.
 
-  F77_INT a_nr = to_f77_int (a.rows ());
-  F77_INT b_nr = to_f77_int (b.rows ());
+  F77_INT a_nr = octave::to_f77_int (a.rows ());
+  F77_INT b_nr = octave::to_f77_int (b.rows ());
 
   double scale;
   F77_INT info;
@@ -2936,11 +2936,11 @@
   bool tra = transa != blas_no_trans;
   bool trb = transb != blas_no_trans;
 
-  F77_INT a_nr = to_f77_int (tra ? a.cols () : a.rows ());
-  F77_INT a_nc = to_f77_int (tra ? a.rows () : a.cols ());
-
-  F77_INT b_nr = to_f77_int (trb ? b.cols () : b.rows ());
-  F77_INT b_nc = to_f77_int (trb ? b.rows () : b.cols ());
+  F77_INT a_nr = octave::to_f77_int (tra ? a.cols () : a.rows ());
+  F77_INT a_nc = octave::to_f77_int (tra ? a.rows () : a.cols ());
+
+  F77_INT b_nr = octave::to_f77_int (trb ? b.cols () : b.rows ());
+  F77_INT b_nc = octave::to_f77_int (trb ? b.rows () : b.cols ());
 
   if (a_nc != b_nr)
     octave::err_nonconformant ("operator *", a_nr, a_nc, b_nr, b_nc);
@@ -2949,7 +2949,7 @@
     retval = Matrix (a_nr, b_nc, 0.0);
   else if (a.data () == b.data () && a_nr == b_nc && tra != trb)
     {
-      F77_INT lda = to_f77_int (a.rows ());
+      F77_INT lda = octave::to_f77_int (a.rows ());
 
       retval = Matrix (a_nr, b_nc);
       double *c = retval.fortran_vec ();
@@ -2968,10 +2968,10 @@
     }
   else
     {
-      F77_INT lda = to_f77_int (a.rows ());
-      F77_INT tda = to_f77_int (a.cols ());
-      F77_INT ldb = to_f77_int (b.rows ());
-      F77_INT tdb = to_f77_int (b.cols ());
+      F77_INT lda = octave::to_f77_int (a.rows ());
+      F77_INT tda = octave::to_f77_int (a.cols ());
+      F77_INT ldb = octave::to_f77_int (b.rows ());
+      F77_INT tdb = octave::to_f77_int (b.cols ());
 
       retval = Matrix (a_nr, b_nc);
       double *c = retval.fortran_vec ();
--- a/liboctave/array/dRowVector.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/array/dRowVector.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -170,10 +170,10 @@
 {
   RowVector retval;
 
-  F77_INT len = to_f77_int (v.numel ());
+  F77_INT len = octave::to_f77_int (v.numel ());
 
-  F77_INT a_nr = to_f77_int (a.rows ());
-  F77_INT a_nc = to_f77_int (a.cols ());
+  F77_INT a_nr = octave::to_f77_int (a.rows ());
+  F77_INT a_nc = octave::to_f77_int (a.cols ());
 
   if (a_nr != len)
     octave::err_nonconformant ("operator *", 1, len, a_nr, a_nc);
@@ -292,9 +292,9 @@
 {
   double retval = 0.0;
 
-  F77_INT len = to_f77_int (v.numel ());
+  F77_INT len = octave::to_f77_int (v.numel ());
 
-  F77_INT a_len = to_f77_int (a.numel ());
+  F77_INT a_len = octave::to_f77_int (a.numel ());
 
   if (len != a_len)
     octave::err_nonconformant ("operator *", len, a_len);
--- a/liboctave/array/dSparse.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/array/dSparse.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -3762,10 +3762,10 @@
                   }
             }
 
-          F77_INT tmp_nr = to_f77_int (nr);
-
-          F77_INT b_nr = to_f77_int (b.rows ());
-          F77_INT b_nc = to_f77_int (b.cols ());
+          F77_INT tmp_nr = octave::to_f77_int (nr);
+
+          F77_INT b_nr = octave::to_f77_int (b.rows ());
+          F77_INT b_nc = octave::to_f77_int (b.cols ());
 
           retval = b;
           double *result = retval.fortran_vec ();
@@ -3827,10 +3827,10 @@
                   }
             }
 
-          F77_INT tmp_nr = to_f77_int (nr);
-
-          F77_INT b_nr = to_f77_int (b.rows ());
-          F77_INT b_nc = to_f77_int (b.cols ());
+          F77_INT tmp_nr = octave::to_f77_int (nr);
+
+          F77_INT b_nr = octave::to_f77_int (b.rows ());
+          F77_INT b_nc = octave::to_f77_int (b.cols ());
 
           retval = b;
           double *result = retval.fortran_vec ();
@@ -3937,7 +3937,7 @@
                   }
             }
 
-          F77_INT tmp_nr = to_f77_int (nr);
+          F77_INT tmp_nr = octave::to_f77_int (nr);
 
           F77_INT tmp_err = 0;
 
@@ -3975,7 +3975,7 @@
                   for (octave_idx_type i = b.cidx (j); i < b.cidx (j+1); i++)
                     work[b.ridx (i)] = b.data (i);
 
-                  F77_INT b_nr = to_f77_int (b.rows ());
+                  F77_INT b_nr = octave::to_f77_int (b.rows ());
 
                   F77_XFCN (dgttrs, DGTTRS,
                             (F77_CONST_CHAR_ARG2 (&job, 1),
@@ -4082,10 +4082,10 @@
                   }
             }
 
-          F77_INT tmp_nr = to_f77_int (nr);
-
-          F77_INT b_nr = to_f77_int (b.rows ());
-          F77_INT b_nc = to_f77_int (b.cols ());
+          F77_INT tmp_nr = octave::to_f77_int (nr);
+
+          F77_INT b_nr = octave::to_f77_int (b.rows ());
+          F77_INT b_nc = octave::to_f77_int (b.cols ());
 
           rcond = 1.;
 
@@ -4148,10 +4148,10 @@
                   }
             }
 
-          F77_INT tmp_nr = to_f77_int (nr);
-
-          F77_INT b_nr = to_f77_int (b.rows ());
-          F77_INT b_nc = to_f77_int (b.cols ());
+          F77_INT tmp_nr = octave::to_f77_int (nr);
+
+          F77_INT b_nr = octave::to_f77_int (b.rows ());
+          F77_INT b_nc = octave::to_f77_int (b.cols ());
 
           rcond = 1.;
 
@@ -4261,7 +4261,7 @@
                   }
             }
 
-          F77_INT tmp_nr = to_f77_int (nr);
+          F77_INT tmp_nr = octave::to_f77_int (nr);
 
           F77_INT tmp_err = 0;
 
@@ -4286,7 +4286,7 @@
             {
               rcond = 1.;
               char job = 'N';
-              F77_INT b_nr = to_f77_int (b.rows ());
+              F77_INT b_nr = octave::to_f77_int (b.rows ());
               octave_idx_type b_nc = b.cols ();
               OCTAVE_LOCAL_BUFFER (double, Bx, b_nr);
               OCTAVE_LOCAL_BUFFER (double, Bz, b_nr);
@@ -4406,7 +4406,7 @@
 
       if (typ == MatrixType::Banded_Hermitian)
         {
-          F77_INT n_lower = to_f77_int (mattype.nlower ());
+          F77_INT n_lower = octave::to_f77_int (mattype.nlower ());
           F77_INT ldm = n_lower + 1;
           Matrix m_band (ldm, nc);
           double *tmp_data = m_band.fortran_vec ();
@@ -4433,7 +4433,7 @@
           if (calc_cond)
             anorm = m_band.abs ().sum ().row (0).max ();
 
-          F77_INT tmp_nr = to_f77_int (nr);
+          F77_INT tmp_nr = octave::to_f77_int (nr);
 
           F77_INT tmp_err = 0;
 
@@ -4496,8 +4496,8 @@
                   retval = b;
                   double *result = retval.fortran_vec ();
 
-                  F77_INT b_nr = to_f77_int (b.rows ());
-                  F77_INT b_nc = to_f77_int (b.cols ());
+                  F77_INT b_nr = octave::to_f77_int (b.rows ());
+                  F77_INT b_nc = octave::to_f77_int (b.cols ());
 
                   F77_XFCN (dpbtrs, DPBTRS,
                             (F77_CONST_CHAR_ARG2 (&job, 1),
@@ -4521,8 +4521,8 @@
       if (typ == MatrixType::Banded)
         {
           // Create the storage for the banded form of the sparse matrix
-          F77_INT n_upper = to_f77_int (mattype.nupper ());
-          F77_INT n_lower = to_f77_int (mattype.nlower ());
+          F77_INT n_upper = octave::to_f77_int (mattype.nupper ());
+          F77_INT n_lower = octave::to_f77_int (mattype.nlower ());
           F77_INT ldm = n_upper + 2 * n_lower + 1;
 
           Matrix m_band (ldm, nc);
@@ -4555,7 +4555,7 @@
                 }
             }
 
-          F77_INT tmp_nr = to_f77_int (nr);
+          F77_INT tmp_nr = octave::to_f77_int (nr);
 
           Array<F77_INT> ipvt (dim_vector (nr, 1));
           F77_INT *pipvt = ipvt.fortran_vec ();
@@ -4592,7 +4592,7 @@
                   Array<F77_INT> iz (dim_vector (nr, 1));
                   F77_INT *piz = iz.fortran_vec ();
 
-                  F77_INT tmp_nc = to_f77_int (nc);
+                  F77_INT tmp_nc = octave::to_f77_int (nc);
 
                   F77_XFCN (dgbcon, DGBCON,
                             (F77_CONST_CHAR_ARG2 (&job, 1),
@@ -4628,8 +4628,8 @@
                   retval = b;
                   double *result = retval.fortran_vec ();
 
-                  F77_INT b_nr = to_f77_int (b.rows ());
-                  F77_INT b_nc = to_f77_int (b.cols ());
+                  F77_INT b_nr = octave::to_f77_int (b.rows ());
+                  F77_INT b_nc = octave::to_f77_int (b.cols ());
 
                   char job = 'N';
                   F77_XFCN (dgbtrs, DGBTRS,
@@ -4675,8 +4675,8 @@
 
       if (typ == MatrixType::Banded_Hermitian)
         {
-          F77_INT n_lower = to_f77_int (mattype.nlower ());
-          F77_INT ldm = to_f77_int (n_lower + 1);
+          F77_INT n_lower = octave::to_f77_int (mattype.nlower ());
+          F77_INT ldm = octave::to_f77_int (n_lower + 1);
 
           Matrix m_band (ldm, nc);
           double *tmp_data = m_band.fortran_vec ();
@@ -4703,7 +4703,7 @@
           if (calc_cond)
             anorm = m_band.abs ().sum ().row (0).max ();
 
-          F77_INT tmp_nr = to_f77_int (nr);
+          F77_INT tmp_nr = octave::to_f77_int (nr);
 
           F77_INT tmp_err = 0;
 
@@ -4761,7 +4761,7 @@
 
               if (err == 0)
                 {
-                  F77_INT b_nr = to_f77_int (b.rows ());
+                  F77_INT b_nr = octave::to_f77_int (b.rows ());
                   octave_idx_type b_nc = b.cols ();
                   OCTAVE_LOCAL_BUFFER (double, Bx, b_nr);
 
@@ -4823,9 +4823,9 @@
       if (typ == MatrixType::Banded)
         {
           // Create the storage for the banded form of the sparse matrix
-          F77_INT n_upper = to_f77_int (mattype.nupper ());
-          F77_INT n_lower = to_f77_int (mattype.nlower ());
-          F77_INT ldm = to_f77_int (n_upper + 2 * n_lower + 1);
+          F77_INT n_upper = octave::to_f77_int (mattype.nupper ());
+          F77_INT n_lower = octave::to_f77_int (mattype.nlower ());
+          F77_INT ldm = octave::to_f77_int (n_upper + 2 * n_lower + 1);
 
           Matrix m_band (ldm, nc);
           double *tmp_data = m_band.fortran_vec ();
@@ -4857,7 +4857,7 @@
                 }
             }
 
-          F77_INT tmp_nr = to_f77_int (nr);
+          F77_INT tmp_nr = octave::to_f77_int (nr);
 
           Array<F77_INT> ipvt (dim_vector (nr, 1));
           F77_INT *pipvt = ipvt.fortran_vec ();
@@ -4892,7 +4892,7 @@
                   Array<F77_INT> iz (dim_vector (nr, 1));
                   F77_INT *piz = iz.fortran_vec ();
 
-                  F77_INT tmp_nc = to_f77_int (nc);
+                  F77_INT tmp_nc = octave::to_f77_int (nc);
 
                   F77_XFCN (dgbcon, DGBCON,
                             (F77_CONST_CHAR_ARG2 (&job, 1),
@@ -4942,7 +4942,7 @@
                            i < b.cidx (j+1); i++)
                         work[b.ridx (i)] = b.data (i);
 
-                      F77_INT b_nr = to_f77_int (b.rows ());
+                      F77_INT b_nr = octave::to_f77_int (b.rows ());
 
                       F77_XFCN (dgbtrs, DGBTRS,
                                 (F77_CONST_CHAR_ARG2 (&job, 1),
@@ -5013,7 +5013,7 @@
 
       if (typ == MatrixType::Banded_Hermitian)
         {
-          F77_INT n_lower = to_f77_int (mattype.nlower ());
+          F77_INT n_lower = octave::to_f77_int (mattype.nlower ());
           F77_INT ldm = n_lower + 1;
 
           Matrix m_band (ldm, nc);
@@ -5041,7 +5041,7 @@
           if (calc_cond)
             anorm = m_band.abs ().sum ().row (0).max ();
 
-          F77_INT tmp_nr = to_f77_int (nr);
+          F77_INT tmp_nr = octave::to_f77_int (nr);
 
           F77_INT tmp_err = 0;
 
@@ -5101,7 +5101,7 @@
 
               if (err == 0)
                 {
-                  F77_INT b_nr = to_f77_int (b.rows ());
+                  F77_INT b_nr = octave::to_f77_int (b.rows ());
                   octave_idx_type b_nc = b.cols ();
 
                   OCTAVE_LOCAL_BUFFER (double, Bx, b_nr);
@@ -5162,8 +5162,8 @@
       if (typ == MatrixType::Banded)
         {
           // Create the storage for the banded form of the sparse matrix
-          F77_INT n_upper = to_f77_int (mattype.nupper ());
-          F77_INT n_lower = to_f77_int (mattype.nlower ());
+          F77_INT n_upper = octave::to_f77_int (mattype.nupper ());
+          F77_INT n_lower = octave::to_f77_int (mattype.nlower ());
           F77_INT ldm = n_upper + 2 * n_lower + 1;
 
           Matrix m_band (ldm, nc);
@@ -5196,7 +5196,7 @@
                 }
             }
 
-          F77_INT tmp_nr = to_f77_int (nr);
+          F77_INT tmp_nr = octave::to_f77_int (nr);
 
           Array<F77_INT> ipvt (dim_vector (nr, 1));
           F77_INT *pipvt = ipvt.fortran_vec ();
@@ -5231,7 +5231,7 @@
                   Array<F77_INT> iz (dim_vector (nr, 1));
                   F77_INT *piz = iz.fortran_vec ();
 
-                  F77_INT tmp_nc = to_f77_int (nc);
+                  F77_INT tmp_nc = octave::to_f77_int (nc);
 
                   F77_XFCN (dgbcon, DGBCON,
                             (F77_CONST_CHAR_ARG2 (&job, 1),
@@ -5265,7 +5265,7 @@
               if (err == 0)
                 {
                   char job = 'N';
-                  F77_INT b_nr = to_f77_int (b.rows ());
+                  F77_INT b_nr = octave::to_f77_int (b.rows ());
                   octave_idx_type b_nc = b.cols ();
                   retval.resize (nr,b_nc);
 
@@ -5336,7 +5336,7 @@
 
       if (typ == MatrixType::Banded_Hermitian)
         {
-          F77_INT n_lower = to_f77_int (mattype.nlower ());
+          F77_INT n_lower = octave::to_f77_int (mattype.nlower ());
           F77_INT ldm = n_lower + 1;
 
           Matrix m_band (ldm, nc);
@@ -5364,7 +5364,7 @@
           if (calc_cond)
             anorm = m_band.abs ().sum ().row (0).max ();
 
-          F77_INT tmp_nr = to_f77_int (nr);
+          F77_INT tmp_nr = octave::to_f77_int (nr);
 
           F77_INT tmp_err = 0;
 
@@ -5425,7 +5425,7 @@
 
               if (err == 0)
                 {
-                  F77_INT b_nr = to_f77_int (b.rows ());
+                  F77_INT b_nr = octave::to_f77_int (b.rows ());
                   octave_idx_type b_nc = b.cols ();
                   OCTAVE_LOCAL_BUFFER (double, Bx, b_nr);
                   OCTAVE_LOCAL_BUFFER (double, Bz, b_nr);
@@ -5516,8 +5516,8 @@
       if (typ == MatrixType::Banded)
         {
           // Create the storage for the banded form of the sparse matrix
-          F77_INT n_upper = to_f77_int (mattype.nupper ());
-          F77_INT n_lower = to_f77_int (mattype.nlower ());
+          F77_INT n_upper = octave::to_f77_int (mattype.nupper ());
+          F77_INT n_lower = octave::to_f77_int (mattype.nlower ());
           F77_INT ldm = n_upper + 2 * n_lower + 1;
 
           Matrix m_band (ldm, nc);
@@ -5550,7 +5550,7 @@
                 }
             }
 
-          F77_INT tmp_nr = to_f77_int (nr);
+          F77_INT tmp_nr = octave::to_f77_int (nr);
 
           Array<F77_INT> ipvt (dim_vector (nr, 1));
           F77_INT *pipvt = ipvt.fortran_vec ();
@@ -5585,7 +5585,7 @@
                   Array<F77_INT> iz (dim_vector (nr, 1));
                   F77_INT *piz = iz.fortran_vec ();
 
-                  F77_INT tmp_nc = to_f77_int (nc);
+                  F77_INT tmp_nc = octave::to_f77_int (nc);
 
                   F77_XFCN (dgbcon, DGBCON,
                             (F77_CONST_CHAR_ARG2 (&job, 1),
@@ -5620,7 +5620,7 @@
                 {
                   char job = 'N';
                   volatile octave_idx_type x_nz = b.nnz ();
-                  F77_INT b_nr = to_f77_int (b.rows ());
+                  F77_INT b_nr = octave::to_f77_int (b.rows ());
                   octave_idx_type b_nc = b.cols ();
                   retval = SparseComplexMatrix (nr, b_nc, x_nz);
                   retval.xcidx (0) = 0;
--- a/liboctave/array/fCColVector.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/array/fCColVector.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -303,10 +303,10 @@
 {
   FloatComplexColumnVector retval;
 
-  F77_INT nr = to_f77_int (m.rows ());
-  F77_INT nc = to_f77_int (m.cols ());
+  F77_INT nr = octave::to_f77_int (m.rows ());
+  F77_INT nc = octave::to_f77_int (m.cols ());
 
-  F77_INT a_len = to_f77_int (a.numel ());
+  F77_INT a_len = octave::to_f77_int (a.numel ());
 
   if (nc != a_len)
     octave::err_nonconformant ("operator *", nr, nc, a_len, 1);
@@ -345,10 +345,10 @@
 FloatComplexColumnVector
 operator * (const FloatDiagMatrix& m, const FloatComplexColumnVector& a)
 {
-  F77_INT nr = to_f77_int (m.rows ());
-  F77_INT nc = to_f77_int (m.cols ());
+  F77_INT nr = octave::to_f77_int (m.rows ());
+  F77_INT nc = octave::to_f77_int (m.cols ());
 
-  F77_INT a_len = to_f77_int (a.numel ());
+  F77_INT a_len = octave::to_f77_int (a.numel ());
 
   if (nc != a_len)
     octave::err_nonconformant ("operator *", nr, nc, a_len, 1);
@@ -370,10 +370,10 @@
 FloatComplexColumnVector
 operator * (const FloatComplexDiagMatrix& m, const FloatColumnVector& a)
 {
-  F77_INT nr = to_f77_int (m.rows ());
-  F77_INT nc = to_f77_int (m.cols ());
+  F77_INT nr = octave::to_f77_int (m.rows ());
+  F77_INT nc = octave::to_f77_int (m.cols ());
 
-  F77_INT a_len = to_f77_int (a.numel ());
+  F77_INT a_len = octave::to_f77_int (a.numel ());
 
   if (nc != a_len)
     octave::err_nonconformant ("operator *", nr, nc, a_len, 1);
@@ -395,10 +395,10 @@
 FloatComplexColumnVector
 operator * (const FloatComplexDiagMatrix& m, const FloatComplexColumnVector& a)
 {
-  F77_INT nr = to_f77_int (m.rows ());
-  F77_INT nc = to_f77_int (m.cols ());
+  F77_INT nr = octave::to_f77_int (m.rows ());
+  F77_INT nc = octave::to_f77_int (m.cols ());
 
-  F77_INT a_len = to_f77_int (a.numel ());
+  F77_INT a_len = octave::to_f77_int (a.numel ());
 
   if (nc != a_len)
     octave::err_nonconformant ("operator *", nr, nc, a_len, 1);
--- a/liboctave/array/fCMatrix.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/array/fCMatrix.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -762,8 +762,8 @@
 {
   FloatComplexMatrix retval;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
 
   if (nr != nc || nr == 0 || nc == 0)
     (*current_liboctave_error_handler) ("inverse requires square matrix");
@@ -821,8 +821,8 @@
 {
   FloatComplexMatrix retval;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
 
   if (nr != nc)
     (*current_liboctave_error_handler) ("inverse requires square matrix");
@@ -1100,12 +1100,12 @@
 
   if (nr == 1 || nc == 1)
     {
-      npts = to_f77_int (nr > nc ? nr : nc);
+      npts = octave::to_f77_int (nr > nc ? nr : nc);
       nsamples = 1;
     }
   else
     {
-      npts = to_f77_int (nr);
+      npts = octave::to_f77_int (nr);
       nsamples = nc;
     }
 
@@ -1143,12 +1143,12 @@
 
   if (nr == 1 || nc == 1)
     {
-      npts = to_f77_int (nr > nc ? nr : nc);
+      npts = octave::to_f77_int (nr > nc ? nr : nc);
       nsamples = 1;
     }
   else
     {
-      npts = to_f77_int (nr);
+      npts = octave::to_f77_int (nr);
       nsamples = nc;
     }
 
@@ -1181,8 +1181,8 @@
 {
   FloatComplexMatrix retval;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
 
   F77_INT npts, nsamples;
 
@@ -1248,8 +1248,8 @@
 {
   FloatComplexMatrix retval;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
 
   F77_INT npts, nsamples;
 
@@ -1348,8 +1348,8 @@
   info = 0;
   rcon = 0.0;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
 
   if (nr != nc)
     (*current_liboctave_error_handler) ("matrix must be square");
@@ -1500,8 +1500,8 @@
 FloatComplexMatrix::rcond (MatrixType &mattype) const
 {
   float rcon = octave::numeric_limits<float>::NaN ();
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
 
   if (nr != nc)
     (*current_liboctave_error_handler) ("matrix must be square");
@@ -1673,11 +1673,11 @@
 {
   FloatComplexMatrix retval;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
-
-  F77_INT b_nr = to_f77_int (b.rows ());
-  F77_INT b_nc = to_f77_int (b.cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
+
+  F77_INT b_nr = octave::to_f77_int (b.rows ());
+  F77_INT b_nc = octave::to_f77_int (b.cols ());
 
   if (nr != b_nr)
     (*current_liboctave_error_handler)
@@ -1775,11 +1775,11 @@
 {
   FloatComplexMatrix retval;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
-
-  F77_INT b_nr = to_f77_int (b.rows ());
-  F77_INT b_nc = to_f77_int (b.cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
+
+  F77_INT b_nr = octave::to_f77_int (b.rows ());
+  F77_INT b_nc = octave::to_f77_int (b.cols ());
 
   if (nr != b_nr)
     (*current_liboctave_error_handler)
@@ -1877,11 +1877,11 @@
 {
   FloatComplexMatrix retval;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
-
-  F77_INT b_nr = to_f77_int (b.rows ());
-  F77_INT b_nc = to_f77_int (b.cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
+
+  F77_INT b_nr = octave::to_f77_int (b.rows ());
+  F77_INT b_nc = octave::to_f77_int (b.cols ());
 
   if (nr != nc || nr != b_nr)
     (*current_liboctave_error_handler)
@@ -2440,13 +2440,13 @@
 {
   FloatComplexMatrix retval;
 
-  F77_INT nrhs = to_f77_int (b.cols ());
-
-  F77_INT m = to_f77_int (rows ());
-  F77_INT n = to_f77_int (cols ());
-
-  F77_INT b_nr = to_f77_int (b.rows ());
-  F77_INT b_nc = to_f77_int (b.cols ());
+  F77_INT nrhs = octave::to_f77_int (b.cols ());
+
+  F77_INT m = octave::to_f77_int (rows ());
+  F77_INT n = octave::to_f77_int (cols ());
+
+  F77_INT b_nr = octave::to_f77_int (b.rows ());
+  F77_INT b_nc = octave::to_f77_int (b.cols ());
 
   if (m != b_nr)
     (*current_liboctave_error_handler)
@@ -2669,10 +2669,10 @@
 
   F77_INT nrhs = 1;
 
-  F77_INT m = to_f77_int (rows ());
-  F77_INT n = to_f77_int (cols ());
-
-  F77_INT b_nel = to_f77_int (b.numel ());
+  F77_INT m = octave::to_f77_int (rows ());
+  F77_INT n = octave::to_f77_int (cols ());
+
+  F77_INT b_nel = octave::to_f77_int (b.numel ());
 
   if (m != b_nel)
     (*current_liboctave_error_handler)
@@ -2799,11 +2799,11 @@
 {
   FloatComplexMatrix retval;
 
-  F77_INT len = to_f77_int (v.numel ());
+  F77_INT len = octave::to_f77_int (v.numel ());
 
   if (len != 0)
     {
-      F77_INT a_len = to_f77_int (a.numel ());
+      F77_INT a_len = octave::to_f77_int (a.numel ());
 
       retval = FloatComplexMatrix (len, a_len);
       FloatComplex *c = retval.fortran_vec ();
@@ -3432,8 +3432,8 @@
   // Solve the sylvester equation, back-transform, and return the
   // solution.
 
-  F77_INT a_nr = to_f77_int (a.rows ());
-  F77_INT b_nr = to_f77_int (b.rows ());
+  F77_INT a_nr = octave::to_f77_int (a.rows ());
+  F77_INT b_nr = octave::to_f77_int (b.rows ());
 
   float scale;
   F77_INT info;
@@ -3516,11 +3516,11 @@
   bool cja = transa == blas_conj_trans;
   bool cjb = transb == blas_conj_trans;
 
-  F77_INT a_nr = to_f77_int (tra ? a.cols () : a.rows ());
-  F77_INT a_nc = to_f77_int (tra ? a.rows () : a.cols ());
-
-  F77_INT b_nr = to_f77_int (trb ? b.cols () : b.rows ());
-  F77_INT b_nc = to_f77_int (trb ? b.rows () : b.cols ());
+  F77_INT a_nr = octave::to_f77_int (tra ? a.cols () : a.rows ());
+  F77_INT a_nc = octave::to_f77_int (tra ? a.rows () : a.cols ());
+
+  F77_INT b_nr = octave::to_f77_int (trb ? b.cols () : b.rows ());
+  F77_INT b_nc = octave::to_f77_int (trb ? b.rows () : b.cols ());
 
   if (a_nc != b_nr)
     octave::err_nonconformant ("operator *", a_nr, a_nc, b_nr, b_nc);
@@ -3529,7 +3529,7 @@
     retval = FloatComplexMatrix (a_nr, b_nc, 0.0);
   else if (a.data () == b.data () && a_nr == b_nc && tra != trb)
     {
-      F77_INT lda = to_f77_int (a.rows ());
+      F77_INT lda = octave::to_f77_int (a.rows ());
 
       // FIXME: looking at the reference BLAS, it appears that it
       // should not be necessary to initialize the output matrix if
@@ -3569,10 +3569,10 @@
     }
   else
     {
-      F77_INT lda = to_f77_int (a.rows ());
-      F77_INT tda = to_f77_int (a.cols ());
-      F77_INT ldb = to_f77_int (b.rows ());
-      F77_INT tdb = to_f77_int (b.cols ());
+      F77_INT lda = octave::to_f77_int (a.rows ());
+      F77_INT tda = octave::to_f77_int (a.cols ());
+      F77_INT ldb = octave::to_f77_int (b.rows ());
+      F77_INT tdb = octave::to_f77_int (b.cols ());
 
       retval = FloatComplexMatrix (a_nr, b_nc, 0.0);
       FloatComplex *c = retval.fortran_vec ();
--- a/liboctave/array/fCRowVector.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/array/fCRowVector.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -283,10 +283,10 @@
 {
   FloatComplexRowVector retval;
 
-  F77_INT len = to_f77_int (v.numel ());
+  F77_INT len = octave::to_f77_int (v.numel ());
 
-  F77_INT a_nr = to_f77_int (a.rows ());
-  F77_INT a_nc = to_f77_int (a.cols ());
+  F77_INT a_nr = octave::to_f77_int (a.rows ());
+  F77_INT a_nc = octave::to_f77_int (a.cols ());
 
   if (a_nr != len)
     octave::err_nonconformant ("operator *", 1, len, a_nr, a_nc);
@@ -407,9 +407,9 @@
 {
   FloatComplex retval (0.0, 0.0);
 
-  F77_INT len = to_f77_int (v.numel ());
+  F77_INT len = octave::to_f77_int (v.numel ());
 
-  F77_INT a_len = to_f77_int (a.numel ());
+  F77_INT a_len = octave::to_f77_int (a.numel ());
 
   if (len != a_len)
     octave::err_nonconformant ("operator *", len, a_len);
--- a/liboctave/array/fColVector.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/array/fColVector.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -179,10 +179,10 @@
 {
   FloatColumnVector retval;
 
-  F77_INT nr = to_f77_int (m.rows ());
-  F77_INT nc = to_f77_int (m.cols ());
+  F77_INT nr = octave::to_f77_int (m.rows ());
+  F77_INT nc = octave::to_f77_int (m.cols ());
 
-  F77_INT a_len = to_f77_int (a.numel ());
+  F77_INT a_len = octave::to_f77_int (a.numel ());
 
   if (nc != a_len)
     octave::err_nonconformant ("operator *", nr, nc, a_len, 1);
@@ -214,10 +214,10 @@
 {
   FloatColumnVector retval;
 
-  F77_INT nr = to_f77_int (m.rows ());
-  F77_INT nc = to_f77_int (m.cols ());
+  F77_INT nr = octave::to_f77_int (m.rows ());
+  F77_INT nc = octave::to_f77_int (m.cols ());
 
-  F77_INT a_len = to_f77_int (a.numel ());
+  F77_INT a_len = octave::to_f77_int (a.numel ());
 
   if (nc != a_len)
     octave::err_nonconformant ("operator *", nr, nc, a_len, 1);
--- a/liboctave/array/fMatrix.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/array/fMatrix.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -477,8 +477,8 @@
 {
   FloatMatrix retval;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
 
   if (nr != nc || nr == 0 || nc == 0)
     (*current_liboctave_error_handler) ("inverse requires square matrix");
@@ -536,8 +536,8 @@
 {
   FloatMatrix retval;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
 
   if (nr != nc || nr == 0 || nc == 0)
     (*current_liboctave_error_handler) ("inverse requires square matrix");
@@ -798,12 +798,12 @@
 
   if (nr == 1 || nc == 1)
     {
-      npts = to_f77_int (nr > nc ? nr : nc);
+      npts = octave::to_f77_int (nr > nc ? nr : nc);
       nsamples = 1;
     }
   else
     {
-      npts = to_f77_int (nr);
+      npts = octave::to_f77_int (nr);
       nsamples = nc;
     }
 
@@ -841,7 +841,7 @@
 
   if (nr == 1 || nc == 1)
     {
-      npts = to_f77_int (nr > nc ? nr : nc);
+      npts = octave::to_f77_int (nr > nc ? nr : nc);
       nsamples = 1;
     }
   else
@@ -879,8 +879,8 @@
 {
   FloatComplexMatrix retval;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
 
   F77_INT npts, nsamples;
 
@@ -946,8 +946,8 @@
 {
   FloatComplexMatrix retval;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
 
   F77_INT npts, nsamples;
 
@@ -1046,8 +1046,8 @@
   info = 0;
   rcon = 0.0;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
 
   if (nr != nc)
     (*current_liboctave_error_handler) ("matrix must be square");
@@ -1192,8 +1192,8 @@
 FloatMatrix::rcond (MatrixType &mattype) const
 {
   float rcon = octave::numeric_limits<float>::NaN ();
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
 
   if (nr != nc)
     (*current_liboctave_error_handler) ("matrix must be square");
@@ -1360,11 +1360,11 @@
 {
   FloatMatrix retval;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
-
-  F77_INT b_nr = to_f77_int (b.rows ());
-  F77_INT b_nc = to_f77_int (b.cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
+
+  F77_INT b_nr = octave::to_f77_int (b.rows ());
+  F77_INT b_nc = octave::to_f77_int (b.cols ());
 
   if (nr != b_nr)
     (*current_liboctave_error_handler)
@@ -1463,11 +1463,11 @@
 {
   FloatMatrix retval;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
-
-  F77_INT b_nr = to_f77_int (b.rows ());
-  F77_INT b_nc = to_f77_int (b.cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
+
+  F77_INT b_nr = octave::to_f77_int (b.rows ());
+  F77_INT b_nc = octave::to_f77_int (b.cols ());
 
   if (nr != b_nr)
     (*current_liboctave_error_handler)
@@ -1565,11 +1565,11 @@
 {
   FloatMatrix retval;
 
-  F77_INT nr = to_f77_int (rows ());
-  F77_INT nc = to_f77_int (cols ());
-
-  F77_INT b_nr = to_f77_int (b.rows ());
-  F77_INT b_nc = to_f77_int (b.cols ());
+  F77_INT nr = octave::to_f77_int (rows ());
+  F77_INT nc = octave::to_f77_int (cols ());
+
+  F77_INT b_nr = octave::to_f77_int (b.rows ());
+  F77_INT b_nc = octave::to_f77_int (b.cols ());
 
   if (nr != nc || nr != b_nr)
     (*current_liboctave_error_handler)
@@ -2101,13 +2101,13 @@
 {
   FloatMatrix retval;
 
-  F77_INT nrhs = to_f77_int (b.cols ());
-
-  F77_INT m = to_f77_int (rows ());
-  F77_INT n = to_f77_int (cols ());
-
-  F77_INT b_nr = to_f77_int (b.rows ());
-  F77_INT b_nc = to_f77_int (b.cols ());
+  F77_INT nrhs = octave::to_f77_int (b.cols ());
+
+  F77_INT m = octave::to_f77_int (rows ());
+  F77_INT n = octave::to_f77_int (cols ());
+
+  F77_INT b_nr = octave::to_f77_int (b.rows ());
+  F77_INT b_nc = octave::to_f77_int (b.cols ());
 
   if (m != b_nr)
     (*current_liboctave_error_handler)
@@ -2323,8 +2323,8 @@
 
   F77_INT nrhs = 1;
 
-  F77_INT m = to_f77_int (rows ());
-  F77_INT n = to_f77_int (cols ());
+  F77_INT m = octave::to_f77_int (rows ());
+  F77_INT n = octave::to_f77_int (cols ());
 
   if (m != b.numel ())
     (*current_liboctave_error_handler)
@@ -2498,11 +2498,11 @@
 {
   FloatMatrix retval;
 
-  F77_INT len = to_f77_int (v.numel ());
+  F77_INT len = octave::to_f77_int (v.numel ());
 
   if (len != 0)
     {
-      F77_INT a_len = to_f77_int (a.numel ());
+      F77_INT a_len = octave::to_f77_int (a.numel ());
 
       retval = FloatMatrix (len, a_len);
       float *c = retval.fortran_vec ();
@@ -2878,8 +2878,8 @@
   // Solve the sylvester equation, back-transform, and return the
   // solution.
 
-  F77_INT a_nr = to_f77_int (a.rows ());
-  F77_INT b_nr = to_f77_int (b.rows ());
+  F77_INT a_nr = octave::to_f77_int (a.rows ());
+  F77_INT b_nr = octave::to_f77_int (b.rows ());
 
   float scale;
   F77_INT info;
@@ -2940,11 +2940,11 @@
   bool tra = transa != blas_no_trans;
   bool trb = transb != blas_no_trans;
 
-  F77_INT a_nr = to_f77_int (tra ? a.cols () : a.rows ());
-  F77_INT a_nc = to_f77_int (tra ? a.rows () : a.cols ());
-
-  F77_INT b_nr = to_f77_int (trb ? b.cols () : b.rows ());
-  F77_INT b_nc = to_f77_int (trb ? b.rows () : b.cols ());
+  F77_INT a_nr = octave::to_f77_int (tra ? a.cols () : a.rows ());
+  F77_INT a_nc = octave::to_f77_int (tra ? a.rows () : a.cols ());
+
+  F77_INT b_nr = octave::to_f77_int (trb ? b.cols () : b.rows ());
+  F77_INT b_nc = octave::to_f77_int (trb ? b.rows () : b.cols ());
 
   if (a_nc != b_nr)
     octave::err_nonconformant ("operator *", a_nr, a_nc, b_nr, b_nc);
@@ -2953,7 +2953,7 @@
     retval = FloatMatrix (a_nr, b_nc, 0.0);
   else if (a.data () == b.data () && a_nr == b_nc && tra != trb)
     {
-      F77_INT lda = to_f77_int (a.rows ());
+      F77_INT lda = octave::to_f77_int (a.rows ());
 
       retval = FloatMatrix (a_nr, b_nc);
       float *c = retval.fortran_vec ();
@@ -2972,10 +2972,10 @@
     }
   else
     {
-      F77_INT lda = to_f77_int (a.rows ());
-      F77_INT tda = to_f77_int (a.cols ());
-      F77_INT ldb = to_f77_int (b.rows ());
-      F77_INT tdb = to_f77_int (b.cols ());
+      F77_INT lda = octave::to_f77_int (a.rows ());
+      F77_INT tda = octave::to_f77_int (a.cols ());
+      F77_INT ldb = octave::to_f77_int (b.rows ());
+      F77_INT tdb = octave::to_f77_int (b.cols ());
 
       retval = FloatMatrix (a_nr, b_nc);
       float *c = retval.fortran_vec ();
--- a/liboctave/array/fRowVector.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/array/fRowVector.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -170,10 +170,10 @@
 {
   FloatRowVector retval;
 
-  F77_INT len = to_f77_int (v.numel ());
+  F77_INT len = octave::to_f77_int (v.numel ());
 
-  F77_INT a_nr = to_f77_int (a.rows ());
-  F77_INT a_nc = to_f77_int (a.cols ());
+  F77_INT a_nr = octave::to_f77_int (a.rows ());
+  F77_INT a_nc = octave::to_f77_int (a.cols ());
 
   if (a_nr != len)
     octave::err_nonconformant ("operator *", 1, len, a_nr, a_nc);
@@ -292,9 +292,9 @@
 {
   float retval = 0.0;
 
-  F77_INT len = to_f77_int (v.numel ());
+  F77_INT len = octave::to_f77_int (v.numel ());
 
-  F77_INT a_len = to_f77_int (a.numel ());
+  F77_INT a_len = octave::to_f77_int (a.numel ());
 
   if (len != a_len)
     octave::err_nonconformant ("operator *", len, a_len);
--- a/liboctave/cruft/misc/f77-fcn.h	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/cruft/misc/f77-fcn.h	Fri Dec 30 14:03:01 2016 -0500
@@ -370,19 +370,20 @@
 
 #if defined (__cplusplus)
 
-inline F77_INT
-to_f77_int (octave_idx_type x)
+namespace octave
 {
-  // FIXME: How to do this job in C, not knowing in advance the actual
-  // type of F77_INT?
+  inline F77_INT
+  to_f77_int (octave_idx_type x)
+  {
+    if (x < std::numeric_limits<F77_INT>::min ()
+        || x > std::numeric_limits<F77_INT>::max ())
+      (*current_liboctave_error_handler)
+        ("integer dimension or index out of range for Fortran INTEGER type");
 
-  if (x < std::numeric_limits<F77_INT>::min ()
-      || x > std::numeric_limits<F77_INT>::max ())
-    (*current_liboctave_error_handler)
-      ("integer dimension or index out of range for Fortran INTEGER type");
+    return static_cast<F77_INT> (x);
+  }
+}
 
-  return static_cast<F77_INT> (x);
-}
 #endif
 
 #if defined (__cplusplus)
--- a/liboctave/numeric/DASPK.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/numeric/DASPK.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -83,7 +83,7 @@
 
   tmp_delta = user_fun (tmp_state, tmp_deriv, time, tmp_ires);
 
-  ires = to_f77_int (tmp_ires);
+  ires = octave::to_f77_int (tmp_ires);
 
   if (ires >= 0)
     {
@@ -166,7 +166,7 @@
       for (F77_INT i = 0; i < 20; i++)
         info(i) = 0;
 
-      F77_INT n = to_f77_int (size ());
+      F77_INT n = octave::to_f77_int (size ());
 
       nn = n;
 
@@ -237,8 +237,8 @@
       abs_tol = absolute_tolerance ();
       rel_tol = relative_tolerance ();
 
-      F77_INT abs_tol_len = to_f77_int (abs_tol.numel ());
-      F77_INT rel_tol_len = to_f77_int (rel_tol.numel ());
+      F77_INT abs_tol_len = octave::to_f77_int (abs_tol.numel ());
+      F77_INT rel_tol_len = octave::to_f77_int (rel_tol.numel ());
 
       if (abs_tol_len == 1 && rel_tol_len == 1)
         {
@@ -283,7 +283,7 @@
           if (maxord > 0 && maxord < 6)
             {
               info(8) = 1;
-              iwork(2) = to_f77_int (maxord);
+              iwork(2) = octave::to_f77_int (maxord);
             }
           else
             {
@@ -302,13 +302,13 @@
           {
             Array<octave_idx_type> ict = inequality_constraint_types ();
 
-            F77_INT ict_nel = to_f77_int (ict.numel ());
+            F77_INT ict_nel = octave::to_f77_int (ict.numel ());
 
             if (ict_nel == n)
               {
                 for (F77_INT i = 0; i < n; i++)
                   {
-                    F77_INT val = to_f77_int (ict(i));
+                    F77_INT val = octave::to_f77_int (ict(i));
                     if (val < -2 || val > 2)
                       {
                         // FIXME: Should this be a warning?
@@ -333,7 +333,7 @@
 
         case 0:
         case 2:
-          info(9) = to_f77_int (eiq);
+          info(9) = octave::to_f77_int (eiq);
           break;
 
         default:
@@ -352,7 +352,7 @@
 
               Array<octave_idx_type> av = algebraic_variables ();
 
-              F77_INT av_nel = to_f77_int (av.numel ());
+              F77_INT av_nel = octave::to_f77_int (av.numel ());
 
               if (av_nel == n)
                 {
@@ -385,7 +385,7 @@
               return retval;
             }
 
-          info(10) = to_f77_int (ccic);
+          info(10) = octave::to_f77_int (ccic);
         }
 
       if (eavfet)
@@ -396,7 +396,7 @@
 
           Array<octave_idx_type> av = algebraic_variables ();
 
-          F77_INT av_nel = to_f77_int (av.numel ());
+          F77_INT av_nel = octave::to_f77_int (av.numel ());
 
           if (av_nel == n)
             {
@@ -419,10 +419,10 @@
 
           if (ich.numel () == 6)
             {
-              iwork(31) = to_f77_int (octave::math::nint_big (ich(0)));
-              iwork(32) = to_f77_int (octave::math::nint_big (ich(1)));
-              iwork(33) = to_f77_int (octave::math::nint_big (ich(2)));
-              iwork(34) = to_f77_int (octave::math::nint_big (ich(3)));
+              iwork(31) = octave::to_f77_int (octave::math::nint_big (ich(0)));
+              iwork(32) = octave::to_f77_int (octave::math::nint_big (ich(1)));
+              iwork(33) = octave::to_f77_int (octave::math::nint_big (ich(2)));
+              iwork(34) = octave::to_f77_int (octave::math::nint_big (ich(3)));
 
               rwork(13) = ich(4);
               rwork(14) = ich(5);
@@ -445,7 +445,7 @@
         case 0:
         case 1:
         case 2:
-          info(17) = to_f77_int (pici);
+          info(17) = octave::to_f77_int (pici);
           break;
 
         default:
@@ -476,7 +476,7 @@
   double *dummy = 0;
   F77_INT *idummy = 0;
 
-  F77_INT tmp_istate = to_f77_int (istate);
+  F77_INT tmp_istate = octave::to_f77_int (istate);
 
   F77_XFCN (ddaspk, DDASPK, (ddaspk_f, nn, t, px, pxdot, tout, pinfo,
                              prel_tol, pabs_tol, tmp_istate, prwork, lrw,
@@ -555,7 +555,7 @@
   Matrix retval;
 
   octave_idx_type n_out = tout.numel ();
-  F77_INT n = to_f77_int (size ());
+  F77_INT n = octave::to_f77_int (size ());
 
   if (n_out > 0 && n > 0)
     {
@@ -600,7 +600,7 @@
   Matrix retval;
 
   octave_idx_type n_out = tout.numel ();
-  F77_INT n = to_f77_int (size ());
+  F77_INT n = octave::to_f77_int (size ());
 
   if (n_out > 0 && n > 0)
     {
--- a/liboctave/numeric/DASRT.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/numeric/DASRT.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -81,7 +81,7 @@
 
   ColumnVector tmp_fval = (*user_fsub) (tmp_state, tmp_deriv, t, tmp_ires);
 
-  ires = to_f77_int (tmp_ires);
+  ires = octave::to_f77_int (tmp_ires);
 
   if (tmp_fval.is_empty ())
     ires = -2;
@@ -165,7 +165,7 @@
       for (F77_INT i = 0; i < 15; i++)
         info(i) = 0;
 
-      F77_INT n = to_f77_int (size ());
+      F77_INT n = octave::to_f77_int (size ());
 
       nn = n;
 
@@ -176,12 +176,12 @@
       if (user_csub)
         {
           ColumnVector tmp = (*user_csub) (x, t);
-          ng = to_f77_int (tmp.numel ());
+          ng = octave::to_f77_int (tmp.numel ());
         }
       else
         ng = 0;
 
-      F77_INT maxord = to_f77_int (maximum_order ());
+      F77_INT maxord = octave::to_f77_int (maximum_order ());
       if (maxord >= 0)
         {
           if (maxord > 0 && maxord < 6)
@@ -273,7 +273,7 @@
       else
         info(7) = 0;
 
-      F77_INT sl = to_f77_int (step_limit ());
+      F77_INT sl = octave::to_f77_int (step_limit ());
       if (sl >= 0)
         {
           info(11) = 1;
@@ -285,8 +285,8 @@
       abs_tol = absolute_tolerance ();
       rel_tol = relative_tolerance ();
 
-      F77_INT abs_tol_len = to_f77_int (abs_tol.numel ());
-      F77_INT rel_tol_len = to_f77_int (rel_tol.numel ());
+      F77_INT abs_tol_len = octave::to_f77_int (abs_tol.numel ());
+      F77_INT rel_tol_len = octave::to_f77_int (rel_tol.numel ());
 
       if (abs_tol_len == 1 && rel_tol_len == 1)
         {
@@ -324,7 +324,7 @@
   double *dummy = 0;
   F77_INT *idummy = 0;
 
-  F77_INT tmp_istate = to_f77_int (istate);
+  F77_INT tmp_istate = octave::to_f77_int (istate);
 
   F77_XFCN (ddasrt, DDASRT, (ddasrt_f, nn, t, px, pxdot, tout, pinfo,
                              prel_tol, pabs_tol, tmp_istate, prwork, lrw,
@@ -393,7 +393,7 @@
   ColumnVector t_out = tout;
 
   octave_idx_type n_out = tout.numel ();
-  F77_INT n = to_f77_int (size ());
+  F77_INT n = octave::to_f77_int (size ());
 
   if (n_out > 0 && n > 0)
     {
@@ -452,7 +452,7 @@
   ColumnVector t_outs = tout;
 
   octave_idx_type n_out = tout.numel ();
-  F77_INT n = to_f77_int (size ());
+  F77_INT n = octave::to_f77_int (size ());
 
   if (n_out > 0 && n > 0)
     {
--- a/liboctave/numeric/DASSL.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/numeric/DASSL.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -80,7 +80,7 @@
 
   tmp_delta = user_fun (tmp_state, tmp_deriv, time, tmp_ires);
 
-  ires = to_f77_int (tmp_ires);
+  ires = octave::to_f77_int (tmp_ires);
 
   if (ires >= 0)
     {
@@ -142,7 +142,7 @@
       for (F77_INT i = 0; i < 15; i++)
         info(i) = 0;
 
-      F77_INT n = to_f77_int (size ());
+      F77_INT n = octave::to_f77_int (size ());
 
       liw = 21 + n;
       lrw = 40 + 9*n + n*n;
@@ -217,7 +217,7 @@
       else
         info(7) = 0;
 
-      F77_INT sl = to_f77_int (step_limit ());
+      F77_INT sl = octave::to_f77_int (step_limit ());
 
       if (sl >= 0)
         {
@@ -227,7 +227,7 @@
       else
         info(11) = 0;
 
-      F77_INT maxord = to_f77_int (maximum_order ());
+      F77_INT maxord = octave::to_f77_int (maximum_order ());
       if (maxord >= 0)
         {
           if (maxord > 0 && maxord < 6)
@@ -244,17 +244,17 @@
             }
         }
 
-      F77_INT enc = to_f77_int (enforce_nonnegativity_constraints ());
+      F77_INT enc = octave::to_f77_int (enforce_nonnegativity_constraints ());
       info(9) = enc ? 1 : 0;
 
-      F77_INT ccic = to_f77_int (compute_consistent_initial_condition ());
+      F77_INT ccic = octave::to_f77_int (compute_consistent_initial_condition ());
       info(10) = ccic ? 1 : 0;
 
       abs_tol = absolute_tolerance ();
       rel_tol = relative_tolerance ();
 
-      F77_INT abs_tol_len = to_f77_int (abs_tol.numel ());
-      F77_INT rel_tol_len = to_f77_int (rel_tol.numel ());
+      F77_INT abs_tol_len = octave::to_f77_int (abs_tol.numel ());
+      F77_INT rel_tol_len = octave::to_f77_int (rel_tol.numel ());
 
       if (abs_tol_len == 1 && rel_tol_len == 1)
         {
@@ -290,7 +290,7 @@
   double *dummy = 0;
   F77_INT *idummy = 0;
 
-  F77_INT tmp_istate = to_f77_int (istate);
+  F77_INT tmp_istate = octave::to_f77_int (istate);
 
   F77_XFCN (ddassl, DDASSL, (ddassl_f, nn, t, px, pxdot, tout, pinfo,
                              prel_tol, pabs_tol, tmp_istate, prwork, lrw,
@@ -360,7 +360,7 @@
   Matrix retval;
 
   octave_idx_type n_out = tout.numel ();
-  F77_INT n = to_f77_int (size ());
+  F77_INT n = octave::to_f77_int (size ());
 
   if (n_out > 0 && n > 0)
     {
@@ -405,7 +405,7 @@
   Matrix retval;
 
   octave_idx_type n_out = tout.numel ();
-  F77_INT n = to_f77_int (size ());
+  F77_INT n = octave::to_f77_int (size ());
 
   if (n_out > 0 && n > 0)
     {
--- a/liboctave/numeric/EIG.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/numeric/EIG.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -40,8 +40,8 @@
   if (a.is_symmetric ())
     return symmetric_init (a, calc_rev, calc_lev);
 
-  F77_INT n = to_f77_int (a.rows ());
-  F77_INT a_nc = to_f77_int (a.cols ());
+  F77_INT n = octave::to_f77_int (a.rows ());
+  F77_INT a_nc = octave::to_f77_int (a.cols ());
 
   if (n != a_nc)
     (*current_liboctave_error_handler) ("EIG requires square matrix");
@@ -173,8 +173,8 @@
 octave_idx_type
 EIG::symmetric_init (const Matrix& a, bool calc_rev, bool calc_lev)
 {
-  F77_INT n = to_f77_int (a.rows ());
-  F77_INT a_nc = to_f77_int (a.cols ());
+  F77_INT n = octave::to_f77_int (a.rows ());
+  F77_INT a_nc = octave::to_f77_int (a.cols ());
 
   if (n != a_nc)
     (*current_liboctave_error_handler) ("EIG requires square matrix");
@@ -232,8 +232,8 @@
   if (a.is_hermitian ())
     return hermitian_init (a, calc_rev, calc_lev);
 
-  F77_INT n = to_f77_int (a.rows ());
-  F77_INT a_nc = to_f77_int (a.cols ());
+  F77_INT n = octave::to_f77_int (a.rows ());
+  F77_INT a_nc = octave::to_f77_int (a.cols ());
 
   if (n != a_nc)
     (*current_liboctave_error_handler) ("EIG requires square matrix");
@@ -326,8 +326,8 @@
 octave_idx_type
 EIG::hermitian_init (const ComplexMatrix& a, bool calc_rev, bool calc_lev)
 {
-  F77_INT n = to_f77_int (a.rows ());
-  F77_INT a_nc = to_f77_int (a.cols ());
+  F77_INT n = octave::to_f77_int (a.rows ());
+  F77_INT a_nc = octave::to_f77_int (a.cols ());
 
   if (n != a_nc)
     (*current_liboctave_error_handler) ("EIG requires square matrix");
@@ -390,11 +390,11 @@
     (*current_liboctave_error_handler)
       ("EIG: matrix contains Inf or NaN values");
 
-  F77_INT n = to_f77_int (a.rows ());
-  F77_INT nb = to_f77_int (b.rows ());
+  F77_INT n = octave::to_f77_int (a.rows ());
+  F77_INT nb = octave::to_f77_int (b.rows ());
 
-  F77_INT a_nc = to_f77_int (a.cols ());
-  F77_INT b_nc = to_f77_int (b.cols ());
+  F77_INT a_nc = octave::to_f77_int (a.cols ());
+  F77_INT b_nc = octave::to_f77_int (b.cols ());
     
   if (n != a_nc || nb != b_nc)
     (*current_liboctave_error_handler) ("EIG requires square matrix");
@@ -527,11 +527,11 @@
 EIG::symmetric_init (const Matrix& a, const Matrix& b, bool calc_rev,
                      bool calc_lev)
 {
-  F77_INT n = to_f77_int (a.rows ());
-  F77_INT nb = to_f77_int (b.rows ());
+  F77_INT n = octave::to_f77_int (a.rows ());
+  F77_INT nb = octave::to_f77_int (b.rows ());
 
-  F77_INT a_nc = to_f77_int (a.cols ());
-  F77_INT b_nc = to_f77_int (b.cols ());
+  F77_INT a_nc = octave::to_f77_int (a.cols ());
+  F77_INT b_nc = octave::to_f77_int (b.cols ());
 
   if (n != a_nc || nb != b_nc)
     (*current_liboctave_error_handler) ("EIG requires square matrix");
@@ -597,11 +597,11 @@
     (*current_liboctave_error_handler)
       ("EIG: matrix contains Inf or NaN values");
 
-  F77_INT n = to_f77_int (a.rows ());
-  F77_INT nb = to_f77_int (b.rows ());
+  F77_INT n = octave::to_f77_int (a.rows ());
+  F77_INT nb = octave::to_f77_int (b.rows ());
 
-  F77_INT a_nc = to_f77_int (a.cols ());
-  F77_INT b_nc = to_f77_int (b.cols ());
+  F77_INT a_nc = octave::to_f77_int (a.cols ());
+  F77_INT b_nc = octave::to_f77_int (b.cols ());
 
   if (n != a_nc || nb != b_nc)
     (*current_liboctave_error_handler) ("EIG requires square matrix");
@@ -704,11 +704,11 @@
 EIG::hermitian_init (const ComplexMatrix& a, const ComplexMatrix& b,
                      bool calc_rev, bool calc_lev)
 {
-  F77_INT n = to_f77_int (a.rows ());
-  F77_INT nb = to_f77_int (b.rows ());
+  F77_INT n = octave::to_f77_int (a.rows ());
+  F77_INT nb = octave::to_f77_int (b.rows ());
 
-  F77_INT a_nc = to_f77_int (a.cols ());
-  F77_INT b_nc = to_f77_int (b.cols ());
+  F77_INT a_nc = octave::to_f77_int (a.cols ());
+  F77_INT b_nc = octave::to_f77_int (b.cols ());
 
   if (n != a_nc || nb != b_nc)
     (*current_liboctave_error_handler) ("EIG requires square matrix");
--- a/liboctave/numeric/LSODE.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/numeric/LSODE.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -120,7 +120,7 @@
 
       istate = 1;
 
-      F77_INT n = to_f77_int (size ());
+      F77_INT n = octave::to_f77_int (size ());
 
       nn = n;
 
@@ -164,7 +164,7 @@
         {
           if (maxord > 0 && maxord <= max_maxord)
             {
-              iwork(4) = to_f77_int (maxord);
+              iwork(4) = octave::to_f77_int (maxord);
               iopt = 1;
             }
           else
@@ -220,7 +220,7 @@
       rel_tol = relative_tolerance ();
       abs_tol = absolute_tolerance ();
 
-      F77_INT abs_tol_len = to_f77_int (abs_tol.numel ());
+      F77_INT abs_tol_len = octave::to_f77_int (abs_tol.numel ());
 
       if (abs_tol_len == 1)
         itol = 1;
@@ -257,7 +257,7 @@
           iopt = 1;
         }
 
-      F77_INT sl = to_f77_int (step_limit ());
+      F77_INT sl = octave::to_f77_int (step_limit ());
       if (sl > 0)
         {
           iwork(5) = sl;
@@ -274,7 +274,7 @@
   F77_INT *piwork = iwork.fortran_vec ();
   double *prwork = rwork.fortran_vec ();
 
-  F77_INT tmp_istate = to_f77_int (istate);
+  F77_INT tmp_istate = octave::to_f77_int (istate);
 
   F77_XFCN (dlsode, DLSODE, (lsode_f, nn, px, t, tout, itol, rel_tol,
                              pabs_tol, itask, tmp_istate, iopt, prwork, lrw,
@@ -384,7 +384,7 @@
   Matrix retval;
 
   octave_idx_type n_out = tout.numel ();
-  F77_INT n = to_f77_int (size ());
+  F77_INT n = octave::to_f77_int (size ());
 
   if (n_out > 0 && n > 0)
     {
@@ -414,7 +414,7 @@
   Matrix retval;
 
   octave_idx_type n_out = tout.numel ();
-  F77_INT n = to_f77_int (size ());
+  F77_INT n = octave::to_f77_int (size ());
 
   if (n_out > 0 && n > 0)
     {
--- a/liboctave/numeric/Quad.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/numeric/Quad.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -126,7 +126,7 @@
 DefQuad::do_integrate (octave_idx_type& ier, octave_idx_type& neval,
                        double& abserr)
 {
-  F77_INT npts = to_f77_int (singularities.numel () + 2);
+  F77_INT npts = octave::to_f77_int (singularities.numel () + 2);
   double *points = singularities.fortran_vec ();
   double result = 0.0;
 
@@ -243,7 +243,7 @@
 FloatDefQuad::do_integrate (octave_idx_type& ier, octave_idx_type& neval,
                             float& abserr)
 {
-  F77_INT npts = to_f77_int (singularities.numel () + 2);
+  F77_INT npts = octave::to_f77_int (singularities.numel () + 2);
   float *points = singularities.fortran_vec ();
   float result = 0.0;
 
--- a/liboctave/numeric/aepbalance.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/numeric/aepbalance.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -53,7 +53,7 @@
       : balanced_mat (a), scale (), ilo (), ihi (),
         job (get_job (noperm, noscal))
     {
-      F77_INT n = to_f77_int (a.cols ());
+      F77_INT n = octave::to_f77_int (a.cols ());
 
       if (a.rows () != n)
         (*current_liboctave_error_handler) ("aepbalance: requires square matrix");
@@ -75,15 +75,15 @@
     Matrix
     aepbalance<Matrix>::balancing_matrix (void) const
     {
-      F77_INT n = to_f77_int (balanced_mat.rows ());
+      F77_INT n = octave::to_f77_int (balanced_mat.rows ());
 
       Matrix balancing_mat (n, n, 0.0);
       for (F77_INT i = 0; i < n; i++)
         balancing_mat.elem (i ,i) = 1.0;
 
       F77_INT info;
-      F77_INT t_ilo = to_f77_int (ilo);
-      F77_INT t_ihi = to_f77_int (ihi);
+      F77_INT t_ilo = octave::to_f77_int (ilo);
+      F77_INT t_ihi = octave::to_f77_int (ihi);
 
       char side = 'R';
 
@@ -103,7 +103,7 @@
       : balanced_mat (a), scale (), ilo (), ihi (),
         job (get_job (noperm, noscal))
     {
-      F77_INT n = to_f77_int (a.cols ());
+      F77_INT n = octave::to_f77_int (a.cols ());
 
       if (a.rows () != n)
         (*current_liboctave_error_handler) ("aepbalance: requires square matrix");
@@ -125,15 +125,15 @@
     FloatMatrix
     aepbalance<FloatMatrix>::balancing_matrix (void) const
     {
-      F77_INT n = to_f77_int (balanced_mat.rows ());
+      F77_INT n = octave::to_f77_int (balanced_mat.rows ());
 
       FloatMatrix balancing_mat (n, n, 0.0);
       for (F77_INT i = 0; i < n; i++)
         balancing_mat.elem (i ,i) = 1.0;
 
       F77_INT info;
-      F77_INT t_ilo = to_f77_int (ilo);
-      F77_INT t_ihi = to_f77_int (ihi);
+      F77_INT t_ilo = octave::to_f77_int (ilo);
+      F77_INT t_ihi = octave::to_f77_int (ihi);
 
       char side = 'R';
 
@@ -153,7 +153,7 @@
       : balanced_mat (a), scale (), ilo (), ihi (),
         job (get_job (noperm, noscal))
     {
-      F77_INT n = to_f77_int (a.cols ());
+      F77_INT n = octave::to_f77_int (a.cols ());
 
       if (a.rows () != n)
         (*current_liboctave_error_handler) ("aepbalance: requires square matrix");
@@ -175,15 +175,15 @@
     ComplexMatrix
     aepbalance<ComplexMatrix>::balancing_matrix (void) const
     {
-      F77_INT n = to_f77_int (balanced_mat.rows ());
+      F77_INT n = octave::to_f77_int (balanced_mat.rows ());
 
       ComplexMatrix balancing_mat (n, n, 0.0);
       for (F77_INT i = 0; i < n; i++)
         balancing_mat.elem (i, i) = 1.0;
 
       F77_INT info;
-      F77_INT t_ilo = to_f77_int (ilo);
-      F77_INT t_ihi = to_f77_int (ihi);
+      F77_INT t_ilo = octave::to_f77_int (ilo);
+      F77_INT t_ihi = octave::to_f77_int (ihi);
 
       char side = 'R';
 
@@ -204,7 +204,7 @@
       : balanced_mat (a), scale (), ilo (), ihi (),
         job (get_job (noperm, noscal))
     {
-      F77_INT n = to_f77_int (a.cols ());
+      F77_INT n = octave::to_f77_int (a.cols ());
 
       if (a.rows () != n)
         (*current_liboctave_error_handler) ("aepbalance: requires square matrix");
@@ -226,15 +226,15 @@
     FloatComplexMatrix
     aepbalance<FloatComplexMatrix>::balancing_matrix (void) const
     {
-      F77_INT n = to_f77_int (balanced_mat.rows ());
+      F77_INT n = octave::to_f77_int (balanced_mat.rows ());
 
       FloatComplexMatrix balancing_mat (n, n, 0.0);
       for (F77_INT i = 0; i < n; i++)
         balancing_mat.elem (i, i) = 1.0;
 
       F77_INT info;
-      F77_INT t_ilo = to_f77_int (ilo);
-      F77_INT t_ihi = to_f77_int (ihi);
+      F77_INT t_ilo = octave::to_f77_int (ilo);
+      F77_INT t_ihi = octave::to_f77_int (ihi);
 
       char side = 'R';
 
--- a/liboctave/numeric/chol.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/numeric/chol.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -61,7 +61,7 @@
   if (r_nr != r_nc)
     (*current_liboctave_error_handler) ("chol2inv requires square matrix");
 
-  F77_INT n = to_f77_int (r_nc);
+  F77_INT n = octave::to_f77_int (r_nc);
   F77_INT info = 0;
 
   Matrix tmp = r;
@@ -110,7 +110,7 @@
   if (r_nr != r_nc)
     (*current_liboctave_error_handler) ("chol2inv requires square matrix");
 
-  F77_INT n = to_f77_int (r_nc);
+  F77_INT n = octave::to_f77_int (r_nc);
   F77_INT info = 0;
 
   FloatMatrix tmp = r;
@@ -159,7 +159,7 @@
   if (r_nr != r_nc)
     (*current_liboctave_error_handler) ("chol2inv requires square matrix");
 
-  F77_INT n = to_f77_int (r_nc);
+  F77_INT n = octave::to_f77_int (r_nc);
   F77_INT info;
 
   ComplexMatrix tmp = r;
@@ -204,7 +204,7 @@
   if (r_nr != r_nc)
     (*current_liboctave_error_handler) ("chol2inv requires square matrix");
 
-  F77_INT n = to_f77_int (r_nc);
+  F77_INT n = octave::to_f77_int (r_nc);
   F77_INT info;
 
   FloatComplexMatrix tmp = r;
@@ -420,7 +420,7 @@
       if (a_nr != a_nc)
         (*current_liboctave_error_handler) ("chol: requires square matrix");
 
-      F77_INT n = to_f77_int (a_nc);
+      F77_INT n = octave::to_f77_int (a_nc);
       F77_INT info;
 
       is_upper = upper;
@@ -489,7 +489,7 @@
     void
     chol<Matrix>::update (const ColumnVector& u)
     {
-      F77_INT n = to_f77_int (chol_mat.rows ());
+      F77_INT n = octave::to_f77_int (chol_mat.rows ());
 
       if (u.numel () != n)
         (*current_liboctave_error_handler) ("cholupdate: dimension mismatch");
@@ -508,7 +508,7 @@
     {
       F77_INT info = -1;
 
-      F77_INT n = to_f77_int (chol_mat.rows ());
+      F77_INT n = octave::to_f77_int (chol_mat.rows ());
 
       if (u.numel () != n)
         (*current_liboctave_error_handler) ("cholupdate: dimension mismatch");
@@ -529,8 +529,8 @@
     {
       F77_INT info = -1;
 
-      F77_INT n = to_f77_int (chol_mat.rows ());
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT n = octave::to_f77_int (chol_mat.rows ());
+      F77_INT j = octave::to_f77_int (j_arg);
 
       if (u.numel () != n + 1)
         (*current_liboctave_error_handler) ("cholinsert: dimension mismatch");
@@ -542,7 +542,7 @@
       OCTAVE_LOCAL_BUFFER (double, w, n);
 
       chol_mat.resize (n+1, n+1);
-      F77_INT ldcm = to_f77_int (chol_mat.rows ());
+      F77_INT ldcm = octave::to_f77_int (chol_mat.rows ());
 
       F77_XFCN (dchinx, DCHINX, (n, chol_mat.fortran_vec (), ldcm,
                                  j + 1, utmp.fortran_vec (), w, info));
@@ -554,8 +554,8 @@
     void
     chol<Matrix>::delete_sym (octave_idx_type j_arg)
     {
-      F77_INT n = to_f77_int (chol_mat.rows ());
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT n = octave::to_f77_int (chol_mat.rows ());
+      F77_INT j = octave::to_f77_int (j_arg);
 
       if (j < 0 || j > n-1)
         (*current_liboctave_error_handler) ("choldelete: index out of range");
@@ -571,9 +571,9 @@
     void
     chol<Matrix>::shift_sym (octave_idx_type i_arg, octave_idx_type j_arg)
     {
-      F77_INT n = to_f77_int (chol_mat.rows ());
-      F77_INT i = to_f77_int (i_arg);
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT n = octave::to_f77_int (chol_mat.rows ());
+      F77_INT i = octave::to_f77_int (i_arg);
+      F77_INT j = octave::to_f77_int (j_arg);
 
       if (i < 0 || i > n-1 || j < 0 || j > n-1)
         (*current_liboctave_error_handler) ("cholshift: index out of range");
@@ -596,7 +596,7 @@
       if (a_nr != a_nc)
         (*current_liboctave_error_handler) ("chol: requires square matrix");
 
-      F77_INT n = to_f77_int (a_nc);
+      F77_INT n = octave::to_f77_int (a_nc);
       F77_INT info;
 
       is_upper = upper;
@@ -665,7 +665,7 @@
     void
     chol<FloatMatrix>::update (const FloatColumnVector& u)
     {
-      F77_INT n = to_f77_int (chol_mat.rows ());
+      F77_INT n = octave::to_f77_int (chol_mat.rows ());
 
       if (u.numel () != n)
         (*current_liboctave_error_handler) ("cholupdate: dimension mismatch");
@@ -684,7 +684,7 @@
     {
       F77_INT info = -1;
 
-      F77_INT n = to_f77_int (chol_mat.rows ());
+      F77_INT n = octave::to_f77_int (chol_mat.rows ());
 
       if (u.numel () != n)
         (*current_liboctave_error_handler) ("cholupdate: dimension mismatch");
@@ -706,8 +706,8 @@
     {
       F77_INT info = -1;
 
-      F77_INT n = to_f77_int (chol_mat.rows ());
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT n = octave::to_f77_int (chol_mat.rows ());
+      F77_INT j = octave::to_f77_int (j_arg);
 
       if (u.numel () != n + 1)
         (*current_liboctave_error_handler) ("cholinsert: dimension mismatch");
@@ -719,7 +719,7 @@
       OCTAVE_LOCAL_BUFFER (float, w, n);
 
       chol_mat.resize (n+1, n+1);
-      F77_INT ldcm = to_f77_int (chol_mat.rows ());
+      F77_INT ldcm = octave::to_f77_int (chol_mat.rows ());
 
       F77_XFCN (schinx, SCHINX, (n, chol_mat.fortran_vec (), ldcm,
                                  j + 1, utmp.fortran_vec (), w, info));
@@ -731,8 +731,8 @@
     void
     chol<FloatMatrix>::delete_sym (octave_idx_type j_arg)
     {
-      F77_INT n = to_f77_int (chol_mat.rows ());
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT n = octave::to_f77_int (chol_mat.rows ());
+      F77_INT j = octave::to_f77_int (j_arg);
 
       if (j < 0 || j > n-1)
         (*current_liboctave_error_handler) ("choldelete: index out of range");
@@ -749,9 +749,9 @@
     void
     chol<FloatMatrix>::shift_sym (octave_idx_type i_arg, octave_idx_type j_arg)
     {
-      F77_INT n = to_f77_int (chol_mat.rows ());
-      F77_INT i = to_f77_int (i_arg);
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT n = octave::to_f77_int (chol_mat.rows ());
+      F77_INT i = octave::to_f77_int (i_arg);
+      F77_INT j = octave::to_f77_int (j_arg);
 
       if (i < 0 || i > n-1 || j < 0 || j > n-1)
         (*current_liboctave_error_handler) ("cholshift: index out of range");
@@ -774,7 +774,7 @@
       if (a_nr != a_nc)
         (*current_liboctave_error_handler) ("chol: requires square matrix");
 
-      F77_INT n = to_f77_int (a_nc);
+      F77_INT n = octave::to_f77_int (a_nc);
       F77_INT info;
 
       is_upper = upper;
@@ -842,7 +842,7 @@
     void
     chol<ComplexMatrix>::update (const ComplexColumnVector& u)
     {
-      F77_INT n = to_f77_int (chol_mat.rows ());
+      F77_INT n = octave::to_f77_int (chol_mat.rows ());
 
       if (u.numel () != n)
         (*current_liboctave_error_handler) ("cholupdate: dimension mismatch");
@@ -864,7 +864,7 @@
     {
       F77_INT info = -1;
 
-      F77_INT n = to_f77_int (chol_mat.rows ());
+      F77_INT n = octave::to_f77_int (chol_mat.rows ());
 
       if (u.numel () != n)
         (*current_liboctave_error_handler) ("cholupdate: dimension mismatch");
@@ -889,8 +889,8 @@
     {
       F77_INT info = -1;
 
-      F77_INT n = to_f77_int (chol_mat.rows ());
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT n = octave::to_f77_int (chol_mat.rows ());
+      F77_INT j = octave::to_f77_int (j_arg);
 
       if (u.numel () != n + 1)
         (*current_liboctave_error_handler) ("cholinsert: dimension mismatch");
@@ -902,7 +902,7 @@
       OCTAVE_LOCAL_BUFFER (double, rw, n);
 
       chol_mat.resize (n+1, n+1);
-      F77_INT ldcm = to_f77_int (chol_mat.rows ());
+      F77_INT ldcm = octave::to_f77_int (chol_mat.rows ());
 
       F77_XFCN (zchinx, ZCHINX, (n,
                                  F77_DBLE_CMPLX_ARG (chol_mat.fortran_vec ()),
@@ -917,8 +917,8 @@
     void
     chol<ComplexMatrix>::delete_sym (octave_idx_type j_arg)
     {
-      F77_INT n = to_f77_int (chol_mat.rows ());
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT n = octave::to_f77_int (chol_mat.rows ());
+      F77_INT j = octave::to_f77_int (j_arg);
 
       if (j < 0 || j > n-1)
         (*current_liboctave_error_handler) ("choldelete: index out of range");
@@ -937,9 +937,9 @@
     chol<ComplexMatrix>::shift_sym (octave_idx_type i_arg,
                                     octave_idx_type j_arg)
     {
-      F77_INT n = to_f77_int (chol_mat.rows ());
-      F77_INT i = to_f77_int (i_arg);
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT n = octave::to_f77_int (chol_mat.rows ());
+      F77_INT i = octave::to_f77_int (i_arg);
+      F77_INT j = octave::to_f77_int (j_arg);
 
       if (i < 0 || i > n-1 || j < 0 || j > n-1)
         (*current_liboctave_error_handler) ("cholshift: index out of range");
@@ -966,7 +966,7 @@
       if (a_nr != a_nc)
         (*current_liboctave_error_handler) ("chol: requires square matrix");
 
-      F77_INT n = to_f77_int (a_nc);
+      F77_INT n = octave::to_f77_int (a_nc);
       F77_INT info;
 
       is_upper = upper;
@@ -1034,7 +1034,7 @@
     void
     chol<FloatComplexMatrix>::update (const FloatComplexColumnVector& u)
     {
-      F77_INT n = to_f77_int (chol_mat.rows ());
+      F77_INT n = octave::to_f77_int (chol_mat.rows ());
 
       if (u.numel () != n)
         (*current_liboctave_error_handler) ("cholupdate: dimension mismatch");
@@ -1053,7 +1053,7 @@
     {
       F77_INT info = -1;
 
-      F77_INT n = to_f77_int (chol_mat.rows ());
+      F77_INT n = octave::to_f77_int (chol_mat.rows ());
 
       if (u.numel () != n)
         (*current_liboctave_error_handler) ("cholupdate: dimension mismatch");
@@ -1075,9 +1075,9 @@
                                           octave_idx_type j_arg)
     {
       F77_INT info = -1;
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT j = octave::to_f77_int (j_arg);
 
-      F77_INT n = to_f77_int (chol_mat.rows ());
+      F77_INT n = octave::to_f77_int (chol_mat.rows ());
 
       if (u.numel () != n + 1)
         (*current_liboctave_error_handler) ("cholinsert: dimension mismatch");
@@ -1089,7 +1089,7 @@
       OCTAVE_LOCAL_BUFFER (float, rw, n);
 
       chol_mat.resize (n+1, n+1);
-      F77_INT ldcm = to_f77_int (chol_mat.rows ());
+      F77_INT ldcm = octave::to_f77_int (chol_mat.rows ());
 
       F77_XFCN (cchinx, CCHINX, (n, F77_CMPLX_ARG (chol_mat.fortran_vec ()),
                                  ldcm, j + 1,
@@ -1103,8 +1103,8 @@
     void
     chol<FloatComplexMatrix>::delete_sym (octave_idx_type j_arg)
     {
-      F77_INT n = to_f77_int (chol_mat.rows ());
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT n = octave::to_f77_int (chol_mat.rows ());
+      F77_INT j = octave::to_f77_int (j_arg);
 
       if (j < 0 || j > n-1)
         (*current_liboctave_error_handler) ("choldelete: index out of range");
@@ -1122,9 +1122,9 @@
     chol<FloatComplexMatrix>::shift_sym (octave_idx_type i_arg,
                                          octave_idx_type j_arg)
     {
-      F77_INT n = to_f77_int (chol_mat.rows ());
-      F77_INT i = to_f77_int (i_arg);
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT n = octave::to_f77_int (chol_mat.rows ());
+      F77_INT i = octave::to_f77_int (i_arg);
+      F77_INT j = octave::to_f77_int (j_arg);
 
       if (i < 0 || i > n-1 || j < 0 || j > n-1)
         (*current_liboctave_error_handler) ("cholshift: index out of range");
--- a/liboctave/numeric/eigs-base.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/numeric/eigs-base.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -139,8 +139,8 @@
 static bool
 vector_product (const Matrix& m, const double *x, double *y)
 {
-  F77_INT nr = to_f77_int (m.rows ());
-  F77_INT nc = to_f77_int (m.cols ());
+  F77_INT nr = octave::to_f77_int (m.rows ());
+  F77_INT nc = octave::to_f77_int (m.cols ());
 
   F77_XFCN (dgemv, DGEMV, (F77_CONST_CHAR_ARG2 ("N", 1),
                            nr, nc, 1.0,  m.data (), nr,
@@ -172,8 +172,8 @@
 static bool
 vector_product (const ComplexMatrix& m, const Complex *x, Complex *y)
 {
-  F77_INT nr = to_f77_int (m.rows ());
-  F77_INT nc = to_f77_int (m.cols ());
+  F77_INT nr = octave::to_f77_int (m.rows ());
+  F77_INT nc = octave::to_f77_int (m.cols ());
 
   F77_XFCN (zgemv, ZGEMV, (F77_CONST_CHAR_ARG2 ("N", 1),
                            nr, nc, 1.0, F77_CONST_DBLE_CMPLX_ARG (m.data ()),
@@ -601,10 +601,10 @@
                          std::ostream& os, double tol, bool rvec,
                          bool cholB, int disp, int maxit)
 {
-  F77_INT k = to_f77_int (k_arg);
-  F77_INT p = to_f77_int (p_arg);
+  F77_INT k = octave::to_f77_int (k_arg);
+  F77_INT p = octave::to_f77_int (p_arg);
   M b(_b);
-  F77_INT n = to_f77_int (m.cols ());
+  F77_INT n = octave::to_f77_int (m.cols ());
   F77_INT mode = 1;
   bool have_b = ! b.is_empty ();
   bool note3 = false;
@@ -729,7 +729,7 @@
 
   do
     {
-      F77_INT tmp_info = to_f77_int (info);
+      F77_INT tmp_info = octave::to_f77_int (info);
 
       F77_FUNC (dsaupd, DSAUPD)
         (ido, F77_CONST_CHAR_ARG2 (&bmat, 1), n,
@@ -879,10 +879,10 @@
                               std::ostream& os, double tol, bool rvec,
                               bool cholB, int disp, int maxit)
 {
-  F77_INT k = to_f77_int (k_arg);
-  F77_INT p = to_f77_int (p_arg);
+  F77_INT k = octave::to_f77_int (k_arg);
+  F77_INT p = octave::to_f77_int (p_arg);
   M b(_b);
-  F77_INT n = to_f77_int (m.cols ());
+  F77_INT n = octave::to_f77_int (m.cols ());
   F77_INT mode = 3;
   bool have_b = ! b.is_empty ();
   std::string typ = "LM";
@@ -990,7 +990,7 @@
 
   do
     {
-      F77_INT tmp_info = to_f77_int (info);
+      F77_INT tmp_info = octave::to_f77_int (info);
 
       F77_FUNC (dsaupd, DSAUPD)
         (ido, F77_CONST_CHAR_ARG2 (&bmat, 1), n,
@@ -1174,9 +1174,9 @@
                        std::ostream& os, double tol, bool rvec,
                        bool /* cholB */, int disp, int maxit)
 {
-  F77_INT n = to_f77_int (n_arg);
-  F77_INT k = to_f77_int (k_arg);
-  F77_INT p = to_f77_int (p_arg);
+  F77_INT n = octave::to_f77_int (n_arg);
+  F77_INT k = octave::to_f77_int (k_arg);
+  F77_INT p = octave::to_f77_int (p_arg);
   std::string typ (_typ);
   bool have_sigma = (sigma ? true : false);
   char bmat = 'I';
@@ -1271,7 +1271,7 @@
 
   do
     {
-      F77_INT tmp_info = to_f77_int (info);
+      F77_INT tmp_info = octave::to_f77_int (info);
 
       F77_FUNC (dsaupd, DSAUPD)
         (ido, F77_CONST_CHAR_ARG2 (&bmat, 1), n,
@@ -1419,10 +1419,10 @@
                             std::ostream& os, double tol, bool rvec,
                             bool cholB, int disp, int maxit)
 {
-  F77_INT k = to_f77_int (k_arg);
-  F77_INT p = to_f77_int (p_arg);
+  F77_INT k = octave::to_f77_int (k_arg);
+  F77_INT p = octave::to_f77_int (p_arg);
   M b(_b);
-  F77_INT n = to_f77_int (m.cols ());
+  F77_INT n = octave::to_f77_int (m.cols ());
   F77_INT mode = 1;
   bool have_b = ! b.is_empty ();
   bool note3 = false;
@@ -1548,7 +1548,7 @@
 
   do
     {
-      F77_INT tmp_info = to_f77_int (info);
+      F77_INT tmp_info = octave::to_f77_int (info);
 
       F77_FUNC (dnaupd, DNAUPD)
         (ido, F77_CONST_CHAR_ARG2 (&bmat, 1), n,
@@ -1746,10 +1746,10 @@
                                  std::ostream& os, double tol, bool rvec,
                                  bool cholB, int disp, int maxit)
 {
-  F77_INT k = to_f77_int (k_arg);
-  F77_INT p = to_f77_int (p_arg);
+  F77_INT k = octave::to_f77_int (k_arg);
+  F77_INT p = octave::to_f77_int (p_arg);
   M b(_b);
-  F77_INT n = to_f77_int (m.cols ());
+  F77_INT n = octave::to_f77_int (m.cols ());
   F77_INT mode = 3;
   bool have_b = ! b.is_empty ();
   std::string typ = "LM";
@@ -1858,7 +1858,7 @@
 
   do
     {
-      F77_INT tmp_info = to_f77_int (info);
+      F77_INT tmp_info = octave::to_f77_int (info);
 
       F77_FUNC (dnaupd, DNAUPD)
         (ido, F77_CONST_CHAR_ARG2 (&bmat, 1), n,
@@ -2095,9 +2095,9 @@
                           std::ostream& os, double tol, bool rvec,
                           bool /* cholB */, int disp, int maxit)
 {
-  F77_INT n = to_f77_int (n_arg);
-  F77_INT k = to_f77_int (k_arg);
-  F77_INT p = to_f77_int (p_arg);
+  F77_INT n = octave::to_f77_int (n_arg);
+  F77_INT k = octave::to_f77_int (k_arg);
+  F77_INT p = octave::to_f77_int (p_arg);
   std::string typ (_typ);
   bool have_sigma = (sigmar ? true : false);
   char bmat = 'I';
@@ -2193,7 +2193,7 @@
 
   do
     {
-      F77_INT tmp_info = to_f77_int (info);
+      F77_INT tmp_info = octave::to_f77_int (info);
 
       F77_FUNC (dnaupd, DNAUPD)
         (ido, F77_CONST_CHAR_ARG2 (&bmat, 1), n,
@@ -2388,10 +2388,10 @@
                                std::ostream& os, double tol, bool rvec,
                                bool cholB, int disp, int maxit)
 {
-  F77_INT k = to_f77_int (k_arg);
-  F77_INT p = to_f77_int (p_arg);
+  F77_INT k = octave::to_f77_int (k_arg);
+  F77_INT p = octave::to_f77_int (p_arg);
   M b(_b);
-  F77_INT n = to_f77_int (m.cols ());
+  F77_INT n = octave::to_f77_int (m.cols ());
   F77_INT mode = 1;
   bool have_b = ! b.is_empty ();
   bool note3 = false;
@@ -2521,7 +2521,7 @@
 
   do
     {
-      F77_INT tmp_info = to_f77_int (info);
+      F77_INT tmp_info = octave::to_f77_int (info);
 
       F77_FUNC (znaupd, ZNAUPD)
         (ido, F77_CONST_CHAR_ARG2 (&bmat, 1), n,
@@ -2674,10 +2674,10 @@
                                     std::ostream& os, double tol, bool rvec,
                                     bool cholB, int disp, int maxit)
 {
-  F77_INT k = to_f77_int (k_arg);
-  F77_INT p = to_f77_int (p_arg);
+  F77_INT k = octave::to_f77_int (k_arg);
+  F77_INT p = octave::to_f77_int (p_arg);
   M b(_b);
-  F77_INT n = to_f77_int (m.cols ());
+  F77_INT n = octave::to_f77_int (m.cols ());
   F77_INT mode = 3;
   bool have_b = ! b.is_empty ();
   std::string typ = "LM";
@@ -2790,7 +2790,7 @@
 
   do
     {
-      F77_INT tmp_info = to_f77_int (info);
+      F77_INT tmp_info = octave::to_f77_int (info);
 
       F77_FUNC (znaupd, ZNAUPD)
         (ido, F77_CONST_CHAR_ARG2 (&bmat, 1), n,
@@ -2985,9 +2985,9 @@
                              double tol, bool rvec, bool /* cholB */,
                              int disp, int maxit)
 {
-  F77_INT n = to_f77_int (n_arg);
-  F77_INT k = to_f77_int (k_arg);
-  F77_INT p = to_f77_int (p_arg);
+  F77_INT n = octave::to_f77_int (n_arg);
+  F77_INT k = octave::to_f77_int (k_arg);
+  F77_INT p = octave::to_f77_int (p_arg);
   std::string typ (_typ);
   bool have_sigma = (std::abs (sigma) ? true : false);
   char bmat = 'I';
@@ -3088,7 +3088,7 @@
 
   do
     {
-      F77_INT tmp_info = to_f77_int (info);
+      F77_INT tmp_info = octave::to_f77_int (info);
 
       F77_FUNC (znaupd, ZNAUPD)
         (ido, F77_CONST_CHAR_ARG2 (&bmat, 1), n,
--- a/liboctave/numeric/fEIG.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/numeric/fEIG.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -41,8 +41,8 @@
   if (a.is_symmetric ())
     return symmetric_init (a, calc_rev, calc_lev);
 
-  F77_INT n = to_f77_int (a.rows ());
-  F77_INT a_nc = to_f77_int (a.cols ());
+  F77_INT n = octave::to_f77_int (a.rows ());
+  F77_INT a_nc = octave::to_f77_int (a.cols ());
 
   if (n != a_nc)
     (*current_liboctave_error_handler) ("EIG requires square matrix");
@@ -171,8 +171,8 @@
 octave_idx_type
 FloatEIG::symmetric_init (const FloatMatrix& a, bool calc_rev, bool calc_lev)
 {
-  F77_INT n = to_f77_int (a.rows ());
-  F77_INT a_nc = to_f77_int (a.cols ());
+  F77_INT n = octave::to_f77_int (a.rows ());
+  F77_INT a_nc = octave::to_f77_int (a.cols ());
 
   if (n != a_nc)
     (*current_liboctave_error_handler) ("EIG requires square matrix");
@@ -231,8 +231,8 @@
   if (a.is_hermitian ())
     return hermitian_init (a, calc_rev, calc_lev);
 
-  F77_INT n = to_f77_int (a.rows ());
-  F77_INT a_nc = to_f77_int (a.cols ());
+  F77_INT n = octave::to_f77_int (a.rows ());
+  F77_INT a_nc = octave::to_f77_int (a.cols ());
 
   if (n != a_nc)
     (*current_liboctave_error_handler) ("EIG requires square matrix");
@@ -324,8 +324,8 @@
 FloatEIG::hermitian_init (const FloatComplexMatrix& a, bool calc_rev,
                           bool calc_lev)
 {
-  F77_INT n = to_f77_int (a.rows ());
-  F77_INT a_nc = to_f77_int (a.cols ());
+  F77_INT n = octave::to_f77_int (a.rows ());
+  F77_INT a_nc = octave::to_f77_int (a.cols ());
 
   if (n != a_nc)
     (*current_liboctave_error_handler) ("EIG requires square matrix");
@@ -388,11 +388,11 @@
     (*current_liboctave_error_handler)
       ("EIG: matrix contains Inf or NaN values");
 
-  F77_INT n = to_f77_int (a.rows ());
-  F77_INT nb = to_f77_int (b.rows ());
+  F77_INT n = octave::to_f77_int (a.rows ());
+  F77_INT nb = octave::to_f77_int (b.rows ());
 
-  F77_INT a_nc = to_f77_int (a.cols ());
-  F77_INT b_nc = to_f77_int (b.cols ());
+  F77_INT a_nc = octave::to_f77_int (a.cols ());
+  F77_INT b_nc = octave::to_f77_int (b.cols ());
 
   if (n != a_nc || nb != b_nc)
     (*current_liboctave_error_handler) ("EIG requires square matrix");
@@ -523,11 +523,11 @@
 FloatEIG::symmetric_init (const FloatMatrix& a, const FloatMatrix& b,
                           bool calc_rev, bool calc_lev)
 {
-  F77_INT n = to_f77_int (a.rows ());
-  F77_INT nb = to_f77_int (b.rows ());
+  F77_INT n = octave::to_f77_int (a.rows ());
+  F77_INT nb = octave::to_f77_int (b.rows ());
 
-  F77_INT a_nc = to_f77_int (a.cols ());
-  F77_INT b_nc = to_f77_int (b.cols ());
+  F77_INT a_nc = octave::to_f77_int (a.cols ());
+  F77_INT b_nc = octave::to_f77_int (b.cols ());
 
   if (n != a_nc || nb != b_nc)
     (*current_liboctave_error_handler) ("EIG requires square matrix");
@@ -593,11 +593,11 @@
     (*current_liboctave_error_handler)
       ("EIG: matrix contains Inf or NaN values");
 
-  F77_INT n = to_f77_int (a.rows ());
-  F77_INT nb = to_f77_int (b.rows ());
+  F77_INT n = octave::to_f77_int (a.rows ());
+  F77_INT nb = octave::to_f77_int (b.rows ());
 
-  F77_INT a_nc = to_f77_int (a.cols ());
-  F77_INT b_nc = to_f77_int (b.cols ());
+  F77_INT a_nc = octave::to_f77_int (a.cols ());
+  F77_INT b_nc = octave::to_f77_int (b.cols ());
 
   if (n != a_nc || nb != b_nc)
     (*current_liboctave_error_handler) ("EIG requires square matrix");
@@ -697,11 +697,11 @@
                           const FloatComplexMatrix& b,
                           bool calc_rev, bool calc_lev)
 {
-  F77_INT n = to_f77_int (a.rows ());
-  F77_INT nb = to_f77_int (b.rows ());
+  F77_INT n = octave::to_f77_int (a.rows ());
+  F77_INT nb = octave::to_f77_int (b.rows ());
 
-  F77_INT a_nc = to_f77_int (a.cols ());
-  F77_INT b_nc = to_f77_int (b.cols ());
+  F77_INT a_nc = octave::to_f77_int (a.cols ());
+  F77_INT b_nc = octave::to_f77_int (b.cols ());
 
   if (n != a_nc || nb != b_nc)
     (*current_liboctave_error_handler) ("EIG requires square matrix");
--- a/liboctave/numeric/gepbalance.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/numeric/gepbalance.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -45,7 +45,7 @@
     gepbalance<Matrix>::init (const Matrix& a, const Matrix& b,
                               const std::string& balance_job)
     {
-      F77_INT n = to_f77_int (a.cols ());
+      F77_INT n = octave::to_f77_int (a.cols ());
 
       if (a.rows () != n)
         (*current_liboctave_error_handler) ("GEPBALANCE requires square matrix");
@@ -109,7 +109,7 @@
     gepbalance<FloatMatrix>::init (const FloatMatrix& a, const FloatMatrix& b,
                                    const std::string& balance_job)
     {
-      F77_INT n = to_f77_int (a.cols ());
+      F77_INT n = octave::to_f77_int (a.cols ());
 
       if (a.rows () != n)
         (*current_liboctave_error_handler)
@@ -175,7 +175,7 @@
                                      const ComplexMatrix& b,
                                      const std::string& balance_job)
     {
-      F77_INT n = to_f77_int (a.cols ());
+      F77_INT n = octave::to_f77_int (a.cols ());
 
       if (a.rows () != n)
         (*current_liboctave_error_handler)
@@ -241,7 +241,7 @@
                                           const FloatComplexMatrix& b,
                                           const std::string& balance_job)
     {
-      F77_INT n = to_f77_int (a.cols ());
+      F77_INT n = octave::to_f77_int (a.cols ());
 
       if (a.rows () != n)
         {
--- a/liboctave/numeric/gsvd.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/numeric/gsvd.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -210,9 +210,9 @@
     {
       F77_INT info;
 
-      F77_INT m = to_f77_int (a.rows ());
-      F77_INT n = to_f77_int (a.cols ());
-      F77_INT p = to_f77_int (b.rows ());
+      F77_INT m = octave::to_f77_int (a.rows ());
+      F77_INT n = octave::to_f77_int (a.cols ());
+      F77_INT p = octave::to_f77_int (b.rows ());
 
       T atmp = a;
       P *tmp_dataA = atmp.fortran_vec ();
--- a/liboctave/numeric/hess.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/numeric/hess.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -40,8 +40,8 @@
     octave_idx_type
     hess<Matrix>::init (const Matrix& a)
     {
-      F77_INT a_nr = to_f77_int (a.rows ());
-      F77_INT a_nc = to_f77_int (a.cols ());
+      F77_INT a_nr = octave::to_f77_int (a.rows ());
+      F77_INT a_nc = octave::to_f77_int (a.cols ());
 
       if (a_nr != a_nc)
         (*current_liboctave_error_handler) ("hess: requires square matrix");
@@ -103,8 +103,8 @@
     octave_idx_type
     hess<FloatMatrix>::init (const FloatMatrix& a)
     {
-      F77_INT a_nr = to_f77_int (a.rows ());
-      F77_INT a_nc = to_f77_int (a.cols ());
+      F77_INT a_nr = octave::to_f77_int (a.rows ());
+      F77_INT a_nc = octave::to_f77_int (a.cols ());
 
       if (a_nr != a_nc)
         (*current_liboctave_error_handler) ("hess: requires square matrix");
@@ -166,8 +166,8 @@
     octave_idx_type
     hess<ComplexMatrix>::init (const ComplexMatrix& a)
     {
-      F77_INT a_nr = to_f77_int (a.rows ());
-      F77_INT a_nc = to_f77_int (a.cols ());
+      F77_INT a_nr = octave::to_f77_int (a.rows ());
+      F77_INT a_nc = octave::to_f77_int (a.cols ());
 
       if (a_nr != a_nc)
         (*current_liboctave_error_handler) ("hess: requires square matrix");
@@ -229,8 +229,8 @@
     octave_idx_type
     hess<FloatComplexMatrix>::init (const FloatComplexMatrix& a)
     {
-      F77_INT a_nr = to_f77_int (a.rows ());
-      F77_INT a_nc = to_f77_int (a.cols ());
+      F77_INT a_nr = octave::to_f77_int (a.rows ());
+      F77_INT a_nc = octave::to_f77_int (a.cols ());
 
       if (a_nr != a_nc)
         {
--- a/liboctave/numeric/lo-specfun.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/numeric/lo-specfun.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -3815,7 +3815,7 @@
     fortran_psifn<double> (double z, octave_idx_type n_arg,
                            double& ans, octave_idx_type& ierr)
     {
-      F77_INT n = to_f77_int (n_arg);
+      F77_INT n = octave::to_f77_int (n_arg);
       F77_INT flag = 0;
       F77_INT t_ierr;
       F77_XFCN (dpsifn, DPSIFN, (z, n, 1, 1, ans, flag, t_ierr));
@@ -3827,7 +3827,7 @@
     fortran_psifn<float> (float z, octave_idx_type n_arg,
                           float& ans, octave_idx_type& ierr)
     {
-      F77_INT n = to_f77_int (n_arg);
+      F77_INT n = octave::to_f77_int (n_arg);
       F77_INT flag = 0;
       F77_INT t_ierr;
       F77_XFCN (psifn, PSIFN, (z, n, 1, 1, ans, flag, t_ierr));
--- a/liboctave/numeric/lu.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/numeric/lu.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -252,8 +252,8 @@
     template <>
     lu<Matrix>::lu (const Matrix& a)
     {
-      F77_INT a_nr = to_f77_int (a.rows ());
-      F77_INT a_nc = to_f77_int (a.columns ());
+      F77_INT a_nr = octave::to_f77_int (a.rows ());
+      F77_INT a_nc = octave::to_f77_int (a.columns ());
       F77_INT mn = (a_nr < a_nc ? a_nr : a_nc);
 
       ipvt.resize (dim_vector (mn, 1));
@@ -282,12 +282,12 @@
       Matrix& l = l_fact;
       Matrix& r = a_fact;
 
-      F77_INT m = to_f77_int (l.rows ());
-      F77_INT n = to_f77_int (r.columns ());
-      F77_INT k = to_f77_int (l.columns ());
+      F77_INT m = octave::to_f77_int (l.rows ());
+      F77_INT n = octave::to_f77_int (r.columns ());
+      F77_INT k = octave::to_f77_int (l.columns ());
 
-      F77_INT u_nel = to_f77_int (u.numel ());
-      F77_INT v_nel = to_f77_int (v.numel ());
+      F77_INT u_nel = octave::to_f77_int (u.numel ());
+      F77_INT v_nel = octave::to_f77_int (v.numel ());
 
       if (u_nel != m || v_nel != n)
         (*current_liboctave_error_handler) ("luupdate: dimensions mismatch");
@@ -308,15 +308,15 @@
       Matrix& l = l_fact;
       Matrix& r = a_fact;
 
-      F77_INT m = to_f77_int (l.rows ());
-      F77_INT n = to_f77_int (r.columns ());
-      F77_INT k = to_f77_int (l.columns ());
+      F77_INT m = octave::to_f77_int (l.rows ());
+      F77_INT n = octave::to_f77_int (r.columns ());
+      F77_INT k = octave::to_f77_int (l.columns ());
 
-      F77_INT u_nr = to_f77_int (u.rows ());
-      F77_INT u_nc = to_f77_int (u.columns ());
+      F77_INT u_nr = octave::to_f77_int (u.rows ());
+      F77_INT u_nc = octave::to_f77_int (u.columns ());
 
-      F77_INT v_nr = to_f77_int (v.rows ());
-      F77_INT v_nc = to_f77_int (v.columns ());
+      F77_INT v_nr = octave::to_f77_int (v.rows ());
+      F77_INT v_nc = octave::to_f77_int (v.columns ());
 
       if (u_nr != m || v_nr != n || u_nc != v_nc)
         (*current_liboctave_error_handler) ("luupdate: dimensions mismatch");
@@ -341,12 +341,12 @@
       Matrix& l = l_fact;
       Matrix& r = a_fact;
 
-      F77_INT m = to_f77_int (l.rows ());
-      F77_INT n = to_f77_int (r.columns ());
-      F77_INT k = to_f77_int (l.columns ());
+      F77_INT m = octave::to_f77_int (l.rows ());
+      F77_INT n = octave::to_f77_int (r.columns ());
+      F77_INT k = octave::to_f77_int (l.columns ());
 
-      F77_INT u_nel = to_f77_int (u.numel ());
-      F77_INT v_nel = to_f77_int (v.numel ());
+      F77_INT u_nel = octave::to_f77_int (u.numel ());
+      F77_INT v_nel = octave::to_f77_int (v.numel ());
 
       if (u_nel != m || v_nel != n)
         (*current_liboctave_error_handler) ("luupdate: dimensions mismatch");
@@ -372,15 +372,15 @@
       Matrix& l = l_fact;
       Matrix& r = a_fact;
 
-      F77_INT m = to_f77_int (l.rows ());
-      F77_INT n = to_f77_int (r.columns ());
-      F77_INT k = to_f77_int (l.columns ());
+      F77_INT m = octave::to_f77_int (l.rows ());
+      F77_INT n = octave::to_f77_int (r.columns ());
+      F77_INT k = octave::to_f77_int (l.columns ());
 
-      F77_INT u_nr = to_f77_int (u.rows ());
-      F77_INT u_nc = to_f77_int (u.columns ());
+      F77_INT u_nr = octave::to_f77_int (u.rows ());
+      F77_INT u_nc = octave::to_f77_int (u.columns ());
 
-      F77_INT v_nr = to_f77_int (v.rows ());
-      F77_INT v_nc = to_f77_int (v.columns ());
+      F77_INT v_nr = octave::to_f77_int (v.rows ());
+      F77_INT v_nc = octave::to_f77_int (v.columns ());
 
       if (u_nr != m || v_nr != n || u_nc != v_nc)
         (*current_liboctave_error_handler) ("luupdate: dimensions mismatch");
@@ -404,8 +404,8 @@
     template <>
     lu<FloatMatrix>::lu (const FloatMatrix& a)
     {
-      F77_INT a_nr = to_f77_int (a.rows ());
-      F77_INT a_nc = to_f77_int (a.columns ());
+      F77_INT a_nr = octave::to_f77_int (a.rows ());
+      F77_INT a_nc = octave::to_f77_int (a.columns ());
       F77_INT mn = (a_nr < a_nc ? a_nr : a_nc);
 
       ipvt.resize (dim_vector (mn, 1));
@@ -434,12 +434,12 @@
       FloatMatrix& l = l_fact;
       FloatMatrix& r = a_fact;
 
-      F77_INT m = to_f77_int (l.rows ());
-      F77_INT n = to_f77_int (r.columns ());
-      F77_INT k = to_f77_int (l.columns ());
+      F77_INT m = octave::to_f77_int (l.rows ());
+      F77_INT n = octave::to_f77_int (r.columns ());
+      F77_INT k = octave::to_f77_int (l.columns ());
 
-      F77_INT u_nel = to_f77_int (u.numel ());
-      F77_INT v_nel = to_f77_int (v.numel ());
+      F77_INT u_nel = octave::to_f77_int (u.numel ());
+      F77_INT v_nel = octave::to_f77_int (v.numel ());
 
       if (u_nel != m || v_nel != n)
         (*current_liboctave_error_handler) ("luupdate: dimensions mismatch");
@@ -461,15 +461,15 @@
       FloatMatrix& l = l_fact;
       FloatMatrix& r = a_fact;
 
-      F77_INT m = to_f77_int (l.rows ());
-      F77_INT n = to_f77_int (r.columns ());
-      F77_INT k = to_f77_int (l.columns ());
+      F77_INT m = octave::to_f77_int (l.rows ());
+      F77_INT n = octave::to_f77_int (r.columns ());
+      F77_INT k = octave::to_f77_int (l.columns ());
 
-      F77_INT u_nr = to_f77_int (u.rows ());
-      F77_INT u_nc = to_f77_int (u.columns ());
+      F77_INT u_nr = octave::to_f77_int (u.rows ());
+      F77_INT u_nc = octave::to_f77_int (u.columns ());
 
-      F77_INT v_nr = to_f77_int (v.rows ());
-      F77_INT v_nc = to_f77_int (v.columns ());
+      F77_INT v_nr = octave::to_f77_int (v.rows ());
+      F77_INT v_nc = octave::to_f77_int (v.columns ());
 
       if (u_nr != m || v_nr != n || u_nc != v_nc)
         (*current_liboctave_error_handler) ("luupdate: dimensions mismatch");
@@ -495,12 +495,12 @@
       FloatMatrix& l = l_fact;
       FloatMatrix& r = a_fact;
 
-      F77_INT m = to_f77_int (l.rows ());
-      F77_INT n = to_f77_int (r.columns ());
-      F77_INT k = to_f77_int (l.columns ());
+      F77_INT m = octave::to_f77_int (l.rows ());
+      F77_INT n = octave::to_f77_int (r.columns ());
+      F77_INT k = octave::to_f77_int (l.columns ());
 
-      F77_INT u_nel = to_f77_int (u.numel ());
-      F77_INT v_nel = to_f77_int (v.numel ());
+      F77_INT u_nel = octave::to_f77_int (u.numel ());
+      F77_INT v_nel = octave::to_f77_int (v.numel ());
 
       if (u_nel != m || v_nel != n)
         (*current_liboctave_error_handler) ("luupdate: dimensions mismatch");
@@ -526,15 +526,15 @@
       FloatMatrix& l = l_fact;
       FloatMatrix& r = a_fact;
 
-      F77_INT m = to_f77_int (l.rows ());
-      F77_INT n = to_f77_int (r.columns ());
-      F77_INT k = to_f77_int (l.columns ());
+      F77_INT m = octave::to_f77_int (l.rows ());
+      F77_INT n = octave::to_f77_int (r.columns ());
+      F77_INT k = octave::to_f77_int (l.columns ());
 
-      F77_INT u_nr = to_f77_int (u.rows ());
-      F77_INT u_nc = to_f77_int (u.columns ());
+      F77_INT u_nr = octave::to_f77_int (u.rows ());
+      F77_INT u_nc = octave::to_f77_int (u.columns ());
 
-      F77_INT v_nr = to_f77_int (v.rows ());
-      F77_INT v_nc = to_f77_int (v.columns ());
+      F77_INT v_nr = octave::to_f77_int (v.rows ());
+      F77_INT v_nc = octave::to_f77_int (v.columns ());
 
       if (u_nr != m || v_nr != n || u_nc != v_nc)
         (*current_liboctave_error_handler) ("luupdate: dimensions mismatch");
@@ -558,8 +558,8 @@
     template <>
     lu<ComplexMatrix>::lu (const ComplexMatrix& a)
     {
-      F77_INT a_nr = to_f77_int (a.rows ());
-      F77_INT a_nc = to_f77_int (a.columns ());
+      F77_INT a_nr = octave::to_f77_int (a.rows ());
+      F77_INT a_nc = octave::to_f77_int (a.columns ());
       F77_INT mn = (a_nr < a_nc ? a_nr : a_nc);
 
       ipvt.resize (dim_vector (mn, 1));
@@ -590,12 +590,12 @@
       ComplexMatrix& l = l_fact;
       ComplexMatrix& r = a_fact;
 
-      F77_INT m = to_f77_int (l.rows ());
-      F77_INT n = to_f77_int (r.columns ());
-      F77_INT k = to_f77_int (l.columns ());
+      F77_INT m = octave::to_f77_int (l.rows ());
+      F77_INT n = octave::to_f77_int (r.columns ());
+      F77_INT k = octave::to_f77_int (l.columns ());
 
-      F77_INT u_nel = to_f77_int (u.numel ());
-      F77_INT v_nel = to_f77_int (v.numel ());
+      F77_INT u_nel = octave::to_f77_int (u.numel ());
+      F77_INT v_nel = octave::to_f77_int (v.numel ());
 
       if (u_nel != m || v_nel != n)
         (*current_liboctave_error_handler) ("luupdate: dimensions mismatch");
@@ -618,15 +618,15 @@
       ComplexMatrix& l = l_fact;
       ComplexMatrix& r = a_fact;
 
-      F77_INT m = to_f77_int (l.rows ());
-      F77_INT n = to_f77_int (r.columns ());
-      F77_INT k = to_f77_int (l.columns ());
+      F77_INT m = octave::to_f77_int (l.rows ());
+      F77_INT n = octave::to_f77_int (r.columns ());
+      F77_INT k = octave::to_f77_int (l.columns ());
 
-      F77_INT u_nr = to_f77_int (u.rows ());
-      F77_INT u_nc = to_f77_int (u.columns ());
+      F77_INT u_nr = octave::to_f77_int (u.rows ());
+      F77_INT u_nc = octave::to_f77_int (u.columns ());
 
-      F77_INT v_nr = to_f77_int (v.rows ());
-      F77_INT v_nc = to_f77_int (v.columns ());
+      F77_INT v_nr = octave::to_f77_int (v.rows ());
+      F77_INT v_nc = octave::to_f77_int (v.columns ());
 
       if (u_nr != m || v_nr != n || u_nc != v_nc)
         (*current_liboctave_error_handler) ("luupdate: dimensions mismatch");
@@ -653,12 +653,12 @@
       ComplexMatrix& l = l_fact;
       ComplexMatrix& r = a_fact;
 
-      F77_INT m = to_f77_int (l.rows ());
-      F77_INT n = to_f77_int (r.columns ());
-      F77_INT k = to_f77_int (l.columns ());
+      F77_INT m = octave::to_f77_int (l.rows ());
+      F77_INT n = octave::to_f77_int (r.columns ());
+      F77_INT k = octave::to_f77_int (l.columns ());
 
-      F77_INT u_nel = to_f77_int (u.numel ());
-      F77_INT v_nel = to_f77_int (v.numel ());
+      F77_INT u_nel = octave::to_f77_int (u.numel ());
+      F77_INT v_nel = octave::to_f77_int (v.numel ());
 
       if (u_nel != m || v_nel != n)
         (*current_liboctave_error_handler) ("luupdate: dimensions mismatch");
@@ -685,15 +685,15 @@
       ComplexMatrix& l = l_fact;
       ComplexMatrix& r = a_fact;
 
-      F77_INT m = to_f77_int (l.rows ());
-      F77_INT n = to_f77_int (r.columns ());
-      F77_INT k = to_f77_int (l.columns ());
+      F77_INT m = octave::to_f77_int (l.rows ());
+      F77_INT n = octave::to_f77_int (r.columns ());
+      F77_INT k = octave::to_f77_int (l.columns ());
 
-      F77_INT u_nr = to_f77_int (u.rows ());
-      F77_INT u_nc = to_f77_int (u.columns ());
+      F77_INT u_nr = octave::to_f77_int (u.rows ());
+      F77_INT u_nc = octave::to_f77_int (u.columns ());
 
-      F77_INT v_nr = to_f77_int (v.rows ());
-      F77_INT v_nc = to_f77_int (v.columns ());
+      F77_INT v_nr = octave::to_f77_int (v.rows ());
+      F77_INT v_nc = octave::to_f77_int (v.columns ());
 
       if (u_nr != m || v_nr != n || u_nc != v_nc)
         (*current_liboctave_error_handler) ("luupdate: dimensions mismatch");
@@ -718,8 +718,8 @@
     template <>
     lu<FloatComplexMatrix>::lu (const FloatComplexMatrix& a)
     {
-      F77_INT a_nr = to_f77_int (a.rows ());
-      F77_INT a_nc = to_f77_int (a.columns ());
+      F77_INT a_nr = octave::to_f77_int (a.rows ());
+      F77_INT a_nc = octave::to_f77_int (a.columns ());
       F77_INT mn = (a_nr < a_nc ? a_nr : a_nc);
 
       ipvt.resize (dim_vector (mn, 1));
@@ -750,12 +750,12 @@
       FloatComplexMatrix& l = l_fact;
       FloatComplexMatrix& r = a_fact;
 
-      F77_INT m = to_f77_int (l.rows ());
-      F77_INT n = to_f77_int (r.columns ());
-      F77_INT k = to_f77_int (l.columns ());
+      F77_INT m = octave::to_f77_int (l.rows ());
+      F77_INT n = octave::to_f77_int (r.columns ());
+      F77_INT k = octave::to_f77_int (l.columns ());
 
-      F77_INT u_nel = to_f77_int (u.numel ());
-      F77_INT v_nel = to_f77_int (v.numel ());
+      F77_INT u_nel = octave::to_f77_int (u.numel ());
+      F77_INT v_nel = octave::to_f77_int (v.numel ());
 
       if (u_nel != m || v_nel != n)
         (*current_liboctave_error_handler) ("luupdate: dimensions mismatch");
@@ -778,15 +778,15 @@
       FloatComplexMatrix& l = l_fact;
       FloatComplexMatrix& r = a_fact;
 
-      F77_INT m = to_f77_int (l.rows ());
-      F77_INT n = to_f77_int (r.columns ());
-      F77_INT k = to_f77_int (l.columns ());
+      F77_INT m = octave::to_f77_int (l.rows ());
+      F77_INT n = octave::to_f77_int (r.columns ());
+      F77_INT k = octave::to_f77_int (l.columns ());
 
-      F77_INT u_nr = to_f77_int (u.rows ());
-      F77_INT u_nc = to_f77_int (u.columns ());
+      F77_INT u_nr = octave::to_f77_int (u.rows ());
+      F77_INT u_nc = octave::to_f77_int (u.columns ());
 
-      F77_INT v_nr = to_f77_int (v.rows ());
-      F77_INT v_nc = to_f77_int (v.columns ());
+      F77_INT v_nr = octave::to_f77_int (v.rows ());
+      F77_INT v_nc = octave::to_f77_int (v.columns ());
 
       if (u_nr != m || v_nr != n || u_nc != v_nc)
         (*current_liboctave_error_handler) ("luupdate: dimensions mismatch");
@@ -812,12 +812,12 @@
       FloatComplexMatrix& l = l_fact;
       FloatComplexMatrix& r = a_fact;
 
-      F77_INT m = to_f77_int (l.rows ());
-      F77_INT n = to_f77_int (r.columns ());
-      F77_INT k = to_f77_int (l.columns ());
+      F77_INT m = octave::to_f77_int (l.rows ());
+      F77_INT n = octave::to_f77_int (r.columns ());
+      F77_INT k = octave::to_f77_int (l.columns ());
 
-      F77_INT u_nel = to_f77_int (u.numel ());
-      F77_INT v_nel = to_f77_int (v.numel ());
+      F77_INT u_nel = octave::to_f77_int (u.numel ());
+      F77_INT v_nel = octave::to_f77_int (v.numel ());
 
       if (u_nel != m || v_nel != n)
         (*current_liboctave_error_handler) ("luupdate: dimensions mismatch");
@@ -845,15 +845,15 @@
       FloatComplexMatrix& l = l_fact;
       FloatComplexMatrix& r = a_fact;
 
-      F77_INT m = to_f77_int (l.rows ());
-      F77_INT n = to_f77_int (r.columns ());
-      F77_INT k = to_f77_int (l.columns ());
+      F77_INT m = octave::to_f77_int (l.rows ());
+      F77_INT n = octave::to_f77_int (r.columns ());
+      F77_INT k = octave::to_f77_int (l.columns ());
 
-      F77_INT u_nr = to_f77_int (u.rows ());
-      F77_INT u_nc = to_f77_int (u.columns ());
+      F77_INT u_nr = octave::to_f77_int (u.rows ());
+      F77_INT u_nc = octave::to_f77_int (u.columns ());
 
-      F77_INT v_nr = to_f77_int (v.rows ());
-      F77_INT v_nc = to_f77_int (v.columns ());
+      F77_INT v_nr = octave::to_f77_int (v.rows ());
+      F77_INT v_nc = octave::to_f77_int (v.columns ());
 
       if (u_nr != m || v_nr != n || u_nc != v_nc)
         (*current_liboctave_error_handler) ("luupdate: dimensions mismatch");
--- a/liboctave/numeric/oct-convn.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/numeric/oct-convn.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -92,11 +92,11 @@
 {
   if (nd == 2)
     {
-      F77_INT ad0 = to_f77_int (ad(0));
-      F77_INT ad1 = to_f77_int (ad(1));
+      F77_INT ad0 = octave::to_f77_int (ad(0));
+      F77_INT ad1 = octave::to_f77_int (ad(1));
 
-      F77_INT bd0 = to_f77_int (bd(0));
-      F77_INT bd1 = to_f77_int (bd(1));
+      F77_INT bd0 = octave::to_f77_int (bd(0));
+      F77_INT bd1 = octave::to_f77_int (bd(1));
 
       convolve_2d<T, R> (a, ad0, ad1, b, bd0, bd1, c, inner);
     }
--- a/liboctave/numeric/qr.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/numeric/qr.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -378,8 +378,8 @@
     qr<Matrix>::form (octave_idx_type n_arg, Matrix& afact, double *tau,
                       type qr_type)
     {
-      F77_INT n = to_f77_int (n_arg);
-      F77_INT m = to_f77_int (afact.rows ());
+      F77_INT n = octave::to_f77_int (n_arg);
+      F77_INT m = octave::to_f77_int (afact.rows ());
       F77_INT min_mn = std::min (m, n);
       F77_INT info;
 
@@ -428,7 +428,7 @@
 
           if (m > 0)
             {
-              F77_INT k = to_f77_int (q.cols ());
+              F77_INT k = octave::to_f77_int (q.cols ());
               // workspace query.
               double rlwork;
               F77_XFCN (dorgqr, DORGQR, (m, k, min_mn, q.fortran_vec (), m,
@@ -448,8 +448,8 @@
     void
     qr<Matrix>::init (const Matrix& a, type qr_type)
     {
-      F77_INT m = to_f77_int (a.rows ());
-      F77_INT n = to_f77_int (a.cols ());
+      F77_INT m = octave::to_f77_int (a.rows ());
+      F77_INT n = octave::to_f77_int (a.cols ());
 
       F77_INT min_mn = m < n ? m : n;
       OCTAVE_LOCAL_BUFFER (double, tau, min_mn);
@@ -484,12 +484,12 @@
     void
     qr<Matrix>::update (const ColumnVector& u, const ColumnVector& v)
     {
-      F77_INT m = to_f77_int (q.rows ());
-      F77_INT n = to_f77_int (r.cols ());
-      F77_INT k = to_f77_int (q.cols ());
+      F77_INT m = octave::to_f77_int (q.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
+      F77_INT k = octave::to_f77_int (q.cols ());
 
-      F77_INT u_nel = to_f77_int (u.numel ());
-      F77_INT v_nel = to_f77_int (v.numel ());
+      F77_INT u_nel = octave::to_f77_int (u.numel ());
+      F77_INT v_nel = octave::to_f77_int (v.numel ());
 
       if (u_nel != m || v_nel != n)
         (*current_liboctave_error_handler) ("qrupdate: dimensions mismatch");
@@ -506,15 +506,15 @@
     void
     qr<Matrix>::update (const Matrix& u, const Matrix& v)
     {
-      F77_INT m = to_f77_int (q.rows ());
-      F77_INT n = to_f77_int (r.cols ());
-      F77_INT k = to_f77_int (q.cols ());
+      F77_INT m = octave::to_f77_int (q.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
+      F77_INT k = octave::to_f77_int (q.cols ());
 
-      F77_INT u_rows = to_f77_int (u.rows ());
-      F77_INT u_cols = to_f77_int (u.cols ());
+      F77_INT u_rows = octave::to_f77_int (u.rows ());
+      F77_INT u_cols = octave::to_f77_int (u.cols ());
 
-      F77_INT v_rows = to_f77_int (v.rows ());
-      F77_INT v_cols = to_f77_int (v.cols ());
+      F77_INT v_rows = octave::to_f77_int (v.rows ());
+      F77_INT v_cols = octave::to_f77_int (v.cols ());
 
       if (u_rows != m || v_rows != n || u_cols != v_cols)
         (*current_liboctave_error_handler) ("qrupdate: dimensions mismatch");
@@ -534,13 +534,13 @@
     void
     qr<Matrix>::insert_col (const ColumnVector& u, octave_idx_type j_arg)
     {
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT j = octave::to_f77_int (j_arg);
 
-      F77_INT m = to_f77_int (q.rows ());
-      F77_INT n = to_f77_int (r.cols ());
-      F77_INT k = to_f77_int (q.cols ());
+      F77_INT m = octave::to_f77_int (q.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
+      F77_INT k = octave::to_f77_int (q.cols ());
 
-      F77_INT u_nel = to_f77_int (u.numel ());
+      F77_INT u_nel = octave::to_f77_int (u.numel ());
 
       if (u_nel != m)
         (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch");
@@ -556,8 +556,8 @@
       else
         r.resize (k, n+1);
 
-      F77_INT ldq = to_f77_int (q.rows ());
-      F77_INT ldr = to_f77_int (r.rows ());
+      F77_INT ldq = octave::to_f77_int (q.rows ());
+      F77_INT ldr = octave::to_f77_int (r.rows ());
 
       ColumnVector utmp = u;
       OCTAVE_LOCAL_BUFFER (double, w, k);
@@ -570,13 +570,13 @@
     void
     qr<Matrix>::insert_col (const Matrix& u, const Array<octave_idx_type>& j)
     {
-      F77_INT m = to_f77_int (q.rows ());
-      F77_INT n = to_f77_int (r.cols ());
-      F77_INT k = to_f77_int (q.cols ());
+      F77_INT m = octave::to_f77_int (q.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
+      F77_INT k = octave::to_f77_int (q.cols ());
 
       Array<octave_idx_type> jsi;
       Array<octave_idx_type> js = j.sort (jsi, 0, ASCENDING);
-      F77_INT nj = to_f77_int (js.numel ());
+      F77_INT nj = octave::to_f77_int (js.numel ());
       bool dups = false;
       for (F77_INT i = 0; i < nj - 1; i++)
         dups = dups && js(i) == js(i+1);
@@ -584,14 +584,14 @@
       if (dups)
         (*current_liboctave_error_handler) ("qrinsert: duplicate index detected");
 
-      F77_INT u_nel = to_f77_int (u.numel ());
-      F77_INT u_cols = to_f77_int (u.cols ());
+      F77_INT u_nel = octave::to_f77_int (u.numel ());
+      F77_INT u_cols = octave::to_f77_int (u.cols ());
 
       if (u_nel != m || u_cols != nj)
         (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch");
 
-      F77_INT js_beg = to_f77_int (js(0));
-      F77_INT js_end = to_f77_int (js(nj-1));
+      F77_INT js_beg = octave::to_f77_int (js(0));
+      F77_INT js_end = octave::to_f77_int (js(nj-1));
 
       if (nj > 0 && (js_beg < 0 || js_end > n))
         (*current_liboctave_error_handler) ("qrinsert: index out of range");
@@ -607,15 +607,15 @@
           else
             r.resize (k, n + nj);
 
-          F77_INT ldq = to_f77_int (q.rows ());
-          F77_INT ldr = to_f77_int (r.rows ());
+          F77_INT ldq = octave::to_f77_int (q.rows ());
+          F77_INT ldr = octave::to_f77_int (r.rows ());
 
           OCTAVE_LOCAL_BUFFER (double, w, kmax);
           for (volatile F77_INT i = 0; i < nj; i++)
             {
               F77_INT ii = i;
               ColumnVector utmp = u.column (jsi(i));
-              F77_INT js_elt = to_f77_int (js(ii));
+              F77_INT js_elt = octave::to_f77_int (js(ii));
               F77_XFCN (dqrinc, DQRINC, (m, n + ii, std::min (kmax, k + ii),
                                          q.fortran_vec (), ldq,
                                          r.fortran_vec (), ldr, js_elt + 1,
@@ -628,17 +628,17 @@
     void
     qr<Matrix>::delete_col (octave_idx_type j_arg)
     {
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT j = octave::to_f77_int (j_arg);
 
-      F77_INT m = to_f77_int (q.rows ());
-      F77_INT k = to_f77_int (r.rows ());
-      F77_INT n = to_f77_int (r.cols ());
+      F77_INT m = octave::to_f77_int (q.rows ());
+      F77_INT k = octave::to_f77_int (r.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
 
       if (j < 0 || j > n-1)
         (*current_liboctave_error_handler) ("qrdelete: index out of range");
 
-      F77_INT ldq = to_f77_int (q.rows ());
-      F77_INT ldr = to_f77_int (r.rows ());
+      F77_INT ldq = octave::to_f77_int (q.rows ());
+      F77_INT ldr = octave::to_f77_int (r.rows ());
 
       OCTAVE_LOCAL_BUFFER (double, w, k);
       F77_XFCN (dqrdec, DQRDEC, (m, n, k, q.fortran_vec (), ldq,
@@ -657,13 +657,13 @@
     void
     qr<Matrix>::delete_col (const Array<octave_idx_type>& j)
     {
-      F77_INT m = to_f77_int (q.rows ());
-      F77_INT n = to_f77_int (r.cols ());
-      F77_INT k = to_f77_int (q.cols ());
+      F77_INT m = octave::to_f77_int (q.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
+      F77_INT k = octave::to_f77_int (q.cols ());
 
       Array<octave_idx_type> jsi;
       Array<octave_idx_type> js = j.sort (jsi, 0, DESCENDING);
-      F77_INT nj = to_f77_int (js.numel ());
+      F77_INT nj = octave::to_f77_int (js.numel ());
       bool dups = false;
       for (F77_INT i = 0; i < nj - 1; i++)
         dups = dups && js(i) == js(i+1);
@@ -671,22 +671,22 @@
       if (dups)
         (*current_liboctave_error_handler) ("qrinsert: duplicate index detected");
 
-      F77_INT js_beg = to_f77_int (js(0));
-      F77_INT js_end = to_f77_int (js(nj-1));
+      F77_INT js_beg = octave::to_f77_int (js(0));
+      F77_INT js_end = octave::to_f77_int (js(nj-1));
 
       if (nj > 0 && (js_beg > n-1 || js_end < 0))
         (*current_liboctave_error_handler) ("qrinsert: index out of range");
 
       if (nj > 0)
         {
-          F77_INT ldq = to_f77_int (q.rows ());
-          F77_INT ldr = to_f77_int (r.rows ());
+          F77_INT ldq = octave::to_f77_int (q.rows ());
+          F77_INT ldr = octave::to_f77_int (r.rows ());
 
           OCTAVE_LOCAL_BUFFER (double, w, k);
           for (volatile F77_INT i = 0; i < nj; i++)
             {
               F77_INT ii = i;
-              F77_INT js_elt = to_f77_int (js(ii));
+              F77_INT js_elt = octave::to_f77_int (js(ii));
               F77_XFCN (dqrdec, DQRDEC, (m, n - ii, k == m ? k : k - ii,
                                          q.fortran_vec (), ldq,
                                          r.fortran_vec (), ldr,
@@ -707,13 +707,13 @@
     void
     qr<Matrix>::insert_row (const RowVector& u, octave_idx_type j_arg)
     {
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT j = octave::to_f77_int (j_arg);
 
-      F77_INT m = to_f77_int (r.rows ());
-      F77_INT n = to_f77_int (r.cols ());
+      F77_INT m = octave::to_f77_int (r.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
       F77_INT k = std::min (m, n);
 
-      F77_INT u_nel = to_f77_int (u.numel ());
+      F77_INT u_nel = octave::to_f77_int (u.numel ());
 
       if (! q.is_square () || u_nel != n)
         (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch");
@@ -724,8 +724,8 @@
       q.resize (m + 1, m + 1);
       r.resize (m + 1, n);
 
-      F77_INT ldq = to_f77_int (q.rows ());
-      F77_INT ldr = to_f77_int (r.rows ());
+      F77_INT ldq = octave::to_f77_int (q.rows ());
+      F77_INT ldr = octave::to_f77_int (r.rows ());
 
       RowVector utmp = u;
       OCTAVE_LOCAL_BUFFER (double, w, k);
@@ -739,10 +739,10 @@
     void
     qr<Matrix>::delete_row (octave_idx_type j_arg)
     {
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT j = octave::to_f77_int (j_arg);
 
-      F77_INT m = to_f77_int (r.rows ());
-      F77_INT n = to_f77_int (r.cols ());
+      F77_INT m = octave::to_f77_int (r.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
 
       if (! q.is_square ())
         (*current_liboctave_error_handler) ("qrdelete: dimensions mismatch");
@@ -750,8 +750,8 @@
       if (j < 0 || j > m-1)
         (*current_liboctave_error_handler) ("qrdelete: index out of range");
 
-      F77_INT ldq = to_f77_int (q.rows ());
-      F77_INT ldr = to_f77_int (r.rows ());
+      F77_INT ldq = octave::to_f77_int (q.rows ());
+      F77_INT ldr = octave::to_f77_int (r.rows ());
 
       OCTAVE_LOCAL_BUFFER (double, w, 2*m);
       F77_XFCN (dqrder, DQRDER, (m, n, q.fortran_vec (), ldq,
@@ -765,18 +765,18 @@
     void
     qr<Matrix>::shift_cols (octave_idx_type i_arg, octave_idx_type j_arg)
     {
-      F77_INT i = to_f77_int (i_arg);
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT i = octave::to_f77_int (i_arg);
+      F77_INT j = octave::to_f77_int (j_arg);
 
-      F77_INT m = to_f77_int (q.rows ());
-      F77_INT k = to_f77_int (r.rows ());
-      F77_INT n = to_f77_int (r.cols ());
+      F77_INT m = octave::to_f77_int (q.rows ());
+      F77_INT k = octave::to_f77_int (r.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
 
       if (i < 0 || i > n-1 || j < 0 || j > n-1)
         (*current_liboctave_error_handler) ("qrshift: index out of range");
 
-      F77_INT ldq = to_f77_int (q.rows ());
-      F77_INT ldr = to_f77_int (r.rows ());
+      F77_INT ldq = octave::to_f77_int (q.rows ());
+      F77_INT ldr = octave::to_f77_int (r.rows ());
 
       OCTAVE_LOCAL_BUFFER (double, w, 2*k);
       F77_XFCN (dqrshc, DQRSHC, (m, n, k,
@@ -792,8 +792,8 @@
     qr<FloatMatrix>::form (octave_idx_type n_arg, FloatMatrix& afact,
                            float *tau, type qr_type)
     {
-      F77_INT n = to_f77_int (n_arg);
-      F77_INT m = to_f77_int (afact.rows ());
+      F77_INT n = octave::to_f77_int (n_arg);
+      F77_INT m = octave::to_f77_int (afact.rows ());
       F77_INT min_mn = std::min (m, n);
       F77_INT info;
 
@@ -842,7 +842,7 @@
 
           if (m > 0)
             {
-              F77_INT k = to_f77_int (q.cols ());
+              F77_INT k = octave::to_f77_int (q.cols ());
               // workspace query.
               float rlwork;
               F77_XFCN (sorgqr, SORGQR, (m, k, min_mn, q.fortran_vec (), m,
@@ -862,8 +862,8 @@
     void
     qr<FloatMatrix>::init (const FloatMatrix& a, type qr_type)
     {
-      F77_INT m = to_f77_int (a.rows ());
-      F77_INT n = to_f77_int (a.cols ());
+      F77_INT m = octave::to_f77_int (a.rows ());
+      F77_INT n = octave::to_f77_int (a.cols ());
 
       F77_INT min_mn = m < n ? m : n;
       OCTAVE_LOCAL_BUFFER (float, tau, min_mn);
@@ -898,12 +898,12 @@
     void
     qr<FloatMatrix>::update (const FloatColumnVector& u, const FloatColumnVector& v)
     {
-      F77_INT m = to_f77_int (q.rows ());
-      F77_INT n = to_f77_int (r.cols ());
-      F77_INT k = to_f77_int (q.cols ());
+      F77_INT m = octave::to_f77_int (q.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
+      F77_INT k = octave::to_f77_int (q.cols ());
 
-      F77_INT u_nel = to_f77_int (u.numel ());
-      F77_INT v_nel = to_f77_int (v.numel ());
+      F77_INT u_nel = octave::to_f77_int (u.numel ());
+      F77_INT v_nel = octave::to_f77_int (v.numel ());
 
       if (u_nel != m || v_nel != n)
         (*current_liboctave_error_handler) ("qrupdate: dimensions mismatch");
@@ -920,15 +920,15 @@
     void
     qr<FloatMatrix>::update (const FloatMatrix& u, const FloatMatrix& v)
     {
-      F77_INT m = to_f77_int (q.rows ());
-      F77_INT n = to_f77_int (r.cols ());
-      F77_INT k = to_f77_int (q.cols ());
+      F77_INT m = octave::to_f77_int (q.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
+      F77_INT k = octave::to_f77_int (q.cols ());
 
-      F77_INT u_rows = to_f77_int (u.rows ());
-      F77_INT u_cols = to_f77_int (u.cols ());
+      F77_INT u_rows = octave::to_f77_int (u.rows ());
+      F77_INT u_cols = octave::to_f77_int (u.cols ());
 
-      F77_INT v_rows = to_f77_int (v.rows ());
-      F77_INT v_cols = to_f77_int (v.cols ());
+      F77_INT v_rows = octave::to_f77_int (v.rows ());
+      F77_INT v_cols = octave::to_f77_int (v.cols ());
 
       if (u_rows != m || v_rows != n || u_cols != v_cols)
         (*current_liboctave_error_handler) ("qrupdate: dimensions mismatch");
@@ -949,13 +949,13 @@
     qr<FloatMatrix>::insert_col (const FloatColumnVector& u,
                                  octave_idx_type j_arg)
     {
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT j = octave::to_f77_int (j_arg);
 
-      F77_INT m = to_f77_int (q.rows ());
-      F77_INT n = to_f77_int (r.cols ());
-      F77_INT k = to_f77_int (q.cols ());
+      F77_INT m = octave::to_f77_int (q.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
+      F77_INT k = octave::to_f77_int (q.cols ());
 
-      F77_INT u_nel = to_f77_int (u.numel ());
+      F77_INT u_nel = octave::to_f77_int (u.numel ());
 
       if (u_nel != m)
         (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch");
@@ -971,8 +971,8 @@
       else
         r.resize (k, n+1);
 
-      F77_INT ldq = to_f77_int (q.rows ());
-      F77_INT ldr = to_f77_int (r.rows ());
+      F77_INT ldq = octave::to_f77_int (q.rows ());
+      F77_INT ldr = octave::to_f77_int (r.rows ());
 
       FloatColumnVector utmp = u;
       OCTAVE_LOCAL_BUFFER (float, w, k);
@@ -986,13 +986,13 @@
     qr<FloatMatrix>::insert_col (const FloatMatrix& u,
                                  const Array<octave_idx_type>& j)
     {
-      F77_INT m = to_f77_int (q.rows ());
-      F77_INT n = to_f77_int (r.cols ());
-      F77_INT k = to_f77_int (q.cols ());
+      F77_INT m = octave::to_f77_int (q.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
+      F77_INT k = octave::to_f77_int (q.cols ());
 
       Array<octave_idx_type> jsi;
       Array<octave_idx_type> js = j.sort (jsi, 0, ASCENDING);
-      F77_INT nj = to_f77_int (js.numel ());
+      F77_INT nj = octave::to_f77_int (js.numel ());
       bool dups = false;
       for (F77_INT i = 0; i < nj - 1; i++)
         dups = dups && js(i) == js(i+1);
@@ -1000,14 +1000,14 @@
       if (dups)
         (*current_liboctave_error_handler) ("qrinsert: duplicate index detected");
 
-      F77_INT u_nel = to_f77_int (u.numel ());
-      F77_INT u_cols = to_f77_int (u.cols ());
+      F77_INT u_nel = octave::to_f77_int (u.numel ());
+      F77_INT u_cols = octave::to_f77_int (u.cols ());
 
       if (u_nel != m || u_cols != nj)
         (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch");
 
-      F77_INT js_beg = to_f77_int (js(0));
-      F77_INT js_end = to_f77_int (js(nj-1));
+      F77_INT js_beg = octave::to_f77_int (js(0));
+      F77_INT js_end = octave::to_f77_int (js(nj-1));
 
       if (nj > 0 && (js_beg < 0 || js_end > n))
         (*current_liboctave_error_handler) ("qrinsert: index out of range");
@@ -1023,15 +1023,15 @@
           else
             r.resize (k, n + nj);
 
-          F77_INT ldq = to_f77_int (q.rows ());
-          F77_INT ldr = to_f77_int (r.rows ());
+          F77_INT ldq = octave::to_f77_int (q.rows ());
+          F77_INT ldr = octave::to_f77_int (r.rows ());
 
           OCTAVE_LOCAL_BUFFER (float, w, kmax);
           for (volatile F77_INT i = 0; i < nj; i++)
             {
               F77_INT ii = i;
               FloatColumnVector utmp = u.column (jsi(i));
-              F77_INT js_elt = to_f77_int (js(ii));
+              F77_INT js_elt = octave::to_f77_int (js(ii));
               F77_XFCN (sqrinc, SQRINC, (m, n + ii, std::min (kmax, k + ii),
                                          q.fortran_vec (), ldq,
                                          r.fortran_vec (), ldr, js_elt + 1,
@@ -1044,17 +1044,17 @@
     void
     qr<FloatMatrix>::delete_col (octave_idx_type j_arg)
     {
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT j = octave::to_f77_int (j_arg);
 
-      F77_INT m = to_f77_int (q.rows ());
-      F77_INT k = to_f77_int (r.rows ());
-      F77_INT n = to_f77_int (r.cols ());
+      F77_INT m = octave::to_f77_int (q.rows ());
+      F77_INT k = octave::to_f77_int (r.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
 
       if (j < 0 || j > n-1)
         (*current_liboctave_error_handler) ("qrdelete: index out of range");
 
-      F77_INT ldq = to_f77_int (q.rows ());
-      F77_INT ldr = to_f77_int (r.rows ());
+      F77_INT ldq = octave::to_f77_int (q.rows ());
+      F77_INT ldr = octave::to_f77_int (r.rows ());
 
       OCTAVE_LOCAL_BUFFER (float, w, k);
       F77_XFCN (sqrdec, SQRDEC, (m, n, k, q.fortran_vec (), ldq,
@@ -1073,13 +1073,13 @@
     void
     qr<FloatMatrix>::delete_col (const Array<octave_idx_type>& j)
     {
-      F77_INT m = to_f77_int (q.rows ());
-      F77_INT n = to_f77_int (r.cols ());
-      F77_INT k = to_f77_int (q.cols ());
+      F77_INT m = octave::to_f77_int (q.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
+      F77_INT k = octave::to_f77_int (q.cols ());
 
       Array<octave_idx_type> jsi;
       Array<octave_idx_type> js = j.sort (jsi, 0, DESCENDING);
-      F77_INT nj = to_f77_int (js.numel ());
+      F77_INT nj = octave::to_f77_int (js.numel ());
       bool dups = false;
       for (F77_INT i = 0; i < nj - 1; i++)
         dups = dups && js(i) == js(i+1);
@@ -1087,22 +1087,22 @@
       if (dups)
         (*current_liboctave_error_handler) ("qrinsert: duplicate index detected");
 
-      F77_INT js_beg = to_f77_int (js(0));
-      F77_INT js_end = to_f77_int (js(nj-1));
+      F77_INT js_beg = octave::to_f77_int (js(0));
+      F77_INT js_end = octave::to_f77_int (js(nj-1));
 
       if (nj > 0 && (js_beg > n-1 || js_end < 0))
         (*current_liboctave_error_handler) ("qrinsert: index out of range");
 
       if (nj > 0)
         {
-          F77_INT ldq = to_f77_int (q.rows ());
-          F77_INT ldr = to_f77_int (r.rows ());
+          F77_INT ldq = octave::to_f77_int (q.rows ());
+          F77_INT ldr = octave::to_f77_int (r.rows ());
 
           OCTAVE_LOCAL_BUFFER (float, w, k);
           for (volatile F77_INT i = 0; i < nj; i++)
             {
               F77_INT ii = i;
-              F77_INT js_elt = to_f77_int (js(ii));
+              F77_INT js_elt = octave::to_f77_int (js(ii));
               F77_XFCN (sqrdec, SQRDEC, (m, n - ii, k == m ? k : k - ii,
                                          q.fortran_vec (), ldq,
                                          r.fortran_vec (), ldr,
@@ -1124,13 +1124,13 @@
     qr<FloatMatrix>::insert_row (const FloatRowVector& u,
                                  octave_idx_type j_arg)
     {
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT j = octave::to_f77_int (j_arg);
 
-      F77_INT m = to_f77_int (r.rows ());
-      F77_INT n = to_f77_int (r.cols ());
+      F77_INT m = octave::to_f77_int (r.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
       F77_INT k = std::min (m, n);
 
-      F77_INT u_nel = to_f77_int (u.numel ());
+      F77_INT u_nel = octave::to_f77_int (u.numel ());
 
       if (! q.is_square () || u_nel != n)
         (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch");
@@ -1141,8 +1141,8 @@
       q.resize (m + 1, m + 1);
       r.resize (m + 1, n);
 
-      F77_INT ldq = to_f77_int (q.rows ());
-      F77_INT ldr = to_f77_int (r.rows ());
+      F77_INT ldq = octave::to_f77_int (q.rows ());
+      F77_INT ldr = octave::to_f77_int (r.rows ());
 
       FloatRowVector utmp = u;
       OCTAVE_LOCAL_BUFFER (float, w, k);
@@ -1156,10 +1156,10 @@
     void
     qr<FloatMatrix>::delete_row (octave_idx_type j_arg)
     {
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT j = octave::to_f77_int (j_arg);
 
-      F77_INT m = to_f77_int (r.rows ());
-      F77_INT n = to_f77_int (r.cols ());
+      F77_INT m = octave::to_f77_int (r.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
 
       if (! q.is_square ())
         (*current_liboctave_error_handler) ("qrdelete: dimensions mismatch");
@@ -1167,8 +1167,8 @@
       if (j < 0 || j > m-1)
         (*current_liboctave_error_handler) ("qrdelete: index out of range");
 
-      F77_INT ldq = to_f77_int (q.rows ());
-      F77_INT ldr = to_f77_int (r.rows ());
+      F77_INT ldq = octave::to_f77_int (q.rows ());
+      F77_INT ldr = octave::to_f77_int (r.rows ());
 
       OCTAVE_LOCAL_BUFFER (float, w, 2*m);
       F77_XFCN (sqrder, SQRDER, (m, n, q.fortran_vec (), ldq,
@@ -1183,18 +1183,18 @@
     void
     qr<FloatMatrix>::shift_cols (octave_idx_type i_arg, octave_idx_type j_arg)
     {
-      F77_INT i = to_f77_int (i_arg);
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT i = octave::to_f77_int (i_arg);
+      F77_INT j = octave::to_f77_int (j_arg);
 
-      F77_INT m = to_f77_int (q.rows ());
-      F77_INT k = to_f77_int (r.rows ());
-      F77_INT n = to_f77_int (r.cols ());
+      F77_INT m = octave::to_f77_int (q.rows ());
+      F77_INT k = octave::to_f77_int (r.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
 
       if (i < 0 || i > n-1 || j < 0 || j > n-1)
         (*current_liboctave_error_handler) ("qrshift: index out of range");
 
-      F77_INT ldq = to_f77_int (q.rows ());
-      F77_INT ldr = to_f77_int (r.rows ());
+      F77_INT ldq = octave::to_f77_int (q.rows ());
+      F77_INT ldr = octave::to_f77_int (r.rows ());
 
       OCTAVE_LOCAL_BUFFER (float, w, 2*k);
       F77_XFCN (sqrshc, SQRSHC, (m, n, k,
@@ -1210,8 +1210,8 @@
     qr<ComplexMatrix>::form (octave_idx_type n_arg, ComplexMatrix& afact,
                              Complex *tau, type qr_type)
     {
-      F77_INT n = to_f77_int (n_arg);
-      F77_INT m = to_f77_int (afact.rows ());
+      F77_INT n = octave::to_f77_int (n_arg);
+      F77_INT m = octave::to_f77_int (afact.rows ());
       F77_INT min_mn = std::min (m, n);
       F77_INT info;
 
@@ -1260,7 +1260,7 @@
 
           if (m > 0)
             {
-              F77_INT k = to_f77_int (q.cols ());
+              F77_INT k = octave::to_f77_int (q.cols ());
               // workspace query.
               Complex clwork;
               F77_XFCN (zungqr, ZUNGQR, (m, k, min_mn,
@@ -1286,8 +1286,8 @@
     void
     qr<ComplexMatrix>::init (const ComplexMatrix& a, type qr_type)
     {
-      F77_INT m = to_f77_int (a.rows ());
-      F77_INT n = to_f77_int (a.cols ());
+      F77_INT m = octave::to_f77_int (a.rows ());
+      F77_INT n = octave::to_f77_int (a.cols ());
 
       F77_INT min_mn = m < n ? m : n;
       OCTAVE_LOCAL_BUFFER (Complex, tau, min_mn);
@@ -1327,12 +1327,12 @@
     qr<ComplexMatrix>::update (const ComplexColumnVector& u,
                                const ComplexColumnVector& v)
     {
-      F77_INT m = to_f77_int (q.rows ());
-      F77_INT n = to_f77_int (r.cols ());
-      F77_INT k = to_f77_int (q.cols ());
+      F77_INT m = octave::to_f77_int (q.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
+      F77_INT k = octave::to_f77_int (q.cols ());
 
-      F77_INT u_nel = to_f77_int (u.numel ());
-      F77_INT v_nel = to_f77_int (v.numel ());
+      F77_INT u_nel = octave::to_f77_int (u.numel ());
+      F77_INT v_nel = octave::to_f77_int (v.numel ());
 
       if (u_nel != m || v_nel != n)
         (*current_liboctave_error_handler) ("qrupdate: dimensions mismatch");
@@ -1352,15 +1352,15 @@
     void
     qr<ComplexMatrix>::update (const ComplexMatrix& u, const ComplexMatrix& v)
     {
-      F77_INT m = to_f77_int (q.rows ());
-      F77_INT n = to_f77_int (r.cols ());
-      F77_INT k = to_f77_int (q.cols ());
+      F77_INT m = octave::to_f77_int (q.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
+      F77_INT k = octave::to_f77_int (q.cols ());
 
-      F77_INT u_rows = to_f77_int (u.rows ());
-      F77_INT u_cols = to_f77_int (u.cols ());
+      F77_INT u_rows = octave::to_f77_int (u.rows ());
+      F77_INT u_cols = octave::to_f77_int (u.cols ());
 
-      F77_INT v_rows = to_f77_int (v.rows ());
-      F77_INT v_cols = to_f77_int (v.cols ());
+      F77_INT v_rows = octave::to_f77_int (v.rows ());
+      F77_INT v_cols = octave::to_f77_int (v.cols ());
 
       if (u_rows != m || v_rows != n || u_cols != v_cols)
         (*current_liboctave_error_handler) ("qrupdate: dimensions mismatch");
@@ -1385,13 +1385,13 @@
     qr<ComplexMatrix>::insert_col (const ComplexColumnVector& u,
                                    octave_idx_type j_arg)
     {
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT j = octave::to_f77_int (j_arg);
 
-      F77_INT m = to_f77_int (q.rows ());
-      F77_INT n = to_f77_int (r.cols ());
-      F77_INT k = to_f77_int (q.cols ());
+      F77_INT m = octave::to_f77_int (q.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
+      F77_INT k = octave::to_f77_int (q.cols ());
 
-      F77_INT u_nel = to_f77_int (u.numel ());
+      F77_INT u_nel = octave::to_f77_int (u.numel ());
 
       if (u_nel != m)
         (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch");
@@ -1407,8 +1407,8 @@
       else
         r.resize (k, n+1);
 
-      F77_INT ldq = to_f77_int (q.rows ());
-      F77_INT ldr = to_f77_int (r.rows ());
+      F77_INT ldq = octave::to_f77_int (q.rows ());
+      F77_INT ldr = octave::to_f77_int (r.rows ());
 
       ComplexColumnVector utmp = u;
       OCTAVE_LOCAL_BUFFER (double, rw, k);
@@ -1423,13 +1423,13 @@
     qr<ComplexMatrix>::insert_col (const ComplexMatrix& u,
                                    const Array<octave_idx_type>& j)
     {
-      F77_INT m = to_f77_int (q.rows ());
-      F77_INT n = to_f77_int (r.cols ());
-      F77_INT k = to_f77_int (q.cols ());
+      F77_INT m = octave::to_f77_int (q.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
+      F77_INT k = octave::to_f77_int (q.cols ());
 
       Array<octave_idx_type> jsi;
       Array<octave_idx_type> js = j.sort (jsi, 0, ASCENDING);
-      F77_INT nj = to_f77_int (js.numel ());
+      F77_INT nj = octave::to_f77_int (js.numel ());
       bool dups = false;
       for (F77_INT i = 0; i < nj - 1; i++)
         dups = dups && js(i) == js(i+1);
@@ -1437,14 +1437,14 @@
       if (dups)
         (*current_liboctave_error_handler) ("qrinsert: duplicate index detected");
 
-      F77_INT u_nel = to_f77_int (u.numel ());
-      F77_INT u_cols = to_f77_int (u.cols ());
+      F77_INT u_nel = octave::to_f77_int (u.numel ());
+      F77_INT u_cols = octave::to_f77_int (u.cols ());
 
       if (u_nel != m || u_cols != nj)
         (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch");
 
-      F77_INT js_beg = to_f77_int (js(0));
-      F77_INT js_end = to_f77_int (js(nj-1));
+      F77_INT js_beg = octave::to_f77_int (js(0));
+      F77_INT js_end = octave::to_f77_int (js(nj-1));
 
       if (nj > 0 && (js_beg < 0 || js_end > n))
         (*current_liboctave_error_handler) ("qrinsert: index out of range");
@@ -1460,15 +1460,15 @@
           else
             r.resize (k, n + nj);
 
-          F77_INT ldq = to_f77_int (q.rows ());
-          F77_INT ldr = to_f77_int (r.rows ());
+          F77_INT ldq = octave::to_f77_int (q.rows ());
+          F77_INT ldr = octave::to_f77_int (r.rows ());
 
           OCTAVE_LOCAL_BUFFER (double, rw, kmax);
           for (volatile F77_INT i = 0; i < nj; i++)
             {
               F77_INT ii = i;
               ComplexColumnVector utmp = u.column (jsi(i));
-              F77_INT js_elt = to_f77_int (js(ii));
+              F77_INT js_elt = octave::to_f77_int (js(ii));
               F77_XFCN (zqrinc, ZQRINC, (m, n + ii, std::min (kmax, k + ii),
                                          F77_DBLE_CMPLX_ARG (q.fortran_vec ()),
                                          ldq,
@@ -1484,17 +1484,17 @@
     void
     qr<ComplexMatrix>::delete_col (octave_idx_type j_arg)
     {
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT j = octave::to_f77_int (j_arg);
 
-      F77_INT m = to_f77_int (q.rows ());
-      F77_INT k = to_f77_int (r.rows ());
-      F77_INT n = to_f77_int (r.cols ());
+      F77_INT m = octave::to_f77_int (q.rows ());
+      F77_INT k = octave::to_f77_int (r.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
 
       if (j < 0 || j > n-1)
         (*current_liboctave_error_handler) ("qrdelete: index out of range");
 
-      F77_INT ldq = to_f77_int (q.rows ());
-      F77_INT ldr = to_f77_int (r.rows ());
+      F77_INT ldq = octave::to_f77_int (q.rows ());
+      F77_INT ldr = octave::to_f77_int (r.rows ());
 
       OCTAVE_LOCAL_BUFFER (double, rw, k);
       F77_XFCN (zqrdec, ZQRDEC, (m, n, k, F77_DBLE_CMPLX_ARG (q.fortran_vec ()),
@@ -1514,13 +1514,13 @@
     void
     qr<ComplexMatrix>::delete_col (const Array<octave_idx_type>& j)
     {
-      F77_INT m = to_f77_int (q.rows ());
-      F77_INT n = to_f77_int (r.cols ());
-      F77_INT k = to_f77_int (q.cols ());
+      F77_INT m = octave::to_f77_int (q.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
+      F77_INT k = octave::to_f77_int (q.cols ());
 
       Array<octave_idx_type> jsi;
       Array<octave_idx_type> js = j.sort (jsi, 0, DESCENDING);
-      F77_INT nj = to_f77_int (js.numel ());
+      F77_INT nj = octave::to_f77_int (js.numel ());
       bool dups = false;
       for (F77_INT i = 0; i < nj - 1; i++)
         dups = dups && js(i) == js(i+1);
@@ -1528,22 +1528,22 @@
       if (dups)
         (*current_liboctave_error_handler) ("qrinsert: duplicate index detected");
 
-      F77_INT js_beg = to_f77_int (js(0));
-      F77_INT js_end = to_f77_int (js(nj-1));
+      F77_INT js_beg = octave::to_f77_int (js(0));
+      F77_INT js_end = octave::to_f77_int (js(nj-1));
 
       if (nj > 0 && (js_beg > n-1 || js_end < 0))
         (*current_liboctave_error_handler) ("qrinsert: index out of range");
 
       if (nj > 0)
         {
-          F77_INT ldq = to_f77_int (q.rows ());
-          F77_INT ldr = to_f77_int (r.rows ());
+          F77_INT ldq = octave::to_f77_int (q.rows ());
+          F77_INT ldr = octave::to_f77_int (r.rows ());
 
           OCTAVE_LOCAL_BUFFER (double, rw, k);
           for (volatile F77_INT i = 0; i < nj; i++)
             {
               F77_INT ii = i;
-              F77_INT js_elt = to_f77_int (js(ii));
+              F77_INT js_elt = octave::to_f77_int (js(ii));
               F77_XFCN (zqrdec, ZQRDEC, (m, n - ii, k == m ? k : k - ii,
                                          F77_DBLE_CMPLX_ARG (q.fortran_vec ()),
                                          ldq,
@@ -1566,13 +1566,13 @@
     qr<ComplexMatrix>::insert_row (const ComplexRowVector& u,
                                    octave_idx_type j_arg)
     {
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT j = octave::to_f77_int (j_arg);
 
-      F77_INT m = to_f77_int (r.rows ());
-      F77_INT n = to_f77_int (r.cols ());
+      F77_INT m = octave::to_f77_int (r.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
       F77_INT k = std::min (m, n);
 
-      F77_INT u_nel = to_f77_int (u.numel ());
+      F77_INT u_nel = octave::to_f77_int (u.numel ());
 
       if (! q.is_square () || u_nel != n)
         (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch");
@@ -1583,8 +1583,8 @@
       q.resize (m + 1, m + 1);
       r.resize (m + 1, n);
 
-      F77_INT ldq = to_f77_int (q.rows ());
-      F77_INT ldr = to_f77_int (r.rows ());
+      F77_INT ldq = octave::to_f77_int (q.rows ());
+      F77_INT ldr = octave::to_f77_int (r.rows ());
 
       ComplexRowVector utmp = u;
       OCTAVE_LOCAL_BUFFER (double, rw, k);
@@ -1599,10 +1599,10 @@
     void
     qr<ComplexMatrix>::delete_row (octave_idx_type j_arg)
     {
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT j = octave::to_f77_int (j_arg);
 
-      F77_INT m = to_f77_int (r.rows ());
-      F77_INT n = to_f77_int (r.cols ());
+      F77_INT m = octave::to_f77_int (r.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
 
       if (! q.is_square ())
         (*current_liboctave_error_handler) ("qrdelete: dimensions mismatch");
@@ -1610,8 +1610,8 @@
       if (j < 0 || j > m-1)
         (*current_liboctave_error_handler) ("qrdelete: index out of range");
 
-      F77_INT ldq = to_f77_int (q.rows ());
-      F77_INT ldr = to_f77_int (r.rows ());
+      F77_INT ldq = octave::to_f77_int (q.rows ());
+      F77_INT ldr = octave::to_f77_int (r.rows ());
 
       OCTAVE_LOCAL_BUFFER (Complex, w, m);
       OCTAVE_LOCAL_BUFFER (double, rw, m);
@@ -1628,18 +1628,18 @@
     qr<ComplexMatrix>::shift_cols (octave_idx_type i_arg,
                                    octave_idx_type j_arg)
     {
-      F77_INT i = to_f77_int (i_arg);
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT i = octave::to_f77_int (i_arg);
+      F77_INT j = octave::to_f77_int (j_arg);
 
-      F77_INT m = to_f77_int (q.rows ());
-      F77_INT k = to_f77_int (r.rows ());
-      F77_INT n = to_f77_int (r.cols ());
+      F77_INT m = octave::to_f77_int (q.rows ());
+      F77_INT k = octave::to_f77_int (r.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
 
       if (i < 0 || i > n-1 || j < 0 || j > n-1)
         (*current_liboctave_error_handler) ("qrshift: index out of range");
 
-      F77_INT ldq = to_f77_int (q.rows ());
-      F77_INT ldr = to_f77_int (r.rows ());
+      F77_INT ldq = octave::to_f77_int (q.rows ());
+      F77_INT ldr = octave::to_f77_int (r.rows ());
 
       OCTAVE_LOCAL_BUFFER (Complex, w, k);
       OCTAVE_LOCAL_BUFFER (double, rw, k);
@@ -1656,8 +1656,8 @@
     qr<FloatComplexMatrix>::form (octave_idx_type n_arg, FloatComplexMatrix& afact,
                                   FloatComplex *tau, type qr_type)
     {
-      F77_INT n = to_f77_int (n_arg);
-      F77_INT m = to_f77_int (afact.rows ());
+      F77_INT n = octave::to_f77_int (n_arg);
+      F77_INT m = octave::to_f77_int (afact.rows ());
       F77_INT min_mn = std::min (m, n);
       F77_INT info;
 
@@ -1706,7 +1706,7 @@
 
           if (m > 0)
             {
-              F77_INT k = to_f77_int (q.cols ());
+              F77_INT k = octave::to_f77_int (q.cols ());
               // workspace query.
               FloatComplex clwork;
               F77_XFCN (cungqr, CUNGQR, (m, k, min_mn,
@@ -1730,8 +1730,8 @@
     void
     qr<FloatComplexMatrix>::init (const FloatComplexMatrix& a, type qr_type)
     {
-      F77_INT m = to_f77_int (a.rows ());
-      F77_INT n = to_f77_int (a.cols ());
+      F77_INT m = octave::to_f77_int (a.rows ());
+      F77_INT n = octave::to_f77_int (a.cols ());
 
       F77_INT min_mn = m < n ? m : n;
       OCTAVE_LOCAL_BUFFER (FloatComplex, tau, min_mn);
@@ -1769,12 +1769,12 @@
     qr<FloatComplexMatrix>::update (const FloatComplexColumnVector& u,
                                     const FloatComplexColumnVector& v)
     {
-      F77_INT m = to_f77_int (q.rows ());
-      F77_INT n = to_f77_int (r.cols ());
-      F77_INT k = to_f77_int (q.cols ());
+      F77_INT m = octave::to_f77_int (q.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
+      F77_INT k = octave::to_f77_int (q.cols ());
 
-      F77_INT u_nel = to_f77_int (u.numel ());
-      F77_INT v_nel = to_f77_int (v.numel ());
+      F77_INT u_nel = octave::to_f77_int (u.numel ());
+      F77_INT v_nel = octave::to_f77_int (v.numel ());
 
       if (u_nel != m || v_nel != n)
         (*current_liboctave_error_handler) ("qrupdate: dimensions mismatch");
@@ -1795,15 +1795,15 @@
     qr<FloatComplexMatrix>::update (const FloatComplexMatrix& u,
                                     const FloatComplexMatrix& v)
     {
-      F77_INT m = to_f77_int (q.rows ());
-      F77_INT n = to_f77_int (r.cols ());
-      F77_INT k = to_f77_int (q.cols ());
+      F77_INT m = octave::to_f77_int (q.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
+      F77_INT k = octave::to_f77_int (q.cols ());
 
-      F77_INT u_rows = to_f77_int (u.rows ());
-      F77_INT u_cols = to_f77_int (u.cols ());
+      F77_INT u_rows = octave::to_f77_int (u.rows ());
+      F77_INT u_cols = octave::to_f77_int (u.cols ());
 
-      F77_INT v_rows = to_f77_int (v.rows ());
-      F77_INT v_cols = to_f77_int (v.cols ());
+      F77_INT v_rows = octave::to_f77_int (v.rows ());
+      F77_INT v_cols = octave::to_f77_int (v.cols ());
 
       if (u_rows != m || v_rows != n || u_cols != v_cols)
         (*current_liboctave_error_handler) ("qrupdate: dimensions mismatch");
@@ -1827,13 +1827,13 @@
     qr<FloatComplexMatrix>::insert_col (const FloatComplexColumnVector& u,
                                         octave_idx_type j_arg)
     {
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT j = octave::to_f77_int (j_arg);
 
-      F77_INT m = to_f77_int (q.rows ());
-      F77_INT n = to_f77_int (r.cols ());
-      F77_INT k = to_f77_int (q.cols ());
+      F77_INT m = octave::to_f77_int (q.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
+      F77_INT k = octave::to_f77_int (q.cols ());
 
-      F77_INT u_nel = to_f77_int (u.numel ());
+      F77_INT u_nel = octave::to_f77_int (u.numel ());
 
       if (u_nel != m)
         (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch");
@@ -1849,8 +1849,8 @@
       else
         r.resize (k, n+1);
 
-      F77_INT ldq = to_f77_int (q.rows ());
-      F77_INT ldr = to_f77_int (r.rows ());
+      F77_INT ldq = octave::to_f77_int (q.rows ());
+      F77_INT ldr = octave::to_f77_int (r.rows ());
 
       FloatComplexColumnVector utmp = u;
       OCTAVE_LOCAL_BUFFER (float, rw, k);
@@ -1864,13 +1864,13 @@
     qr<FloatComplexMatrix>::insert_col (const FloatComplexMatrix& u,
                                         const Array<octave_idx_type>& j)
     {
-      F77_INT m = to_f77_int (q.rows ());
-      F77_INT n = to_f77_int (r.cols ());
-      F77_INT k = to_f77_int (q.cols ());
+      F77_INT m = octave::to_f77_int (q.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
+      F77_INT k = octave::to_f77_int (q.cols ());
 
       Array<octave_idx_type> jsi;
       Array<octave_idx_type> js = j.sort (jsi, 0, ASCENDING);
-      F77_INT nj = to_f77_int (js.numel ());
+      F77_INT nj = octave::to_f77_int (js.numel ());
       bool dups = false;
       for (F77_INT i = 0; i < nj - 1; i++)
         dups = dups && js(i) == js(i+1);
@@ -1878,14 +1878,14 @@
       if (dups)
         (*current_liboctave_error_handler) ("qrinsert: duplicate index detected");
 
-      F77_INT u_nel = to_f77_int (u.numel ());
-      F77_INT u_cols = to_f77_int (u.cols ());
+      F77_INT u_nel = octave::to_f77_int (u.numel ());
+      F77_INT u_cols = octave::to_f77_int (u.cols ());
 
       if (u_nel != m || u_cols != nj)
         (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch");
 
-      F77_INT js_beg = to_f77_int (js(0));
-      F77_INT js_end = to_f77_int (js(nj-1));
+      F77_INT js_beg = octave::to_f77_int (js(0));
+      F77_INT js_end = octave::to_f77_int (js(nj-1));
 
       if (nj > 0 && (js_beg < 0 || js_end > n))
         (*current_liboctave_error_handler) ("qrinsert: index out of range");
@@ -1901,14 +1901,14 @@
           else
             r.resize (k, n + nj);
 
-          F77_INT ldq = to_f77_int (q.rows ());
-          F77_INT ldr = to_f77_int (r.rows ());
+          F77_INT ldq = octave::to_f77_int (q.rows ());
+          F77_INT ldr = octave::to_f77_int (r.rows ());
 
           OCTAVE_LOCAL_BUFFER (float, rw, kmax);
           for (volatile F77_INT i = 0; i < nj; i++)
             {
               F77_INT ii = i;
-              F77_INT js_elt = to_f77_int (js(ii));
+              F77_INT js_elt = octave::to_f77_int (js(ii));
               F77_XFCN (cqrinc, CQRINC, (m, n + ii, std::min (kmax, k + ii),
                                          F77_CMPLX_ARG (q.fortran_vec ()), ldq,
                                          F77_CMPLX_ARG (r.fortran_vec ()), ldr,
@@ -1923,17 +1923,17 @@
     void
     qr<FloatComplexMatrix>::delete_col (octave_idx_type j_arg)
     {
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT j = octave::to_f77_int (j_arg);
 
-      F77_INT m = to_f77_int (q.rows ());
-      F77_INT k = to_f77_int (r.rows ());
-      F77_INT n = to_f77_int (r.cols ());
+      F77_INT m = octave::to_f77_int (q.rows ());
+      F77_INT k = octave::to_f77_int (r.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
 
       if (j < 0 || j > n-1)
         (*current_liboctave_error_handler) ("qrdelete: index out of range");
 
-      F77_INT ldq = to_f77_int (q.rows ());
-      F77_INT ldr = to_f77_int (r.rows ());
+      F77_INT ldq = octave::to_f77_int (q.rows ());
+      F77_INT ldr = octave::to_f77_int (r.rows ());
 
       OCTAVE_LOCAL_BUFFER (float, rw, k);
       F77_XFCN (cqrdec, CQRDEC, (m, n, k, F77_CMPLX_ARG (q.fortran_vec ()), ldq,
@@ -1953,13 +1953,13 @@
     void
     qr<FloatComplexMatrix>::delete_col (const Array<octave_idx_type>& j)
     {
-      F77_INT m = to_f77_int (q.rows ());
-      F77_INT n = to_f77_int (r.cols ());
-      F77_INT k = to_f77_int (q.cols ());
+      F77_INT m = octave::to_f77_int (q.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
+      F77_INT k = octave::to_f77_int (q.cols ());
 
       Array<octave_idx_type> jsi;
       Array<octave_idx_type> js = j.sort (jsi, 0, DESCENDING);
-      F77_INT nj = to_f77_int (js.numel ());
+      F77_INT nj = octave::to_f77_int (js.numel ());
       bool dups = false;
       for (F77_INT i = 0; i < nj - 1; i++)
         dups = dups && js(i) == js(i+1);
@@ -1967,22 +1967,22 @@
       if (dups)
         (*current_liboctave_error_handler) ("qrinsert: duplicate index detected");
 
-      F77_INT js_beg = to_f77_int (js(0));
-      F77_INT js_end = to_f77_int (js(nj-1));
+      F77_INT js_beg = octave::to_f77_int (js(0));
+      F77_INT js_end = octave::to_f77_int (js(nj-1));
 
       if (nj > 0 && (js_beg > n-1 || js_end < 0))
         (*current_liboctave_error_handler) ("qrinsert: index out of range");
 
       if (nj > 0)
         {
-          F77_INT ldq = to_f77_int (q.rows ());
-          F77_INT ldr = to_f77_int (r.rows ());
+          F77_INT ldq = octave::to_f77_int (q.rows ());
+          F77_INT ldr = octave::to_f77_int (r.rows ());
 
           OCTAVE_LOCAL_BUFFER (float, rw, k);
           for (volatile F77_INT i = 0; i < nj; i++)
             {
               F77_INT ii = i;
-              F77_INT js_elt = to_f77_int (js(ii));
+              F77_INT js_elt = octave::to_f77_int (js(ii));
               F77_XFCN (cqrdec, CQRDEC, (m, n - ii, k == m ? k : k - ii,
                                          F77_CMPLX_ARG (q.fortran_vec ()), ldq,
                                          F77_CMPLX_ARG (r.fortran_vec ()), ldr,
@@ -2004,13 +2004,13 @@
     qr<FloatComplexMatrix>::insert_row (const FloatComplexRowVector& u,
                                         octave_idx_type j_arg)
     {
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT j = octave::to_f77_int (j_arg);
 
-      F77_INT m = to_f77_int (r.rows ());
-      F77_INT n = to_f77_int (r.cols ());
+      F77_INT m = octave::to_f77_int (r.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
       F77_INT k = std::min (m, n);
 
-      F77_INT u_nel = to_f77_int (u.numel ());
+      F77_INT u_nel = octave::to_f77_int (u.numel ());
 
       if (! q.is_square () || u_nel != n)
         (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch");
@@ -2021,8 +2021,8 @@
       q.resize (m + 1, m + 1);
       r.resize (m + 1, n);
 
-      F77_INT ldq = to_f77_int (q.rows ());
-      F77_INT ldr = to_f77_int (r.rows ());
+      F77_INT ldq = octave::to_f77_int (q.rows ());
+      F77_INT ldr = octave::to_f77_int (r.rows ());
 
       FloatComplexRowVector utmp = u;
       OCTAVE_LOCAL_BUFFER (float, rw, k);
@@ -2037,10 +2037,10 @@
     void
     qr<FloatComplexMatrix>::delete_row (octave_idx_type j_arg)
     {
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT j = octave::to_f77_int (j_arg);
 
-      F77_INT m = to_f77_int (r.rows ());
-      F77_INT n = to_f77_int (r.cols ());
+      F77_INT m = octave::to_f77_int (r.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
 
       if (! q.is_square ())
         (*current_liboctave_error_handler) ("qrdelete: dimensions mismatch");
@@ -2048,8 +2048,8 @@
       if (j < 0 || j > m-1)
         (*current_liboctave_error_handler) ("qrdelete: index out of range");
 
-      F77_INT ldq = to_f77_int (q.rows ());
-      F77_INT ldr = to_f77_int (r.rows ());
+      F77_INT ldq = octave::to_f77_int (q.rows ());
+      F77_INT ldr = octave::to_f77_int (r.rows ());
 
       OCTAVE_LOCAL_BUFFER (FloatComplex, w, m);
       OCTAVE_LOCAL_BUFFER (float, rw, m);
@@ -2066,18 +2066,18 @@
     qr<FloatComplexMatrix>::shift_cols (octave_idx_type i_arg,
                                         octave_idx_type j_arg)
     {
-      F77_INT i = to_f77_int (i_arg);
-      F77_INT j = to_f77_int (j_arg);
+      F77_INT i = octave::to_f77_int (i_arg);
+      F77_INT j = octave::to_f77_int (j_arg);
 
-      F77_INT m = to_f77_int (q.rows ());
-      F77_INT k = to_f77_int (r.rows ());
-      F77_INT n = to_f77_int (r.cols ());
+      F77_INT m = octave::to_f77_int (q.rows ());
+      F77_INT k = octave::to_f77_int (r.rows ());
+      F77_INT n = octave::to_f77_int (r.cols ());
 
       if (i < 0 || i > n-1 || j < 0 || j > n-1)
         (*current_liboctave_error_handler) ("qrshift: index out of range");
 
-      F77_INT ldq = to_f77_int (q.rows ());
-      F77_INT ldr = to_f77_int (r.rows ());
+      F77_INT ldq = octave::to_f77_int (q.rows ());
+      F77_INT ldr = octave::to_f77_int (r.rows ());
 
       OCTAVE_LOCAL_BUFFER (FloatComplex, w, k);
       OCTAVE_LOCAL_BUFFER (float, rw, k);
--- a/liboctave/numeric/qrp.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/numeric/qrp.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -50,8 +50,8 @@
     {
       assert (qr_type != qr<Matrix>::raw);
 
-      F77_INT m = to_f77_int (a.rows ());
-      F77_INT n = to_f77_int (a.cols ());
+      F77_INT m = octave::to_f77_int (a.rows ());
+      F77_INT n = octave::to_f77_int (a.cols ());
 
       F77_INT min_mn = m < n ? m : n;
       OCTAVE_LOCAL_BUFFER (double, tau, min_mn);
@@ -118,8 +118,8 @@
     {
       assert (qr_type != qr<FloatMatrix>::raw);
 
-      F77_INT m = to_f77_int (a.rows ());
-      F77_INT n = to_f77_int (a.cols ());
+      F77_INT m = octave::to_f77_int (a.rows ());
+      F77_INT n = octave::to_f77_int (a.cols ());
 
       F77_INT min_mn = m < n ? m : n;
       OCTAVE_LOCAL_BUFFER (float, tau, min_mn);
@@ -186,8 +186,8 @@
     {
       assert (qr_type != qr<ComplexMatrix>::raw);
 
-      F77_INT m = to_f77_int (a.rows ());
-      F77_INT n = to_f77_int (a.cols ());
+      F77_INT m = octave::to_f77_int (a.rows ());
+      F77_INT n = octave::to_f77_int (a.cols ());
 
       F77_INT min_mn = m < n ? m : n;
       OCTAVE_LOCAL_BUFFER (Complex, tau, min_mn);
@@ -262,8 +262,8 @@
     {
       assert (qr_type != qr<FloatComplexMatrix>::raw);
 
-      F77_INT m = to_f77_int (a.rows ());
-      F77_INT n = to_f77_int (a.cols ());
+      F77_INT m = octave::to_f77_int (a.rows ());
+      F77_INT n = octave::to_f77_int (a.cols ());
 
       F77_INT min_mn = m < n ? m : n;
       OCTAVE_LOCAL_BUFFER (FloatComplex, tau, min_mn);
--- a/liboctave/numeric/schur.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/numeric/schur.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -96,8 +96,8 @@
     F77_INT
     schur<Matrix>::init (const Matrix& a, const std::string& ord, bool calc_unitary)
     {
-      F77_INT a_nr = to_f77_int (a.rows ());
-      F77_INT a_nc = to_f77_int (a.cols ());
+      F77_INT a_nr = octave::to_f77_int (a.rows ());
+      F77_INT a_nc = octave::to_f77_int (a.cols ());
 
       if (a_nr != a_nc)
         (*current_liboctave_error_handler) ("schur: requires square matrix");
@@ -183,8 +183,8 @@
     schur<FloatMatrix>::init (const FloatMatrix& a, const std::string& ord,
                               bool calc_unitary)
     {
-      F77_INT a_nr = to_f77_int (a.rows ());
-      F77_INT a_nc = to_f77_int (a.cols ());
+      F77_INT a_nr = octave::to_f77_int (a.rows ());
+      F77_INT a_nc = octave::to_f77_int (a.cols ());
 
       if (a_nr != a_nc)
         (*current_liboctave_error_handler) ("SCHUR requires square matrix");
@@ -270,8 +270,8 @@
     schur<ComplexMatrix>::init (const ComplexMatrix& a, const std::string& ord,
                                 bool calc_unitary)
     {
-      F77_INT a_nr = to_f77_int (a.rows ());
-      F77_INT a_nc = to_f77_int (a.cols ());
+      F77_INT a_nr = octave::to_f77_int (a.rows ());
+      F77_INT a_nc = octave::to_f77_int (a.cols ());
 
       if (a_nr != a_nc)
         (*current_liboctave_error_handler) ("SCHUR requires square matrix");
@@ -355,7 +355,7 @@
       ComplexMatrix s (s_arg);
       ComplexMatrix u (u_arg);
 
-      F77_INT n = to_f77_int (s.rows ());
+      F77_INT n = octave::to_f77_int (s.rows ());
 
       if (s.columns () != n || u.rows () != n || u.columns () != n)
         (*current_liboctave_error_handler)
@@ -378,8 +378,8 @@
     schur<FloatComplexMatrix>::init (const FloatComplexMatrix& a,
                                      const std::string& ord, bool calc_unitary)
     {
-      F77_INT a_nr = to_f77_int (a.rows ());
-      F77_INT a_nc = to_f77_int (a.cols ());
+      F77_INT a_nr = octave::to_f77_int (a.rows ());
+      F77_INT a_nc = octave::to_f77_int (a.cols ());
 
       if (a_nr != a_nc)
         (*current_liboctave_error_handler) ("SCHUR requires square matrix");
@@ -464,7 +464,7 @@
       FloatComplexMatrix s (s_arg);
       FloatComplexMatrix u (u_arg);
 
-      F77_INT n = to_f77_int (s.rows ());
+      F77_INT n = octave::to_f77_int (s.rows ());
 
       if (s.columns () != n || u.rows () != n || u.columns () != n)
         (*current_liboctave_error_handler)
--- a/liboctave/numeric/svd.cc	Fri Dec 30 13:52:13 2016 -0500
+++ b/liboctave/numeric/svd.cc	Fri Dec 30 14:03:01 2016 -0500
@@ -282,8 +282,8 @@
     {
       F77_INT info;
 
-      F77_INT m = to_f77_int (a.rows ());
-      F77_INT n = to_f77_int (a.cols ());
+      F77_INT m = octave::to_f77_int (a.rows ());
+      F77_INT n = octave::to_f77_int (a.cols ());
 
       if (m == 0 || n == 0)
         {