bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gsl] gsl-1.10 "make check" for "linalg" and "randist" -- test.c doe


From: mrengert
Subject: [Bug-gsl] gsl-1.10 "make check" for "linalg" and "randist" -- test.c does not compile
Date: Thu, 28 Feb 2008 16:05:56 -0500 (EST)
User-agent: SquirrelMail/1.4.11

Hi –

First – thanks very much for great free software libraries.

I found two minor issues in the GSL library package “gsl-1.10”

I built GSL on a sparc / Solaris 10:

   $ uname -a
   SunOS cod 5.10 Generic_120011-14 sun4u sparc SUNW,Sun-Fire-V210

And configured the build with “configure –prefix=$HOME CC=/opt/SUNWspro/bin/cc”

----------

Two files fail to compile when making "check", because assignment statements are
intermixed with declaration statements (is legal in c++, maybe?)

The files are:  linalg/test.c  and  randist/test.c.

After moving the offending statements down after the last declaration, all was 
well.

Below I have included a diff for the offending statements.

Regards,

Mark Rengert
REDCOM Laboratories, Inc.
Victor NY 14564




$ diff --context=7 linalg/test.c~ linalg/test.c
*** linalg/test.c~      Mon Sep 10 12:06:53 2007
--- linalg/test.c       Thu Feb 28 14:54:18 2008
***************
*** 3190,3209 ****
  int
  test_choleskyc_solve_dim(const gsl_matrix_complex * m, const 
gsl_vector_complex * actual, double eps)
  {
    int s = 0;
    unsigned long i, dim = m->size1;
    gsl_complex z;

-   GSL_SET_IMAG(&z, 0.0);
-
    gsl_vector_complex * rhs = gsl_vector_complex_alloc(dim);
    gsl_matrix_complex * u  = gsl_matrix_complex_alloc(dim,dim);
    gsl_vector_complex * x = gsl_vector_complex_calloc(dim);
    gsl_matrix_complex_memcpy(u,m);
    for(i=0; i<dim; i++)
      {
        GSL_SET_REAL(&z, i + 1.0);
        gsl_vector_complex_set(rhs, i, z);
      }
    s += gsl_linalg_complex_cholesky_decomp(u);
    s += gsl_linalg_complex_cholesky_solve(u, rhs, x);
--- 3190,3210 ----
  int
  test_choleskyc_solve_dim(const gsl_matrix_complex * m, const 
gsl_vector_complex * actual, double eps)
  {
    int s = 0;
    unsigned long i, dim = m->size1;
    gsl_complex z;

    gsl_vector_complex * rhs = gsl_vector_complex_alloc(dim);
    gsl_matrix_complex * u  = gsl_matrix_complex_alloc(dim,dim);
    gsl_vector_complex * x = gsl_vector_complex_calloc(dim);
    gsl_matrix_complex_memcpy(u,m);
+
+   GSL_SET_IMAG(&z, 0.0);
+
    for(i=0; i<dim; i++)
      {
        GSL_SET_REAL(&z, i + 1.0);
        gsl_vector_complex_set(rhs, i, z);
      }
    s += gsl_linalg_complex_cholesky_decomp(u);
    s += gsl_linalg_complex_cholesky_solve(u, rhs, x);





$ diff --context=7 randist/test.c~ randist/test.c
*** randist/test.c~     Mon Sep 10 12:06:53 2007
--- randist/test.c      Thu Feb 28 15:04:03 2008
***************
*** 514,530 ****

  double
  integrate (pdf_func * pdf, double a, double b)
  {
    double result, abserr;
    size_t n = 1000;
    gsl_function f;
-   f.function = &wrapper_function;
-   f.params = pdf;
    gsl_integration_workspace * w = gsl_integration_workspace_alloc (n);
    gsl_integration_qags (&f, a, b, 1e-16, 1e-4, n, w, &result, &abserr);
    gsl_integration_workspace_free (w);
    return result;
  }


  void
--- 514,530 ----

  double
  integrate (pdf_func * pdf, double a, double b)
  {
    double result, abserr;
    size_t n = 1000;
    gsl_function f;
    gsl_integration_workspace * w = gsl_integration_workspace_alloc (n);
+   f.function = &wrapper_function;
+   f.params = (void *)pdf;
    gsl_integration_qags (&f, a, b, 1e-16, 1e-4, n, w, &result, &abserr);
    gsl_integration_workspace_free (w);
    return result;
  }


  void










reply via email to

[Prev in Thread] Current Thread [Next in Thread]