# HG changeset patch # User jwe # Date 797615912 0 # Node ID 97eac19837dca713b4ca0435f926a1a70883504b # Parent 5cca5ae2029986cce4d81167fdf9cb9f887eca0e [project @ 1995-04-11 15:58:32 by jwe] diff -r 5cca5ae20299 -r 97eac19837dc liboctave/CColVector.cc --- a/liboctave/CColVector.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/CColVector.cc Tue Apr 11 15:58:32 1995 +0000 @@ -38,10 +38,10 @@ extern "C" { - int F77_FCN (zgemv) (const char*, const int*, const int*, - const Complex*, const Complex*, const int*, - const Complex*, const int*, const Complex*, - Complex*, const int*, long); + int F77_FCN (zgemv) (const char*, const int&, const int&, + const Complex&, const Complex*, const int&, + const Complex*, const int&, const Complex&, + Complex*, const int&, long); } /* @@ -446,16 +446,12 @@ if (nc == 0 || nr == 0) return ComplexColumnVector (0); - char trans = 'N'; int ld = nr; - Complex alpha (1.0); - Complex beta (0.0); - int i_one = 1; Complex *y = new Complex [nr]; - F77_FCN (zgemv) (&trans, &nr, &nc, &alpha, m.data (), &ld, a.data (), - &i_one, &beta, y, &i_one, 1L); + F77_FCN (zgemv) ("N", nr, nc, 1.0, m.data (), ld, a.data (), 1, 0.0, + y, 1, 1L); return ComplexColumnVector (y, nr); } diff -r 5cca5ae20299 -r 97eac19837dc liboctave/CMatrix.cc --- a/liboctave/CMatrix.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/CMatrix.cc Tue Apr 11 15:58:32 1995 +0000 @@ -42,36 +42,36 @@ extern "C" { - int F77_FCN (zgemm) (const char*, const char*, const int*, - const int*, const int*, const Complex*, - const Complex*, const int*, const Complex*, - const int*, const Complex*, Complex*, const int*, + int F77_FCN (zgemm) (const char*, const char*, const int&, + const int&, const int&, const Complex&, + const Complex*, const int&, const Complex*, + const int&, const Complex&, Complex*, const int&, long, long); - int F77_FCN (zgeco) (Complex*, const int*, const int*, int*, - double*, Complex*); - - int F77_FCN (zgedi) (Complex*, const int*, const int*, int*, - Complex*, Complex*, const int*); - - int F77_FCN (zgesl) (Complex*, const int*, const int*, int*, - Complex*, const int*); - - int F77_FCN (zgelss) (const int*, const int*, const int*, Complex*, - const int*, Complex*, const int*, double*, - const double*, int*, Complex*, const int*, - double*, int*); + int F77_FCN (zgeco) (Complex*, const int&, const int&, int*, + double&, Complex*); + + int F77_FCN (zgedi) (Complex*, const int&, const int&, int*, + Complex*, Complex*, const int&); + + int F77_FCN (zgesl) (Complex*, const int&, const int&, int*, + Complex*, const int&); + + int F77_FCN (zgelss) (const int&, const int&, const int&, Complex*, + const int&, Complex*, const int&, double*, + double&, int&, Complex*, const int&, + double*, int&); // Note that the original complex fft routines were not written for // double complex arguments. They have been modified by adding an // implicit double precision (a-h,o-z) statement at the beginning of // each subroutine. - int F77_FCN (cffti) (const int*, Complex*); - - int F77_FCN (cfftf) (const int*, Complex*, Complex*); - - int F77_FCN (cfftb) (const int*, Complex*, Complex*); + int F77_FCN (cffti) (const int&, Complex*); + + int F77_FCN (cfftf) (const int&, Complex*, Complex*); + + int F77_FCN (cfftb) (const int&, Complex*, Complex*); } /* @@ -788,7 +788,7 @@ Complex *z = new Complex [nr]; Complex *tmp_data = dup (data (), len); - F77_FCN (zgeco) (tmp_data, &nr, &nc, ipvt, &rcond, z); + F77_FCN (zgeco) (tmp_data, nr, nc, ipvt, rcond, z); volatile double rcond_plus_one = rcond + 1.0; if (rcond_plus_one == 1.0) @@ -798,10 +798,9 @@ } else { - int job = 1; - Complex dummy; - - F77_FCN (zgedi) (tmp_data, &nr, &nc, ipvt, &dummy, z, &job); + Complex *dummy; + + F77_FCN (zgedi) (tmp_data, nr, nc, ipvt, dummy, z, 1); } delete [] ipvt; @@ -868,10 +867,10 @@ Complex *wsave = new Complex [nn]; Complex *tmp_data = dup (data (), length ()); - F77_FCN (cffti) (&npts, wsave); + F77_FCN (cffti) (npts, wsave); for (int j = 0; j < nsamples; j++) - F77_FCN (cfftf) (&npts, &tmp_data[npts*j], wsave); + F77_FCN (cfftf) (npts, &tmp_data[npts*j], wsave); delete [] wsave; @@ -899,10 +898,10 @@ Complex *wsave = new Complex [nn]; Complex *tmp_data = dup (data (), length ()); - F77_FCN (cffti) (&npts, wsave); + F77_FCN (cffti) (npts, wsave); for (int j = 0; j < nsamples; j++) - F77_FCN (cfftb) (&npts, &tmp_data[npts*j], wsave); + F77_FCN (cfftb) (npts, &tmp_data[npts*j], wsave); for (j = 0; j < npts*nsamples; j++) tmp_data[j] = tmp_data[j] / (double) npts; @@ -933,10 +932,10 @@ Complex *wsave = new Complex [nn]; Complex *tmp_data = dup (data (), length ()); - F77_FCN (cffti) (&npts, wsave); + F77_FCN (cffti) (npts, wsave); for (int j = 0; j < nsamples; j++) - F77_FCN (cfftf) (&npts, &tmp_data[npts*j], wsave); + F77_FCN (cfftf) (npts, &tmp_data[npts*j], wsave); delete [] wsave; @@ -946,14 +945,14 @@ wsave = new Complex [nn]; Complex *row = new Complex[npts]; - F77_FCN (cffti) (&npts, wsave); + F77_FCN (cffti) (npts, wsave); for (j = 0; j < nsamples; j++) { for (int i = 0; i < npts; i++) row[i] = tmp_data[i*nr + j]; - F77_FCN (cfftf) (&npts, row, wsave); + F77_FCN (cfftf) (npts, row, wsave); for (i = 0; i < npts; i++) tmp_data[i*nr + j] = row[i]; @@ -986,10 +985,10 @@ Complex *wsave = new Complex [nn]; Complex *tmp_data = dup (data (), length ()); - F77_FCN (cffti) (&npts, wsave); + F77_FCN (cffti) (npts, wsave); for (int j = 0; j < nsamples; j++) - F77_FCN (cfftb) (&npts, &tmp_data[npts*j], wsave); + F77_FCN (cfftb) (npts, &tmp_data[npts*j], wsave); delete [] wsave; @@ -1002,14 +1001,14 @@ wsave = new Complex [nn]; Complex *row = new Complex[npts]; - F77_FCN (cffti) (&npts, wsave); + F77_FCN (cffti) (npts, wsave); for (j = 0; j < nsamples; j++) { for (int i = 0; i < npts; i++) row[i] = tmp_data[i*nr + j]; - F77_FCN (cfftb) (&npts, row, wsave); + F77_FCN (cfftb) (npts, row, wsave); for (i = 0; i < npts; i++) tmp_data[i*nr + j] = row[i] / (double) npts; @@ -1059,7 +1058,7 @@ Complex *z = new Complex [nr]; Complex *tmp_data = dup (data (), length ()); - F77_FCN (zgeco) (tmp_data, &nr, &nr, ipvt, &rcond, z); + F77_FCN (zgeco) (tmp_data, nr, nr, ipvt, rcond, z); volatile double rcond_plus_one = rcond + 1.0; if (rcond_plus_one == 1.0) @@ -1069,9 +1068,8 @@ } else { - int job = 10; Complex d[2]; - F77_FCN (zgedi) (tmp_data, &nr, &nr, ipvt, d, z, &job); + F77_FCN (zgedi) (tmp_data, nr, nr, ipvt, d, z, 10); retval = ComplexDET (d); } @@ -1141,7 +1139,7 @@ Complex *z = new Complex [nr]; Complex *tmp_data = dup (data (), length ()); - F77_FCN (zgeco) (tmp_data, &nr, &nr, ipvt, &rcond, z); + F77_FCN (zgeco) (tmp_data, nr, nr, ipvt, rcond, z); volatile double rcond_plus_one = rcond + 1.0; if (rcond_plus_one == 1.0) @@ -1150,12 +1148,10 @@ } else { - int job = 0; - Complex *result = dup (b.data (), b.length ()); for (int j = 0; j < b_nc; j++) - F77_FCN (zgesl) (tmp_data, &nr, &nr, ipvt, &result[nr*j], &job); + F77_FCN (zgesl) (tmp_data, nr, nr, ipvt, &result[nr*j], 0); retval = ComplexMatrix (result, b_nr, b_nc); } @@ -1204,7 +1200,7 @@ Complex *z = new Complex [nr]; Complex *tmp_data = dup (data (), length ()); - F77_FCN (zgeco) (tmp_data, &nr, &nr, ipvt, &rcond, z); + F77_FCN (zgeco) (tmp_data, nr, nr, ipvt, rcond, z); volatile double rcond_plus_one = rcond + 1.0; if (rcond_plus_one == 1.0) @@ -1213,11 +1209,9 @@ } else { - int job = 0; - Complex *result = dup (b.data (), b_len); - F77_FCN (zgesl) (tmp_data, &nr, &nr, ipvt, result, &job); + F77_FCN (zgesl) (tmp_data, nr, nr, ipvt, result, 0); retval = ComplexColumnVector (result, b_len); } @@ -1286,8 +1280,8 @@ lrwork = lrwork > 1 ? lrwork : 1; double *rwork = new double [lrwork]; - F77_FCN (zgelss) (&m, &n, &nrhs, tmp_data, &m, presult, &nrr, s, - &rcond, &rank, work, &lwork, rwork, &info); + F77_FCN (zgelss) (m, n, nrhs, tmp_data, m, presult, nrr, s, + rcond, rank, work, lwork, rwork, info); ComplexMatrix retval (n, nrhs); for (j = 0; j < nrhs; j++) @@ -1359,8 +1353,8 @@ lrwork = lrwork > 1 ? lrwork : 1; double *rwork = new double [lrwork]; - F77_FCN (zgelss) (&m, &n, &nrhs, tmp_data, &m, presult, &nrr, s, - &rcond, &rank, work, &lwork, rwork, &info); + F77_FCN (zgelss) (m, n, nrhs, tmp_data, m, presult, nrr, s, + rcond, rank, work, lwork, rwork, info); ComplexColumnVector retval (n); for (i = 0; i < n; i++) @@ -1405,17 +1399,10 @@ if (len == 0) return ComplexMatrix (len, len, 0.0); - char transa = 'N'; - char transb = 'N'; - Complex alpha (1.0); - Complex beta (0.0); - int anr = 1; - Complex *c = new Complex [len * a_len]; - F77_FCN (zgemm) (&transa, &transb, &len, &a_len, &anr, &alpha, - v.data (), &len, a.data (), &anr, &beta, c, &len, - 1L, 1L); + F77_FCN (zgemm) ("N", "N", len, a_len, 1, 1.0, v.data (), len, + a.data (), 1, 0.0, c, len, 1L, 1L); return ComplexMatrix (c, len, a_len); } @@ -2453,19 +2440,13 @@ if (nr == 0 || nc == 0 || a_nc == 0) return ComplexMatrix (nr, nc, 0.0); - char trans = 'N'; - char transa = 'N'; - int ld = nr; int lda = a.rows (); - Complex alpha (1.0); - Complex beta (0.0); - Complex *c = new Complex [nr*a_nc]; - F77_FCN (zgemm) (&trans, &transa, &nr, &a_nc, &nc, &alpha, m.data (), - &ld, a.data (), &lda, &beta, c, &nr, 1L, 1L); + F77_FCN (zgemm) ("N", "N", nr, a_nc, nc, 1.0, m.data (), + ld, a.data (), lda, 0.0, c, nr, 1L, 1L); return ComplexMatrix (c, nr, a_nc); } diff -r 5cca5ae20299 -r 97eac19837dc liboctave/CRowVector.cc --- a/liboctave/CRowVector.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/CRowVector.cc Tue Apr 11 15:58:32 1995 +0000 @@ -38,10 +38,10 @@ extern "C" { - int F77_FCN (zgemv) (const char*, const int*, const int*, - const Complex*, const Complex*, const int*, - const Complex*, const int*, const Complex*, - Complex*, const int*, long); + int F77_FCN (zgemv) (const char*, const int&, const int&, + const Complex&, const Complex*, const int&, + const Complex*, const int&, const Complex&, + Complex*, const int&, long); } /* @@ -438,16 +438,12 @@ int a_nr = a.rows (); int a_nc = a.cols (); - char trans = 'T'; int ld = a_nr; - Complex alpha (1.0); - Complex beta (0.0); - int i_one = 1; Complex *y = new Complex [len]; - F77_FCN (zgemv) (&trans, &a_nc, &a_nr, &alpha, a.data (), &ld, - v.data (), &i_one, &beta, y, &i_one, 1L); + F77_FCN (zgemv) ("T", a_nc, a_nr, 1.0, a.data (), ld, v.data (), 1, + 0.0, y, 1, 1L); return ComplexRowVector (y, len); } diff -r 5cca5ae20299 -r 97eac19837dc liboctave/CmplxAEPBAL.cc --- a/liboctave/CmplxAEPBAL.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/CmplxAEPBAL.cc Tue Apr 11 15:58:32 1995 +0000 @@ -31,12 +31,12 @@ extern "C" { - int F77_FCN (zgebal) (const char*, const int*, Complex*, const int*, - int*, int*, double*, int*, long, long); + int F77_FCN (zgebal) (const char*, const int&, Complex*, const int&, + int&, int&, double*, int&, long, long); - int F77_FCN (zgebak) (const char*, const char*, const int*, const int*, - const int*, double*, const int*, Complex*, - const int*, int*, long, long); + int F77_FCN (zgebak) (const char*, const char*, const int&, const int&, + const int&, double*, const int&, Complex*, + const int&, int&, long, long); } int @@ -56,8 +56,8 @@ balanced_mat = a; - F77_FCN (zgebal) (balance_job, &n, balanced_mat.fortran_vec (), - &n, &ilo, &ihi, scale, &info, 1L, 1L); + F77_FCN (zgebal) (balance_job, n, balanced_mat.fortran_vec (), + n, ilo, ihi, scale, info, 1L, 1L); // Initialize balancing matrix to identity. @@ -65,8 +65,8 @@ for (int i = 0; i < n; i++) balancing_mat (i, i) = 1.0; - F77_FCN (zgebak) (balance_job, "R", &n, &ilo, &ihi, scale, &n, - balancing_mat.fortran_vec (), &n, &info, 1L, 1L); + F77_FCN (zgebak) (balance_job, "R", n, ilo, ihi, scale, n, + balancing_mat.fortran_vec (), n, info, 1L, 1L); delete [] scale; diff -r 5cca5ae20299 -r 97eac19837dc liboctave/CmplxCHOL.cc --- a/liboctave/CmplxCHOL.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/CmplxCHOL.cc Tue Apr 11 15:58:32 1995 +0000 @@ -32,8 +32,8 @@ extern "C" { - int F77_FCN (zpotrf) (const char*, const int*, Complex*, const int*, - int*, long); + int F77_FCN (zpotrf) (const char*, const int&, Complex*, const int&, + int&, long); } int @@ -48,14 +48,12 @@ return -1; } - char uplo = 'U'; - int n = a_nc; int info; Complex *h = dup (a.data (), a.length ()); - F77_FCN (zpotrf) (&uplo, &n, h, &n, &info, 1L); + F77_FCN (zpotrf) ("U", n, h, n, info, 1L); chol_mat = ComplexMatrix (h, n, n); diff -r 5cca5ae20299 -r 97eac19837dc liboctave/CmplxHESS.cc --- a/liboctave/CmplxHESS.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/CmplxHESS.cc Tue Apr 11 15:58:32 1995 +0000 @@ -32,20 +32,20 @@ extern "C" { - int F77_FCN (zgebal) (const char*, const int*, Complex*, const int*, - int*, int*, double*, int*, long, long); + int F77_FCN (zgebal) (const char*, const int&, Complex*, const int&, + int&, int&, double*, int&, long, long); - int F77_FCN (zgebak) (const char*, const char*, const int*, const int*, - const int*, double*, const int*, Complex*, - const int*, int*, long, long); + int F77_FCN (zgehrd) (const int&, const int&, const int&, Complex*, + const int&, Complex*, Complex*, const int&, + int&, long, long); + + int F77_FCN (zunghr) (const int&, const int&, const int&, Complex*, + const int&, Complex*, Complex*, const int&, + int&, long, long); - int F77_FCN (zgehrd) (const int*, const int*, const int*, Complex*, - const int*, Complex*, Complex*, const int*, - int*, long, long); - - int F77_FCN (zunghr) (const int*, const int*, const int*, Complex*, - const int*, Complex*, Complex*, const int*, - int*, long, long); + int F77_FCN (zgebak) (const char*, const char*, const int&, const int&, + const int&, double*, const int&, Complex*, + const int&, int&, long, long); } int @@ -60,8 +60,8 @@ return -1; } - char job = 'N'; - char side = 'R'; + char *job = "N"; + char *side = "R"; int n = a_nc; int lwork = 32 * n; @@ -76,18 +76,15 @@ Complex *work = new Complex [lwork]; Complex *z = new Complex [n*n]; - F77_FCN (zgebal) (&job, &n, h, &n, &ilo, &ihi, scale, &info, 1L, 1L); + F77_FCN (zgebal) (job, n, h, n, ilo, ihi, scale, info, 1L, 1L); - F77_FCN (zgehrd) (&n, &ilo, &ihi, h, &n, tau, work, &lwork, &info, 1L, - 1L); + F77_FCN (zgehrd) (n, ilo, ihi, h, n, tau, work, lwork, info, 1L, 1L); copy (z, h, n*n); - F77_FCN (zunghr) (&n, &ilo, &ihi, z, &n, tau, work, &lwork, &info, 1L, - 1L); + F77_FCN (zunghr) (n, ilo, ihi, z, n, tau, work, lwork, info, 1L, 1L); - F77_FCN (zgebak) (&job, &side, &n, &ilo, &ihi, scale, &n, z, &n, &info, - 1L, 1L); + F77_FCN (zgebak) (job, side, n, ilo, ihi, scale, n, z, n, info, 1L, 1L); hess_mat = ComplexMatrix (h, n, n); unitary_hess_mat = ComplexMatrix (z, n, n); diff -r 5cca5ae20299 -r 97eac19837dc liboctave/CmplxLU.cc --- a/liboctave/CmplxLU.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/CmplxLU.cc Tue Apr 11 15:58:32 1995 +0000 @@ -32,8 +32,8 @@ extern "C" { - int F77_FCN (zgesv) (const int*, const int*, Complex*, const int*, - int*, Complex*, const int*, int*); + int F77_FCN (zgesv) (const int&, const int&, Complex*, const int&, + int*, Complex*, const int&, int&); } ComplexLU::ComplexLU (const ComplexMatrix& a) @@ -52,10 +52,9 @@ int *pvt = new int [n]; Complex *tmp_data = dup (a.data (), a.length ()); int info = 0; - int zero = 0; - Complex b; + Complex *b; - F77_FCN (zgesv) (&n, &zero, tmp_data, &n, ipvt, &b, &n, &info); + F77_FCN (zgesv) (n, 0, tmp_data, n, ipvt, b, n, info); ComplexMatrix A_fact (tmp_data, n, n); diff -r 5cca5ae20299 -r 97eac19837dc liboctave/CmplxQR.cc --- a/liboctave/CmplxQR.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/CmplxQR.cc Tue Apr 11 15:58:32 1995 +0000 @@ -32,11 +32,11 @@ extern "C" { - int F77_FCN (zgeqrf) (const int*, const int*, Complex*, const int*, - Complex*, Complex*, const int*, int*); + int F77_FCN (zgeqrf) (const int&, const int&, Complex*, const int&, + Complex*, Complex*, const int&, int&); - int F77_FCN (zungqr) (const int*, const int*, const int*, Complex*, - const int*, Complex*, Complex*, const int*, int*); + int F77_FCN (zungqr) (const int&, const int&, const int&, Complex*, + const int&, Complex*, Complex*, const int&, int&); } ComplexQR::ComplexQR (const ComplexMatrix& a, QR::type qr_type) @@ -66,7 +66,7 @@ else tmp_data = dup (a.data (), a.length ()); - F77_FCN (zgeqrf) (&m, &n, tmp_data, &m, tau, work, &lwork, &info); + F77_FCN (zgeqrf) (m, n, tmp_data, m, tau, work, lwork, info); delete [] work; @@ -103,8 +103,7 @@ lwork = 32*m; work = new Complex[lwork]; - F77_FCN (zungqr) (&m, &m, &min_mn, tmp_data, &m, tau, work, - &lwork, &info); + F77_FCN (zungqr) (m, m, min_mn, tmp_data, m, tau, work, lwork, info); q = ComplexMatrix (tmp_data, m, m); q.resize (m, n2); diff -r 5cca5ae20299 -r 97eac19837dc liboctave/CmplxQRP.cc --- a/liboctave/CmplxQRP.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/CmplxQRP.cc Tue Apr 11 15:58:32 1995 +0000 @@ -34,11 +34,11 @@ extern "C" { - int F77_FCN (zgeqpf) (const int*, const int*, Complex*, const int*, - int*, Complex*, Complex*, double*, int*); + int F77_FCN (zgeqpf) (const int&, const int&, Complex*, const int&, + int*, Complex*, Complex*, double*, int&); - int F77_FCN (zungqr) (const int*, const int*, const int*, Complex*, - const int*, Complex*, Complex*, const int*, int*); + int F77_FCN (zungqr) (const int&, const int&, const int&, Complex*, + const int&, Complex*, Complex*, const int&, int&); } // It would be best to share some of this code with ComplexQR class... @@ -83,7 +83,7 @@ for (int i = 0; i < n; i++) jpvt[i] = 0; - F77_FCN (zgeqpf) (&m, &n, tmp_data, &m, jpvt, tau, work, rwork, &info); + F77_FCN (zgeqpf) (m, n, tmp_data, m, jpvt, tau, work, rwork, info); // Form Permutation matrix (if economy is requested, return the // indices only!) @@ -126,8 +126,7 @@ lwork = 32*m; work = new Complex[lwork]; - F77_FCN (zungqr) (&m, &m, &min_mn, tmp_data, &m, tau, work, - &lwork, &info); + F77_FCN (zungqr) (m, m, min_mn, tmp_data, m, tau, work, lwork, info); q = ComplexMatrix (tmp_data, m, m); q.resize (m, n2); diff -r 5cca5ae20299 -r 97eac19837dc liboctave/CmplxSCHUR.cc --- a/liboctave/CmplxSCHUR.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/CmplxSCHUR.cc Tue Apr 11 15:58:32 1995 +0000 @@ -32,23 +32,23 @@ extern "C" { - int F77_FCN (zgeesx) (const char*, const char*, int (*)(Complex*), - const char*, const int*, Complex*, const int*, - int*, Complex*, Complex*, const int*, double*, - double*, Complex*, const int*, double*, int*, - int*, long, long); + int F77_FCN (zgeesx) (const char*, const char*, int (*)(const Complex&), + const char*, const int&, Complex*, const int&, + int&, Complex*, Complex*, const int&, double&, + double&, Complex*, const int&, double*, int*, + int&, long, long); } static int -complex_select_ana (Complex *a) +complex_select_ana (const Complex& a) { - return a->real () < 0.0; + return a.real () < 0.0; } static int -complex_select_dig (Complex *a) +complex_select_dig (const Complex& a) { - return (abs (*a) < 1.0); + return (abs (a) < 1.0); } int @@ -63,14 +63,14 @@ return -1; } - char jobvs = 'V'; - char sort; + char *jobvs = "V"; + char *sort; if (*ord == 'A' || *ord == 'D' || *ord == 'a' || *ord == 'd') - sort = 'S'; + sort = "S"; else - sort = 'N'; + sort = "N"; - char sense = 'N'; + char *sense = "N"; int n = a_nc; int lwork = 8 * n; @@ -95,21 +95,21 @@ if (*ord == 'A' || *ord == 'a') { - F77_FCN (zgeesx) (&jobvs, &sort, complex_select_ana, &sense, - &n, s, &n, &sdim, w, q, &n, &rconde, &rcondv, - work, &lwork, rwork, bwork, &info, 1L, 1L); + F77_FCN (zgeesx) (jobvs, sort, complex_select_ana, sense, + n, s, n, sdim, w, q, n, rconde, rcondv, + work, lwork, rwork, bwork, info, 1L, 1L); } else if (*ord == 'D' || *ord == 'd') { - F77_FCN (zgeesx) (&jobvs, &sort, complex_select_dig, &sense, - &n, s, &n, &sdim, w, q, &n, &rconde, &rcondv, - work, &lwork, rwork, bwork, &info, 1L, 1L); + F77_FCN (zgeesx) (jobvs, sort, complex_select_dig, sense, + n, s, n, sdim, w, q, n, rconde, rcondv, + work, lwork, rwork, bwork, info, 1L, 1L); } else { - F77_FCN (zgeesx) (&jobvs, &sort, (void *) 0, &sense, &n, s, - &n, &sdim, w, q, &n, &rconde, &rcondv, work, - &lwork, rwork, bwork, &info, 1L, 1L); + F77_FCN (zgeesx) (jobvs, sort, (void *) 0, sense, n, s, + n, sdim, w, q, n, rconde, rcondv, work, + lwork, rwork, bwork, info, 1L, 1L); } schur_mat = ComplexMatrix (s, n, n); diff -r 5cca5ae20299 -r 97eac19837dc liboctave/CmplxSVD.cc --- a/liboctave/CmplxSVD.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/CmplxSVD.cc Tue Apr 11 15:58:32 1995 +0000 @@ -31,10 +31,10 @@ extern "C" { - int F77_FCN (zgesvd) (const char*, const char*, const int*, - const int*, Complex*, const int*, double*, - Complex*, const int*, Complex*, const int*, - Complex*, const int*, double*, int*, long, long); + int F77_FCN (zgesvd) (const char*, const char*, const int&, + const int&, Complex*, const int&, double*, + Complex*, const int&, Complex*, const int&, + Complex*, const int&, double*, int&, long, long); } int @@ -50,8 +50,8 @@ int min_mn = m < n ? m : n; int max_mn = m > n ? m : n; - char jobu = 'A'; - char jobv = 'A'; + char *jobu = "A"; + char *jobv = "A"; int ncol_u = m; int nrow_vt = n; @@ -60,7 +60,7 @@ if (svd_type == SVD::economy) { - jobu = jobv = 'S'; + jobu = jobv = "S"; ncol_u = nrow_vt = nrow_s = ncol_s = min_mn; } @@ -74,8 +74,8 @@ int lrwork = 5*max_mn; double *rwork = new double[lrwork]; - F77_FCN (zgesvd) (&jobu, &jobv, &m, &n, tmp_data, &m, s_vec, u, &m, - vt, &nrow_vt, work, &lwork, rwork, &info, 1L, 1L); + F77_FCN (zgesvd) (jobu, jobv, m, n, tmp_data, m, s_vec, u, m, + vt, nrow_vt, work, lwork, rwork, info, 1L, 1L); left_sm = ComplexMatrix (u, m, ncol_u); sigma = DiagMatrix (s_vec, nrow_s, ncol_s); diff -r 5cca5ae20299 -r 97eac19837dc liboctave/CollocWt.cc --- a/liboctave/CollocWt.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/CollocWt.cc Tue Apr 11 15:58:32 1995 +0000 @@ -33,10 +33,10 @@ extern "C" { - int F77_FCN (jcobi) (int*, int*, int*, int*, double*, double*, + int F77_FCN (jcobi) (int&, int&, int&, int&, double&, double&, double*, double*, double*, double*); - int F77_FCN (dfopr) (int*, int*, int*, int*, int*, int*, + int F77_FCN (dfopr) (int&, int&, int&, int&, int&, int&, double*, double*, double*, double*, double*); } @@ -275,7 +275,7 @@ // Compute roots. - F77_FCN (jcobi) (&nt, &n, &inc_left, &inc_right, &Alpha, &Beta, + F77_FCN (jcobi) (nt, n, inc_left, inc_right, Alpha, Beta, dif1, dif2, dif3, pr); int id; @@ -286,7 +286,7 @@ id = 1; for (i = 1; i <= nt; i++) { - F77_FCN (dfopr) (&nt, &n, &inc_left, &inc_right, &i, &id, dif1, + F77_FCN (dfopr) (nt, n, inc_left, inc_right, i, id, dif1, dif2, dif3, pr, vect); for (j = 0; j < nt; j++) @@ -298,7 +298,7 @@ id = 2; for (i = 1; i <= nt; i++) { - F77_FCN (dfopr) (&nt, &n, &inc_left, &inc_right, &i, &id, dif1, + F77_FCN (dfopr) (nt, n, inc_left, inc_right, i, id, dif1, dif2, dif3, pr, vect); for (j = 0; j < nt; j++) @@ -309,7 +309,7 @@ id = 3; double *pq = q.fortran_vec (); - F77_FCN (dfopr) (&nt, &n, &inc_left, &inc_right, &i, &id, dif1, + F77_FCN (dfopr) (nt, n, inc_left, inc_right, i, id, dif1, dif2, dif3, pr, pq); delete [] dif1; diff -r 5cca5ae20299 -r 97eac19837dc liboctave/DASSL.cc --- a/liboctave/DASSL.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/DASSL.cc Tue Apr 11 15:58:32 1995 +0000 @@ -31,14 +31,14 @@ extern "C" { - int F77_FCN (ddassl) (int (*)(double*, double*, double*, double*, - int*, double*, int*), - const int*, double*, double*, double*, - double*, const int*, const double*, - const double*, int*, double*, const int*, - int*, const int*, const double*, const int*, - int (*)(double*, double*, double*, double*, - double*, double*, int*)); + int F77_FCN (ddassl) (int (*)(const double&, double*, double*, + double*, int&, double*, int*), + const int&, double&, double*, double*, + double&, const int*, const double&, + const double&, int&, double*, const int&, + int*, const int&, const double*, const int*, + int (*)(const double&, double*, double*, + double*, const double&, double*, int*)); } static DAEFunc::DAERHSFunc user_fun; @@ -190,8 +190,8 @@ } int -ddassl_f (double *time, double *state, double *deriv, double *delta, - int *ires, double *rpar, int *ipar) +ddassl_f (const double& time, double *state, double *deriv, + double *delta, int& ires, double *rpar, int *ipar) { Vector tmp_deriv (nn); Vector tmp_state (nn); @@ -203,10 +203,10 @@ tmp_state.elem (i) = state [i]; } - tmp_delta = user_fun (tmp_state, tmp_deriv, *time); + tmp_delta = user_fun (tmp_state, tmp_deriv, time); if (tmp_delta.length () == 0) - *ires = -2; + ires = -2; else { for (i = 0; i < nn; i++) @@ -217,8 +217,8 @@ } int -ddassl_j (double *time, double *state, double *deriv, double *pd, - double *cj, double *rpar, int *ipar) +ddassl_j (const double& time, double *state, double *deriv, double *pd, + const double& cj, double *rpar, int *ipar) { Vector tmp_state (nn); Vector tmp_deriv (nn); @@ -232,11 +232,11 @@ tmp_jac.dfdxdot = &tmp_dfdxdot; tmp_jac.dfdx = &tmp_dfdx; - tmp_jac = user_jac (tmp_state, tmp_deriv, *time); + tmp_jac = user_jac (tmp_state, tmp_deriv, time); // Fix up the matrix of partial derivatives for dassl. - tmp_dfdx = tmp_dfdx + (tmp_dfdxdot * (*cj)); + tmp_dfdx = tmp_dfdx + cj * tmp_dfdxdot; for (int j = 0; j < nn; j++) for (int i = 0; i < nn; i++) @@ -289,8 +289,8 @@ else info[6] = 0; - double dummy; - int idummy; + double *dummy; + int *idummy; if (restart) { @@ -300,9 +300,9 @@ // again: - F77_FCN (ddassl) (ddassl_f, &n, &t, px, pxdot, &tout, info, - &rel_tol, &abs_tol, &idid, rwork, &lrw, iwork, - &liw, &dummy, &idummy, ddassl_j); + F77_FCN (ddassl) (ddassl_f, n, t, px, pxdot, tout, info, + rel_tol, abs_tol, idid, rwork, lrw, iwork, + liw, dummy, idummy, ddassl_j); switch (idid) { diff -r 5cca5ae20299 -r 97eac19837dc liboctave/EIG.cc --- a/liboctave/EIG.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/EIG.cc Tue Apr 11 15:58:32 1995 +0000 @@ -32,15 +32,15 @@ extern "C" { - int F77_FCN (dgeev) (const char*, const char*, const int*, double*, - const int*, double*, double*, double*, - const int*, double*, const int*, double*, - const int*, int*, long, long); + int F77_FCN (dgeev) (const char*, const char*, const int&, double*, + const int&, double*, double*, double*, + const int&, double*, const int&, double*, + const int&, int&, long, long); - int F77_FCN (zgeev) (const char*, const char*, const int*, Complex*, - const int*, Complex*, Complex*, const int*, - Complex*, const int*, Complex*, const int*, - double*, int*, long, long); + int F77_FCN (zgeev) (const char*, const char*, const int&, Complex*, + const int&, Complex*, Complex*, const int&, + Complex*, const int&, Complex*, const int&, + double*, int&, long, long); } int @@ -57,9 +57,6 @@ int info; - char jobvl = 'N'; - char jobvr = 'V'; - double *tmp_data = dup (a.data (), a.length ()); double *wr = new double[n]; double *wi = new double[n]; @@ -68,11 +65,11 @@ int lwork = 8*n; double *work = new double[lwork]; - double dummy; + double *dummy; int idummy = 1; - F77_FCN (dgeev) (&jobvl, &jobvr, &n, tmp_data, &n, wr, wi, &dummy, - &idummy, pvr, &n, work, &lwork, &info, 1L, 1L); + F77_FCN (dgeev) ("N", "V", n, tmp_data, n, wr, wi, dummy, + idummy, pvr, n, work, lwork, info, 1L, 1L); lambda.resize (n); v.resize (n, n); @@ -128,9 +125,6 @@ int info; - char jobvl = 'N'; - char jobvr = 'V'; - lambda.resize (n); v.resize (n, n); @@ -143,12 +137,11 @@ Complex *work = new Complex[lwork]; double *rwork = new double[4*n]; - Complex dummy; + Complex *dummy; int idummy = 1; - F77_FCN (zgeev) (&jobvl, &jobvr, &n, tmp_data, &n, pw, &dummy, - &idummy, pvr, &n, work, &lwork, rwork, &info, 1L, - 1L); + F77_FCN (zgeev) ("N", "V", n, tmp_data, n, pw, dummy, idummy, pvr, + n, work, lwork, rwork, info, 1L, 1L); delete [] tmp_data; delete [] work; diff -r 5cca5ae20299 -r 97eac19837dc liboctave/LSODE.cc --- a/liboctave/LSODE.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/LSODE.cc Tue Apr 11 15:58:32 1995 +0000 @@ -35,12 +35,14 @@ extern "C" { - int F77_FCN (lsode) (int (*)(int*, double*, double*, double*, int*), - int *, double *, double *, double *, - int *, double *, double *, int *, int *, int *, - double *, int *, int *, int *, - int (*)(int*, double*, double*, int*, int*, - double*, int*), int *); + int F77_FCN (lsode) (int (*)(const int&, const double&, double*, + double*, int&), + int&, double*, double&, double&, int&, + double&, double&, int&, int&, int&, + double*, int&, int*, int&, + int (*)(const int&, const double&, double*, + const int&, const int&, double*, + const int&), int&); } static ODEFunc::ODERHSFunc user_fun; @@ -148,23 +150,23 @@ } int -lsode_f (int *neq, double *time, double *state, double *deriv, int *ierr) +lsode_f (const int& neq, const double& time, double *state, + double *deriv, int& ierr) { - int nn = *neq; - ColumnVector tmp_deriv (nn); + ColumnVector tmp_deriv (neq); /* * NOTE: this won't work if LSODE passes copies of the state vector. * In that case we have to create a temporary vector object * and copy. */ - tmp_deriv = (*user_fun) (*tmp_x, *time); + tmp_deriv = (*user_fun) (*tmp_x, time); if (tmp_deriv.length () == 0) - *ierr = -1; + ierr = -1; else { - for (int i = 0; i < nn; i++) + for (int i = 0; i < neq; i++) deriv [i] = tmp_deriv.elem (i); } @@ -172,22 +174,21 @@ } int -lsode_j (int *neq, double *time, double *state, int *ml, int *mu, - double *pd, int *nrowpd) +lsode_j (const int& neq, const double& time, double *state, + const int& ml, const int& mu, double *pd, const int& nrowpd) { - int nn = *neq; - Matrix tmp_jac (nn, nn); + Matrix tmp_jac (neq, neq); /* * NOTE: this won't work if LSODE passes copies of the state vector. * In that case we have to create a temporary vector object * and copy. */ - tmp_jac = (*user_jac) (*tmp_x, *time); + tmp_jac = (*user_jac) (*tmp_x, time); - for (int j = 0; j < nn; j++) - for (int i = 0; i < nn; i++) - pd [*nrowpd * j + i] = tmp_jac (i, j); + for (int j = 0; j < neq; j++) + for (int i = 0; i < neq; i++) + pd [nrowpd * j + i] = tmp_jac (i, j); return 0; } @@ -242,10 +243,9 @@ again: - (void) F77_FCN (lsode) (lsode_f, &n, xp, &t, &tout, &itol, - &rel_tol, &abs_tol, &itask, &istate, &iopt, - rwork, &lrw, iwork, &liw, lsode_j, - &method_flag); + (void) F77_FCN (lsode) (lsode_f, n, xp, t, tout, itol, rel_tol, + abs_tol, itask, istate, iopt, rwork, lrw, + iwork, liw, lsode_j, method_flag); switch (istate) { diff -r 5cca5ae20299 -r 97eac19837dc liboctave/NLEqn.cc --- a/liboctave/NLEqn.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/NLEqn.cc Tue Apr 11 15:58:32 1995 +0000 @@ -36,12 +36,12 @@ extern "C" { int F77_FCN (hybrd1) (int (*)(int*, double*, double*, int*), - const int*, double*, double*, const double*, - int*, double*, const int*); + const int&, double*, double*, const double&, + int&, double*, const int&); int F77_FCN (hybrj1) (int (*)(int*, double*, double*, double*, int*, int*), - const int*, double*, double*, double*, const int*, - const double*, int*, double*, const int*); + const int&, double*, double*, double*, const int&, + const double&, int&, double*, const int&); } static nonlinear_fcn user_fun; @@ -205,8 +205,6 @@ Vector NLEqn::solve (int& info) { - int tmp_info = 0; - if (n == 0) { error ("equation set not initialized"); @@ -229,8 +227,8 @@ double *wa = new double [lwa]; double *fjac = new double [n*n]; - F77_FCN (hybrj1) (hybrj1_fcn, &n, px, fvec, fjac, &n, &tol, - &tmp_info, wa, &lwa); + F77_FCN (hybrj1) (hybrj1_fcn, n, px, fvec, fjac, n, tol, info, + wa, lwa); delete [] wa; delete [] fjac; @@ -240,15 +238,13 @@ int lwa = (n*(3*n+13))/2; double *wa = new double [lwa]; - F77_FCN (hybrd1) (hybrd1_fcn, &n, px, fvec, &tol, &tmp_info, wa, &lwa); + F77_FCN (hybrd1) (hybrd1_fcn, n, px, fvec, tol, info, wa, lwa); delete [] wa; } Vector retval; - info = tmp_info; - if (info >= 0) { retval.resize (n); diff -r 5cca5ae20299 -r 97eac19837dc liboctave/NPSOL.cc --- a/liboctave/NPSOL.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/NPSOL.cc Tue Apr 11 15:58:32 1995 +0000 @@ -40,17 +40,18 @@ extern "C" { - int F77_FCN (npoptn) (char *, long); + int F77_FCN (npoptn) (const char*, long); - int F77_FCN (npsol) (int *, int *, int *, int *, int *, int *, - double *, double *, double *, - int (*)(int*, int*, int*, int*, int*, double*, - double*, double*, int*), - int (*)(int*, int*, double*, double*, double*, int*), - int *, int *, int *, double *, - double *, double *, double *, double *, - double *, double *, int *, int *, double *, - int *); + int F77_FCN (npsol) (int&, int&, int&, int&, int&, int&, double*, + double*, double*, + int (*)(int&, const int&, const int&, const + int&, int*, double*, double*, double*, + int*), + int (*)(int&, const int&, double*, double*, + double*, int*), + int&, int&, int*, double*, double*, double*, + double&, double*, double*, double*, int*, int&, + double*, int&); } // XXX FIXME XXX -- would be nice to not have to have this global @@ -65,24 +66,23 @@ static jacobian_fcn user_jac; int -npsol_objfun (int *mode, int *n, double *xx, double *objf, - double *objgrd, int *nstate) +npsol_objfun (int& mode, const int& n, double *xx, double *objf, + double *objgrd, int* nstate) { - int nn = *n; - Vector tmp_x (nn); + Vector tmp_x (n); npsol_objective_error = 0; - for (int i = 0; i < nn; i++) + for (int i = 0; i < n; i++) tmp_x.elem (i) = xx[i]; - if (*mode == 0 || *mode == 2) + if (mode == 0 || mode == 2) { double value = (*user_phi) (tmp_x); if (npsol_objective_error) { - *mode = -1; + mode = -1; return 0; } @@ -93,17 +93,17 @@ #endif } - if ((*mode == 1 || *mode == 2) && user_grad) + if ((mode == 1 || mode == 2) && user_grad) { - Vector tmp_grad (nn); + Vector tmp_grad (n); tmp_grad = (*user_grad) (tmp_x); if (tmp_grad.length () == 0) - *mode = -1; + mode = -1; else { - for (i = 0; i < nn; i++) + for (i = 0; i < n; i++) objgrd[i] = tmp_grad.elem (i); } } @@ -112,42 +112,42 @@ } int -npsol_confun (int *mode, int *ncnln, int *n, int *nrowj, int *needc, - double *xx, double *cons, double *cjac, int *nstate) +npsol_confun (int& mode, const int& ncnln, const int& n, + const int& nrowj, int* needc, double *xx, + double *cons, double *cjac, int* nstate) { - int nn = *n, nncnln = *ncnln; - Vector tmp_x (nn); - Vector tmp_c (nncnln); + Vector tmp_x (n); + Vector tmp_c (ncnln); - for (int i = 0; i < nn; i++) + for (int i = 0; i < n; i++) tmp_x.elem (i) = xx[i]; tmp_c = (*user_g) (tmp_x); if (tmp_c.length () == 0) { - *mode = -1; + mode = -1; return 0; } else { - for (i = 0; i < nncnln; i++) + for (i = 0; i < ncnln; i++) cons[i] = tmp_c.elem (i); } if (user_jac) { - Matrix tmp_jac (nncnln, nn); + Matrix tmp_jac (ncnln, n); tmp_jac = (*user_jac) (tmp_x); if (tmp_jac.rows () == 0 || tmp_jac.columns () == 0) - *mode = -1; + mode = -1; else { - int ld = *nrowj; - for (int j = 0; j < nn; j++) - for (i = 0; i < nncnln; i++) + int ld = nrowj; + for (int j = 0; j < n; j++) + for (i = 0; i < ncnln; i++) cjac[i+j*ld] = tmp_jac (i, j); } } @@ -300,10 +300,10 @@ while (attempt++ < 5) { - F77_FCN (npsol) (&n, &nclin, &ncnln, &nrowa, &nrowj, &nrowr, pclin, - clow, cup, npsol_confun, npsol_objfun, &inform, - &iter, istate, c, cjac, pclambda, &objf, objgrd, r, - px, iw, &leniw, w, &lenw); + F77_FCN (npsol) (n, nclin, ncnln, nrowa, nrowj, nrowr, pclin, + clow, cup, npsol_confun, npsol_objfun, inform, + iter, istate, c, cjac, pclambda, objf, objgrd, r, + px, iw, leniw, w, lenw); if (inform == 6 || inform == 1) continue; diff -r 5cca5ae20299 -r 97eac19837dc liboctave/QLD.cc --- a/liboctave/QLD.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/QLD.cc Tue Apr 11 15:58:32 1995 +0000 @@ -36,10 +36,10 @@ extern "C" { - int F77_FCN (qld) (int*, int*, int*, int*, int*, double*, double*, + int F77_FCN (qld) (int&, int&, int&, int&, int&, double*, double*, double*, double*, double*, double*, double*, - double*, int*, int*, int*, double*, int*, int*, - int*); + double*, int&, int&, int&, double*, int&, int*, + int&); } Vector @@ -107,12 +107,12 @@ int mmax = m > 0 ? m : 1; iprint = 1; - F77_FCN (qld) (&m, &me, &mmax, &n, &n, ph, pc, pa, pb, pxl, pxu, px, - u, &iout, &inform, &iprint, war, &lwar, iwar, &liwar); + F77_FCN (qld) (m, me, mmax, n, n, ph, pc, pa, pb, pxl, pxu, px, + u, iout, inform, iprint, war, lwar, iwar, liwar); - delete war; - delete iwar; - delete u; + delete [] war; + delete [] iwar; + delete [] u; objf = (x.transpose () * H * x) / 2.0; if (c.capacity () > 0) diff -r 5cca5ae20299 -r 97eac19837dc liboctave/QPSOL.cc --- a/liboctave/QPSOL.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/QPSOL.cc Tue Apr 11 15:58:32 1995 +0000 @@ -35,28 +35,24 @@ extern "C" { - int F77_FCN (qpsol) (int*, int*, int*, int*, int*, int*, int*, int*, - double*, double*, double*, double*, double*, + int F77_FCN (qpsol) (int&, int&, int&, int&, int&, int&, int&, int&, + double&, double*, double*, double*, double*, double*, double*, - int (*)(int*, int*, int*, int*, double*, - double*, double*), - int*, int*, int*, int*, double*, int*, int*, - double*, double*, int*, int*, double*, int*); + int (*)(const int&, const int&, const int&, + const int&, double*, double*, double*), + int&, int&, int&, int*, double*, int&, int&, + double&, double*, int*, int&, double*, int&); - int F77_FCN (dgemv) (const char*, const int*, const int*, - const double*, const double*, const int*, - const double*, const int*, const double*, - double*, const int*, long); + int F77_FCN (dgemv) (const char*, const int&, const int&, + const double&, const double*, const int&, + const double*, const int&, const double&, + double*, const int&, long); } int -qphess (int *pn, int *pnrowh, int *ncolh, int *pcol, double *hess, - double *x, double *hx) +qphess (const int& n, const int& nrowh, const int& ncolh, + const int& jthcol, double *hess, double *x, double *hx) { - int n = *pn; - int nrowh = *pnrowh; - int jthcol = *pcol; - if (jthcol > 0) { int hp = (jthcol - 1) * nrowh; @@ -65,13 +61,7 @@ } else { - char trans = 'N'; - double alpha = 1.0; - double beta = 0.0; - int i_one = 1; - - F77_FCN (dgemv) (&trans, pn, pn, &alpha, hess, pn, x, &i_one, - &beta, hx, &i_one, 1L); + F77_FCN (dgemv) ("N", n, n, 1.0, hess, n, x, 1, 0.0, hx, 1, 1L); } return 0; @@ -159,10 +149,10 @@ int *iw = new int [leniw]; double *w = new double [lenw]; - F77_FCN (qpsol) (&itmax, &msglvl, &n, &nclin, &nctotl, &ncon, &n, - &n, &bigbnd, pa, pbl, pbu, pc, featol, ph, qphess, - &cold, &lp, &orthog, istate, px, &inform, &iter, - &objf, pclambda, iw, &leniw, w, &lenw); + F77_FCN (qpsol) (itmax, msglvl, n, nclin, nctotl, ncon, n, + n, bigbnd, pa, pbl, pbu, pc, featol, ph, qphess, + cold, lp, orthog, istate, px, inform, iter, + objf, pclambda, iw, leniw, w, lenw); delete [] pbl; delete [] pbu; diff -r 5cca5ae20299 -r 97eac19837dc liboctave/Quad.cc --- a/liboctave/Quad.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/Quad.cc Tue Apr 11 15:58:32 1995 +0000 @@ -42,16 +42,16 @@ extern "C" { - int F77_FCN (dqagp) (const double (*)(double*, int*), const double*, - const double*, const int*, const double*, - const double*, const double*, double*, double*, - int*, int*, const int*, const int*, int*, int*, - double*); + int F77_FCN (dqagp) (const double (*)(double*, int&), + const double&, const double&, const int&, + const double*, const double&, const double&, + double&, double&, int&, int&, const int&, + const int&, int&, int*, double*); - int F77_FCN (dqagi) (const double (*)(double*, int*), const double*, - const int*, const double*, const double*, - double*, double*, int*, int*, const int*, - const int*, int*, int*, double*); + int F77_FCN (dqagi) (const double (*)(double*, int&), const double&, + const int&, const double&, const double&, + double&, double&, int&, int&, const int&, + const int&, int&, int*, double*); } Quad::Quad (integrand_fcn fcn) @@ -88,7 +88,7 @@ } static double -user_function (double *x, int *ierr) +user_function (double *x, int& ierr) { #if defined (sun) && defined (__GNUC__) double xx = access_double (x); @@ -101,7 +101,7 @@ double retval = (*user_fcn) (xx); if (quad_integration_error) - *ierr = -1; + ierr = -1; return retval; } @@ -175,9 +175,9 @@ double abs_tol = absolute_tolerance (); double rel_tol = relative_tolerance (); - F77_FCN (dqagp) (user_function, &lower_limit, &upper_limit, &npts, - points, &abs_tol, &rel_tol, &result, &abserr, - &neval, &ier, &leniw, &lenw, &last, iwork, work); + F77_FCN (dqagp) (user_function, lower_limit, upper_limit, npts, + points, abs_tol, rel_tol, result, abserr, + neval, ier, leniw, lenw, last, iwork, work); delete [] iwork; delete [] work; @@ -243,9 +243,9 @@ double abs_tol = absolute_tolerance (); double rel_tol = relative_tolerance (); - F77_FCN (dqagi) (user_function, &bound, &inf, &abs_tol, &rel_tol, - &result, &abserr, &neval, &ier, &leniw, &lenw, - &last, iwork, work); + F77_FCN (dqagi) (user_function, bound, inf, abs_tol, rel_tol, + result, abserr, neval, ier, leniw, lenw, + last, iwork, work); delete [] iwork; delete [] work; diff -r 5cca5ae20299 -r 97eac19837dc liboctave/dColVector.cc --- a/liboctave/dColVector.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/dColVector.cc Tue Apr 11 15:58:32 1995 +0000 @@ -38,10 +38,10 @@ extern "C" { - int F77_FCN (dgemv) (const char*, const int*, const int*, - const double*, const double*, const int*, - const double*, const int*, const double*, - double*, const int*, long); + int F77_FCN (dgemv) (const char*, const int&, const int&, + const double&, const double*, const int&, + const double*, const int&, const double&, + double*, const int&, long); } /* @@ -221,16 +221,12 @@ if (nr == 0 || nc == 0) return ColumnVector (0); - char trans = 'N'; int ld = nr; - double alpha = 1.0; - double beta = 0.0; - int i_one = 1; double *y = new double [nr]; - F77_FCN (dgemv) (&trans, &nr, &nc, &alpha, m.data (), &ld, a.data (), - &i_one, &beta, y, &i_one, 1L); + F77_FCN (dgemv) ("N", nr, nc, 1.0, m.data (), ld, a.data (), 1, 0.0, + y, 1, 1L); return ColumnVector (y, nr); } diff -r 5cca5ae20299 -r 97eac19837dc liboctave/dMatrix.cc --- a/liboctave/dMatrix.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/dMatrix.cc Tue Apr 11 15:58:32 1995 +0000 @@ -43,36 +43,35 @@ extern "C" { - int F77_FCN (dgemm) (const char*, const char*, const int*, - const int*, const int*, const double*, - const double*, const int*, const double*, - const int*, const double*, double*, const int*, + int F77_FCN (dgemm) (const char*, const char*, const int&, + const int&, const int&, const double&, + const double*, const int&, const double*, + const int&, const double&, double*, const int&, long, long); - int F77_FCN (dgeco) (double*, const int*, const int*, int*, double*, + int F77_FCN (dgeco) (double*, const int&, const int&, int*, double&, double*); - int F77_FCN (dgesl) (const double*, const int*, const int*, - const int*, double*, const int*); + int F77_FCN (dgesl) (const double*, const int&, const int&, + const int*, double*, const int&); - int F77_FCN (dgedi) (double*, const int*, const int*, const int*, - double*, double*, const int*); + int F77_FCN (dgedi) (double*, const int&, const int&, const int*, + double*, double*, const int&); - int F77_FCN (dgelss) (const int*, const int*, const int*, double*, - const int*, double*, const int*, double*, - const double*, int*, double*, const int*, - int*); + int F77_FCN (dgelss) (const int&, const int&, const int&, double*, + const int&, double*, const int&, double*, + double&, int&, double*, const int&, int&); // Note that the original complex fft routines were not written for // double complex arguments. They have been modified by adding an // implicit double precision (a-h,o-z) statement at the beginning of // each subroutine. - int F77_FCN (cffti) (const int*, Complex*); + int F77_FCN (cffti) (const int&, Complex*); - int F77_FCN (cfftf) (const int*, Complex*, Complex*); + int F77_FCN (cfftf) (const int&, Complex*, Complex*); - int F77_FCN (cfftb) (const int*, Complex*, Complex*); + int F77_FCN (cfftb) (const int&, Complex*, Complex*); } /* @@ -515,7 +514,7 @@ double *z = new double [nr]; double *tmp_data = dup (data (), len); - F77_FCN (dgeco) (tmp_data, &nr, &nc, ipvt, &rcond, z); + F77_FCN (dgeco) (tmp_data, nr, nc, ipvt, rcond, z); volatile double rcond_plus_one = rcond + 1.0; if (rcond_plus_one == 1.0) @@ -525,10 +524,9 @@ } else { - int job = 1; - double dummy; + double *dummy; - F77_FCN (dgedi) (tmp_data, &nr, &nc, ipvt, &dummy, z, &job); + F77_FCN (dgedi) (tmp_data, nr, nc, ipvt, dummy, z, 1); } delete [] ipvt; @@ -595,10 +593,10 @@ Complex *wsave = new Complex [nn]; Complex *tmp_data = make_complex (data (), length ()); - F77_FCN (cffti) (&npts, wsave); + F77_FCN (cffti) (npts, wsave); for (int j = 0; j < nsamples; j++) - F77_FCN (cfftf) (&npts, &tmp_data[npts*j], wsave); + F77_FCN (cfftf) (npts, &tmp_data[npts*j], wsave); delete [] wsave; @@ -626,10 +624,10 @@ Complex *wsave = new Complex [nn]; Complex *tmp_data = make_complex (data (), length ()); - F77_FCN (cffti) (&npts, wsave); + F77_FCN (cffti) (npts, wsave); for (int j = 0; j < nsamples; j++) - F77_FCN (cfftb) (&npts, &tmp_data[npts*j], wsave); + F77_FCN (cfftb) (npts, &tmp_data[npts*j], wsave); for (j = 0; j < npts*nsamples; j++) tmp_data[j] = tmp_data[j] / (double) npts; @@ -660,10 +658,10 @@ Complex *wsave = new Complex [nn]; Complex *tmp_data = make_complex (data (), length ()); - F77_FCN (cffti) (&npts, wsave); + F77_FCN (cffti) (npts, wsave); for (int j = 0; j < nsamples; j++) - F77_FCN (cfftf) (&npts, &tmp_data[npts*j], wsave); + F77_FCN (cfftf) (npts, &tmp_data[npts*j], wsave); delete [] wsave; @@ -673,14 +671,14 @@ wsave = new Complex [nn]; Complex *row = new Complex[npts]; - F77_FCN (cffti) (&npts, wsave); + F77_FCN (cffti) (npts, wsave); for (j = 0; j < nsamples; j++) { for (int i = 0; i < npts; i++) row[i] = tmp_data[i*nr + j]; - F77_FCN (cfftf) (&npts, row, wsave); + F77_FCN (cfftf) (npts, row, wsave); for (i = 0; i < npts; i++) tmp_data[i*nr + j] = row[i]; @@ -713,10 +711,10 @@ Complex *wsave = new Complex [nn]; Complex *tmp_data = make_complex (data (), length ()); - F77_FCN (cffti) (&npts, wsave); + F77_FCN (cffti) (npts, wsave); for (int j = 0; j < nsamples; j++) - F77_FCN (cfftb) (&npts, &tmp_data[npts*j], wsave); + F77_FCN (cfftb) (npts, &tmp_data[npts*j], wsave); delete [] wsave; @@ -729,14 +727,14 @@ wsave = new Complex [nn]; Complex *row = new Complex[npts]; - F77_FCN (cffti) (&npts, wsave); + F77_FCN (cffti) (npts, wsave); for (j = 0; j < nsamples; j++) { for (int i = 0; i < npts; i++) row[i] = tmp_data[i*nr + j]; - F77_FCN (cfftb) (&npts, row, wsave); + F77_FCN (cfftb) (npts, row, wsave); for (i = 0; i < npts; i++) tmp_data[i*nr + j] = row[i] / (double) npts; @@ -786,7 +784,7 @@ double *z = new double [nr]; double *tmp_data = dup (data (), length ()); - F77_FCN (dgeco) (tmp_data, &nr, &nr, ipvt, &rcond, z); + F77_FCN (dgeco) (tmp_data, nr, nr, ipvt, rcond, z); volatile double rcond_plus_one = rcond + 1.0; if (rcond_plus_one == 1.0) @@ -796,9 +794,8 @@ } else { - int job = 10; double d[2]; - F77_FCN (dgedi) (tmp_data, &nr, &nr, ipvt, d, z, &job); + F77_FCN (dgedi) (tmp_data, nr, nr, ipvt, d, z, 10); retval = DET (d); } @@ -845,7 +842,7 @@ double *z = new double [nr]; double *tmp_data = dup (data (), length ()); - F77_FCN (dgeco) (tmp_data, &nr, &nr, ipvt, &rcond, z); + F77_FCN (dgeco) (tmp_data, nr, nr, ipvt, rcond, z); volatile double rcond_plus_one = rcond + 1.0; if (rcond_plus_one == 1.0) @@ -854,13 +851,11 @@ } else { - int job = 0; - double *result = dup (b.data (), b.length ()); int b_nc = b.cols (); for (int j = 0; j < b_nc; j++) - F77_FCN (dgesl) (tmp_data, &nr, &nr, ipvt, &result[nr*j], &job); + F77_FCN (dgesl) (tmp_data, nr, nr, ipvt, &result[nr*j], 0); retval = Matrix (result, b.rows (), b_nc); } @@ -927,7 +922,7 @@ double *z = new double [nr]; double *tmp_data = dup (data (), length ()); - F77_FCN (dgeco) (tmp_data, &nr, &nr, ipvt, &rcond, z); + F77_FCN (dgeco) (tmp_data, nr, nr, ipvt, rcond, z); volatile double rcond_plus_one = rcond + 1.0; if (rcond_plus_one == 1.0) @@ -936,13 +931,11 @@ } else { - int job = 0; - int b_len = b.length (); double *result = dup (b.data (), b_len); - F77_FCN (dgesl) (tmp_data, &nr, &nr, ipvt, result, &job); + F77_FCN (dgesl) (tmp_data, nr, nr, ipvt, result, 0); retval = ColumnVector (result, b_len); } @@ -1028,8 +1021,8 @@ double *work = new double [lwork]; - F77_FCN (dgelss) (&m, &n, &nrhs, tmp_data, &m, presult, &nrr, s, - &rcond, &rank, work, &lwork, &info); + F77_FCN (dgelss) (m, n, nrhs, tmp_data, m, presult, nrr, s, rcond, + rank, work, lwork, info); Matrix retval (n, nrhs); for (j = 0; j < nrhs; j++) @@ -1115,8 +1108,8 @@ double *work = new double [lwork]; - F77_FCN (dgelss) (&m, &n, &nrhs, tmp_data, &m, presult, &nrr, s, - &rcond, &rank, work, &lwork, &info); + F77_FCN (dgelss) (m, n, nrhs, tmp_data, m, presult, nrr, s, rcond, + rank, work, lwork, info); ColumnVector retval (n); for (i = 0; i < n; i++) @@ -1260,17 +1253,10 @@ if (len == 0) return Matrix (len, len, 0.0); - char transa = 'N'; - char transb = 'N'; - double alpha = 1.0; - double beta = 0.0; - int anr = 1; - double *c = new double [len * a_len]; - F77_FCN (dgemm) (&transa, &transb, &len, &a_len, &anr, &alpha, - v.data (), &len, a.data (), &anr, &beta, c, &len, - 1L, 1L); + F77_FCN (dgemm) ("N", "N", len, a_len, 1, 1.0, v.data (), + len, a.data (), 1, 0.0, c, len, 1L, 1L); return Matrix (c, len, a_len); } @@ -1519,19 +1505,13 @@ if (nr == 0 || nc == 0 || a_nc == 0) return Matrix (nr, a_nc, 0.0); - char trans = 'N'; - char transa = 'N'; - int ld = nr; int lda = a_nr; - double alpha = 1.0; - double beta = 0.0; - double *c = new double [nr*a_nc]; - F77_FCN (dgemm) (&trans, &transa, &nr, &a_nc, &nc, &alpha, m.data (), - &ld, a.data (), &lda, &beta, c, &nr, 1L, 1L); + F77_FCN (dgemm) ("N", "N", nr, a_nc, nc, 1.0, m.data (), + ld, a.data (), lda, 0.0, c, nr, 1L, 1L); return Matrix (c, nr, a_nc); } diff -r 5cca5ae20299 -r 97eac19837dc liboctave/dRowVector.cc --- a/liboctave/dRowVector.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/dRowVector.cc Tue Apr 11 15:58:32 1995 +0000 @@ -38,13 +38,13 @@ extern "C" { - int F77_FCN (dgemv) (const char*, const int*, const int*, - const double*, const double*, const int*, - const double*, const int*, const double*, - double*, const int*, long); + int F77_FCN (dgemv) (const char*, const int&, const int&, + const double&, const double*, const int&, + const double*, const int&, const double&, + double*, const int&, long); - double F77_FCN (ddot) (const int*, const double*, const int*, - const double*, const int*); + double F77_FCN (ddot) (const int&, const double*, const int&, + const double*, const int&); } /* @@ -226,16 +226,12 @@ int a_nr = a.rows (); int a_nc = a.cols (); - char trans = 'T'; int ld = a_nr; - double alpha = 1.0; - double beta = 0.0; - int i_one = 1; double *y = new double [len]; - F77_FCN (dgemv) (&trans, &a_nc, &a_nr, &alpha, a.data (), &ld, - v.data (), &i_one, &beta, y, &i_one, 1L); + F77_FCN (dgemv) ("T", a_nc, a_nr, 1.0, a.data (), ld, v.data (), + 1, 0.0, y, 1, 1L); return RowVector (y, len); } @@ -363,8 +359,7 @@ return 0.0; } - int i_one = 1; - return F77_FCN (ddot) (&len, v.data (), &i_one, a.data (), &i_one); + return F77_FCN (ddot) (len, v.data (), 1, a.data (), 1); } Complex diff -r 5cca5ae20299 -r 97eac19837dc liboctave/dbleAEPBAL.cc --- a/liboctave/dbleAEPBAL.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/dbleAEPBAL.cc Tue Apr 11 15:58:32 1995 +0000 @@ -30,13 +30,13 @@ extern "C" { - int F77_FCN (dgebal) (const char*, const int*, double*, - const int*, int*, int*, double*, - int*, long, long); + int F77_FCN (dgebal) (const char*, const int&, double*, + const int&, int&, int&, double*, + int&, long, long); - int F77_FCN (dgebak) (const char*, const char*, const int*, const int*, - const int*, double*, const int*, double*, const int*, - int*, long, long); + int F77_FCN (dgebak) (const char*, const char*, const int&, const int&, + const int&, double*, const int&, double*, const int&, + int&, long, long); } int @@ -62,8 +62,8 @@ balanced_mat = a; - F77_FCN (dgebal) (balance_job, &n, balanced_mat.fortran_vec (), - &n, &ilo, &ihi, scale, &info, 1L, 1L); + F77_FCN (dgebal) (balance_job, n, balanced_mat.fortran_vec (), + n, ilo, ihi, scale, info, 1L, 1L); // Initialize balancing matrix to identity. @@ -71,8 +71,8 @@ for (int i = 0; i < n; i++) balancing_mat.elem (i ,i) = 1.0; - F77_FCN (dgebak) (balance_job, "R", &n, &ilo, &ihi, scale, &n, - balancing_mat.fortran_vec (), &n, &info, 1L, 1L); + F77_FCN (dgebak) (balance_job, "R", n, ilo, ihi, scale, n, + balancing_mat.fortran_vec (), n, info, 1L, 1L); delete [] scale; diff -r 5cca5ae20299 -r 97eac19837dc liboctave/dbleCHOL.cc --- a/liboctave/dbleCHOL.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/dbleCHOL.cc Tue Apr 11 15:58:32 1995 +0000 @@ -32,8 +32,8 @@ extern "C" { - int F77_FCN (dpotrf) (const char*, const int*, double*, const int*, - int*, long); + int F77_FCN (dpotrf) (const char*, const int&, double*, const int&, + int&, long); } int @@ -47,14 +47,12 @@ return -1; } - char uplo = 'U'; - int n = a_nc; int info; double *h = dup (a.data (), a.length ()); - F77_FCN (dpotrf) (&uplo, &n, h, &n, &info, 1L); + F77_FCN (dpotrf) ("U", n, h, n, info, 1L); chol_mat = Matrix (h, n, n); diff -r 5cca5ae20299 -r 97eac19837dc liboctave/dbleGEPBAL.cc --- a/liboctave/dbleGEPBAL.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/dbleGEPBAL.cc Tue Apr 11 15:58:32 1995 +0000 @@ -32,21 +32,21 @@ extern "C" { - int F77_FCN (dgebak) (const char*, const char*, const int*, const int*, - const int*, double*, const int*, double*, const int*, - int*, long, long); + int F77_FCN (dgebak) (const char*, const char*, const int&, const int&, + const int&, double*, const int&, double*, const int&, + int&, long, long); - int F77_FCN (reduce) (const int*, const int*, double*, - const int*, double*, - int*, int*, double*, double*); + int F77_FCN (reduce) (const int&, const int&, double*, + const int&, double*, + int&, int&, double*, double*); - int F77_FCN (scaleg) (const int*, const int*, double*, - const int*, double*, - const int*, const int*, double*, double*, double*); + int F77_FCN (scaleg) (const int&, const int&, double*, + const int&, double*, + const int&, const int&, double*, double*, double*); - int F77_FCN (gradeq) (const int*, const int*, double*, - const int*, double*, - int*, int*, double*, double*); + int F77_FCN (gradeq) (const int&, const int&, double*, + const int&, double*, + int&, int&, double*, double*); } int @@ -105,8 +105,8 @@ if (*balance_job == 'P' || *balance_job == 'B') { - F77_FCN (reduce) (&n, &n, balanced_a_mat.fortran_vec (), - &n, balanced_b_mat.fortran_vec (), &ilo, &ihi, + F77_FCN (reduce) (n, n, balanced_a_mat.fortran_vec (), + n, balanced_b_mat.fortran_vec (), ilo, ihi, cscale, wk.fortran_vec ()); } else @@ -122,8 +122,8 @@ if ((*balance_job == 'S' || *balance_job == 'B') && ilo != ihi) { - F77_FCN (scaleg) (&n, &n, balanced_a_mat.fortran_vec (), - &n, balanced_b_mat.fortran_vec (), &ilo, &ihi, + F77_FCN (scaleg) (n, n, balanced_a_mat.fortran_vec (), + n, balanced_b_mat.fortran_vec (), ilo, ihi, cscale, cperm, wk.fortran_vec ()); } else @@ -148,14 +148,14 @@ // Column permutations/scaling. - F77_FCN (dgebak) (balance_job, "R", &n, &ilo, &ihi, cscale, &n, - right_balancing_mat.fortran_vec (), &n, &info, 1L, - 1L); + F77_FCN (dgebak) (balance_job, "R", n, ilo, ihi, cscale, n, + right_balancing_mat.fortran_vec (), n, info, + 1L, 1L); // Row permutations/scaling. - F77_FCN (dgebak) (balance_job, "L", &n, &ilo, &ihi, &wk.elem (0, 0), &n, - left_balancing_mat.fortran_vec (), &n, &info, 1L, 1L); + F77_FCN (dgebak) (balance_job, "L", n, ilo, ihi, wk.fortran_vec (), n, + left_balancing_mat.fortran_vec (), n, info, 1L, 1L); // XXX FIXME XXX --- these four lines need to be added and debugged. // GEPBALANCE::init will work without them, though, so here they are. @@ -163,9 +163,9 @@ #if 0 if ((*balance_job == 'P' || *balance_job == 'B') && ilo != ihi) { - F77_FCN (gradeq) (&n, &n, balanced_a_mat.fortran_vec (), - &n, balanced_b_mat.fortran_vec (), &ilo, &ihi, - cperm, &wk.elem (0, 1)); + F77_FCN (gradeq) (n, n, balanced_a_mat.fortran_vec (), + n, balanced_b_mat.fortran_vec (), ilo, ihi, + cperm, wk.fortran_vec ()); } #endif diff -r 5cca5ae20299 -r 97eac19837dc liboctave/dbleHESS.cc --- a/liboctave/dbleHESS.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/dbleHESS.cc Tue Apr 11 15:58:32 1995 +0000 @@ -32,21 +32,21 @@ extern "C" { - int F77_FCN (dgebal) (const char*, const int*, double*, - const int*, int*, int*, double*, - int*, long, long); + int F77_FCN (dgebal) (const char*, const int&, double*, + const int&, int&, int&, double*, + int&, long, long); - int F77_FCN (dgebak) (const char*, const char*, const int*, const int*, - const int*, double*, const int*, double*, const int*, - int*, long, long); + int F77_FCN (dgehrd) (const int&, const int&, const int&, + double*, const int&, double*, double*, + const int&, int&, long, long); - int F77_FCN (dgehrd) (const int*, const int*, const int*, - double*, const int*, double*, double*, - const int*, int*, long, long); + int F77_FCN (dorghr) (const int&, const int&, const int&, + double*, const int&, double*, double*, + const int&, int&, long, long); - int F77_FCN (dorghr) (const int*, const int*, const int*, - double*, const int*, double*, double*, - const int*, int*, long, long); + int F77_FCN (dgebak) (const char*, const char*, const int&, const int&, + const int&, double*, const int&, double*, const int&, + int&, long, long); } int @@ -60,8 +60,8 @@ return -1; } - char jobbal = 'N'; - char side = 'R'; + char *jobbal = "N"; + char *side = "R"; int n = a_nc; int lwork = 32 * n; @@ -76,19 +76,15 @@ double *z = new double [n*n]; double *work = new double [lwork]; - F77_FCN (dgebal) (&jobbal, &n, h, &n, &ilo, &ihi, scale, &info, - 1L, 1L); + F77_FCN (dgebal) (jobbal, n, h, n, ilo, ihi, scale, info, 1L, 1L); - F77_FCN (dgehrd) (&n, &ilo, &ihi, h, &n, tau, work, &lwork, &info, - 1L, 1L); + F77_FCN (dgehrd) (n, ilo, ihi, h, n, tau, work, lwork, info, 1L, 1L); copy (z, h, n*n); - F77_FCN (dorghr) (&n, &ilo, &ihi, z, &n, tau, work, &lwork, &info, - 1L, 1L); + F77_FCN (dorghr) (n, ilo, ihi, z, n, tau, work, lwork, info, 1L, 1L); - F77_FCN (dgebak) (&jobbal, &side, &n, &ilo, &ihi, scale, &n, z, &n, - &info, 1L, 1L); + F77_FCN (dgebak) (jobbal, side, n, ilo, ihi, scale, n, z, n, info, 1L, 1L); // We need to clear out all of the area below the sub-diagonal which was used // to store the unitary matrix. diff -r 5cca5ae20299 -r 97eac19837dc liboctave/dbleLU.cc --- a/liboctave/dbleLU.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/dbleLU.cc Tue Apr 11 15:58:32 1995 +0000 @@ -32,8 +32,8 @@ extern "C" { - int F77_FCN (dgesv) (const int*, const int*, double*, const int*, - int*, double*, const int*, int*); + int F77_FCN (dgesv) (const int&, const int&, double*, const int&, + int*, double&, const int&, int&); } LU::LU (const Matrix& a) @@ -52,10 +52,9 @@ int *pvt = new int [n]; double *tmp_data = dup (a.data (), a.length ()); int info = 0; - int zero = 0; double b; - F77_FCN (dgesv) (&n, &zero, tmp_data, &n, ipvt, &b, &n, &info); + F77_FCN (dgesv) (n, 0, tmp_data, n, ipvt, b, n, info); Matrix A_fact (tmp_data, n, n); diff -r 5cca5ae20299 -r 97eac19837dc liboctave/dbleQR.cc --- a/liboctave/dbleQR.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/dbleQR.cc Tue Apr 11 15:58:32 1995 +0000 @@ -32,14 +32,11 @@ extern "C" { - int F77_FCN (dgeqrf) (const int*, const int*, double*, const int*, - double*, double*, const int*, int*); + int F77_FCN (dgeqrf) (const int&, const int&, double*, const int&, + double*, double*, const int&, int&); - int F77_FCN (dorgqr) (const int*, const int*, const int*, double*, - const int*, double*, double*, const int*, int*); - - int F77_FCN (dgeqpf) (const int*, const int*, double*, const int*, - int*, double*, double*, int*); + int F77_FCN (dorgqr) (const int&, const int&, const int&, double*, + const int&, double*, double*, const int&, int&); } QR::QR (const Matrix& a, QR::type qr_type) @@ -68,7 +65,7 @@ else tmp_data = dup (a.data (), a.length ()); - F77_FCN (dgeqrf) (&m, &n, tmp_data, &m, tau, work, &lwork, &info); + F77_FCN (dgeqrf) (m, n, tmp_data, m, tau, work, lwork, info); delete [] work; @@ -105,8 +102,7 @@ lwork = 32*m; work = new double[lwork]; - F77_FCN (dorgqr) (&m, &m, &min_mn, tmp_data, &m, tau, work, - &lwork, &info); + F77_FCN (dorgqr) (m, m, min_mn, tmp_data, m, tau, work, lwork, info); q = Matrix (tmp_data, m, m); q.resize (m, n2); diff -r 5cca5ae20299 -r 97eac19837dc liboctave/dbleQRP.cc --- a/liboctave/dbleQRP.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/dbleQRP.cc Tue Apr 11 15:58:32 1995 +0000 @@ -34,11 +34,11 @@ extern "C" { - int F77_FCN (dgeqpf) (const int*, const int*, double*, const int*, - int*, double*, double*, int*); + int F77_FCN (dgeqpf) (const int&, const int&, double*, const int&, + int*, double*, double*, int&); - int F77_FCN (dorgqr) (const int*, const int*, const int*, double*, - const int*, double*, double*, const int*, int*); + int F77_FCN (dorgqr) (const int&, const int&, const int&, double*, + const int&, double*, double*, const int&, int&); } // It would be best to share some of this code with QR class... @@ -79,7 +79,7 @@ for (int i = 0; i < n; i++) jpvt[i] = 0; - F77_FCN (dgeqpf) (&m, &n, tmp_data, &m, jpvt, tau, work, &info); + F77_FCN (dgeqpf) (m, n, tmp_data, m, jpvt, tau, work, info); // Form Permutation matrix (if economy is requested, return the // indices only!) @@ -122,8 +122,7 @@ lwork = 32*m; work = new double[lwork]; - F77_FCN (dorgqr) (&m, &m, &min_mn, tmp_data, &m, tau, work, - &lwork, &info); + F77_FCN (dorgqr) (m, m, min_mn, tmp_data, m, tau, work, lwork, info); q = Matrix (tmp_data, m, m); q.resize (m, n2); diff -r 5cca5ae20299 -r 97eac19837dc liboctave/dbleSCHUR.cc --- a/liboctave/dbleSCHUR.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/dbleSCHUR.cc Tue Apr 11 15:58:32 1995 +0000 @@ -33,23 +33,23 @@ extern "C" { int F77_FCN (dgeesx) (const char*, const char*, - int (*)(double*, double*), const char*, - const int*, double*, const int*, int*, double*, - double*, double*, const int*, double*, double*, - double*, const int*, int*, const int*, int*, - int*, long, long); + int (*)(const double&, const double&), + const char*, const int&, double*, const int&, + int&, double*, double*, double*, const int&, + double&, double&, double*, const int&, int*, + const int&, int*, int&, long, long); } static int -select_ana (double *a, double *b) +select_ana (const double& a, const double& b) { - return (*a < 0.0); + return (a < 0.0); } static int -select_dig (double *a, double *b) +select_dig (const double& a, const double& b) { - return (hypot (*a, *b) < 1.0); + return (hypot (a, b) < 1.0); } int @@ -63,15 +63,15 @@ return -1; } - char jobvs = 'V'; - char sort; + char *jobvs = "V"; + char *sort; if (*ord == 'A' || *ord == 'D' || *ord == 'a' || *ord == 'd') - sort = 'S'; + sort = "S"; else - sort = 'N'; + sort = "N"; - char sense = 'N'; + char *sense = "N"; int n = a_nc; int lwork = 8 * n; @@ -100,22 +100,22 @@ if (*ord == 'A' || *ord == 'a') { - F77_FCN (dgeesx) (&jobvs, &sort, select_ana, &sense, &n, s, &n, - &sdim, wr, wi, q, &n, &rconde, &rcondv, work, - &lwork, iwork, &liwork, bwork, &info, 1L, 1L); + F77_FCN (dgeesx) (jobvs, sort, select_ana, sense, n, s, n, + sdim, wr, wi, q, n, rconde, rcondv, work, + lwork, iwork, liwork, bwork, info, 1L, 1L); } else if (*ord == 'D' || *ord == 'd') { - F77_FCN (dgeesx) (&jobvs, &sort, select_dig, &sense, &n, s, &n, - &sdim, wr, wi, q, &n, &rconde, &rcondv, work, - &lwork, iwork, &liwork, bwork, &info, 1L, 1L); + F77_FCN (dgeesx) (jobvs, sort, select_dig, sense, n, s, n, + sdim, wr, wi, q, n, rconde, rcondv, work, + lwork, iwork, liwork, bwork, info, 1L, 1L); } else { - F77_FCN (dgeesx) (&jobvs, &sort, (void *) 0, &sense, &n, s, - &n, &sdim, wr, wi, q, &n, &rconde, &rcondv, - work, &lwork, iwork, &liwork, bwork, &info, + F77_FCN (dgeesx) (jobvs, sort, (void *) 0, sense, n, s, + n, sdim, wr, wi, q, n, rconde, rcondv, + work, lwork, iwork, liwork, bwork, info, 1L, 1L); } diff -r 5cca5ae20299 -r 97eac19837dc liboctave/dbleSVD.cc --- a/liboctave/dbleSVD.cc Tue Apr 11 01:07:17 1995 +0000 +++ b/liboctave/dbleSVD.cc Tue Apr 11 15:58:32 1995 +0000 @@ -31,10 +31,10 @@ extern "C" { - int F77_FCN (dgesvd) (const char*, const char*, const int*, - const int*, double*, const int*, double*, - double*, const int*, double*, const int*, - double*, const int*, int*, long, long); + int F77_FCN (dgesvd) (const char*, const char*, const int&, + const int&, double*, const int&, double*, + double*, const int&, double*, const int&, + double*, const int&, int&, long, long); } int @@ -50,8 +50,8 @@ int min_mn = m < n ? m : n; int max_mn = m > n ? m : n; - char jobu = 'A'; - char jobv = 'A'; + char *jobu = "A"; + char *jobv = "A"; int ncol_u = m; int nrow_vt = n; @@ -60,7 +60,7 @@ if (svd_type == SVD::economy) { - jobu = jobv = 'S'; + jobu = jobv ="S"; ncol_u = nrow_vt = nrow_s = ncol_s = min_mn; } @@ -73,8 +73,8 @@ int lwork = tmp1 > tmp2 ? tmp1 : tmp2; double *work = new double[lwork]; - F77_FCN (dgesvd) (&jobu, &jobv, &m, &n, tmp_data, &m, s_vec, u, &m, - vt, &nrow_vt, work, &lwork, &info, 1L, 1L); + F77_FCN (dgesvd) (jobu, jobv, m, n, tmp_data, m, s_vec, u, m, + vt, nrow_vt, work, lwork, info, 1L, 1L); left_sm = Matrix (u, m, ncol_u); sigma = DiagMatrix (s_vec, nrow_s, ncol_s);