Mercurial > hg > octave-terminal
changeset 1249:86fc40576f22
[project @ 1995-04-11 01:03:08 by jwe]
author | jwe |
---|---|
date | Tue, 11 Apr 1995 01:03:57 +0000 |
parents | 961d2acf5e86 |
children | 5cca5ae20299 |
files | liboctave/acosh.c src/rand.cc |
diffstat | 2 files changed, 12 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/acosh.c +++ b/liboctave/acosh.c @@ -21,19 +21,19 @@ */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include <config.h> #endif #ifndef HAVE_ACOSH #include "f77-uscore.h" -extern double F77_FCN (dacosh) (double*); +extern double F77_FCN (dacosh) (const double&); double acosh (double x) { - return F77_FCN (dacosh) (&x); + return F77_FCN (dacosh) (x); } #endif
--- a/src/rand.cc +++ b/src/rand.cc @@ -43,10 +43,10 @@ extern "C" { - int *F77_FCN (dgennor) (double*, double*, double*); - int *F77_FCN (dgenunf) (double*, double*, double*); - int *F77_FCN (setall) (int*, int*); - int *F77_FCN (getsd) (int*, int*); + int *F77_FCN (dgennor) (const double&, const double&, double&); + int *F77_FCN (dgenunf) (const double&, const double&, double&); + int *F77_FCN (setall) (const int&, const int&); + int *F77_FCN (getsd) (int&, int&); } static double @@ -54,7 +54,7 @@ { union d2i { double d; int i[2]; }; union d2i u; - F77_FCN (getsd) (&(u.i[0]), &(u.i[1])); + F77_FCN (getsd) (u.i[0]), u.i[1]); return u.d; } @@ -81,7 +81,7 @@ u.d = val; int i0 = force_to_fit_range (u.i[0], 1, 2147483563); int i1 = force_to_fit_range (u.i[1], 1, 2147483399); - F77_FCN (setall) (&i0, &i1); + F77_FCN (setall) (i0, i1); } static char * @@ -147,7 +147,7 @@ s0 = force_to_fit_range (s0, 1, 2147483563); s1 = force_to_fit_range (s1, 1, 2147483399); - F77_FCN (setall) (&s0, &s1); + F77_FCN (setall) (s0, s1); initialized = 1; } @@ -266,18 +266,16 @@ for (int j = 0; j < m; j++) for (int i = 0; i < n; i++) { - double d_zero = 0.0; - double d_one = 1.0; double val; switch (current_distribution) { case uniform: - F77_FCN (dgenunf) (&d_zero, &d_one, &val); + F77_FCN (dgenunf) (0.0, 1.0, val); rand_mat.elem (i, j) = val; break; case normal: - F77_FCN (dgennor) (&d_zero, &d_one, &val); + F77_FCN (dgennor) (0.0, 1.0, val); rand_mat.elem (i, j) = val; break;