[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gsl] Gnu Scientific Library: Reference Manual
From: |
Thomas Spuhler |
Subject: |
Re: [Help-gsl] Gnu Scientific Library: Reference Manual |
Date: |
Thu, 30 Jun 2005 12:44:04 -0700 |
User-agent: |
KMail/1.7.2 |
On Thursday 30 June 2005 12:22 pm, Jon Drews wrote:
> On 6/30/05, Thomas Spuhler <address@hidden> wrote:
> > On Thursday 30 June 2005 10:41 am, Jon Drews wrote:
> > > Hi:
> > >
> > > How up to date is the Gnu Scientific Library: Reference Manual book?
> > > Does it include more examples than the on line version?
> >
> > It includes some nice samples that actually work.
>
> Thanks Thomas:
>
> I found a mistake in my own little examples and corrected it. Does
> the book contain more examples than the online version?
I use the online. I copied this one:
#include <stdio.h>
#include <gsl/gsl_errno.h>
#include <gsl/gsl_sf_bessel.h>
int
main (void)
{
double x = 5.0;
gsl_sf_result result;
double expected = -0.17759677131433830434739701;
int status = gsl_sf_bessel_J0_e (x, &result);
printf ("status = %s\n", gsl_strerror(status));
printf ("J0(5.0) = %.18f\n"
" +/- % .18f\n",
result.val, result.err);
printf ("exact = %.18f\n", expected);
return status;
}
There are some quirks to compile it. It's best to use a make file.
Here is the content of my make file:
GSLLIBS = -L/usr/local/lib -lgsl -lgslcblas
GSLINCS = -I/usr/local/include
# space seperated list of source files in program
SOURCES = bessel.cpp
# change testProgram.exe to the name you wish your
# executable program to be
bessel: $(SOURCES)
g++ -o $@ $(GSLINCS) $(GSLLIBS) $(SOURCES)
Put it into the same directory and the just type make
--
Best regards
Thomas Spuhler
All Tusonix outgoing e-mail has been scanned for viruses
pgpezvSV2TKpo.pgp
Description: PGP signature