├── doc ├── examples │ ├── randpoisson.out │ ├── blas.out │ ├── intro.out │ ├── cblas.out │ ├── randpoisson.2.out │ ├── block.out │ ├── linalglu.out │ ├── rng.out │ ├── specfun.out │ ├── const.out │ ├── cdf.out │ ├── rngunif.out │ ├── specfun_e.out │ ├── stat.out │ ├── diff.out │ ├── rngunif.2.out │ ├── sortsmall.out │ ├── statsort.out │ ├── integration.out │ ├── intro.c │ ├── combination.out │ ├── polyroots.out │ ├── demo_fn.h │ ├── sum.out │ ├── block.c │ ├── specfun.c │ ├── vectorview.out │ ├── qrng.c │ ├── permseq.c │ ├── vectorr.c │ ├── vectorw.c │ ├── rngunif.c │ ├── vector.c │ ├── ieee.c │ ├── rng.c │ ├── cdf.c │ ├── matrix.c │ ├── multimin.out │ ├── specfun_e.c │ ├── randwalk.c │ ├── fitting3.c │ ├── polyroots.c │ ├── combination.c │ ├── ieeeround.c │ ├── vectorview.c │ ├── const.c │ ├── cblas.c │ ├── stat.c │ ├── randpoisson.c │ ├── diff.c │ ├── cheb.c │ ├── sortsmall.c │ ├── min.out │ ├── blas.c │ ├── demo_fn.c │ ├── histogram.c │ ├── ntuplew.c │ ├── linalglu.c │ ├── fft.c │ ├── interp.c │ ├── matrixw.c │ └── integration.c ├── stamp-vti ├── version.texi ├── specfunc-dawson.texi ├── specfunc-elljac.texi ├── specfunc-clausen.texi ├── specfunc-pow-int.texi └── specfunc-synchrotron.texi ├── THANKS ├── vector ├── TODO ├── view.h ├── test_static.c ├── gsl_vector.h └── gsl_vector_complex.h ├── complex ├── math.c ├── gsl_complex_math.h ├── Makefile.am ├── TODO ├── CMakeLists.txt └── inline.c ├── const ├── ChangeLog ├── TODO ├── Makefile.am └── CMakeLists.txt ├── randist ├── levy.c └── Makefile.am ├── cheb ├── TODO ├── Makefile.am └── CMakeLists.txt ├── ieee-utils ├── TODO ├── Makefile.am └── CMakeLists.txt ├── err ├── TODO ├── Makefile.am └── CMakeLists.txt ├── histogram ├── TODO └── Makefile.am ├── matrix ├── test_static.c ├── view.h ├── matrix.c ├── TODO └── gsl_matrix.h ├── specfunc ├── check.h ├── gsl_specfunc.h ├── eval.h ├── cheb_eval.c └── cheb_eval_mode.c ├── utils ├── placeholder.c ├── README ├── Makefile.am ├── CMakeLists.txt ├── memcpy.c ├── memmove.c └── strtoul.c ├── cdf ├── error.h └── rat_eval.h ├── ode-initval ├── odeiv_util.h ├── Makefile.am └── CMakeLists.txt ├── multimin ├── TODO └── CMakeLists.txt ├── bspline ├── TODO ├── Makefile.am ├── CMakeLists.txt └── bspline.h ├── cblas ├── srotg.c ├── drotg.c ├── sasum.c ├── snrm2.c ├── dasum.c ├── dnrm2.c ├── dzasum.c ├── dznrm2.c ├── scasum.c ├── scnrm2.c ├── icamax.c ├── isamax.c ├── izamax.c ├── cscal.c ├── csscal.c ├── dscal.c ├── idamax.c ├── srotmg.c ├── sscal.c ├── zscal.c ├── cswap.c ├── drotmg.c ├── sswap.c ├── zdscal.c ├── zswap.c ├── dswap.c ├── ccopy.c ├── scopy.c ├── zcopy.c ├── dcopy.c ├── drotm.c ├── srotm.c ├── caxpy.c ├── saxpy.c ├── srot.c ├── zaxpy.c ├── daxpy.c ├── drot.c ├── chpr.c ├── cdotc_sub.c ├── cdotu_sub.c ├── dspr.c ├── sspr.c ├── zdotu_sub.c ├── zhpr.c ├── zdotc_sub.c ├── cher.c ├── ssyr.c ├── zher.c ├── dsyr.c ├── sdot.c ├── TODO ├── cgerc.c ├── cgeru.c ├── chpr2.c ├── ddot.c ├── dsdot.c ├── sger.c ├── zgerc.c ├── zgeru.c ├── dger.c ├── sspr2.c ├── zhpr2.c ├── dspr2.c ├── cher2.c ├── ctpmv.c ├── zher2.c ├── chpmv.c ├── dtpmv.c ├── dtpsv.c ├── ssyr2.c ├── stpmv.c ├── stpsv.c ├── zhpmv.c ├── ztpmv.c ├── dsyr2.c ├── sdsdot.c ├── sspmv.c ├── ctpsv.c ├── dspmv.c ├── chemv.c ├── ctrmv.c ├── strmv.c ├── strsv.c ├── ztpsv.c ├── ztrmv.c ├── dtrmv.c ├── dtrsv.c ├── ssymv.c ├── zhemv.c ├── ctbmv.c ├── dsymv.c ├── chbmv.c ├── cherk.c ├── dtbmv.c ├── dtbsv.c ├── stbmv.c ├── stbsv.c ├── zhbmv.c ├── ztbmv.c ├── csyrk.c ├── ssbmv.c ├── ssyrk.c ├── zherk.c ├── zsyrk.c ├── cgemv.c ├── dsbmv.c ├── dsyrk.c ├── sgemv.c ├── zgemv.c ├── ctrsv.c ├── ztrsv.c ├── dgemv.c ├── chemm.c ├── ctbsv.c ├── zhemm.c ├── csymm.c ├── ssymm.c ├── zsymm.c ├── ztbsv.c ├── cgbmv.c ├── cher2k.c ├── csyr2k.c ├── sgbmv.c ├── zgbmv.c ├── zher2k.c ├── zsyr2k.c ├── dsymm.c ├── ctrmm.c ├── ssyr2k.c ├── ztrmm.c ├── dgbmv.c ├── dtrmm.c ├── dtrsm.c ├── strmm.c ├── strsm.c ├── dsyr2k.c ├── cgemm.c ├── sgemm.c ├── zgemm.c ├── dgemm.c ├── ctrsm.c ├── ztrsm.c ├── hypot.c └── tests.c ├── gsl.pc.in ├── integration ├── reset.c ├── positivity.c ├── set_initial.c ├── Makefile.am └── CMakeLists.txt ├── blas ├── TODO ├── CMakeLists.txt └── Makefile.am ├── linalg ├── TODO └── Makefile.am ├── test ├── Makefile.am └── CMakeLists.txt ├── qrng ├── inline.c ├── Makefile.am ├── TODO └── CMakeLists.txt ├── siman ├── TODO ├── siman_test_driver.sh ├── Makefile.am └── CMakeLists.txt ├── multifit ├── TODO ├── test_fn.c └── CMakeLists.txt ├── test_gsl_histogram.sh ├── ntuple ├── ChangeLog ├── CMakeLists.txt └── Makefile.am ├── gsl ├── CMakeLists.txt └── Makefile.am ├── autogen.sh ├── roots ├── TODO ├── Makefile.am └── CMakeLists.txt ├── deriv ├── ChangeLog ├── Makefile.am └── CMakeLists.txt ├── fft ├── complex_internal.h ├── dft.c ├── signals.c ├── TODO └── CMakeLists.txt ├── interpolation ├── TODO ├── Makefile.am └── CMakeLists.txt ├── sum ├── Makefile.am └── CMakeLists.txt ├── dht ├── Makefile.am ├── ChangeLog └── CMakeLists.txt ├── sys ├── Makefile.am ├── CMakeLists.txt └── fdiv.c ├── wavelet ├── TODO ├── Makefile.am └── CMakeLists.txt ├── gsl_version.h ├── min ├── Makefile.am └── CMakeLists.txt ├── gsl_version.h.cmake ├── gsl_version.h.in ├── statistics ├── wmean.c ├── wskew.c ├── wabsdev.c ├── wkurtosis.c ├── wvariance.c └── gsl_statistics.h ├── sort ├── gsl_sort.h └── gsl_sort_vector.h ├── eigen ├── TODO ├── Makefile.am └── CMakeLists.txt ├── dist.info ├── poly ├── Makefile.am └── CMakeLists.txt ├── fit ├── Makefile.am ├── ChangeLog └── CMakeLists.txt ├── diff ├── Makefile.am ├── CMakeLists.txt └── ChangeLog ├── block ├── gsl_block.h ├── Makefile.am └── CMakeLists.txt ├── permutation ├── gsl_permute.h └── gsl_permute_vector.h ├── combination ├── CMakeLists.txt ├── Makefile.am └── inline.c ├── monte ├── Makefile.am └── CMakeLists.txt ├── multiroots ├── Makefile.am └── CMakeLists.txt └── mkinstalldirs /doc/examples/randpoisson.out: -------------------------------------------------------------------------------- 1 | 2 5 5 2 1 0 3 4 1 1 2 | -------------------------------------------------------------------------------- /THANKS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LuaDist/gsl/HEAD/THANKS -------------------------------------------------------------------------------- /doc/examples/blas.out: -------------------------------------------------------------------------------- 1 | [ 367.76, 368.12 2 | 674.06, 674.72 ] -------------------------------------------------------------------------------- /doc/examples/intro.out: -------------------------------------------------------------------------------- 1 | J0(5) = -1.775967713143382920e-01 2 | -------------------------------------------------------------------------------- /doc/examples/cblas.out: -------------------------------------------------------------------------------- 1 | [ 367.76, 368.12 2 | 674.06, 674.72 ] 3 | -------------------------------------------------------------------------------- /vector/TODO: -------------------------------------------------------------------------------- 1 | * Pretty print function 2 | 3 | * Vector p-norms 4 | -------------------------------------------------------------------------------- /complex/math.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LuaDist/gsl/HEAD/complex/math.c -------------------------------------------------------------------------------- /const/ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LuaDist/gsl/HEAD/const/ChangeLog -------------------------------------------------------------------------------- /doc/examples/randpoisson.2.out: -------------------------------------------------------------------------------- 1 | GSL_RNG_SEED=123 2 | 4 5 6 3 3 1 4 2 5 5 3 | -------------------------------------------------------------------------------- /randist/levy.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LuaDist/gsl/HEAD/randist/levy.c -------------------------------------------------------------------------------- /const/TODO: -------------------------------------------------------------------------------- 1 | could add RADIATION_DENSITY_CONSTANT (7.56591e-16) /* J m-3 K-4 */ 2 | -------------------------------------------------------------------------------- /doc/examples/block.out: -------------------------------------------------------------------------------- 1 | length of block = 100 2 | block data address = 0x804b0d8 3 | -------------------------------------------------------------------------------- /doc/examples/linalglu.out: -------------------------------------------------------------------------------- 1 | x = -4.05205 2 | -12.6056 3 | 1.66091 4 | 8.69377 5 | -------------------------------------------------------------------------------- /cheb/TODO: -------------------------------------------------------------------------------- 1 | Provide a way to save/restore coefficients, or access the coefficient data. -------------------------------------------------------------------------------- /doc/examples/rng.out: -------------------------------------------------------------------------------- 1 | generator type: mt19937 2 | seed = 0 3 | first value = 4293858116 4 | -------------------------------------------------------------------------------- /doc/examples/specfun.out: -------------------------------------------------------------------------------- 1 | J0(5.0) = -0.177596771314338292 2 | exact = -0.177596771314338292 3 | -------------------------------------------------------------------------------- /complex/gsl_complex_math.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LuaDist/gsl/HEAD/complex/gsl_complex_math.h -------------------------------------------------------------------------------- /ieee-utils/TODO: -------------------------------------------------------------------------------- 1 | * Fix up ieee-utils/fp-m68klinux.c for correct behavior and actually 2 | test it. 3 | -------------------------------------------------------------------------------- /vector/view.h: -------------------------------------------------------------------------------- 1 | #define NULL_VECTOR {0, 0, 0, 0, 0} 2 | #define NULL_VECTOR_VIEW {{0, 0, 0, 0, 0}} 3 | -------------------------------------------------------------------------------- /err/TODO: -------------------------------------------------------------------------------- 1 | * Add a GSL_ERROR_MODE environment variable for choosing error 2 | behavior at runtime (???). 3 | 4 | -------------------------------------------------------------------------------- /doc/examples/const.out: -------------------------------------------------------------------------------- 1 | light travel time from Earth to Mars: 2 | minimum = 4.3 minutes 3 | maximum = 21.0 minutes 4 | -------------------------------------------------------------------------------- /doc/stamp-vti: -------------------------------------------------------------------------------- 1 | @set UPDATED 25 August 2009 2 | @set UPDATED-MONTH August 2009 3 | @set EDITION 1.13 4 | @set VERSION 1.13 5 | -------------------------------------------------------------------------------- /doc/version.texi: -------------------------------------------------------------------------------- 1 | @set UPDATED 25 August 2009 2 | @set UPDATED-MONTH August 2009 3 | @set EDITION 1.13 4 | @set VERSION 1.13 5 | -------------------------------------------------------------------------------- /histogram/TODO: -------------------------------------------------------------------------------- 1 | * Implement N-d histograms (Simone Piccardi is 2 | working on something here). 3 | 4 | -------------------------------------------------------------------------------- /doc/examples/cdf.out: -------------------------------------------------------------------------------- 1 | prob(x < 2.000000) = 0.977250 2 | prob(x > 2.000000) = 0.022750 3 | Pinv(0.977250) = 2.000000 4 | Qinv(0.022750) = 2.000000 5 | -------------------------------------------------------------------------------- /vector/test_static.c: -------------------------------------------------------------------------------- 1 | #undef HAVE_INLINE 2 | #ifndef NO_INLINE 3 | #define NO_INLINE 4 | #endif 5 | #define DESC " (static)" 6 | #include "test.c" 7 | -------------------------------------------------------------------------------- /doc/examples/rngunif.out: -------------------------------------------------------------------------------- 1 | 0.99974 2 | 0.16291 3 | 0.28262 4 | 0.94720 5 | 0.23166 6 | 0.48497 7 | 0.95748 8 | 0.74431 9 | 0.54004 10 | 0.73995 11 | -------------------------------------------------------------------------------- /doc/examples/specfun_e.out: -------------------------------------------------------------------------------- 1 | status = success 2 | J0(5.0) = -0.177596771314338292 3 | +/- 0.000000000000000193 4 | exact = -0.177596771314338292 5 | -------------------------------------------------------------------------------- /matrix/test_static.c: -------------------------------------------------------------------------------- 1 | 2 | #undef HAVE_INLINE 3 | #ifndef NO_INLINE 4 | #define NO_INLINE 5 | #endif 6 | #define DESC " (static)" 7 | #include "test.c" 8 | -------------------------------------------------------------------------------- /specfunc/check.h: -------------------------------------------------------------------------------- 1 | /* check for underflow */ 2 | 3 | #define CHECK_UNDERFLOW(r) if (fabs((r)->val) < GSL_DBL_MIN) GSL_ERROR("underflow", GSL_EUNDRFLW); 4 | -------------------------------------------------------------------------------- /utils/placeholder.c: -------------------------------------------------------------------------------- 1 | void 2 | gsl_utils_placeholder (void); 3 | 4 | void 5 | gsl_utils_placeholder (void) 6 | { 7 | int i = 0; 8 | i++ ; 9 | } 10 | -------------------------------------------------------------------------------- /cdf/error.h: -------------------------------------------------------------------------------- 1 | /* CDF_ERROR: call the error handler, and return a NAN. */ 2 | 3 | #define CDF_ERROR(reason, gsl_errno) GSL_ERROR_VAL(reason, gsl_errno, GSL_NAN) 4 | 5 | -------------------------------------------------------------------------------- /ode-initval/odeiv_util.h: -------------------------------------------------------------------------------- 1 | #define DBL_MEMCPY(dest,src,n) memcpy((dest),(src),(n)*sizeof(double)) 2 | #define DBL_ZERO_MEMSET(dest,n) memset((dest),0,(n)*sizeof(double)) 3 | -------------------------------------------------------------------------------- /doc/examples/stat.out: -------------------------------------------------------------------------------- 1 | The dataset is 17.2, 18.1, 16.5, 18.3, 12.6 2 | The sample mean is 16.54 3 | The estimated variance is 4.2984 4 | The largest value is 18.3 5 | The smallest value is 12.6 6 | -------------------------------------------------------------------------------- /matrix/view.h: -------------------------------------------------------------------------------- 1 | #define NULL_VECTOR {0, 0, 0, 0, 0} 2 | #define NULL_VECTOR_VIEW {{0, 0, 0, 0, 0}} 3 | 4 | #define NULL_MATRIX {0, 0, 0, 0, 0, 0} 5 | #define NULL_MATRIX_VIEW {{0, 0, 0, 0, 0, 0}} 6 | -------------------------------------------------------------------------------- /doc/examples/diff.out: -------------------------------------------------------------------------------- 1 | f(x) = x^(3/2) 2 | x = 2.0 3 | f'(x) = 2.1213203120 +/- 0.0000004064 4 | exact = 2.1213203436 5 | 6 | x = 0.0 7 | f'(x) = 0.0000000160 +/- 0.0000000339 8 | exact = 0.0000000000 9 | -------------------------------------------------------------------------------- /doc/examples/rngunif.2.out: -------------------------------------------------------------------------------- 1 | GSL_RNG_TYPE=mrg 2 | GSL_RNG_SEED=123 3 | 0.33050 4 | 0.86631 5 | 0.32982 6 | 0.67620 7 | 0.53391 8 | 0.06457 9 | 0.16847 10 | 0.70229 11 | 0.04371 12 | 0.86374 13 | -------------------------------------------------------------------------------- /doc/examples/sortsmall.out: -------------------------------------------------------------------------------- 1 | 5 smallest values from 100000 2 | 0: 0.000003489200025797 3 | 1: 0.000008199829608202 4 | 2: 0.000008953968062997 5 | 3: 0.000010712770745158 6 | 4: 0.000033531803637743 7 | -------------------------------------------------------------------------------- /doc/examples/statsort.out: -------------------------------------------------------------------------------- 1 | Original dataset: 17.2, 18.1, 16.5, 18.3, 12.6 2 | Sorted dataset: 12.6, 16.5, 17.2, 18.1, 18.3 3 | The median is 17.2 4 | The upper quartile is 18.1 5 | The lower quartile is 16.5 6 | -------------------------------------------------------------------------------- /utils/README: -------------------------------------------------------------------------------- 1 | Some common routines. 2 | These were taken from the lib directory of Texinfo-3.11. 3 | Many are common to other GNU packages as well. 4 | (On the FSF machines, check /gd/gnu/lib for the latest.) 5 | 6 | -------------------------------------------------------------------------------- /doc/examples/integration.out: -------------------------------------------------------------------------------- 1 | result = -3.999999999999973799 2 | exact result = -4.000000000000000000 3 | estimated error = 0.000000000000246025 4 | actual error = 0.000000000000026201 5 | intervals = 8 6 | -------------------------------------------------------------------------------- /multimin/TODO: -------------------------------------------------------------------------------- 1 | * Check behavior of conjugate_fr in multimin -- the demo results look odd. 2 | 3 | * Should have made f and df return int instead of void. 4 | 5 | * Handle errors via GSL_NAN similar to min.h in min/ 6 | -------------------------------------------------------------------------------- /utils/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libutils.la 2 | 3 | # Don't need to list alloca.c, etc., Automake includes them. 4 | libutils_la_SOURCES = system.h placeholder.c 5 | libutils_la_LIBADD = @LIBOBJS@ 6 | 7 | EXTRA_DIST = README 8 | -------------------------------------------------------------------------------- /specfunc/gsl_specfunc.h: -------------------------------------------------------------------------------- 1 | /* Author: G. Jungman */ 2 | 3 | 4 | /* Convenience header */ 5 | #ifndef __GSL_SPECFUNC_H__ 6 | #define __GSL_SPECFUNC_H__ 7 | 8 | #include 9 | 10 | #endif /* __GSL_SPECFUNC_H__ */ 11 | -------------------------------------------------------------------------------- /doc/examples/intro.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (void) 6 | { 7 | double x = 5.0; 8 | double y = gsl_sf_bessel_J0 (x); 9 | printf ("J0(%g) = %.18e\n", x, y); 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /bspline/TODO: -------------------------------------------------------------------------------- 1 | Add functions: 2 | 3 | gsl_bspline_smooth to fit smoothing splines to data more efficiently 4 | than the standard least squares inversion (see pppack l2appr and 5 | smooth.spline() from GNU R) 6 | 7 | + any other useful functions from pppack 8 | -------------------------------------------------------------------------------- /cblas/srotg.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_srotg (float *a, float *b, float *c, float *s) 7 | { 8 | #define BASE float 9 | #include "source_rotg.h" 10 | #undef BASE 11 | } 12 | -------------------------------------------------------------------------------- /cblas/drotg.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_drotg (double *a, double *b, double *c, double *s) 7 | { 8 | #define BASE double 9 | #include "source_rotg.h" 10 | #undef BASE 11 | } 12 | -------------------------------------------------------------------------------- /cblas/sasum.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | float 6 | cblas_sasum (const int N, const float *X, const int incX) 7 | { 8 | #define BASE float 9 | #include "source_asum_r.h" 10 | #undef BASE 11 | } 12 | -------------------------------------------------------------------------------- /cblas/snrm2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | float 6 | cblas_snrm2 (const int N, const float *X, const int incX) 7 | { 8 | #define BASE float 9 | #include "source_nrm2_r.h" 10 | #undef BASE 11 | } 12 | -------------------------------------------------------------------------------- /gsl.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: GSL 7 | Description: GNU Scientific Library 8 | Version: @VERSION@ 9 | Libs: @GSL_LIBS@ -lgslcblas @LIBS@ 10 | Cflags: @GSL_CFLAGS@ 11 | -------------------------------------------------------------------------------- /matrix/matrix.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | /* Compile all the inline matrix functions */ 6 | 7 | #define COMPILE_INLINE_STATIC 8 | #include "build.h" 9 | #include 10 | 11 | -------------------------------------------------------------------------------- /cblas/dasum.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | double 6 | cblas_dasum (const int N, const double *X, const int incX) 7 | { 8 | #define BASE double 9 | #include "source_asum_r.h" 10 | #undef BASE 11 | } 12 | -------------------------------------------------------------------------------- /cblas/dnrm2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | double 6 | cblas_dnrm2 (const int N, const double *X, const int incX) 7 | { 8 | #define BASE double 9 | #include "source_nrm2_r.h" 10 | #undef BASE 11 | } 12 | -------------------------------------------------------------------------------- /cblas/dzasum.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | double 6 | cblas_dzasum (const int N, const void *X, const int incX) 7 | { 8 | #define BASE double 9 | #include "source_asum_c.h" 10 | #undef BASE 11 | } 12 | -------------------------------------------------------------------------------- /cblas/dznrm2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | double 6 | cblas_dznrm2 (const int N, const void *X, const int incX) 7 | { 8 | #define BASE double 9 | #include "source_nrm2_c.h" 10 | #undef BASE 11 | } 12 | -------------------------------------------------------------------------------- /cblas/scasum.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | float 6 | cblas_scasum (const int N, const void *X, const int incX) 7 | { 8 | #define BASE float 9 | #include "source_asum_c.h" 10 | #undef BASE 11 | } 12 | -------------------------------------------------------------------------------- /cblas/scnrm2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | float 6 | cblas_scnrm2 (const int N, const void *X, const int incX) 7 | { 8 | #define BASE float 9 | #include "source_nrm2_c.h" 10 | #undef BASE 11 | } 12 | -------------------------------------------------------------------------------- /cblas/icamax.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | CBLAS_INDEX 6 | cblas_icamax (const int N, const void *X, const int incX) 7 | { 8 | #define BASE float 9 | #include "source_iamax_c.h" 10 | #undef BASE 11 | } 12 | -------------------------------------------------------------------------------- /cblas/isamax.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | CBLAS_INDEX 6 | cblas_isamax (const int N, const float *X, const int incX) 7 | { 8 | #define BASE float 9 | #include "source_iamax_r.h" 10 | #undef BASE 11 | } 12 | -------------------------------------------------------------------------------- /cblas/izamax.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | CBLAS_INDEX 6 | cblas_izamax (const int N, const void *X, const int incX) 7 | { 8 | #define BASE double 9 | #include "source_iamax_c.h" 10 | #undef BASE 11 | } 12 | -------------------------------------------------------------------------------- /doc/examples/combination.out: -------------------------------------------------------------------------------- 1 | All subsets of {0,1,2,3} by size: 2 | { } 3 | { 0 } 4 | { 1 } 5 | { 2 } 6 | { 3 } 7 | { 0 1 } 8 | { 0 2 } 9 | { 0 3 } 10 | { 1 2 } 11 | { 1 3 } 12 | { 2 3 } 13 | { 0 1 2 } 14 | { 0 1 3 } 15 | { 0 2 3 } 16 | { 1 2 3 } 17 | { 0 1 2 3 } 18 | -------------------------------------------------------------------------------- /integration/reset.c: -------------------------------------------------------------------------------- 1 | static inline void 2 | reset_nrmax (gsl_integration_workspace * workspace); 3 | 4 | static inline void 5 | reset_nrmax (gsl_integration_workspace * workspace) 6 | { 7 | workspace->nrmax = 0; 8 | workspace->i = workspace->order[0] ; 9 | } 10 | -------------------------------------------------------------------------------- /cblas/cscal.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_cscal (const int N, const void *alpha, void *X, const int incX) 7 | { 8 | #define BASE float 9 | #include "source_scal_c.h" 10 | #undef BASE 11 | } 12 | -------------------------------------------------------------------------------- /cblas/csscal.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_csscal (const int N, const float alpha, void *X, const int incX) 7 | { 8 | #define BASE float 9 | #include "source_scal_c_s.h" 10 | #undef BASE 11 | } 12 | -------------------------------------------------------------------------------- /cblas/dscal.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_dscal (const int N, const double alpha, double *X, const int incX) 7 | { 8 | #define BASE double 9 | #include "source_scal_r.h" 10 | #undef BASE 11 | } 12 | -------------------------------------------------------------------------------- /cblas/idamax.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | CBLAS_INDEX 6 | cblas_idamax (const int N, const double *X, const int incX) 7 | { 8 | #define BASE double 9 | #include "source_iamax_r.h" 10 | #undef BASE 11 | } 12 | -------------------------------------------------------------------------------- /cblas/srotmg.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_srotmg (float *d1, float *d2, float *b1, const float b2, float *P) 7 | { 8 | #define BASE float 9 | #include "source_rotmg.h" 10 | #undef BASE 11 | } 12 | -------------------------------------------------------------------------------- /cblas/sscal.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_sscal (const int N, const float alpha, float *X, const int incX) 7 | { 8 | #define BASE float 9 | #include "source_scal_r.h" 10 | #undef BASE 11 | } 12 | -------------------------------------------------------------------------------- /cblas/zscal.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_zscal (const int N, const void *alpha, void *X, const int incX) 7 | { 8 | #define BASE double 9 | #include "source_scal_c.h" 10 | #undef BASE 11 | } 12 | -------------------------------------------------------------------------------- /cblas/cswap.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_cswap (const int N, void *X, const int incX, void *Y, const int incY) 7 | { 8 | #define BASE float 9 | #include "source_swap_c.h" 10 | #undef BASE 11 | } 12 | -------------------------------------------------------------------------------- /cblas/drotmg.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_drotmg (double *d1, double *d2, double *b1, const double b2, double *P) 7 | { 8 | #define BASE double 9 | #include "source_rotmg.h" 10 | #undef BASE 11 | } 12 | -------------------------------------------------------------------------------- /cblas/sswap.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_sswap (const int N, float *X, const int incX, float *Y, const int incY) 7 | { 8 | #define BASE float 9 | #include "source_swap_r.h" 10 | #undef BASE 11 | } 12 | -------------------------------------------------------------------------------- /cblas/zdscal.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_zdscal (const int N, const double alpha, void *X, const int incX) 7 | { 8 | #define BASE double 9 | #include "source_scal_c_s.h" 10 | #undef BASE 11 | } 12 | -------------------------------------------------------------------------------- /cblas/zswap.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_zswap (const int N, void *X, const int incX, void *Y, const int incY) 7 | { 8 | #define BASE double 9 | #include "source_swap_c.h" 10 | #undef BASE 11 | } 12 | -------------------------------------------------------------------------------- /blas/TODO: -------------------------------------------------------------------------------- 1 | 2 | * We need a test suite for this directory! 3 | 4 | * Verify that we support the full CBLAS interface and that the GSL 5 | CBLAS library can be used standalone 6 | 7 | * Check that substituting the Reference Blas, ATLAS, and Intel BLAS 8 | all work correctly 9 | 10 | -------------------------------------------------------------------------------- /doc/examples/polyroots.out: -------------------------------------------------------------------------------- 1 | z0 = -0.809016994374947451 +0.587785252292473137 2 | z1 = -0.809016994374947451 -0.587785252292473137 3 | z2 = +0.309016994374947451 +0.951056516295153642 4 | z3 = +0.309016994374947451 -0.951056516295153642 5 | z4 = +1.000000000000000000 +0.000000000000000000 6 | -------------------------------------------------------------------------------- /doc/examples/demo_fn.h: -------------------------------------------------------------------------------- 1 | struct quadratic_params 2 | { 3 | double a, b, c; 4 | }; 5 | 6 | double quadratic (double x, void *params); 7 | double quadratic_deriv (double x, void *params); 8 | void quadratic_fdf (double x, void *params, 9 | double *y, double *dy); 10 | -------------------------------------------------------------------------------- /linalg/TODO: -------------------------------------------------------------------------------- 1 | * Support M 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_dswap (const int N, double *X, const int incX, double *Y, 7 | const int incY) 8 | { 9 | #define BASE double 10 | #include "source_swap_r.h" 11 | #undef BASE 12 | } 13 | -------------------------------------------------------------------------------- /test/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libgsltest.la 2 | 3 | pkginclude_HEADERS = gsl_test.h 4 | 5 | libgsltest_la_SOURCES = results.c 6 | 7 | #check_PROGRAMS = test 8 | #TESTS = test 9 | #test_SOURCES = test_errnos.c 10 | #test_LDADD = libgsltest.la ../sys/libgslsys.la ../utils/libutils.la 11 | -------------------------------------------------------------------------------- /cblas/ccopy.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_ccopy (const int N, const void *X, const int incX, void *Y, 7 | const int incY) 8 | { 9 | #define BASE float 10 | #include "source_copy_c.h" 11 | #undef BASE 12 | } 13 | -------------------------------------------------------------------------------- /cblas/scopy.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_scopy (const int N, const float *X, const int incX, float *Y, 7 | const int incY) 8 | { 9 | #define BASE float 10 | #include "source_copy_r.h" 11 | #undef BASE 12 | } 13 | -------------------------------------------------------------------------------- /cblas/zcopy.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_zcopy (const int N, const void *X, const int incX, void *Y, 7 | const int incY) 8 | { 9 | #define BASE double 10 | #include "source_copy_c.h" 11 | #undef BASE 12 | } 13 | -------------------------------------------------------------------------------- /qrng/inline.c: -------------------------------------------------------------------------------- 1 | /* Author: G. Jungman 2 | */ 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | /* Compile all the inline functions */ 9 | 10 | #define COMPILE_INLINE_STATIC 11 | #include "build.h" 12 | #include 13 | 14 | -------------------------------------------------------------------------------- /cblas/dcopy.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_dcopy (const int N, const double *X, const int incX, double *Y, 7 | const int incY) 8 | { 9 | #define BASE double 10 | #include "source_copy_r.h" 11 | #undef BASE 12 | } 13 | -------------------------------------------------------------------------------- /utils/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | ########### next target ############### 3 | 4 | set(utils_STAT_SRCS system.h placeholder.c) 5 | 6 | add_library(utils STATIC EXCLUDE_FROM_ALL ${utils_STAT_SRCS}) 7 | set(utils_STAT_SRCS ${utils_STAT_SRCS} PARENT_SCOPE) 8 | 9 | ########### install files ############### 10 | 11 | -------------------------------------------------------------------------------- /cblas/drotm.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_drotm (const int N, double *X, const int incX, double *Y, 7 | const int incY, const double *P) 8 | { 9 | #define BASE double 10 | #include "source_rotm.h" 11 | #undef BASE 12 | } 13 | -------------------------------------------------------------------------------- /cblas/srotm.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_srotm (const int N, float *X, const int incX, float *Y, const int incY, 7 | const float *P) 8 | { 9 | #define BASE float 10 | #include "source_rotm.h" 11 | #undef BASE 12 | } 13 | -------------------------------------------------------------------------------- /doc/examples/sum.out: -------------------------------------------------------------------------------- 1 | term-by-term sum = 1.5961632439130233 using 20 terms 2 | term-by-term sum = 1.5759958390005426 using 13 terms 3 | exact value = 1.6449340668482264 4 | accelerated sum = 1.6449340668166479 using 13 terms 5 | estimated error = 0.0000000000508580 6 | actual error = -0.0000000000315785 7 | -------------------------------------------------------------------------------- /cblas/caxpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_caxpy (const int N, const void *alpha, const void *X, const int incX, 7 | void *Y, const int incY) 8 | { 9 | #define BASE float 10 | #include "source_axpy_c.h" 11 | #undef BASE 12 | } 13 | -------------------------------------------------------------------------------- /siman/TODO: -------------------------------------------------------------------------------- 1 | * Reorganize siman interfaces to allow iterative use. 2 | 3 | * Maybe the routines can be made to work with pointers instead of structs 4 | so that only pointer manipulation is done by the siman algorithm and 5 | there is no need for malloc. A call would look something like 6 | siman(&start,&result, ...) 7 | -------------------------------------------------------------------------------- /cblas/saxpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_saxpy (const int N, const float alpha, const float *X, const int incX, 7 | float *Y, const int incY) 8 | { 9 | #define BASE float 10 | #include "source_axpy_r.h" 11 | #undef BASE 12 | } 13 | -------------------------------------------------------------------------------- /cblas/srot.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_srot (const int N, float *X, const int incX, float *Y, const int incY, 7 | const float c, const float s) 8 | { 9 | #define BASE float 10 | #include "source_rot.h" 11 | #undef BASE 12 | } 13 | -------------------------------------------------------------------------------- /cblas/zaxpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_zaxpy (const int N, const void *alpha, const void *X, const int incX, 7 | void *Y, const int incY) 8 | { 9 | #define BASE double 10 | #include "source_axpy_c.h" 11 | #undef BASE 12 | } 13 | -------------------------------------------------------------------------------- /doc/examples/block.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (void) 6 | { 7 | gsl_block * b = gsl_block_alloc (100); 8 | 9 | printf ("length of block = %u\n", b->size); 10 | printf ("block data address = %#x\n", b->data); 11 | 12 | gsl_block_free (b); 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /multifit/TODO: -------------------------------------------------------------------------------- 1 | The following would also be nice additions to the multifit function suite 2 | (see MS Excel regression output for example): 3 | 4 | 1. Produce the correlation coefficient (r) and other statistics. 5 | 2. Allow fit variable weighting (not observation weighting). 6 | 3. Allow for principal factor computations. 7 | 8 | -------------------------------------------------------------------------------- /test_gsl_histogram.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | cat > test.exp.1.tmp < test.obs.1.tmp 11 | 12 | cmp test.exp.1.tmp test.obs.1.tmp 13 | STATUS=$? 14 | rm test.exp.1.tmp test.obs.1.tmp 15 | 16 | exit $STATUS 17 | -------------------------------------------------------------------------------- /cblas/daxpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_daxpy (const int N, const double alpha, const double *X, const int incX, 7 | double *Y, const int incY) 8 | { 9 | #define BASE double 10 | #include "source_axpy_r.h" 11 | #undef BASE 12 | } 13 | -------------------------------------------------------------------------------- /cblas/drot.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_drot (const int N, double *X, const int incX, double *Y, const int incY, 7 | const double c, const double s) 8 | { 9 | #define BASE double 10 | #include "source_rot.h" 11 | #undef BASE 12 | } 13 | -------------------------------------------------------------------------------- /ntuple/ChangeLog: -------------------------------------------------------------------------------- 1 | 2008-07-03 Brian Gough 2 | 3 | * Makefile.am (INCLUDES): use top_srcdir instead of top_builddir 4 | 5 | 2004-05-30 Brian Gough 6 | 7 | * ntuple/test.c (main): choose ratio 1/(i+1.5) to avoid values 8 | exactly on test cutoff x=0.1 9 | 10 | -------------------------------------------------------------------------------- /doc/examples/specfun.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (void) 6 | { 7 | double x = 5.0; 8 | double expected = -0.17759677131433830434739701; 9 | 10 | double y = gsl_sf_bessel_J0 (x); 11 | 12 | printf ("J0(5.0) = %.18f\n", y); 13 | printf ("exact = %.18f\n", expected); 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /cblas/chpr.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_chpr (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const int N, const float alpha, const void *X, const int incX, 8 | void *Ap) 9 | { 10 | #define BASE float 11 | #include "source_hpr.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /err/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libgslerr.la 2 | 3 | pkginclude_HEADERS = gsl_errno.h gsl_message.h 4 | 5 | libgslerr_la_SOURCES = error.c stream.c message.c strerror.c 6 | 7 | check_PROGRAMS = test 8 | 9 | TESTS = $(check_PROGRAMS) 10 | 11 | test_SOURCES = test.c 12 | test_LDADD = libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la 13 | -------------------------------------------------------------------------------- /test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | ########### next target ############### 4 | 5 | set(gsltest_STAT_SRCS results.c) 6 | 7 | add_library(gsltest STATIC EXCLUDE_FROM_ALL ${gsltest_STAT_SRCS}) 8 | set(gsltest_STAT_SRCS ${gsltest_STAT_SRCS} PARENT_SCOPE) 9 | 10 | ########### install files ############### 11 | 12 | install(FILES gsl_test.h DESTINATION ${INSTALL_INC}/gsl) 13 | -------------------------------------------------------------------------------- /cblas/cdotc_sub.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_cdotc_sub (const int N, const void *X, const int incX, const void *Y, 7 | const int incY, void *result) 8 | { 9 | #define BASE float 10 | #define CONJ_SIGN (-1.0) 11 | #include "source_dot_c.h" 12 | #undef CONJ_SIGN 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/cdotu_sub.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_cdotu_sub (const int N, const void *X, const int incX, const void *Y, 7 | const int incY, void *result) 8 | { 9 | #define BASE float 10 | #define CONJ_SIGN 1.0 11 | #include "source_dot_c.h" 12 | #undef CONJ_SIGN 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/dspr.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_dspr (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const int N, const double alpha, const double *X, const int incX, 8 | double *Ap) 9 | { 10 | #define BASE double 11 | #include "source_spr.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /cblas/sspr.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_sspr (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const int N, const float alpha, const float *X, const int incX, 8 | float *Ap) 9 | { 10 | #define BASE float 11 | #include "source_spr.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /cblas/zdotu_sub.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_zdotu_sub (const int N, const void *X, const int incX, const void *Y, 7 | const int incY, void *result) 8 | { 9 | #define BASE double 10 | #define CONJ_SIGN 1.0 11 | #include "source_dot_c.h" 12 | #undef CONJ_SIGN 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/zhpr.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_zhpr (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const int N, const double alpha, const void *X, const int incX, 8 | void *Ap) 9 | { 10 | #define BASE double 11 | #include "source_hpr.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /cblas/zdotc_sub.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_zdotc_sub (const int N, const void *X, const int incX, const void *Y, 7 | const int incY, void *result) 8 | { 9 | #define BASE double 10 | #define CONJ_SIGN (-1.0) 11 | #include "source_dot_c.h" 12 | #undef CONJ_SIGN 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/cher.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_cher (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const int N, const float alpha, const void *X, const int incX, 8 | void *A, const int lda) 9 | { 10 | #define BASE float 11 | #include "source_her.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /cblas/ssyr.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_ssyr (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const int N, const float alpha, const float *X, const int incX, 8 | float *A, const int lda) 9 | { 10 | #define BASE float 11 | #include "source_syr.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /cblas/zher.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_zher (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const int N, const double alpha, const void *X, const int incX, 8 | void *A, const int lda) 9 | { 10 | #define BASE double 11 | #include "source_her.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /doc/examples/vectorview.out: -------------------------------------------------------------------------------- 1 | matrix column 0, norm = 4.31461 2 | matrix column 1, norm = 3.1205 3 | matrix column 2, norm = 2.19316 4 | matrix column 3, norm = 3.26114 5 | matrix column 4, norm = 2.53416 6 | matrix column 5, norm = 2.57281 7 | matrix column 6, norm = 4.20469 8 | matrix column 7, norm = 3.65202 9 | matrix column 8, norm = 2.08524 10 | matrix column 9, norm = 3.07313 11 | -------------------------------------------------------------------------------- /matrix/TODO: -------------------------------------------------------------------------------- 1 | * Tests for subrowcol 2 | 3 | * Pretty print function 4 | 5 | * Clean up the tests. 6 | 7 | * Run tests where matrix tda != size2, note that tda is a physical 8 | dimension and size2 is the number of columns in the matrix. This will 9 | probably find a lot of bugs in the matrix logic. 10 | 11 | * Matrix norms that can be calculated analytically, e.g. Frobenius, etc 12 | -------------------------------------------------------------------------------- /blas/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | ########### next target ############### 4 | 5 | set(gslblas_STAT_SRCS blas.c) 6 | set(gslblas_STAT_SRCS ${gslblas_STAT_SRCS} PARENT_SCOPE) 7 | 8 | add_library(gslblas STATIC EXCLUDE_FROM_ALL ${gslblas_STAT_SRCS}) 9 | 10 | 11 | ########### install files ############### 12 | 13 | install(FILES gsl_blas.h gsl_blas_types.h DESTINATION ${INSTALL_INC}/gsl) 14 | -------------------------------------------------------------------------------- /cblas/dsyr.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_dsyr (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const int N, const double alpha, const double *X, const int incX, 8 | double *A, const int lda) 9 | { 10 | #define BASE double 11 | #include "source_syr.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /doc/examples/qrng.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (void) 6 | { 7 | int i; 8 | gsl_qrng * q = gsl_qrng_alloc (gsl_qrng_sobol, 2); 9 | 10 | for (i = 0; i < 1024; i++) 11 | { 12 | double v[2]; 13 | gsl_qrng_get (q, v); 14 | printf ("%.5f %.5f\n", v[0], v[1]); 15 | } 16 | 17 | gsl_qrng_free (q); 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /cblas/sdot.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | float 6 | cblas_sdot (const int N, const float *X, const int incX, const float *Y, 7 | const int incY) 8 | { 9 | #define INIT_VAL 0.0 10 | #define ACC_TYPE float 11 | #define BASE float 12 | #include "source_dot_r.h" 13 | #undef ACC_TYPE 14 | #undef BASE 15 | #undef INIT_VAL 16 | } 17 | -------------------------------------------------------------------------------- /cblas/TODO: -------------------------------------------------------------------------------- 1 | use macros so that all complex arithmetic can use native complex types if compiler supports them 2 | 3 | make sure double/float are replaced by BASE everywhere 4 | well... not _everywhere_; internal accumulations should 5 | be done in double always; there's no reason not too, 6 | it's safer and maybe even faster [GJ] 7 | 8 | gbmv_c : use conj*imag instead of having branches form Trans & ConjTrans 9 | -------------------------------------------------------------------------------- /cblas/cgerc.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_cgerc (const enum CBLAS_ORDER order, const int M, const int N, 7 | const void *alpha, const void *X, const int incX, const void *Y, 8 | const int incY, void *A, const int lda) 9 | { 10 | #define BASE float 11 | #include "source_gerc.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /cblas/cgeru.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_cgeru (const enum CBLAS_ORDER order, const int M, const int N, 7 | const void *alpha, const void *X, const int incX, const void *Y, 8 | const int incY, void *A, const int lda) 9 | { 10 | #define BASE float 11 | #include "source_geru.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /cblas/chpr2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_chpr2 (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const int N, const void *alpha, const void *X, const int incX, 8 | const void *Y, const int incY, void *Ap) 9 | { 10 | #define BASE float 11 | #include "source_hpr2.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /cblas/ddot.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | double 6 | cblas_ddot (const int N, const double *X, const int incX, const double *Y, 7 | const int incY) 8 | { 9 | #define INIT_VAL 0.0 10 | #define ACC_TYPE double 11 | #define BASE double 12 | #include "source_dot_r.h" 13 | #undef ACC_TYPE 14 | #undef BASE 15 | #undef INIT_VAL 16 | } 17 | -------------------------------------------------------------------------------- /cblas/dsdot.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | double 6 | cblas_dsdot (const int N, const float *X, const int incX, const float *Y, 7 | const int incY) 8 | { 9 | #define INIT_VAL 0.0 10 | #define ACC_TYPE double 11 | #define BASE float 12 | #include "source_dot_r.h" 13 | #undef ACC_TYPE 14 | #undef BASE 15 | #undef INIT_VAL 16 | } 17 | -------------------------------------------------------------------------------- /cblas/sger.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_sger (const enum CBLAS_ORDER order, const int M, const int N, 7 | const float alpha, const float *X, const int incX, const float *Y, 8 | const int incY, float *A, const int lda) 9 | { 10 | #define BASE float 11 | #include "source_ger.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /cblas/zgerc.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_zgerc (const enum CBLAS_ORDER order, const int M, const int N, 7 | const void *alpha, const void *X, const int incX, const void *Y, 8 | const int incY, void *A, const int lda) 9 | { 10 | #define BASE double 11 | #include "source_gerc.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /cblas/zgeru.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_zgeru (const enum CBLAS_ORDER order, const int M, const int N, 7 | const void *alpha, const void *X, const int incX, const void *Y, 8 | const int incY, void *A, const int lda) 9 | { 10 | #define BASE double 11 | #include "source_geru.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /cblas/dger.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_dger (const enum CBLAS_ORDER order, const int M, const int N, 7 | const double alpha, const double *X, const int incX, 8 | const double *Y, const int incY, double *A, const int lda) 9 | { 10 | #define BASE double 11 | #include "source_ger.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /cblas/sspr2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_sspr2 (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const int N, const float alpha, const float *X, const int incX, 8 | const float *Y, const int incY, float *Ap) 9 | { 10 | #define BASE double 11 | #include "source_spr2.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /cblas/zhpr2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_zhpr2 (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const int N, const void *alpha, const void *X, const int incX, 8 | const void *Y, const int incY, void *Ap) 9 | { 10 | #define BASE double 11 | #include "source_hpr2.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /cblas/dspr2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_dspr2 (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const int N, const double alpha, const double *X, const int incX, 8 | const double *Y, const int incY, double *Ap) 9 | { 10 | #define BASE double 11 | #include "source_spr2.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /gsl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | # Copy .h files into a gsl subdirectory so that #include works. 3 | FILE(GLOB_RECURSE HEADERLIST ${CMAKE_CURRENT_SOURCE_DIR}/../gsl*.h) 4 | FOREACH(v ${HEADERLIST}) 5 | GET_FILENAME_COMPONENT(dest ${v} NAME) 6 | CONFIGURE_FILE(${v} gsl/${dest} COPYONLY) 7 | ENDFOREACH(v) 8 | 9 | 10 | ########### install files ############### 11 | 12 | 13 | 14 | # clean: delete gsl*.h 15 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | echo "If you use a recent version of autotools, this script is obsolete" 4 | echo "Just run autoreconf -i instead" 5 | echo 6 | 7 | # Run this to generate all the auto-generated files needed by the GNU 8 | # configure program 9 | libtoolize --automake 10 | aclocal 11 | autoheader 12 | automake --add-missing --gnu 13 | autoconf 14 | echo "Now use ./configure --enable-maintainer-mode" 15 | -------------------------------------------------------------------------------- /cblas/cher2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_cher2 (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const int N, const void *alpha, const void *X, const int incX, 8 | const void *Y, const int incY, void *A, const int lda) 9 | { 10 | #define BASE float 11 | #include "source_her2.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /cblas/ctpmv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_ctpmv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, 8 | const int N, const void *Ap, void *X, const int incX) 9 | { 10 | #define BASE float 11 | #include "source_tpmv_c.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /cblas/zher2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_zher2 (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const int N, const void *alpha, const void *X, const int incX, 8 | const void *Y, const int incY, void *A, const int lda) 9 | { 10 | #define BASE double 11 | #include "source_her2.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /cblas/chpmv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_chpmv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const int N, const void *alpha, const void *Ap, const void *X, 8 | const int incX, const void *beta, void *Y, const int incY) 9 | { 10 | #define BASE float 11 | #include "source_hpmv.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /cblas/dtpmv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_dtpmv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, 8 | const int N, const double *Ap, double *X, const int incX) 9 | { 10 | #define BASE double 11 | #include "source_tpmv_r.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /cblas/dtpsv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_dtpsv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, 8 | const int N, const double *Ap, double *X, const int incX) 9 | { 10 | #define BASE double 11 | #include "source_tpsv_r.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /cblas/ssyr2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_ssyr2 (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const int N, const float alpha, const float *X, const int incX, 8 | const float *Y, const int incY, float *A, const int lda) 9 | { 10 | #define BASE float 11 | #include "source_syr2.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /cblas/stpmv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_stpmv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, 8 | const int N, const float *Ap, float *X, const int incX) 9 | { 10 | #define BASE float 11 | #include "source_tpmv_r.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /cblas/stpsv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_stpsv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, 8 | const int N, const float *Ap, float *X, const int incX) 9 | { 10 | #define BASE float 11 | #include "source_tpsv_r.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /cblas/zhpmv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_zhpmv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const int N, const void *alpha, const void *Ap, const void *X, 8 | const int incX, const void *beta, void *Y, const int incY) 9 | { 10 | #define BASE double 11 | #include "source_hpmv.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /cblas/ztpmv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_ztpmv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, 8 | const int N, const void *Ap, void *X, const int incX) 9 | { 10 | #define BASE double 11 | #include "source_tpmv_c.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /cblas/dsyr2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_dsyr2 (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const int N, const double alpha, const double *X, const int incX, 8 | const double *Y, const int incY, double *A, const int lda) 9 | { 10 | #define BASE double 11 | #include "source_syr2.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /cblas/sdsdot.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | float 6 | cblas_sdsdot (const int N, const float alpha, const float *X, const int incX, 7 | const float *Y, const int incY) 8 | { 9 | #define INIT_VAL alpha 10 | #define ACC_TYPE double 11 | #define BASE float 12 | #include "source_dot_r.h" 13 | #undef ACC_TYPE 14 | #undef BASE 15 | #undef INIT_VAL 16 | } 17 | -------------------------------------------------------------------------------- /cblas/sspmv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_sspmv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const int N, const float alpha, const float *Ap, const float *X, 8 | const int incX, const float beta, float *Y, const int incY) 9 | { 10 | #define BASE float 11 | #include "source_spmv.h" 12 | #undef BASE 13 | } 14 | -------------------------------------------------------------------------------- /roots/TODO: -------------------------------------------------------------------------------- 1 | * Add an inline version of the iterate method for speed? Perhaps not, 2 | the time taken for each iteration surely dominated by the convergence 3 | test. 4 | 5 | * Numerical derivatives? Maybe have a function to manufacture an fdf 6 | from an f and optionally a df. (We'll need to approximate the 7 | derivative if it is not provided; this is something which should be 8 | done outside the root finding package.) 9 | 10 | -------------------------------------------------------------------------------- /const/Makefile.am: -------------------------------------------------------------------------------- 1 | pkginclude_HEADERS = gsl_const.h gsl_const_cgs.h gsl_const_mks.h gsl_const_cgsm.h gsl_const_mksa.h gsl_const_num.h 2 | 3 | INCLUDES = -I$(top_srcdir) 4 | 5 | TESTS = $(check_PROGRAMS) 6 | 7 | check_PROGRAMS = test 8 | 9 | test_SOURCES = test.c 10 | 11 | test_LDADD = ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gsl/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | header-links: remove-links 3 | HEADERLIST="$(top_srcdir)/gsl*.h $(top_srcdir)/*/gsl*.h"; \ 4 | for h in $$HEADERLIST; do \ 5 | BASENAME=`basename $$h`; \ 6 | test -r $$BASENAME || $(LN_S) $$h $$BASENAME; \ 7 | done 8 | 9 | remove-links: 10 | rm -f gsl*.h 11 | 12 | 13 | all: all-am header-links 14 | 15 | clean: clean-am remove-links 16 | distclean: distclean-am remove-links 17 | -rm -f Makefile 18 | -------------------------------------------------------------------------------- /integration/positivity.c: -------------------------------------------------------------------------------- 1 | /* Compare the integral of f(x) with the integral of |f(x)| 2 | to determine if f(x) covers both positive and negative values */ 3 | 4 | static inline int 5 | test_positivity (double result, double resabs); 6 | 7 | static inline int 8 | test_positivity (double result, double resabs) 9 | { 10 | int status = (fabs (result) >= (1 - 50 * GSL_DBL_EPSILON) * resabs); 11 | 12 | return status; 13 | } 14 | -------------------------------------------------------------------------------- /integration/set_initial.c: -------------------------------------------------------------------------------- 1 | static inline 2 | void set_initial_result (gsl_integration_workspace * workspace, 3 | double result, double error); 4 | 5 | static inline 6 | void set_initial_result (gsl_integration_workspace * workspace, 7 | double result, double error) 8 | { 9 | workspace->size = 1; 10 | workspace->rlist[0] = result; 11 | workspace->elist[0] = error; 12 | } 13 | -------------------------------------------------------------------------------- /blas/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libgslblas.la 2 | 3 | pkginclude_HEADERS = gsl_blas.h gsl_blas_types.h 4 | 5 | INCLUDES = -I$(top_srcdir) 6 | 7 | libgslblas_la_SOURCES = blas.c 8 | 9 | #check_PROGRAMS = test 10 | #TESTS = test 11 | #test_LDADD = libgslblas.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la 12 | #test_SOURCES = test_blas_raw.c test_cases.c test_cases.h 13 | 14 | 15 | -------------------------------------------------------------------------------- /deriv/ChangeLog: -------------------------------------------------------------------------------- 1 | 2008-07-03 Brian Gough 2 | 3 | * Makefile.am (INCLUDES): use top_srcdir instead of top_builddir 4 | 5 | 2007-08-22 Brian Gough 6 | 7 | * deriv.c (central_deriv): corrected dy term for error in h 8 | (forward_deriv): corrected dy term for error in h 9 | 10 | 2004-03-06 Brian Gough 11 | 12 | * reworking API of gsl_diff 13 | 14 | -------------------------------------------------------------------------------- /cblas/ctpsv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | #include "hypot.c" 6 | 7 | void 8 | cblas_ctpsv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 9 | const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, 10 | const int N, const void *Ap, void *X, const int incX) 11 | { 12 | #define BASE float 13 | #include "source_tpsv_c.h" 14 | #undef BASE 15 | } 16 | -------------------------------------------------------------------------------- /cblas/dspmv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_dspmv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const int N, const double alpha, const double *Ap, 8 | const double *X, const int incX, const double beta, double *Y, 9 | const int incY) 10 | { 11 | #define BASE double 12 | #include "source_spmv.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /doc/examples/permseq.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (void) 6 | { 7 | gsl_permutation * p = gsl_permutation_alloc (3); 8 | 9 | gsl_permutation_init (p); 10 | 11 | do 12 | { 13 | gsl_permutation_fprintf (stdout, p, " %u"); 14 | printf ("\n"); 15 | } 16 | while (gsl_permutation_next(p) == GSL_SUCCESS); 17 | 18 | gsl_permutation_free (p); 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /fft/complex_internal.h: -------------------------------------------------------------------------------- 1 | /* Handling of packed complex types... not meant for client consumption. 2 | */ 3 | #ifndef COMPLEX_INTERNAL_H_ 4 | #define COMPLEX_INTERNAL_H_ 5 | 6 | #define VECTOR(a,stride,i) ((a)[(stride)*(i)]) 7 | #define REAL(a,stride,i) ((a)[2*(stride)*(i)]) 8 | #define IMAG(a,stride,i) ((a)[2*(stride)*(i)+1]) 9 | 10 | #define REAL0(a) ((a)[0]) 11 | #define IMAG0(a) ((a)[1]) 12 | 13 | 14 | #endif /* !COMPLEX_INTERNAL_H_ */ 15 | -------------------------------------------------------------------------------- /cblas/chemv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_chemv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const int N, const void *alpha, const void *A, const int lda, 8 | const void *X, const int incX, const void *beta, void *Y, 9 | const int incY) 10 | { 11 | #define BASE float 12 | #include "source_hemv.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/ctrmv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_ctrmv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, 8 | const int N, const void *A, const int lda, void *X, 9 | const int incX) 10 | { 11 | #define BASE float 12 | #include "source_trmv_c.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/strmv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_strmv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, 8 | const int N, const float *A, const int lda, float *X, 9 | const int incX) 10 | { 11 | #define BASE float 12 | #include "source_trmv_r.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/strsv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_strsv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, 8 | const int N, const float *A, const int lda, float *X, 9 | const int incX) 10 | { 11 | #define BASE float 12 | #include "source_trsv_r.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/ztpsv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | #include "hypot.c" 6 | 7 | void 8 | cblas_ztpsv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 9 | const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, 10 | const int N, const void *Ap, void *X, const int incX) 11 | { 12 | #define BASE double 13 | #include "source_tpsv_c.h" 14 | #undef BASE 15 | } 16 | -------------------------------------------------------------------------------- /cblas/ztrmv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_ztrmv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, 8 | const int N, const void *A, const int lda, void *X, 9 | const int incX) 10 | { 11 | #define BASE double 12 | #include "source_trmv_c.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /interpolation/TODO: -------------------------------------------------------------------------------- 1 | 1. need to add a test for the akima splines 2 | 3 | 2. [DOCUMENTATION] From: Conrad Curry 4 | 5 | I would suggest adding more about cspline and Akima similiar to what 6 | is given for 'polynomial', particularly under what conditions one 7 | would be prefered over the other. 8 | 9 | 3. add akima splines without the Wodicka modification, so that the spline 10 | is a smooth curve without corners. 11 | -------------------------------------------------------------------------------- /cblas/dtrmv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_dtrmv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, 8 | const int N, const double *A, const int lda, double *X, 9 | const int incX) 10 | { 11 | #define BASE double 12 | #include "source_trmv_r.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/dtrsv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_dtrsv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, 8 | const int N, const double *A, const int lda, double *X, 9 | const int incX) 10 | { 11 | #define BASE double 12 | #include "source_trsv_r.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/ssymv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_ssymv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const int N, const float alpha, const float *A, const int lda, 8 | const float *X, const int incX, const float beta, float *Y, 9 | const int incY) 10 | { 11 | #define BASE float 12 | #include "source_symv.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/zhemv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_zhemv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const int N, const void *alpha, const void *A, const int lda, 8 | const void *X, const int incX, const void *beta, void *Y, 9 | const int incY) 10 | { 11 | #define BASE double 12 | #include "source_hemv.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/ctbmv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_ctbmv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, 8 | const int N, const int K, const void *A, const int lda, void *X, 9 | const int incX) 10 | { 11 | #define BASE float 12 | #include "source_tbmv_c.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/dsymv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_dsymv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const int N, const double alpha, const double *A, const int lda, 8 | const double *X, const int incX, const double beta, double *Y, 9 | const int incY) 10 | { 11 | #define BASE double 12 | #include "source_symv.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/chbmv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_chbmv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const int N, const int K, const void *alpha, const void *A, 8 | const int lda, const void *X, const int incX, const void *beta, 9 | void *Y, const int incY) 10 | { 11 | #define BASE float 12 | #include "source_hbmv.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/cherk.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_cherk (const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE Trans, const int N, const int K, 8 | const float alpha, const void *A, const int lda, 9 | const float beta, void *C, const int ldc) 10 | { 11 | #define BASE float 12 | #include "source_herk.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/dtbmv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_dtbmv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, 8 | const int N, const int K, const double *A, const int lda, 9 | double *X, const int incX) 10 | { 11 | #define BASE double 12 | #include "source_tbmv_r.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/dtbsv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_dtbsv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, 8 | const int N, const int K, const double *A, const int lda, 9 | double *X, const int incX) 10 | { 11 | #define BASE double 12 | #include "source_tbsv_r.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/stbmv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_stbmv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, 8 | const int N, const int K, const float *A, const int lda, 9 | float *X, const int incX) 10 | { 11 | #define BASE float 12 | #include "source_tbmv_r.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/stbsv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_stbsv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, 8 | const int N, const int K, const float *A, const int lda, 9 | float *X, const int incX) 10 | { 11 | #define BASE float 12 | #include "source_tbsv_r.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/zhbmv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_zhbmv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const int N, const int K, const void *alpha, const void *A, 8 | const int lda, const void *X, const int incX, const void *beta, 9 | void *Y, const int incY) 10 | { 11 | #define BASE double 12 | #include "source_hbmv.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/ztbmv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_ztbmv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, 8 | const int N, const int K, const void *A, const int lda, void *X, 9 | const int incX) 10 | { 11 | #define BASE double 12 | #include "source_tbmv_c.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cheb/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libgslcheb.la 2 | 3 | pkginclude_HEADERS = gsl_chebyshev.h 4 | 5 | INCLUDES = -I$(top_srcdir) 6 | 7 | libgslcheb_la_SOURCES = deriv.c eval.c init.c integ.c 8 | 9 | TESTS = $(check_PROGRAMS) 10 | 11 | check_PROGRAMS = test 12 | 13 | test_LDADD = libgslcheb.la ../ieee-utils/libgslieeeutils.la ../test/libgsltest.la ../sys/libgslsys.la ../err/libgslerr.la ../utils/libutils.la 14 | 15 | test_SOURCES = test.c 16 | 17 | 18 | -------------------------------------------------------------------------------- /doc/examples/vectorr.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (void) 6 | { 7 | int i; 8 | gsl_vector * v = gsl_vector_alloc (10); 9 | 10 | { 11 | FILE * f = fopen ("test.dat", "r"); 12 | gsl_vector_fscanf (f, v); 13 | fclose (f); 14 | } 15 | 16 | for (i = 0; i < 10; i++) 17 | { 18 | printf ("%g\n", gsl_vector_get(v, i)); 19 | } 20 | 21 | gsl_vector_free (v); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /cblas/csyrk.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_csyrk (const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE Trans, const int N, const int K, 8 | const void *alpha, const void *A, const int lda, 9 | const void *beta, void *C, const int ldc) 10 | { 11 | #define BASE float 12 | #include "source_syrk_c.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/ssbmv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_ssbmv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const int N, const int K, const float alpha, const float *A, 8 | const int lda, const float *X, const int incX, const float beta, 9 | float *Y, const int incY) 10 | { 11 | #define BASE float 12 | #include "source_sbmv.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/ssyrk.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_ssyrk (const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE Trans, const int N, const int K, 8 | const float alpha, const float *A, const int lda, 9 | const float beta, float *C, const int ldc) 10 | { 11 | #define BASE float 12 | #include "source_syrk_r.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/zherk.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_zherk (const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE Trans, const int N, const int K, 8 | const double alpha, const void *A, const int lda, 9 | const double beta, void *C, const int ldc) 10 | { 11 | #define BASE double 12 | #include "source_herk.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/zsyrk.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_zsyrk (const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE Trans, const int N, const int K, 8 | const void *alpha, const void *A, const int lda, 9 | const void *beta, void *C, const int ldc) 10 | { 11 | #define BASE double 12 | #include "source_syrk_c.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /doc/examples/vectorw.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (void) 6 | { 7 | int i; 8 | gsl_vector * v = gsl_vector_alloc (100); 9 | 10 | for (i = 0; i < 100; i++) 11 | { 12 | gsl_vector_set (v, i, 1.23 + i); 13 | } 14 | 15 | { 16 | FILE * f = fopen ("test.dat", "w"); 17 | gsl_vector_fprintf (f, v, "%.5g"); 18 | fclose (f); 19 | } 20 | 21 | gsl_vector_free (v); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /sum/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libgslsum.la 2 | 3 | pkginclude_HEADERS = gsl_sum.h 4 | 5 | INCLUDES = -I$(top_srcdir) 6 | 7 | libgslsum_la_SOURCES = levin_u.c levin_utrunc.c work_u.c work_utrunc.c 8 | 9 | TESTS = $(check_PROGRAMS) 10 | 11 | check_PROGRAMS = test 12 | 13 | test_LDADD = libgslsum.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la 14 | 15 | test_SOURCES = test.c 16 | 17 | 18 | -------------------------------------------------------------------------------- /cblas/cgemv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_cgemv (const enum CBLAS_ORDER order, const enum CBLAS_TRANSPOSE TransA, 7 | const int M, const int N, const void *alpha, const void *A, 8 | const int lda, const void *X, const int incX, const void *beta, 9 | void *Y, const int incY) 10 | { 11 | #define BASE float 12 | #include "source_gemv_c.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/dsbmv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_dsbmv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 7 | const int N, const int K, const double alpha, const double *A, 8 | const int lda, const double *X, const int incX, 9 | const double beta, double *Y, const int incY) 10 | { 11 | #define BASE double 12 | #include "source_sbmv.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/dsyrk.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_dsyrk (const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE Trans, const int N, const int K, 8 | const double alpha, const double *A, const int lda, 9 | const double beta, double *C, const int ldc) 10 | { 11 | #define BASE double 12 | #include "source_syrk_r.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/sgemv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_sgemv (const enum CBLAS_ORDER order, const enum CBLAS_TRANSPOSE TransA, 7 | const int M, const int N, const float alpha, const float *A, 8 | const int lda, const float *X, const int incX, const float beta, 9 | float *Y, const int incY) 10 | { 11 | #define BASE float 12 | #include "source_gemv_r.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/zgemv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_zgemv (const enum CBLAS_ORDER order, const enum CBLAS_TRANSPOSE TransA, 7 | const int M, const int N, const void *alpha, const void *A, 8 | const int lda, const void *X, const int incX, const void *beta, 9 | void *Y, const int incY) 10 | { 11 | #define BASE double 12 | #include "source_gemv_c.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /dht/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libgsldht.la 2 | 3 | pkginclude_HEADERS = gsl_dht.h 4 | 5 | INCLUDES = -I$(top_srcdir) 6 | 7 | TESTS = $(check_PROGRAMS) 8 | 9 | check_PROGRAMS = test 10 | 11 | test_LDADD = libgsldht.la ../specfunc/libgslspecfunc.la ../complex/libgslcomplex.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la 12 | 13 | test_SOURCES = test.c 14 | 15 | libgsldht_la_SOURCES = dht.c 16 | -------------------------------------------------------------------------------- /doc/examples/rngunif.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (void) 6 | { 7 | const gsl_rng_type * T; 8 | gsl_rng * r; 9 | 10 | int i, n = 10; 11 | 12 | gsl_rng_env_setup(); 13 | 14 | T = gsl_rng_default; 15 | r = gsl_rng_alloc (T); 16 | 17 | for (i = 0; i < n; i++) 18 | { 19 | double u = gsl_rng_uniform (r); 20 | printf ("%.5f\n", u); 21 | } 22 | 23 | gsl_rng_free (r); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /doc/examples/vector.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (void) 6 | { 7 | int i; 8 | gsl_vector * v = gsl_vector_alloc (3); 9 | 10 | for (i = 0; i < 3; i++) 11 | { 12 | gsl_vector_set (v, i, 1.23 + i); 13 | } 14 | 15 | for (i = 0; i < 100; i++) /* OUT OF RANGE ERROR */ 16 | { 17 | printf ("v_%d = %g\n", i, gsl_vector_get (v, i)); 18 | } 19 | 20 | gsl_vector_free (v); 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /cblas/ctrsv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | #include "hypot.c" 6 | 7 | void 8 | cblas_ctrsv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 9 | const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, 10 | const int N, const void *A, const int lda, void *X, 11 | const int incX) 12 | { 13 | #define BASE float 14 | #include "source_trsv_c.h" 15 | #undef BASE 16 | } 17 | -------------------------------------------------------------------------------- /cblas/ztrsv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | #include "hypot.c" 6 | 7 | void 8 | cblas_ztrsv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 9 | const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, 10 | const int N, const void *A, const int lda, void *X, 11 | const int incX) 12 | { 13 | #define BASE double 14 | #include "source_trsv_c.h" 15 | #undef BASE 16 | } 17 | -------------------------------------------------------------------------------- /utils/memcpy.c: -------------------------------------------------------------------------------- 1 | /* Copy LEN bytes starting at SRCADDR to DESTADDR. Result undefined 2 | if the source overlaps with the destination. 3 | Return DESTADDR. */ 4 | 5 | #if HAVE_CONFIG_H 6 | #include 7 | #endif 8 | 9 | char * 10 | memcpy (destaddr, srcaddr, len) 11 | char *destaddr; 12 | const char *srcaddr; 13 | int len; 14 | { 15 | char *dest = destaddr; 16 | 17 | while (len-- > 0) 18 | *destaddr++ = *srcaddr++; 19 | return dest; 20 | } 21 | -------------------------------------------------------------------------------- /cblas/dgemv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_dgemv (const enum CBLAS_ORDER order, const enum CBLAS_TRANSPOSE TransA, 7 | const int M, const int N, const double alpha, const double *A, 8 | const int lda, const double *X, const int incX, 9 | const double beta, double *Y, const int incY) 10 | { 11 | #define BASE double 12 | #include "source_gemv_r.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /qrng/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libgslqrng.la 2 | 3 | pkginclude_HEADERS = gsl_qrng.h 4 | 5 | INCLUDES = -I$(top_srcdir) 6 | 7 | libgslqrng_la_SOURCES = gsl_qrng.h qrng.c niederreiter-2.c sobol.c halton.c reversehalton.c inline.c 8 | 9 | TESTS = $(check_PROGRAMS) 10 | check_PROGRAMS = test 11 | 12 | test_SOURCES = test.c 13 | test_LDADD = libgslqrng.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la 14 | 15 | -------------------------------------------------------------------------------- /sys/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libgslsys.la 2 | 3 | pkginclude_HEADERS = gsl_sys.h 4 | 5 | libgslsys_la_SOURCES = minmax.c prec.c hypot.c log1p.c expm1.c coerce.c invhyp.c pow_int.c infnan.c fdiv.c fcmp.c ldfrexp.c 6 | 7 | INCLUDES = -I$(top_srcdir) 8 | 9 | check_PROGRAMS = test 10 | TESTS = $(check_PROGRAMS) 11 | test_SOURCES = test.c 12 | test_LDADD = libgslsys.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la libgslsys.la ../utils/libutils.la 13 | -------------------------------------------------------------------------------- /cblas/chemm.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_chemm (const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, 7 | const enum CBLAS_UPLO Uplo, const int M, const int N, 8 | const void *alpha, const void *A, const int lda, const void *B, 9 | const int ldb, const void *beta, void *C, const int ldc) 10 | { 11 | #define BASE float 12 | #include "source_hemm.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/ctbsv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | #include "hypot.c" 6 | 7 | void 8 | cblas_ctbsv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 9 | const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, 10 | const int N, const int K, const void *A, const int lda, void *X, 11 | const int incX) 12 | { 13 | #define BASE float 14 | #include "source_tbsv_c.h" 15 | #undef BASE 16 | } 17 | -------------------------------------------------------------------------------- /cblas/zhemm.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_zhemm (const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, 7 | const enum CBLAS_UPLO Uplo, const int M, const int N, 8 | const void *alpha, const void *A, const int lda, const void *B, 9 | const int ldb, const void *beta, void *C, const int ldc) 10 | { 11 | #define BASE double 12 | #include "source_hemm.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cdf/rat_eval.h: -------------------------------------------------------------------------------- 1 | static double 2 | rat_eval (const double a[], const size_t na, 3 | const double b[], const size_t nb, const double x) 4 | { 5 | size_t i, j; 6 | double u, v, r; 7 | 8 | u = a[na - 1]; 9 | 10 | for (i = na - 1; i > 0; i--) 11 | { 12 | u = x * u + a[i - 1]; 13 | } 14 | 15 | v = b[nb - 1]; 16 | 17 | for (j = nb - 1; j > 0; j--) 18 | { 19 | v = x * v + b[j - 1]; 20 | } 21 | 22 | r = u / v; 23 | 24 | return r; 25 | } 26 | -------------------------------------------------------------------------------- /cblas/csymm.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_csymm (const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, 7 | const enum CBLAS_UPLO Uplo, const int M, const int N, 8 | const void *alpha, const void *A, const int lda, const void *B, 9 | const int ldb, const void *beta, void *C, const int ldc) 10 | { 11 | #define BASE float 12 | #include "source_symm_c.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/ssymm.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_ssymm (const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, 7 | const enum CBLAS_UPLO Uplo, const int M, const int N, 8 | const float alpha, const float *A, const int lda, const float *B, 9 | const int ldb, const float beta, float *C, const int ldc) 10 | { 11 | #define BASE float 12 | #include "source_symm_r.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/zsymm.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_zsymm (const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, 7 | const enum CBLAS_UPLO Uplo, const int M, const int N, 8 | const void *alpha, const void *A, const int lda, const void *B, 9 | const int ldb, const void *beta, void *C, const int ldc) 10 | { 11 | #define BASE double 12 | #include "source_symm_c.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/ztbsv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | #include "hypot.c" 6 | 7 | void 8 | cblas_ztbsv (const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, 9 | const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, 10 | const int N, const int K, const void *A, const int lda, void *X, 11 | const int incX) 12 | { 13 | #define BASE double 14 | #include "source_tbsv_c.h" 15 | #undef BASE 16 | } 17 | -------------------------------------------------------------------------------- /doc/examples/ieee.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (void) 6 | { 7 | float f = 1.0/3.0; 8 | double d = 1.0/3.0; 9 | 10 | double fd = f; /* promote from float to double */ 11 | 12 | printf (" f="); gsl_ieee_printf_float(&f); 13 | printf ("\n"); 14 | 15 | printf ("fd="); gsl_ieee_printf_double(&fd); 16 | printf ("\n"); 17 | 18 | printf (" d="); gsl_ieee_printf_double(&d); 19 | printf ("\n"); 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /cblas/cgbmv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_cgbmv (const enum CBLAS_ORDER order, const enum CBLAS_TRANSPOSE TransA, 7 | const int M, const int N, const int KL, const int KU, 8 | const void *alpha, const void *A, const int lda, const void *X, 9 | const int incX, const void *beta, void *Y, const int incY) 10 | { 11 | #define BASE float 12 | #include "source_gbmv_c.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /specfunc/eval.h: -------------------------------------------------------------------------------- 1 | /* evaluate a function discarding the status value in a modifiable way */ 2 | 3 | #define EVAL_RESULT(fn) \ 4 | gsl_sf_result result; \ 5 | int status = fn; \ 6 | if (status != GSL_SUCCESS) { \ 7 | GSL_ERROR_VAL(#fn, status, result.val); \ 8 | } ; \ 9 | return result.val; 10 | 11 | #define EVAL_DOUBLE(fn) \ 12 | int status = fn; \ 13 | if (status != GSL_SUCCESS) { \ 14 | GSL_ERROR_VAL(#fn, status, result); \ 15 | } ; \ 16 | return result; 17 | 18 | -------------------------------------------------------------------------------- /cblas/cher2k.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_cher2k (const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE Trans, const int N, const int K, 8 | const void *alpha, const void *A, const int lda, const void *B, 9 | const int ldb, const float beta, void *C, const int ldc) 10 | { 11 | #define BASE float 12 | #include "source_her2k.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/csyr2k.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_csyr2k (const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE Trans, const int N, const int K, 8 | const void *alpha, const void *A, const int lda, const void *B, 9 | const int ldb, const void *beta, void *C, const int ldc) 10 | { 11 | #define BASE float 12 | #include "source_syr2k_c.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/sgbmv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_sgbmv (const enum CBLAS_ORDER order, const enum CBLAS_TRANSPOSE TransA, 7 | const int M, const int N, const int KL, const int KU, 8 | const float alpha, const float *A, const int lda, const float *X, 9 | const int incX, const float beta, float *Y, const int incY) 10 | { 11 | #define BASE float 12 | #include "source_gbmv_r.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/zgbmv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_zgbmv (const enum CBLAS_ORDER order, const enum CBLAS_TRANSPOSE TransA, 7 | const int M, const int N, const int KL, const int KU, 8 | const void *alpha, const void *A, const int lda, const void *X, 9 | const int incX, const void *beta, void *Y, const int incY) 10 | { 11 | #define BASE double 12 | #include "source_gbmv_c.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/zher2k.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_zher2k (const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE Trans, const int N, const int K, 8 | const void *alpha, const void *A, const int lda, const void *B, 9 | const int ldb, const double beta, void *C, const int ldc) 10 | { 11 | #define BASE double 12 | #include "source_her2k.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /cblas/zsyr2k.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_zsyr2k (const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE Trans, const int N, const int K, 8 | const void *alpha, const void *A, const int lda, const void *B, 9 | const int ldb, const void *beta, void *C, const int ldc) 10 | { 11 | #define BASE double 12 | #include "source_syr2k_c.h" 13 | #undef BASE 14 | } 15 | -------------------------------------------------------------------------------- /doc/examples/rng.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | gsl_rng * r; /* global generator */ 5 | 6 | int 7 | main (void) 8 | { 9 | const gsl_rng_type * T; 10 | 11 | gsl_rng_env_setup(); 12 | 13 | T = gsl_rng_default; 14 | r = gsl_rng_alloc (T); 15 | 16 | printf ("generator type: %s\n", gsl_rng_name (r)); 17 | printf ("seed = %lu\n", gsl_rng_default_seed); 18 | printf ("first value = %lu\n", gsl_rng_get (r)); 19 | 20 | gsl_rng_free (r); 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /doc/examples/cdf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (void) 6 | { 7 | double P, Q; 8 | double x = 2.0; 9 | 10 | P = gsl_cdf_ugaussian_P (x); 11 | printf ("prob(x < %f) = %f\n", x, P); 12 | 13 | Q = gsl_cdf_ugaussian_Q (x); 14 | printf ("prob(x > %f) = %f\n", x, Q); 15 | 16 | x = gsl_cdf_ugaussian_Pinv (P); 17 | printf ("Pinv(%f) = %f\n", P, x); 18 | 19 | x = gsl_cdf_ugaussian_Qinv (Q); 20 | printf ("Qinv(%f) = %f\n", Q, x); 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /wavelet/TODO: -------------------------------------------------------------------------------- 1 | * Implement more wavelet types: 2 | Check the literature to find out what are commonly used types. Candidates 3 | could be coiflets and symmlets. 4 | ** Coefficients for coiflets and symmlets found so far are only with a 5 | precision of about eight digts. This is probaly insufficient. 6 | 7 | * Wavelet packet transform: 8 | Should include utility functions for selecting the coefficients according 9 | to "dwt-type", "best basis" or "best level". 10 | 11 | * Continuous wavelet transform. 12 | -------------------------------------------------------------------------------- /cblas/dsymm.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_dsymm (const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, 7 | const enum CBLAS_UPLO Uplo, const int M, const int N, 8 | const double alpha, const double *A, const int lda, 9 | const double *B, const int ldb, const double beta, double *C, 10 | const int ldc) 11 | { 12 | #define BASE double 13 | #include "source_symm_r.h" 14 | #undef BASE 15 | } 16 | -------------------------------------------------------------------------------- /dht/ChangeLog: -------------------------------------------------------------------------------- 1 | 2009-07-09 Brian Gough 2 | 3 | * dht.c (gsl_dht_free): handle NULL argument in free 4 | 5 | 2008-07-03 Brian Gough 6 | 7 | * Makefile.am (INCLUDES): use top_srcdir instead of top_builddir 8 | 9 | Mon Apr 23 10:31:58 2001 Brian Gough 10 | 11 | * unified error handling conventions to _e for error handling 12 | functions and no suffix for plain functions, so _impl functions 13 | are no longer needed. 14 | 15 | -------------------------------------------------------------------------------- /gsl_version.h: -------------------------------------------------------------------------------- 1 | #ifndef __GSL_VERSION_H__ 2 | #define __GSL_VERSION_H__ 3 | 4 | #include 5 | 6 | #undef __BEGIN_DECLS 7 | #undef __END_DECLS 8 | #ifdef __cplusplus 9 | # define __BEGIN_DECLS extern "C" { 10 | # define __END_DECLS } 11 | #else 12 | # define __BEGIN_DECLS /* empty */ 13 | # define __END_DECLS /* empty */ 14 | #endif 15 | __BEGIN_DECLS 16 | 17 | 18 | #define GSL_VERSION "1.13" 19 | 20 | GSL_VAR const char * gsl_version; 21 | 22 | __END_DECLS 23 | 24 | #endif /* __GSL_VERSION_H__ */ 25 | -------------------------------------------------------------------------------- /cblas/ctrmm.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_ctrmm (const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, 7 | const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, 8 | const enum CBLAS_DIAG Diag, const int M, const int N, 9 | const void *alpha, const void *A, const int lda, void *B, 10 | const int ldb) 11 | { 12 | #define BASE float 13 | #include "source_trmm_c.h" 14 | #undef BASE 15 | } 16 | -------------------------------------------------------------------------------- /cblas/ssyr2k.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_ssyr2k (const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE Trans, const int N, const int K, 8 | const float alpha, const float *A, const int lda, 9 | const float *B, const int ldb, const float beta, float *C, 10 | const int ldc) 11 | { 12 | #define BASE float 13 | #include "source_syr2k_r.h" 14 | #undef BASE 15 | } 16 | -------------------------------------------------------------------------------- /cblas/ztrmm.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_ztrmm (const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, 7 | const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, 8 | const enum CBLAS_DIAG Diag, const int M, const int N, 9 | const void *alpha, const void *A, const int lda, void *B, 10 | const int ldb) 11 | { 12 | #define BASE double 13 | #include "source_trmm_c.h" 14 | #undef BASE 15 | } 16 | -------------------------------------------------------------------------------- /complex/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libgslcomplex.la 2 | 3 | pkginclude_HEADERS = gsl_complex.h gsl_complex_math.h 4 | 5 | INCLUDES = -I$(top_srcdir) 6 | 7 | libgslcomplex_la_SOURCES = math.c inline.c 8 | 9 | TESTS = $(check_PROGRAMS) 10 | check_PROGRAMS = test 11 | 12 | test_SOURCES = test.c results.h results1.h results2.h results_real.h 13 | test_LDADD = libgslcomplex.la ../err/libgslerr.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la 14 | 15 | -------------------------------------------------------------------------------- /min/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libgslmin.la 2 | 3 | pkginclude_HEADERS = gsl_min.h 4 | 5 | noinst_HEADERS = min.h 6 | 7 | INCLUDES = -I$(top_srcdir) 8 | 9 | libgslmin_la_SOURCES = fsolver.c golden.c brent.c convergence.c bracketing.c quad_golden.c 10 | 11 | check_PROGRAMS = test 12 | 13 | TESTS = $(check_PROGRAMS) 14 | 15 | test_SOURCES = test.c test_funcs.c test.h 16 | test_LDADD = libgslmin.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../utils/libutils.la ../sys/libgslsys.la 17 | -------------------------------------------------------------------------------- /cblas/dgbmv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_dgbmv (const enum CBLAS_ORDER order, const enum CBLAS_TRANSPOSE TransA, 7 | const int M, const int N, const int KL, const int KU, 8 | const double alpha, const double *A, const int lda, 9 | const double *X, const int incX, const double beta, double *Y, 10 | const int incY) 11 | { 12 | #define BASE double 13 | #include "source_gbmv_r.h" 14 | #undef BASE 15 | } 16 | -------------------------------------------------------------------------------- /cblas/dtrmm.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_dtrmm (const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, 7 | const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, 8 | const enum CBLAS_DIAG Diag, const int M, const int N, 9 | const double alpha, const double *A, const int lda, double *B, 10 | const int ldb) 11 | { 12 | #define BASE double 13 | #include "source_trmm_r.h" 14 | #undef BASE 15 | } 16 | -------------------------------------------------------------------------------- /cblas/dtrsm.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_dtrsm (const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, 7 | const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, 8 | const enum CBLAS_DIAG Diag, const int M, const int N, 9 | const double alpha, const double *A, const int lda, double *B, 10 | const int ldb) 11 | { 12 | #define BASE double 13 | #include "source_trsm_r.h" 14 | #undef BASE 15 | } 16 | -------------------------------------------------------------------------------- /cblas/strmm.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_strmm (const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, 7 | const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, 8 | const enum CBLAS_DIAG Diag, const int M, const int N, 9 | const float alpha, const float *A, const int lda, float *B, 10 | const int ldb) 11 | { 12 | #define BASE float 13 | #include "source_trmm_r.h" 14 | #undef BASE 15 | } 16 | -------------------------------------------------------------------------------- /cblas/strsm.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_strsm (const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, 7 | const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, 8 | const enum CBLAS_DIAG Diag, const int M, const int N, 9 | const float alpha, const float *A, const int lda, float *B, 10 | const int ldb) 11 | { 12 | #define BASE float 13 | #include "source_trsm_r.h" 14 | #undef BASE 15 | } 16 | -------------------------------------------------------------------------------- /gsl_version.h.cmake: -------------------------------------------------------------------------------- 1 | #ifndef __GSL_VERSION_H__ 2 | #define __GSL_VERSION_H__ 3 | 4 | #include 5 | 6 | #undef __BEGIN_DECLS 7 | #undef __END_DECLS 8 | #ifdef __cplusplus 9 | # define __BEGIN_DECLS extern "C" { 10 | # define __END_DECLS } 11 | #else 12 | # define __BEGIN_DECLS /* empty */ 13 | # define __END_DECLS /* empty */ 14 | #endif 15 | __BEGIN_DECLS 16 | 17 | 18 | #define GSL_VERSION "@VERSION@" 19 | 20 | GSL_VAR const char * gsl_version; 21 | 22 | __END_DECLS 23 | 24 | #endif /* __GSL_VERSION_H__ */ 25 | -------------------------------------------------------------------------------- /gsl_version.h.in: -------------------------------------------------------------------------------- 1 | #ifndef __GSL_VERSION_H__ 2 | #define __GSL_VERSION_H__ 3 | 4 | #include 5 | 6 | #undef __BEGIN_DECLS 7 | #undef __END_DECLS 8 | #ifdef __cplusplus 9 | # define __BEGIN_DECLS extern "C" { 10 | # define __END_DECLS } 11 | #else 12 | # define __BEGIN_DECLS /* empty */ 13 | # define __END_DECLS /* empty */ 14 | #endif 15 | __BEGIN_DECLS 16 | 17 | 18 | #define GSL_VERSION "@VERSION@" 19 | 20 | GSL_VAR const char * gsl_version; 21 | 22 | __END_DECLS 23 | 24 | #endif /* __GSL_VERSION_H__ */ 25 | -------------------------------------------------------------------------------- /statistics/wmean.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define BASE_LONG_DOUBLE 5 | #include "templates_on.h" 6 | #include "wmean_source.c" 7 | #include "templates_off.h" 8 | #undef BASE_LONG_DOUBLE 9 | 10 | #define BASE_DOUBLE 11 | #include "templates_on.h" 12 | #include "wmean_source.c" 13 | #include "templates_off.h" 14 | #undef BASE_DOUBLE 15 | 16 | #define BASE_FLOAT 17 | #include "templates_on.h" 18 | #include "wmean_source.c" 19 | #include "templates_off.h" 20 | #undef BASE_FLOAT 21 | 22 | -------------------------------------------------------------------------------- /cblas/dsyr2k.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_dsyr2k (const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, 7 | const enum CBLAS_TRANSPOSE Trans, const int N, const int K, 8 | const double alpha, const double *A, const int lda, 9 | const double *B, const int ldb, const double beta, double *C, 10 | const int ldc) 11 | { 12 | #define BASE double 13 | #include "source_syr2k_r.h" 14 | #undef BASE 15 | } 16 | -------------------------------------------------------------------------------- /sort/gsl_sort.h: -------------------------------------------------------------------------------- 1 | #ifndef __GSL_SORT_H__ 2 | #define __GSL_SORT_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | 11 | #include 12 | #include 13 | 14 | #include 15 | #include 16 | 17 | #include 18 | #include 19 | 20 | #endif /* __GSL_SORT_H__ */ 21 | -------------------------------------------------------------------------------- /cblas/cgemm.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_cgemm (const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, 7 | const enum CBLAS_TRANSPOSE TransB, const int M, const int N, 8 | const int K, const void *alpha, const void *A, const int lda, 9 | const void *B, const int ldb, const void *beta, void *C, 10 | const int ldc) 11 | { 12 | #define BASE float 13 | #include "source_gemm_c.h" 14 | #undef BASE 15 | } 16 | -------------------------------------------------------------------------------- /cblas/sgemm.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_sgemm (const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, 7 | const enum CBLAS_TRANSPOSE TransB, const int M, const int N, 8 | const int K, const float alpha, const float *A, const int lda, 9 | const float *B, const int ldb, const float beta, float *C, 10 | const int ldc) 11 | { 12 | #define BASE float 13 | #include "source_gemm_r.h" 14 | #undef BASE 15 | } 16 | -------------------------------------------------------------------------------- /cblas/zgemm.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_zgemm (const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, 7 | const enum CBLAS_TRANSPOSE TransB, const int M, const int N, 8 | const int K, const void *alpha, const void *A, const int lda, 9 | const void *B, const int ldb, const void *beta, void *C, 10 | const int ldc) 11 | { 12 | #define BASE double 13 | #include "source_gemm_c.h" 14 | #undef BASE 15 | } 16 | -------------------------------------------------------------------------------- /cblas/dgemm.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | void 6 | cblas_dgemm (const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, 7 | const enum CBLAS_TRANSPOSE TransB, const int M, const int N, 8 | const int K, const double alpha, const double *A, const int lda, 9 | const double *B, const int ldb, const double beta, double *C, 10 | const int ldc) 11 | { 12 | #define BASE double 13 | #include "source_gemm_r.h" 14 | #undef BASE 15 | } 16 | -------------------------------------------------------------------------------- /const/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | ########### next target ############### 3 | 4 | set(test_SRCS test.c) 5 | set(test_SRCS ${test_SRCS} PARENT_SCOPE) 6 | 7 | if(KDE4_BUILD_TESTS) 8 | 9 | add_executable(test ${test_SRCS}) 10 | 11 | target_link_libraries(test gslieeeutils gslerr gsltest gslsys utils) 12 | 13 | endif(KDE4_BUILD_TESTS) 14 | 15 | ########### install files ############### 16 | 17 | install(FILES gsl_const.h gsl_const_cgs.h gsl_const_mks.h gsl_const_cgsm.h gsl_const_mksa.h gsl_const_num.h DESTINATION ${INSTALL_INC}/gsl) 18 | 19 | 20 | -------------------------------------------------------------------------------- /eigen/TODO: -------------------------------------------------------------------------------- 1 | 2 | * dlae2.f has better handling of 2x2 eigenvalues than our qrstep.c 3 | 4 | * Document Jacobi eigen function, in particular that it only works for 5 | symmetric matrices. 6 | 7 | * add support for nonsymmv left eigenvectors?: 8 | 9 | gsl_eigen_nonsymmv_params(const int lr) 10 | 11 | to specify whether we should compute left/right eigenvectors (or both). 12 | 13 | If they want both, we'll need a new function: 14 | 15 | gsl_eigen_nonsymmv_lr(..., evec_r, evec_l, ...) 16 | and 17 | gsl_eigen_nonsymmv_lr_Z(...) 18 | -------------------------------------------------------------------------------- /dist.info: -------------------------------------------------------------------------------- 1 | --- This file is part of LuaDist project 2 | 3 | name = "gsl" 4 | version = "1.13" 5 | 6 | desc = "The GNU Scientific Library (GSL) is a numerical library for C and C++ programmers." 7 | author = "Mark Galassi,Jim Davies,James Theiler,Brian Gough,Reid Priedhorsky,Gerard Jungman,Michael Booth,Fabrice Rossi,Simone Piccardi,Carlo Perassi,Dan, Ho-Jin,Szymon Jaroszewicz,Nicolas Darnis,Tuomo Keskitalo,Ivo Alxneit,Jason H. Stover,Patrick Alken" 8 | url = "http://www.gnu.org/software/gsl/" 9 | maintainer = "Peter Drahoš" 10 | license = "GPL" 11 | -------------------------------------------------------------------------------- /statistics/wskew.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #define BASE_LONG_DOUBLE 6 | #include "templates_on.h" 7 | #include "wskew_source.c" 8 | #include "templates_off.h" 9 | #undef BASE_LONG_DOUBLE 10 | 11 | #define BASE_DOUBLE 12 | #include "templates_on.h" 13 | #include "wskew_source.c" 14 | #include "templates_off.h" 15 | #undef BASE_DOUBLE 16 | 17 | #define BASE_FLOAT 18 | #include "templates_on.h" 19 | #include "wskew_source.c" 20 | #include "templates_off.h" 21 | #undef BASE_FLOAT 22 | 23 | -------------------------------------------------------------------------------- /cblas/ctrsm.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | #include "hypot.c" 6 | 7 | void 8 | cblas_ctrsm (const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, 9 | const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, 10 | const enum CBLAS_DIAG Diag, const int M, const int N, 11 | const void *alpha, const void *A, const int lda, void *B, 12 | const int ldb) 13 | { 14 | #define BASE float 15 | #include "source_trsm_c.h" 16 | #undef BASE 17 | } 18 | -------------------------------------------------------------------------------- /cblas/ztrsm.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cblas.h" 4 | 5 | #include "hypot.c" 6 | 7 | void 8 | cblas_ztrsm (const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, 9 | const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, 10 | const enum CBLAS_DIAG Diag, const int M, const int N, 11 | const void *alpha, const void *A, const int lda, void *B, 12 | const int ldb) 13 | { 14 | #define BASE double 15 | #include "source_trsm_c.h" 16 | #undef BASE 17 | } 18 | -------------------------------------------------------------------------------- /doc/examples/matrix.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (void) 6 | { 7 | int i, j; 8 | gsl_matrix * m = gsl_matrix_alloc (10, 3); 9 | 10 | for (i = 0; i < 10; i++) 11 | for (j = 0; j < 3; j++) 12 | gsl_matrix_set (m, i, j, 0.23 + 100*i + j); 13 | 14 | for (i = 0; i < 100; i++) /* OUT OF RANGE ERROR */ 15 | for (j = 0; j < 3; j++) 16 | printf ("m(%d,%d) = %g\n", i, j, 17 | gsl_matrix_get (m, i, j)); 18 | 19 | gsl_matrix_free (m); 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /statistics/wabsdev.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #define BASE_LONG_DOUBLE 6 | #include "templates_on.h" 7 | #include "wabsdev_source.c" 8 | #include "templates_off.h" 9 | #undef BASE_LONG_DOUBLE 10 | 11 | #define BASE_DOUBLE 12 | #include "templates_on.h" 13 | #include "wabsdev_source.c" 14 | #include "templates_off.h" 15 | #undef BASE_DOUBLE 16 | 17 | #define BASE_FLOAT 18 | #include "templates_on.h" 19 | #include "wabsdev_source.c" 20 | #include "templates_off.h" 21 | #undef BASE_FLOAT 22 | -------------------------------------------------------------------------------- /doc/examples/multimin.out: -------------------------------------------------------------------------------- 1 | x y f 2 | 1 4.99629 6.99072 687.84780 3 | 2 4.98886 6.97215 683.55456 4 | 3 4.97400 6.93501 675.01278 5 | 4 4.94429 6.86073 658.10798 6 | 5 4.88487 6.71217 625.01340 7 | 6 4.76602 6.41506 561.68440 8 | 7 4.52833 5.82083 446.46694 9 | 8 4.05295 4.63238 261.79422 10 | 9 3.10219 2.25548 75.49762 11 | 10 2.85185 1.62963 67.03704 12 | 11 2.19088 1.76182 45.31640 13 | 12 0.86892 2.02622 30.18555 14 | Minimum found at: 15 | 13 1.00000 2.00000 30.00000 16 | -------------------------------------------------------------------------------- /statistics/wkurtosis.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #define BASE_LONG_DOUBLE 6 | #include "templates_on.h" 7 | #include "wkurtosis_source.c" 8 | #include "templates_off.h" 9 | #undef BASE_LONG_DOUBLE 10 | 11 | #define BASE_DOUBLE 12 | #include "templates_on.h" 13 | #include "wkurtosis_source.c" 14 | #include "templates_off.h" 15 | #undef BASE_DOUBLE 16 | 17 | #define BASE_FLOAT 18 | #include "templates_on.h" 19 | #include "wkurtosis_source.c" 20 | #include "templates_off.h" 21 | #undef BASE_FLOAT 22 | -------------------------------------------------------------------------------- /statistics/wvariance.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #define BASE_LONG_DOUBLE 6 | #include "templates_on.h" 7 | #include "wvariance_source.c" 8 | #include "templates_off.h" 9 | #undef BASE_LONG_DOUBLE 10 | 11 | #define BASE_DOUBLE 12 | #include "templates_on.h" 13 | #include "wvariance_source.c" 14 | #include "templates_off.h" 15 | #undef BASE_DOUBLE 16 | 17 | #define BASE_FLOAT 18 | #include "templates_on.h" 19 | #include "wvariance_source.c" 20 | #include "templates_off.h" 21 | #undef BASE_FLOAT 22 | -------------------------------------------------------------------------------- /doc/examples/specfun_e.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int 6 | main (void) 7 | { 8 | double x = 5.0; 9 | gsl_sf_result result; 10 | 11 | double expected = -0.17759677131433830434739701; 12 | 13 | int status = gsl_sf_bessel_J0_e (x, &result); 14 | 15 | printf ("status = %s\n", gsl_strerror(status)); 16 | printf ("J0(5.0) = %.18f\n" 17 | " +/- % .18f\n", 18 | result.val, result.err); 19 | printf ("exact = %.18f\n", expected); 20 | return status; 21 | } 22 | -------------------------------------------------------------------------------- /cblas/hypot.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | static double xhypot (const double x, const double y); 4 | 5 | static double xhypot (const double x, const double y) 6 | { 7 | double xabs = fabs(x) ; 8 | double yabs = fabs(y) ; 9 | double min, max; 10 | 11 | if (xabs < yabs) { 12 | min = xabs ; 13 | max = yabs ; 14 | } else { 15 | min = yabs ; 16 | max = xabs ; 17 | } 18 | 19 | if (min == 0) 20 | { 21 | return max ; 22 | } 23 | 24 | { 25 | double u = min / max ; 26 | return max * sqrt (1 + u * u) ; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /poly/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libgslpoly.la 2 | 3 | pkginclude_HEADERS = gsl_poly.h 4 | 5 | INCLUDES = -I$(top_srcdir) 6 | 7 | libgslpoly_la_SOURCES = dd.c eval.c solve_quadratic.c solve_cubic.c zsolve_quadratic.c zsolve_cubic.c zsolve.c zsolve_init.c deriv.c 8 | 9 | noinst_HEADERS = balance.c companion.c qr.c 10 | 11 | TESTS = $(check_PROGRAMS) 12 | 13 | check_PROGRAMS = test 14 | 15 | test_SOURCES = test.c 16 | test_LDADD = libgslpoly.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la 17 | 18 | -------------------------------------------------------------------------------- /doc/specfunc-dawson.texi: -------------------------------------------------------------------------------- 1 | @cindex Dawson function 2 | 3 | The Dawson integral is defined by @math{\exp(-x^2) \int_0^x dt 4 | \exp(t^2)}. A table of Dawson's integral can be found in Abramowitz & 5 | Stegun, Table 7.5. The Dawson functions are declared in the header file 6 | @file{gsl_sf_dawson.h}. 7 | 8 | @deftypefun double gsl_sf_dawson (double @var{x}) 9 | @deftypefunx int gsl_sf_dawson_e (double @var{x}, gsl_sf_result * @var{result}) 10 | These routines compute the value of Dawson's integral for @var{x}. 11 | @comment Exceptional Return Values: GSL_EUNDRFLW 12 | @end deftypefun 13 | -------------------------------------------------------------------------------- /doc/examples/randwalk.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int 6 | main (void) 7 | { 8 | int i; 9 | double x = 0, y = 0, dx, dy; 10 | 11 | const gsl_rng_type * T; 12 | gsl_rng * r; 13 | 14 | gsl_rng_env_setup(); 15 | T = gsl_rng_default; 16 | r = gsl_rng_alloc (T); 17 | 18 | printf ("%g %g\n", x, y); 19 | 20 | for (i = 0; i < 10; i++) 21 | { 22 | gsl_ran_dir_2d (r, &dx, &dy); 23 | x += dx; y += dy; 24 | printf ("%g %g\n", x, y); 25 | } 26 | 27 | gsl_rng_free (r); 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /fft/dft.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | #include "complex_internal.h" 13 | 14 | #define BASE_DOUBLE 15 | #include "templates_on.h" 16 | #include "dft_source.c" 17 | #include "templates_off.h" 18 | #undef BASE_DOUBLE 19 | 20 | #define BASE_FLOAT 21 | #include "templates_on.h" 22 | #include "dft_source.c" 23 | #include "templates_off.h" 24 | #undef BASE_FLOAT 25 | 26 | -------------------------------------------------------------------------------- /doc/examples/fitting3.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int 6 | main (void) 7 | { 8 | double x; 9 | const gsl_rng_type * T; 10 | gsl_rng * r; 11 | 12 | gsl_rng_env_setup (); 13 | 14 | T = gsl_rng_default; 15 | r = gsl_rng_alloc (T); 16 | 17 | for (x = 0.1; x < 2; x+= 0.1) 18 | { 19 | double y0 = exp (x); 20 | double sigma = 0.1 * y0; 21 | double dy = gsl_ran_gaussian (r, sigma); 22 | 23 | printf ("%g %g %g\n", x, y0 + dy, sigma); 24 | } 25 | 26 | gsl_rng_free(r); 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /doc/examples/polyroots.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (void) 6 | { 7 | int i; 8 | /* coefficients of P(x) = -1 + x^5 */ 9 | double a[6] = { -1, 0, 0, 0, 0, 1 }; 10 | double z[10]; 11 | 12 | gsl_poly_complex_workspace * w 13 | = gsl_poly_complex_workspace_alloc (6); 14 | 15 | gsl_poly_complex_solve (a, 6, w, z); 16 | 17 | gsl_poly_complex_workspace_free (w); 18 | 19 | for (i = 0; i < 5; i++) 20 | { 21 | printf ("z%d = %+.18f %+.18f\n", 22 | i, z[2*i], z[2*i+1]); 23 | } 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /fit/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libgslfit.la 2 | 3 | pkginclude_HEADERS = gsl_fit.h 4 | 5 | INCLUDES = -I$(top_srcdir) 6 | 7 | libgslfit_la_SOURCES = linear.c 8 | 9 | check_PROGRAMS = test #demo 10 | 11 | TESTS = $(check_PROGRAMS) 12 | 13 | test_SOURCES = test.c 14 | test_LDADD = libgslfit.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../utils/libutils.la ../sys/libgslsys.la 15 | 16 | #demo_SOURCES = demo.c 17 | #demo_LDADD = libgslfit.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../utils/libutils.la ../sys/libgslsys.la 18 | 19 | -------------------------------------------------------------------------------- /roots/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*-makefile-*- 2 | 3 | noinst_LTLIBRARIES = libgslroots.la 4 | 5 | pkginclude_HEADERS = gsl_roots.h 6 | 7 | noinst_HEADERS = roots.h 8 | 9 | INCLUDES = -I$(top_srcdir) 10 | 11 | libgslroots_la_SOURCES = bisection.c brent.c falsepos.c newton.c secant.c steffenson.c convergence.c fsolver.c fdfsolver.c 12 | 13 | check_PROGRAMS = test 14 | 15 | TESTS = $(check_PROGRAMS) 16 | 17 | test_SOURCES = test.c test_funcs.c test.h 18 | test_LDADD = libgslroots.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la 19 | 20 | -------------------------------------------------------------------------------- /doc/examples/combination.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (void) 6 | { 7 | gsl_combination * c; 8 | size_t i; 9 | 10 | printf ("All subsets of {0,1,2,3} by size:\n") ; 11 | for (i = 0; i <= 4; i++) 12 | { 13 | c = gsl_combination_calloc (4, i); 14 | do 15 | { 16 | printf ("{"); 17 | gsl_combination_fprintf (stdout, c, " %u"); 18 | printf (" }\n"); 19 | } 20 | while (gsl_combination_next (c) == GSL_SUCCESS); 21 | gsl_combination_free (c); 22 | } 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /doc/examples/ieeeround.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int 6 | main (void) 7 | { 8 | double x = 1, oldsum = 0, sum = 0; 9 | int i = 0; 10 | 11 | gsl_ieee_env_setup (); /* read GSL_IEEE_MODE */ 12 | 13 | do 14 | { 15 | i++; 16 | 17 | oldsum = sum; 18 | sum += x; 19 | x = x / i; 20 | 21 | printf ("i=%2d sum=%.18f error=%g\n", 22 | i, sum, sum - M_E); 23 | 24 | if (i > 30) 25 | break; 26 | } 27 | while (sum != oldsum); 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /qrng/TODO: -------------------------------------------------------------------------------- 1 | * Sort out "const" in prototypes, it looks odd since there are consts 2 | for many functions which modify the state. (Applies to both qrng and rng) 3 | 4 | * It would be useful to include functions to generate quasi-random 5 | number distributions (at least the Gaussian distribution)? obviously 6 | the Box-Mueller algorithm cannot be used to maintain the low 7 | discrepancy characteristics of the sequence, there are several 8 | methods suggested in the literature but it isn't at all my field so 9 | I'm not sure which is to be preferred. (DENISON Francis 10 | ) 11 | -------------------------------------------------------------------------------- /doc/specfunc-elljac.texi: -------------------------------------------------------------------------------- 1 | @cindex Jacobi elliptic functions 2 | @cindex elliptic functions (Jacobi) 3 | 4 | The Jacobian Elliptic functions are defined in Abramowitz & Stegun, 5 | Chapter 16. The functions are declared in the header file 6 | @file{gsl_sf_elljac.h}. 7 | 8 | @deftypefun int gsl_sf_elljac_e (double @var{u}, double @var{m}, double * @var{sn}, double * @var{cn}, double * @var{dn}) 9 | This function computes the Jacobian elliptic functions @math{sn(u|m)}, 10 | @math{cn(u|m)}, @math{dn(u|m)} by descending Landen 11 | transformations. 12 | @comment Exceptional Return Values: GSL_EDOM 13 | @end deftypefun 14 | -------------------------------------------------------------------------------- /wavelet/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libgslwavelet.la 2 | 3 | pkginclude_HEADERS = gsl_wavelet.h gsl_wavelet2d.h 4 | 5 | INCLUDES = -I$(top_srcdir) 6 | 7 | libgslwavelet_la_SOURCES = dwt.c wavelet.c bspline.c daubechies.c haar.c 8 | 9 | check_PROGRAMS = test 10 | 11 | TESTS = $(check_PROGRAMS) 12 | 13 | test_LDADD = libgslwavelet.la ../blas/libgslblas.la ../cblas/libgslcblas.la ../matrix/libgslmatrix.la ../vector/libgslvector.la ../block/libgslblock.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la 14 | 15 | test_SOURCES = test.c 16 | 17 | 18 | -------------------------------------------------------------------------------- /diff/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libgsldiff.la 2 | 3 | INCLUDES = -I$(top_srcdir) 4 | 5 | libgsldiff_la_SOURCES = diff.c 6 | 7 | pkginclude_HEADERS = gsl_diff.h 8 | 9 | TESTS = $(check_PROGRAMS) 10 | check_PROGRAMS = test #demo 11 | 12 | test_SOURCES = test.c 13 | test_LDADD = libgsldiff.la ../vector/libgslvector.la ../block/libgslblock.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la 14 | 15 | #demo_SOURCES = demo.c 16 | #demo_LDADD = libgsldiff.la ../vector/libgslvector.la ../block/libgslblock.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la 17 | -------------------------------------------------------------------------------- /statistics/gsl_statistics.h: -------------------------------------------------------------------------------- 1 | #ifndef __GSL_STATISTICS_H__ 2 | #define __GSL_STATISTICS_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | 11 | #include 12 | #include 13 | 14 | #include 15 | #include 16 | 17 | #include 18 | #include 19 | 20 | #endif /* __GSL_STATISTICS_H__ */ 21 | -------------------------------------------------------------------------------- /deriv/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libgslderiv.la 2 | 3 | INCLUDES = -I$(top_srcdir) 4 | 5 | libgslderiv_la_SOURCES = deriv.c 6 | 7 | pkginclude_HEADERS = gsl_deriv.h 8 | 9 | TESTS = $(check_PROGRAMS) 10 | check_PROGRAMS = test #demo 11 | 12 | test_SOURCES = test.c 13 | test_LDADD = libgslderiv.la ../vector/libgslvector.la ../block/libgslblock.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la 14 | 15 | #demo_SOURCES = demo.c 16 | #demo_LDADD = libgslderiv.la ../vector/libgslvector.la ../block/libgslblock.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la 17 | -------------------------------------------------------------------------------- /fft/signals.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | 11 | #include "complex_internal.h" 12 | 13 | #include "urand.c" 14 | 15 | #define BASE_DOUBLE 16 | #include "templates_on.h" 17 | #include "signals_source.c" 18 | #include "templates_off.h" 19 | #undef BASE_DOUBLE 20 | 21 | #define BASE_FLOAT 22 | #include "templates_on.h" 23 | #include "signals_source.c" 24 | #include "templates_off.h" 25 | #undef BASE_FLOAT 26 | 27 | -------------------------------------------------------------------------------- /fit/ChangeLog: -------------------------------------------------------------------------------- 1 | 2008-07-03 Brian Gough 2 | 3 | * Makefile.am (INCLUDES): use top_srcdir instead of top_builddir 4 | 5 | 2007-05-23 Brian Gough 6 | 7 | * gsl_fit.h linear.c (gsl_fit_mul_est, gsl_fit_linear_est): made 8 | parameters in prototypes for _est functions consistent, 9 | c00->cov00, c01->cov01, c11 -> cov11 10 | 11 | 2004-12-23 Brian Gough 12 | 13 | * gsl_fit.h: remove unused declarations 14 | 15 | Tue Sep 19 19:09:46 2000 Brian Gough 16 | 17 | * fit/test.c (main): removed unused variables 18 | 19 | -------------------------------------------------------------------------------- /sort/gsl_sort_vector.h: -------------------------------------------------------------------------------- 1 | #ifndef __GSL_SORT_VECTOR_H__ 2 | #define __GSL_SORT_VECTOR_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | 11 | #include 12 | #include 13 | 14 | #include 15 | #include 16 | 17 | #include 18 | #include 19 | 20 | #endif /* __GSL_SORT_VECTOR_H__ */ 21 | -------------------------------------------------------------------------------- /fit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | ########### next target ############### 4 | 5 | set(gslfit_STAT_SRCS linear.c) 6 | set(gslfit_STAT_SRCS ${gslfit_STAT_SRCS} PARENT_SCOPE) 7 | 8 | add_library(gslfit STATIC EXCLUDE_FROM_ALL ${gslfit_STAT_SRCS}) 9 | 10 | 11 | ########### next target ############### 12 | 13 | set(test_SRCS test.c) 14 | 15 | if(KDE4_BUILD_TESTS) 16 | 17 | add_executable(test ${test_SRCS}) 18 | 19 | target_link_libraries(test gslfit gslieeeutils gslerr gsltest utils gslsys) 20 | 21 | endif(KDE4_BUILD_TESTS) 22 | 23 | ########### install files ############### 24 | 25 | install(FILES gsl_fit.h DESTINATION ${INSTALL_INC}/gsl) 26 | -------------------------------------------------------------------------------- /diff/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | ########### next target ############### 3 | 4 | set(gsldiff_STAT_SRCS diff.c) 5 | set(gsldiff_STAT_SRCS ${gsldiff_STAT_SRCS} PARENT_SCOPE) 6 | 7 | add_library(gsldiff STATIC EXCLUDE_FROM_ALL ${gsldiff_STAT_SRCS}) 8 | 9 | 10 | ########### next target ############### 11 | 12 | set(test_SRCS test.c) 13 | 14 | if(KDE4_BUILD_TESTS) 15 | 16 | add_executable(test ${test_SRCS}) 17 | 18 | target_link_libraries(test gsldiff gslvector gslblock gslieeeutils gslerr gsltest gslsys) 19 | 20 | endif(KDE4_BUILD_TESTS) 21 | 22 | ########### install files ############### 23 | 24 | install(FILES gsl_diff.h DESTINATION ${INSTALL_INC}/gsl) 25 | -------------------------------------------------------------------------------- /dht/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | ########### next target ############### 3 | 4 | set(gsldht_STAT_SRCS dht.c) 5 | set(gsldht_STAT_SRCS ${gsldht_STAT_SRCS} PARENT_SCOPE) 6 | 7 | add_library(gsldht STATIC EXCLUDE_FROM_ALL ${gsldht_STAT_SRCS}) 8 | 9 | 10 | ########### next target ############### 11 | 12 | set(test_SRCS test.c) 13 | 14 | if(KDE4_BUILD_TESTS) 15 | 16 | add_executable(test ${test_SRCS}) 17 | 18 | target_link_libraries(test gsldht gslspecfunc gslcomplex gslieeeutils gslerr gsltest gslsys utils) 19 | 20 | endif(KDE4_BUILD_TESTS) 21 | 22 | ########### install files ############### 23 | 24 | install(FILES gsl_dht.h DESTINATION ${INSTALL_INC}/gsl) 25 | 26 | -------------------------------------------------------------------------------- /deriv/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | ########### next target ############### 3 | 4 | set(gslderiv_STAT_SRCS deriv.c) 5 | set(gslderiv_STAT_SRCS ${gslderiv_STAT_SRCS} PARENT_SCOPE) 6 | 7 | add_library(gslderiv STATIC EXCLUDE_FROM_ALL ${gslderiv_STAT_SRCS}) 8 | 9 | ########### next target ############### 10 | 11 | set(test_SRCS test.c) 12 | 13 | if(KDE4_BUILD_TESTS) 14 | 15 | add_executable(test ${test_SRCS}) 16 | 17 | target_link_libraries(test gslderiv gslvector gslblock gslieeeutils gslerr gsltest gslsys) 18 | 19 | endif(KDE4_BUILD_TESTS) 20 | 21 | ########### install files ############### 22 | 23 | install(FILES gsl_deriv.h DESTINATION ${INSTALL_INC}/gsl) 24 | 25 | -------------------------------------------------------------------------------- /doc/examples/vectorview.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int 7 | main (void) 8 | { 9 | size_t i,j; 10 | 11 | gsl_matrix *m = gsl_matrix_alloc (10, 10); 12 | 13 | for (i = 0; i < 10; i++) 14 | for (j = 0; j < 10; j++) 15 | gsl_matrix_set (m, i, j, sin (i) + cos (j)); 16 | 17 | for (j = 0; j < 10; j++) 18 | { 19 | gsl_vector_view column = gsl_matrix_column (m, j); 20 | double d; 21 | 22 | d = gsl_blas_dnrm2 (&column.vector); 23 | 24 | printf ("matrix column %d, norm = %g\n", j, d); 25 | } 26 | 27 | gsl_matrix_free (m); 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /siman/siman_test_driver.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # assume good result from tests; increment it if any test fails 4 | EXIT_STATUS=0 5 | 6 | for seed in "" 12345 ; 7 | do 8 | ./siman_test > siman_test.out 2>&1 9 | SECOND_LAST_ENERGY=`tail -2 siman_test.out1 | head -1 | awk '{print $4}'` 10 | LAST_ENERGY=`tail -1 siman_test.out1 | awk '{print $4}'` 11 | # echo " " $SECOND_LAST_ENERGY $LAST_ENERGY 12 | if [ $SECOND_LAST_ENERGY = $LAST_ENERGY ]; 13 | then 14 | echo -n "PASS: " 15 | else 16 | echo -n "FAIL: " 17 | EXIT_STATUS=`expr $EXIT_STATUS + 1` 18 | fi 19 | echo "simulated annealing test (travelling salesman problem) seed=${seed:-default}" 20 | done 21 | 22 | exit $EXIT_STATUS 23 | -------------------------------------------------------------------------------- /block/gsl_block.h: -------------------------------------------------------------------------------- 1 | #ifndef __GSL_BLOCK_H__ 2 | #define __GSL_BLOCK_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include 13 | #include 14 | 15 | #include 16 | #include 17 | 18 | #include 19 | #include 20 | 21 | #include 22 | #include 23 | 24 | #endif /* __GSL_BLOCK_H__ */ 25 | -------------------------------------------------------------------------------- /ntuple/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | ########### next target ############### 3 | 4 | set(gslntuple_STAT_SRCS ntuple.c) 5 | set(gslntuple_STAT_SRCS ${gslntuple_STAT_SRCS} PARENT_SCOPE) 6 | 7 | add_library(gslntuple STATIC EXCLUDE_FROM_ALL ${gslntuple_STAT_SRCS}) 8 | 9 | 10 | ########### next target ############### 11 | 12 | set(test_SRCS test.c) 13 | 14 | if(KDE4_BUILD_TESTS) 15 | 16 | add_executable(test ${test_SRCS}) 17 | 18 | target_link_libraries(test gslntuple gslhistogram gslblock gslieeeutils gslerr gsltest gslsys utils) 19 | 20 | endif(KDE4_BUILD_TESTS) 21 | 22 | ########### install files ############### 23 | 24 | install(FILES gsl_ntuple.h DESTINATION ${INSTALL_INC}/gsl) 25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/examples/const.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (void) 6 | { 7 | double c = GSL_CONST_MKSA_SPEED_OF_LIGHT; 8 | double au = GSL_CONST_MKSA_ASTRONOMICAL_UNIT; 9 | double minutes = GSL_CONST_MKSA_MINUTE; 10 | 11 | /* distance stored in meters */ 12 | double r_earth = 1.00 * au; 13 | double r_mars = 1.52 * au; 14 | 15 | double t_min, t_max; 16 | 17 | t_min = (r_mars - r_earth) / c; 18 | t_max = (r_mars + r_earth) / c; 19 | 20 | printf ("light travel time from Earth to Mars:\n"); 21 | printf ("minimum = %.1f minutes\n", t_min / minutes); 22 | printf ("maximum = %.1f minutes\n", t_max / minutes); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /err/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | ########### next target ############### 4 | 5 | set(gslerr_STAT_SRCS 6 | error.c 7 | stream.c 8 | message.c 9 | strerror.c) 10 | set(gslerr_STAT_SRCS ${gslerr_STAT_SRCS} PARENT_SCOPE) 11 | 12 | add_library(gslerr STATIC EXCLUDE_FROM_ALL ${gslerr_STAT_SRCS}) 13 | 14 | 15 | ########### next target ############### 16 | 17 | set(test_SRCS test.c) 18 | 19 | if(KDE4_BUILD_TESTS) 20 | 21 | add_executable(test ${test_SRCS}) 22 | 23 | target_link_libraries(test gslerr gsltest gslsys utils) 24 | 25 | endif(KDE4_BUILD_TESTS) 26 | 27 | ########### install files ############### 28 | 29 | install(FILES gsl_errno.h gsl_message.h DESTINATION ${INSTALL_INC}/gsl) 30 | 31 | -------------------------------------------------------------------------------- /bspline/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libgslbspline.la 2 | 3 | pkginclude_HEADERS = gsl_bspline.h 4 | 5 | INCLUDES = -I$(top_srcdir) 6 | 7 | libgslbspline_la_SOURCES = bspline.c 8 | 9 | noinst_HEADERS = bspline.h 10 | 11 | check_PROGRAMS = test 12 | 13 | TESTS = $(check_PROGRAMS) 14 | 15 | test_LDADD = libgslbspline.la ../linalg/libgsllinalg.la ../permutation/libgslpermutation.la ../blas/libgslblas.la ../matrix/libgslmatrix.la ../vector/libgslvector.la ../block/libgslblock.la ../complex/libgslcomplex.la ../cblas/libgslcblas.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la ../statistics/libgslstatistics.la 16 | 17 | test_SOURCES = test.c 18 | -------------------------------------------------------------------------------- /cheb/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | ########### next target ############### 3 | 4 | set(gslcheb_STAT_SRCS 5 | deriv.c 6 | eval.c 7 | init.c 8 | integ.c) 9 | set(gslcheb_STAT_SRCS ${gslcheb_STAT_SRCS} PARENT_SCOPE) 10 | 11 | add_library(gslcheb STATIC EXCLUDE_FROM_ALL ${gslcheb_STAT_SRCS}) 12 | 13 | 14 | ########### next target ############### 15 | 16 | set(test_SRCS test.c) 17 | 18 | if(KDE4_BUILD_TESTS) 19 | 20 | add_executable(test ${test_SRCS}) 21 | 22 | target_link_libraries(test gslcheb gslieeeutils gsltest gslsys gslerr utils) 23 | 24 | endif(KDE4_BUILD_TESTS) 25 | 26 | ########### install files ############### 27 | 28 | install(FILES gsl_chebyshev.h DESTINATION ${INSTALL_INC}/gsl) 29 | 30 | 31 | -------------------------------------------------------------------------------- /fft/TODO: -------------------------------------------------------------------------------- 1 | * Sine and Cosine Transforms from FFTPACK. 2 | 3 | * A simple multidimensional fft. 4 | 5 | * Convolutions. This will need different interfaces corresponding to 6 | the type of underlying FFT (radix-2, mixed-radix, radix-2 real, 7 | mixed-radix real). The convolution function should be fft'ed before 8 | being passed, so that the function can be used in a loop. The main 9 | point of the function being to do the index manipulation for the 10 | multiplication F*G. Theoretically someone might want to convolve real 11 | and complex data together which could be done but would double the 12 | number of interfaces. It would be reasonable to restrict the 13 | convolutions to real-real and complex-complex. 14 | 15 | -------------------------------------------------------------------------------- /ieee-utils/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libgslieeeutils.la 2 | 3 | pkginclude_HEADERS = gsl_ieee_utils.h 4 | 5 | libgslieeeutils_la_SOURCES = print.c make_rep.c gsl_ieee_utils.h env.c fp.c read.c 6 | 7 | noinst_HEADERS = fp-aix.c fp-darwin.c fp-darwin86.c fp-hpux.c fp-hpux11.c fp-irix.c fp-gnum68k.c fp-gnuppc.c fp-solaris.c fp-gnusparc.c fp-sunos4.c fp-tru64.c fp-unknown.c fp-gnux86.c fp-freebsd.c fp-os2emx.c fp-netbsd.c fp-openbsd.c fp-gnuc99.c endian.c standardize.c 8 | 9 | INCLUDES = -I$(top_srcdir) 10 | 11 | TESTS = $(check_PROGRAMS) 12 | check_PROGRAMS = test 13 | test_LDADD = libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la 14 | test_SOURCES = test.c 15 | -------------------------------------------------------------------------------- /matrix/gsl_matrix.h: -------------------------------------------------------------------------------- 1 | #ifndef __GSL_MATRIX_H__ 2 | #define __GSL_MATRIX_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include 13 | #include 14 | 15 | #include 16 | #include 17 | 18 | #include 19 | #include 20 | 21 | #include 22 | #include 23 | 24 | 25 | #endif /* __GSL_MATRIX_H__ */ 26 | -------------------------------------------------------------------------------- /vector/gsl_vector.h: -------------------------------------------------------------------------------- 1 | #ifndef __GSL_VECTOR_H__ 2 | #define __GSL_VECTOR_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include 13 | #include 14 | 15 | #include 16 | #include 17 | 18 | #include 19 | #include 20 | 21 | #include 22 | #include 23 | 24 | 25 | #endif /* __GSL_VECTOR_H__ */ 26 | -------------------------------------------------------------------------------- /complex/TODO: -------------------------------------------------------------------------------- 1 | * Complex polynomial solvers (Got Newton-Mueller from 2 | jotahtin@cc.hut.fi, still to add (BJG)). 3 | 4 | * The asymptotic behavior of the secondary functions (sec, csc, cot, 5 | etc) can overflow because of expressions like cosh(x) / D , where D = 6 | cosh^2 which is computed prior to the division. This should by 7 | special casing "small" vs "large" arguments as has been done for the 8 | sin,cos,tan versions. 9 | 10 | * Perhaps there is something useful in LCY65 L. A. Lyusternik, 11 | O. A. Chervonenkis, and A. R. Yanpol'skii, Handbook for computing 12 | elementary functions, International Series of Monographs in Pure and 13 | Applied Mathematics, vol. 76, Pergamon Press, Oxford, 1965. 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /sum/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | ########### next target ############### 4 | 5 | set(gslsum_STAT_SRCS 6 | levin_u.c 7 | levin_utrunc.c 8 | work_u.c 9 | work_utrunc.c) 10 | set(gslsum_STAT_SRCS ${gslsum_STAT_SRCS} PARENT_SCOPE) 11 | 12 | add_library(gslsum STATIC EXCLUDE_FROM_ALL ${gslsum_STAT_SRCS}) 13 | 14 | 15 | ########### next target ############### 16 | 17 | set(test_SRCS test.c) 18 | 19 | if(KDE4_BUILD_TESTS) 20 | 21 | add_executable(test ${test_SRCS}) 22 | 23 | target_link_libraries(test gslsum gslieeeutils gslerr gsltest gslsys utils) 24 | 25 | endif(KDE4_BUILD_TESTS) 26 | 27 | ########### install files ############### 28 | 29 | install(FILES gsl_sum.h DESTINATION ${INSTALL_INC}/gsl) 30 | 31 | 32 | -------------------------------------------------------------------------------- /integration/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libgslintegration.la 2 | 3 | INCLUDES = -I$(top_srcdir) 4 | 5 | libgslintegration_la_SOURCES = qk15.c qk21.c qk31.c qk41.c qk51.c qk61.c qk.c qng.c qng.h qag.c qags.c qagp.c workspace.c qcheb.c qawc.c qmomo.c qaws.c qmomof.c qawo.c qawf.c 6 | 7 | pkginclude_HEADERS = gsl_integration.h 8 | noinst_HEADERS = qpsrt.c qpsrt2.c qelg.c qc25c.c qc25s.c qc25f.c ptsort.c util.c err.c positivity.c append.c initialise.c set_initial.c reset.c 9 | 10 | TESTS = $(check_PROGRAMS) 11 | check_PROGRAMS = test 12 | 13 | test_SOURCES = test.c tests.c tests.h 14 | test_LDADD = libgslintegration.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la 15 | -------------------------------------------------------------------------------- /permutation/gsl_permute.h: -------------------------------------------------------------------------------- 1 | #ifndef __GSL_PERMUTE_H__ 2 | #define __GSL_PERMUTE_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include 13 | #include 14 | 15 | #include 16 | #include 17 | 18 | #include 19 | #include 20 | 21 | #include 22 | #include 23 | 24 | #endif /* __GSL_PERMUTE_H__ */ 25 | -------------------------------------------------------------------------------- /utils/memmove.c: -------------------------------------------------------------------------------- 1 | /* memmove.c -- copy memory. 2 | Copy LENGTH bytes from SOURCE to DEST. Does not null-terminate. 3 | In the public domain. 4 | By David MacKenzie . */ 5 | 6 | #if HAVE_CONFIG_H 7 | #include 8 | #endif 9 | 10 | void 11 | memmove (dest, source, length) 12 | char *dest; 13 | const char *source; 14 | unsigned length; 15 | { 16 | if (source < dest) 17 | /* Moving from low mem to hi mem; start at end. */ 18 | for (source += length, dest += length; length; --length) 19 | *--dest = *--source; 20 | else if (source != dest) 21 | /* Moving from hi mem to low mem; start at beginning. */ 22 | for (; length; --length) 23 | *dest++ = *source++; 24 | } 25 | -------------------------------------------------------------------------------- /doc/examples/cblas.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (void) 6 | { 7 | int lda = 3; 8 | 9 | float A[] = { 0.11, 0.12, 0.13, 10 | 0.21, 0.22, 0.23 }; 11 | 12 | int ldb = 2; 13 | 14 | float B[] = { 1011, 1012, 15 | 1021, 1022, 16 | 1031, 1032 }; 17 | 18 | int ldc = 2; 19 | 20 | float C[] = { 0.00, 0.00, 21 | 0.00, 0.00 }; 22 | 23 | /* Compute C = A B */ 24 | 25 | cblas_sgemm (CblasRowMajor, 26 | CblasNoTrans, CblasNoTrans, 2, 2, 3, 27 | 1.0, A, lda, B, ldb, 0.0, C, ldc); 28 | 29 | printf ("[ %g, %g\n", C[0], C[1]); 30 | printf (" %g, %g ]\n", C[2], C[3]); 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /doc/examples/stat.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main(void) 6 | { 7 | double data[5] = {17.2, 18.1, 16.5, 18.3, 12.6}; 8 | double mean, variance, largest, smallest; 9 | 10 | mean = gsl_stats_mean(data, 1, 5); 11 | variance = gsl_stats_variance(data, 1, 5); 12 | largest = gsl_stats_max(data, 1, 5); 13 | smallest = gsl_stats_min(data, 1, 5); 14 | 15 | printf ("The dataset is %g, %g, %g, %g, %g\n", 16 | data[0], data[1], data[2], data[3], data[4]); 17 | 18 | printf ("The sample mean is %g\n", mean); 19 | printf ("The estimated variance is %g\n", variance); 20 | printf ("The largest value is %g\n", largest); 21 | printf ("The smallest value is %g\n", smallest); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /bspline/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | ########### next target ############### 4 | 5 | set(gslbspline_STAT_SRCS bspline.c) 6 | set(gslbspline_STAT_SRCS ${gslbspline_STAT_SRCS} PARENT_SCOPE) 7 | 8 | add_library(gslbspline STATIC EXCLUDE_FROM_ALL ${gslbspline_STAT_SRCS}) 9 | 10 | 11 | ########### next target ############### 12 | 13 | set(test_SRCS test.c) 14 | 15 | if(KDE4_BUILD_TESTS) 16 | 17 | add_executable(test ${test_SRCS}) 18 | 19 | target_link_libraries(test gslbspline gsllinalg gslpermutation gslblas gslmatrix gslvector gslblock gslcomplex gslcblas gslieeeutils gslerr gsltest gslsys utils gslstatistics) 20 | 21 | endif(KDE4_BUILD_TESTS) 22 | 23 | ########### install files ############### 24 | 25 | install(FILES gsl_bspline.h DESTINATION ${INSTALL_INC}/gsl) 26 | 27 | -------------------------------------------------------------------------------- /doc/examples/randpoisson.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int 6 | main (void) 7 | { 8 | const gsl_rng_type * T; 9 | gsl_rng * r; 10 | 11 | int i, n = 10; 12 | double mu = 3.0; 13 | 14 | /* create a generator chosen by the 15 | environment variable GSL_RNG_TYPE */ 16 | 17 | gsl_rng_env_setup(); 18 | 19 | T = gsl_rng_default; 20 | r = gsl_rng_alloc (T); 21 | 22 | /* print n random variates chosen from 23 | the poisson distribution with mean 24 | parameter mu */ 25 | 26 | for (i = 0; i < n; i++) 27 | { 28 | unsigned int k = gsl_ran_poisson (r, mu); 29 | printf (" %u", k); 30 | } 31 | 32 | printf ("\n"); 33 | gsl_rng_free (r); 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /ieee-utils/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | ########### next target ############### 3 | 4 | set(gslieeeutils_STAT_SRCS 5 | print.c 6 | make_rep.c 7 | gsl_ieee_utils.h 8 | env.c 9 | fp.c 10 | read.c) 11 | set(gslieee-utils_STAT_SRCS ${gslieeeutils_STAT_SRCS} PARENT_SCOPE) 12 | 13 | add_library(gslieeeutils STATIC EXCLUDE_FROM_ALL ${gslieeeutils_STAT_SRCS}) 14 | 15 | ########### next target ############### 16 | 17 | set(test_SRCS test.c) 18 | 19 | if(KDE4_BUILD_TESTS) 20 | 21 | add_executable(test ${test_SRCS}) 22 | 23 | target_link_libraries(test gslieeeutils gslerr gsltest gslsys utils) 24 | 25 | endif(KDE4_BUILD_TESTS) 26 | 27 | ########### install files ############### 28 | 29 | install(FILES gsl_ieee_utils.h DESTINATION ${INSTALL_INC}/gsl) 30 | 31 | -------------------------------------------------------------------------------- /min/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | ########### next target ############### 4 | 5 | set(gslmin_STAT_SRCS 6 | fsolver.c 7 | golden.c 8 | brent.c 9 | convergence.c 10 | bracketing.c 11 | quad_golden.c) 12 | set(gslmin_STAT_SRCS ${gslmin_STAT_SRCS} PARENT_SCOPE) 13 | 14 | add_library(gslmin STATIC EXCLUDE_FROM_ALL ${gslmin_STAT_SRCS}) 15 | 16 | 17 | ########### next target ############### 18 | 19 | set(test_SRCS test.c test_funcs.c test.h) 20 | 21 | if(KDE4_BUILD_TESTS) 22 | 23 | add_executable(test ${test_SRCS}) 24 | 25 | target_link_libraries(test gslmin gslieeeutils gslerr gsltest utils gslsys) 26 | 27 | endif(KDE4_BUILD_TESTS) 28 | 29 | ########### install files ############### 30 | 31 | install(FILES gsl_min.h DESTINATION ${INSTALL_INC}/gsl) 32 | 33 | -------------------------------------------------------------------------------- /interpolation/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libgslinterpolation.la 2 | 3 | check_PROGRAMS = test 4 | 5 | pkginclude_HEADERS = gsl_interp.h gsl_spline.h 6 | 7 | libgslinterpolation_la_SOURCES = accel.c akima.c cspline.c interp.c linear.c integ_eval.h spline.c poly.c inline.c 8 | 9 | INCLUDES = -I$(top_srcdir) 10 | 11 | TESTS = $(check_PROGRAMS) 12 | 13 | test_LDADD = libgslinterpolation.la ../poly/libgslpoly.la ../linalg/libgsllinalg.la ../permutation/libgslpermutation.la ../blas/libgslblas.la ../matrix/libgslmatrix.la ../vector/libgslvector.la ../block/libgslblock.la ../complex/libgslcomplex.la ../cblas/libgslcblas.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la 14 | 15 | test_SOURCES = test.c 16 | 17 | -------------------------------------------------------------------------------- /qrng/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | ########### next target ############### 3 | 4 | set(gslqrng_STAT_SRCS 5 | gsl_qrng.h 6 | qrng.c 7 | niederreiter-2.c 8 | sobol.c 9 | halton.c 10 | reversehalton.c 11 | inline.c) 12 | set(gslqrng_STAT_SRCS ${gslqrng_STAT_SRCS} PARENT_SCOPE) 13 | 14 | add_library(gslqrng STATIC EXCLUDE_FROM_ALL ${gslqrng_STAT_SRCS}) 15 | 16 | 17 | ########### next target ############### 18 | 19 | set(test_SRCS test.c) 20 | 21 | if(KDE4_BUILD_TESTS) 22 | 23 | add_executable(test ${test_SRCS}) 24 | 25 | target_link_libraries(test gslqrng gslieeeutils gslerr gsltest gslsys utils) 26 | 27 | endif(KDE4_BUILD_TESTS) 28 | 29 | ########### install files ############### 30 | 31 | install(FILES gsl_qrng.h DESTINATION ${INSTALL_INC}/gsl) 32 | 33 | 34 | -------------------------------------------------------------------------------- /combination/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | ########### next target ############### 3 | 4 | set(gslcombination_STAT_SRCS 5 | init.c 6 | file.c 7 | combination.c 8 | inline.c) 9 | set(gslcombination_STAT_SRCS ${gslcombination_STAT_SRCS} PARENT_SCOPE) 10 | 11 | add_library(gslcombination STATIC EXCLUDE_FROM_ALL ${gslcombination_STAT_SRCS}) 12 | 13 | 14 | ########### next target ############### 15 | 16 | set(test_SRCS test.c) 17 | 18 | if(KDE4_BUILD_TESTS) 19 | 20 | add_executable(test ${test_SRCS}) 21 | 22 | target_link_libraries(test gslcombination gslvector gslblock gslieeeutils gslerr gsltest gslsys utils) 23 | 24 | endif(KDE4_BUILD_TESTS) 25 | 26 | ########### install files ############### 27 | 28 | install(FILES gsl_combination.h DESTINATION ${INSTALL_INC}/gsl) 29 | 30 | 31 | -------------------------------------------------------------------------------- /doc/examples/diff.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | double f (double x, void * params) 6 | { 7 | return pow (x, 1.5); 8 | } 9 | 10 | int 11 | main (void) 12 | { 13 | gsl_function F; 14 | double result, abserr; 15 | 16 | F.function = &f; 17 | F.params = 0; 18 | 19 | printf ("f(x) = x^(3/2)\n"); 20 | 21 | gsl_deriv_central (&F, 2.0, 1e-8, &result, &abserr); 22 | printf ("x = 2.0\n"); 23 | printf ("f'(x) = %.10f +/- %.10f\n", result, abserr); 24 | printf ("exact = %.10f\n\n", 1.5 * sqrt(2.0)); 25 | 26 | gsl_deriv_forward (&F, 0.0, 1e-8, &result, &abserr); 27 | printf ("x = 0.0\n"); 28 | printf ("f'(x) = %.10f +/- %.10f\n", result, abserr); 29 | printf ("exact = %.10f\n", 0.0); 30 | 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /complex/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | ########### next target ############### 3 | 4 | set(gslcomplex_STAT_SRCS math.c inline.c) 5 | set(gslcomplex_STAT_SRCS ${gslcomplex_STAT_SRCS} PARENT_SCOPE) 6 | 7 | add_library(gslcomplex STATIC EXCLUDE_FROM_ALL ${gslcomplex_STAT_SRCS}) 8 | 9 | 10 | ########### next target ############### 11 | 12 | set(test_SRCS 13 | test.c 14 | results.h 15 | results1.h 16 | results2.h 17 | results_real.h) 18 | 19 | if(KDE4_BUILD_TESTS) 20 | 21 | add_executable(test ${test_SRCS}) 22 | 23 | target_link_libraries(test gslcomplex gslerr gslieeeutils gslerr gsltest gslsys utils) 24 | 25 | endif(KDE4_BUILD_TESTS) 26 | 27 | ########### install files ############### 28 | 29 | install(FILES gsl_complex.h gsl_complex_math.h DESTINATION ${INSTALL_INC}/gsl) 30 | 31 | -------------------------------------------------------------------------------- /siman/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | check_PROGRAMS = test 4 | noinst_PROGRAMS = siman_tsp 5 | noinst_LTLIBRARIES = libgslsiman.la 6 | 7 | TESTS = $(check_PROGRAMS) 8 | EXTRA_DIST = siman_test_driver.sh 9 | 10 | test_SOURCES = test.c 11 | test_LDADD = libgslsiman.la ../rng/libgslrng.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la 12 | 13 | siman_tsp_SOURCES = siman_tsp.c 14 | siman_tsp_LDADD = libgslsiman.la ../rng/libgslrng.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../sys/libgslsys.la ../utils/libutils.la 15 | 16 | CLEANFILES = siman_test.out 17 | 18 | libgslsiman_la_SOURCES = siman.c 19 | pkginclude_HEADERS = gsl_siman.h 20 | 21 | INCLUDES = -I$(top_srcdir) 22 | -------------------------------------------------------------------------------- /diff/ChangeLog: -------------------------------------------------------------------------------- 1 | 2008-09-18 Brian Gough 2 | 3 | * diff.c test.c: temporarily enable deprecated functions for 4 | testing 5 | 6 | * gsl_diff.h: marked these functions deprecated, use gsl_deriv 7 | instead. 8 | 9 | 2008-07-03 Brian Gough 10 | 11 | * Makefile.am (INCLUDES): use top_srcdir instead of top_builddir 12 | 13 | Mon Apr 23 13:26:21 2001 Brian Gough 14 | 15 | * Makefile.am: removed demo from Makefile 16 | 17 | * test.c (test): changed return type to void 18 | 19 | Mon Feb 5 13:42:54 2001 Brian Gough 20 | 21 | * diff.c: moved gradient calculating function into multimin since 22 | it depends on multimin functions 23 | 24 | * test.c (main): tidied up the tests 25 | 26 | -------------------------------------------------------------------------------- /ode-initval/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libgslodeiv.la 2 | 3 | pkginclude_HEADERS = gsl_odeiv.h 4 | 5 | INCLUDES = -I$(top_srcdir) 6 | 7 | libgslodeiv_la_SOURCES = control.c cstd.c cscal.c evolve.c step.c rk2.c rk2imp.c rk2simp.c rk4.c rk4imp.c rkf45.c rk8pd.c rkck.c bsimp.c gear1.c gear2.c 8 | 9 | noinst_HEADERS = odeiv_util.h 10 | 11 | check_PROGRAMS = test 12 | 13 | TESTS = $(check_PROGRAMS) 14 | 15 | test_LDADD = libgslodeiv.la ../linalg/libgsllinalg.la ../blas/libgslblas.la ../cblas/libgslcblas.la ../matrix/libgslmatrix.la ../permutation/libgslpermutation.la ../vector/libgslvector.la ../block/libgslblock.la ../complex/libgslcomplex.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la 16 | 17 | test_SOURCES = test.c 18 | 19 | -------------------------------------------------------------------------------- /wavelet/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | ########### next target ############### 3 | 4 | set(gslwavelet_STAT_SRCS 5 | dwt.c 6 | wavelet.c 7 | bspline.c 8 | daubechies.c 9 | haar.c) 10 | set(gslwavelet_STAT_SRCS ${gslwavelet_STAT_SRCS} PARENT_SCOPE) 11 | 12 | add_library(gslwavelet STATIC EXCLUDE_FROM_ALL ${gslwavelet_STAT_SRCS}) 13 | 14 | 15 | ########### next target ############### 16 | 17 | set(test_SRCS test.c) 18 | 19 | if(KDE4_BUILD_TESTS) 20 | 21 | add_executable(test ${test_SRCS}) 22 | 23 | target_link_libraries(test gslwavelet gslblas gslcblas gslmatrix gslvector gslblock gslieeeutils gslerr gsltest gslsys utils) 24 | 25 | endif(KDE4_BUILD_TESTS) 26 | 27 | ########### install files ############### 28 | 29 | install(FILES gsl_wavelet.h gsl_wavelet2d.h DESTINATION ${INSTALL_INC}/gsl) 30 | -------------------------------------------------------------------------------- /monte/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libgslmonte.la 2 | 3 | libgslmonte_la_SOURCES = miser.c plain.c gsl_monte_vegas.h gsl_monte_miser.h gsl_monte_plain.h gsl_monte.h vegas.c 4 | 5 | pkginclude_HEADERS = gsl_monte.h gsl_monte_vegas.h gsl_monte_miser.h gsl_monte_plain.h 6 | 7 | INCLUDES = -I$(top_srcdir) 8 | 9 | TESTS = $(check_PROGRAMS) 10 | 11 | check_PROGRAMS = test #demo 12 | 13 | test_SOURCES = test.c 14 | test_LDADD = libgslmonte.la ../rng/libgslrng.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la 15 | 16 | noinst_HEADERS = test_main.c 17 | 18 | #demo_SOURCES= demo.c 19 | #demo_LDADD = libgslmonte.la ../rng/libgslrng.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../utils/libutils.la 20 | 21 | 22 | -------------------------------------------------------------------------------- /doc/examples/cheb.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | double 6 | f (double x, void *p) 7 | { 8 | if (x < 0.5) 9 | return 0.25; 10 | else 11 | return 0.75; 12 | } 13 | 14 | int 15 | main (void) 16 | { 17 | int i, n = 10000; 18 | 19 | gsl_cheb_series *cs = gsl_cheb_alloc (40); 20 | 21 | gsl_function F; 22 | 23 | F.function = f; 24 | F.params = 0; 25 | 26 | gsl_cheb_init (cs, &F, 0.0, 1.0); 27 | 28 | for (i = 0; i < n; i++) 29 | { 30 | double x = i / (double)n; 31 | double r10 = gsl_cheb_eval_n (cs, 10, x); 32 | double r40 = gsl_cheb_eval (cs, x); 33 | printf ("%g %g %g %g\n", 34 | x, GSL_FN_EVAL (&F, x), r10, r40); 35 | } 36 | 37 | gsl_cheb_free (cs); 38 | 39 | return 0; 40 | } 41 | -------------------------------------------------------------------------------- /doc/examples/sortsmall.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (void) 6 | { 7 | const gsl_rng_type * T; 8 | gsl_rng * r; 9 | 10 | size_t i, k = 5, N = 100000; 11 | 12 | double * x = malloc (N * sizeof(double)); 13 | double * small = malloc (k * sizeof(double)); 14 | 15 | gsl_rng_env_setup(); 16 | 17 | T = gsl_rng_default; 18 | r = gsl_rng_alloc (T); 19 | 20 | for (i = 0; i < N; i++) 21 | { 22 | x[i] = gsl_rng_uniform(r); 23 | } 24 | 25 | gsl_sort_smallest (small, k, x, 1, N); 26 | 27 | printf ("%d smallest values from %d\n", k, N); 28 | 29 | for (i = 0; i < k; i++) 30 | { 31 | printf ("%d: %.18f\n", i, small[i]); 32 | } 33 | 34 | free (x); 35 | free (small); 36 | gsl_rng_free (r); 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /doc/examples/min.out: -------------------------------------------------------------------------------- 1 | 0 [0.0000000, 6.0000000] 2.0000000 -1.1415927 6.0000000 2 | 1 [2.0000000, 6.0000000] 3.2758640 +0.1342713 4.0000000 3 | 2 [2.0000000, 3.2831929] 3.2758640 +0.1342713 1.2831929 4 | 3 [2.8689068, 3.2831929] 3.2758640 +0.1342713 0.4142862 5 | 4 [2.8689068, 3.2831929] 3.2758640 +0.1342713 0.4142862 6 | 5 [2.8689068, 3.2758640] 3.1460585 +0.0044658 0.4069572 7 | 6 [3.1346075, 3.2758640] 3.1460585 +0.0044658 0.1412565 8 | 7 [3.1346075, 3.1874620] 3.1460585 +0.0044658 0.0528545 9 | 8 [3.1346075, 3.1460585] 3.1460585 +0.0044658 0.0114510 10 | 9 [3.1346075, 3.1460585] 3.1424060 +0.0008133 0.0114510 11 | 10 [3.1346075, 3.1424060] 3.1415885 -0.0000041 0.0077985 12 | Converged: 13 | 11 [3.1415885, 3.1424060] 3.1415927 -0.0000000 0.0008175 14 | -------------------------------------------------------------------------------- /specfunc/cheb_eval.c: -------------------------------------------------------------------------------- 1 | 2 | static inline int 3 | cheb_eval_e(const cheb_series * cs, 4 | const double x, 5 | gsl_sf_result * result) 6 | { 7 | int j; 8 | double d = 0.0; 9 | double dd = 0.0; 10 | 11 | double y = (2.0*x - cs->a - cs->b) / (cs->b - cs->a); 12 | double y2 = 2.0 * y; 13 | 14 | double e = 0.0; 15 | 16 | for(j = cs->order; j>=1; j--) { 17 | double temp = d; 18 | d = y2*d - dd + cs->c[j]; 19 | e += fabs(y2*temp) + fabs(dd) + fabs(cs->c[j]); 20 | dd = temp; 21 | } 22 | 23 | { 24 | double temp = d; 25 | d = y*d - dd + 0.5 * cs->c[0]; 26 | e += fabs(y*temp) + fabs(dd) + 0.5 * fabs(cs->c[0]); 27 | } 28 | 29 | result->val = d; 30 | result->err = GSL_DBL_EPSILON * e + fabs(cs->c[cs->order]); 31 | 32 | return GSL_SUCCESS; 33 | } 34 | 35 | -------------------------------------------------------------------------------- /combination/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libgslcombination.la 2 | 3 | pkginclude_HEADERS = gsl_combination.h 4 | 5 | INCLUDES = -I$(top_srcdir) 6 | 7 | libgslcombination_la_SOURCES = init.c file.c combination.c inline.c 8 | 9 | noinst_HEADERS = 10 | 11 | TESTS = $(check_PROGRAMS) 12 | 13 | check_PROGRAMS = test 14 | 15 | test_SOURCES = test.c 16 | 17 | test_LDADD = libgslcombination.la ../vector/libgslvector.la ../block/libgslblock.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la 18 | 19 | #noinst_PROGRAMS = demo 20 | #demo_SOURCES = demo.c 21 | #demo_LDADD = libgslcombination.la ../vector/libgslvector.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la 22 | 23 | #CLEANFILES = test.txt test.dat 24 | 25 | 26 | -------------------------------------------------------------------------------- /fft/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | ########### next target ############### 3 | 4 | set(gslfft_STAT_SRCS dft.c fft.c) 5 | set(gslfft_STAT_SRCS ${gslfft_STAT_SRCS} PARENT_SCOPE) 6 | 7 | add_library(gslfft STATIC EXCLUDE_FROM_ALL ${gslfft_STAT_SRCS}) 8 | 9 | 10 | ########### next target ############### 11 | 12 | set(test_SRCS test.c signals.c) 13 | 14 | if(KDE4_BUILD_TESTS) 15 | 16 | add_executable(test ${test_SRCS}) 17 | 18 | target_link_libraries(test gslfft gslieeeutils gslerr gsltest gslsys utils) 19 | 20 | endif(KDE4_BUILD_TESTS) 21 | 22 | ########### install files ############### 23 | 24 | install(FILES gsl_fft.h gsl_fft_complex.h gsl_fft_halfcomplex.h gsl_fft_real.h gsl_dft_complex.h gsl_dft_complex_float.h gsl_fft_complex_float.h gsl_fft_halfcomplex_float.h gsl_fft_real_float.h DESTINATION ${INSTALL_INC}/gsl) 25 | 26 | 27 | -------------------------------------------------------------------------------- /poly/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | ########### next target ############### 4 | 5 | set(gslpoly_STAT_SRCS 6 | dd.c 7 | eval.c 8 | solve_quadratic.c 9 | solve_cubic.c 10 | zsolve_quadratic.c 11 | zsolve_cubic.c 12 | zsolve.c 13 | zsolve_init.c 14 | deriv.c) 15 | set(gslpoly_STAT_SRCS ${gslpoly_STAT_SRCS} PARENT_SCOPE) 16 | 17 | add_library(gslpoly STATIC EXCLUDE_FROM_ALL ${gslpoly_STAT_SRCS}) 18 | 19 | 20 | ########### next target ############### 21 | 22 | set(test_SRCS test.c) 23 | 24 | if(KDE4_BUILD_TESTS) 25 | 26 | add_executable(test ${test_SRCS}) 27 | 28 | target_link_libraries(test gslpoly gslieeeutils gslerr gsltest gslsys utils) 29 | 30 | endif(KDE4_BUILD_TESTS) 31 | 32 | ########### install files ############### 33 | 34 | install(FILES gsl_poly.h DESTINATION ${INSTALL_INC}/gsl) 35 | -------------------------------------------------------------------------------- /doc/specfunc-clausen.texi: -------------------------------------------------------------------------------- 1 | @cindex Clausen functions 2 | 3 | The Clausen function is defined by the following integral, 4 | @tex 5 | \beforedisplay 6 | $$ 7 | Cl_2(x) = - \int_0^x dt \log(2 \sin(t/2)) 8 | $$ 9 | \afterdisplay 10 | @end tex 11 | @ifinfo 12 | 13 | @example 14 | Cl_2(x) = - \int_0^x dt \log(2 \sin(t/2)) 15 | @end example 16 | 17 | @end ifinfo 18 | @noindent 19 | It is related to the dilogarithm by 20 | @c{$Cl_2(\theta) = \Im(Li_2(e^{i\theta}))$} 21 | @math{Cl_2(\theta) = \Im Li_2(\exp(i\theta))}. 22 | The Clausen functions are declared in the header file 23 | @file{gsl_sf_clausen.h}. 24 | 25 | @deftypefun double gsl_sf_clausen (double @var{x}) 26 | @deftypefunx int gsl_sf_clausen_e (double @var{x}, gsl_sf_result * @var{result}) 27 | These routines compute the Clausen integral @math{Cl_2(x)}. 28 | @end deftypefun 29 | -------------------------------------------------------------------------------- /roots/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ########### next target ############### 2 | 3 | set(gslroots_STAT_SRCS 4 | bisection.c 5 | brent.c 6 | falsepos.c 7 | newton.c 8 | secant.c 9 | steffenson.c 10 | convergence.c 11 | fsolver.c 12 | fdfsolver.c) 13 | set(gslroots_STAT_SRCS ${gslroots_STAT_SRCS} PARENT_SCOPE) 14 | 15 | add_library(gslroots STATIC EXCLUDE_FROM_ALL ${gslroots_STAT_SRCS}) 16 | 17 | ########### next target ############### 18 | 19 | set(test_SRCS test.c test_funcs.c test.h) 20 | 21 | if(KDE4_BUILD_TESTS) 22 | 23 | add_executable(test ${test_SRCS}) 24 | 25 | target_link_libraries(test gslroots gslieeeutils gslerr gsltest gslsys utils) 26 | 27 | endif(KDE4_BUILD_TESTS) 28 | 29 | ########### install files ############### 30 | 31 | install(FILES gsl_roots.h DESTINATION ${INSTALL_INC}/gsl) 32 | 33 | -------------------------------------------------------------------------------- /specfunc/cheb_eval_mode.c: -------------------------------------------------------------------------------- 1 | static inline int 2 | cheb_eval_mode_e(const cheb_series * cs, 3 | const double x, 4 | gsl_mode_t mode, 5 | gsl_sf_result * result) 6 | { 7 | int j; 8 | double d = 0.0; 9 | double dd = 0.0; 10 | 11 | double y = (2.*x - cs->a - cs->b) / (cs->b - cs->a); 12 | double y2 = 2.0 * y; 13 | 14 | int eval_order; 15 | 16 | if(GSL_MODE_PREC(mode) == GSL_PREC_DOUBLE) 17 | eval_order = cs->order; 18 | else 19 | eval_order = cs->order_sp; 20 | 21 | for(j = eval_order; j>=1; j--) { 22 | double temp = d; 23 | d = y2*d - dd + cs->c[j]; 24 | dd = temp; 25 | } 26 | 27 | result->val = y*d - dd + 0.5 * cs->c[0]; 28 | result->err = GSL_DBL_EPSILON * fabs(result->val) + fabs(cs->c[eval_order]); 29 | return GSL_SUCCESS; 30 | } 31 | -------------------------------------------------------------------------------- /sys/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | ########### next target ############### 3 | 4 | set(gslsys_STAT_SRCS 5 | minmax.c 6 | prec.c 7 | hypot.c 8 | log1p.c 9 | expm1.c 10 | coerce.c 11 | invhyp.c 12 | pow_int.c 13 | infnan.c 14 | fdiv.c 15 | fcmp.c 16 | ldfrexp.c) 17 | set(gslsys_STAT_SRCS ${gslsys_STAT_SRCS} PARENT_SCOPE) 18 | 19 | add_library(gslsys STATIC EXCLUDE_FROM_ALL ${gslsys_STAT_SRCS}) 20 | 21 | 22 | ########### next target ############### 23 | 24 | set(test_SRCS test.c) 25 | 26 | if(KDE4_BUILD_TESTS) 27 | 28 | add_executable(test ${test_SRCS}) 29 | 30 | target_link_libraries(test gslsys gslieeeutils gslerr gsltest gslsys utils) 31 | 32 | endif(KDE4_BUILD_TESTS) 33 | 34 | ########### install files ############### 35 | 36 | install(FILES gsl_sys.h DESTINATION ${INSTALL_INC}/gsl) 37 | 38 | -------------------------------------------------------------------------------- /doc/examples/blas.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (void) 6 | { 7 | double a[] = { 0.11, 0.12, 0.13, 8 | 0.21, 0.22, 0.23 }; 9 | 10 | double b[] = { 1011, 1012, 11 | 1021, 1022, 12 | 1031, 1032 }; 13 | 14 | double c[] = { 0.00, 0.00, 15 | 0.00, 0.00 }; 16 | 17 | gsl_matrix_view A = gsl_matrix_view_array(a, 2, 3); 18 | gsl_matrix_view B = gsl_matrix_view_array(b, 3, 2); 19 | gsl_matrix_view C = gsl_matrix_view_array(c, 2, 2); 20 | 21 | /* Compute C = A B */ 22 | 23 | gsl_blas_dgemm (CblasNoTrans, CblasNoTrans, 24 | 1.0, &A.matrix, &B.matrix, 25 | 0.0, &C.matrix); 26 | 27 | printf ("[ %g, %g\n", c[0], c[1]); 28 | printf (" %g, %g ]\n", c[2], c[3]); 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /eigen/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libgsleigen.la 2 | 3 | check_PROGRAMS = test 4 | 5 | pkginclude_HEADERS = gsl_eigen.h 6 | libgsleigen_la_SOURCES = jacobi.c symm.c symmv.c nonsymm.c nonsymmv.c herm.c hermv.c gensymm.c gensymmv.c genherm.c genhermv.c gen.c genv.c sort.c francis.c schur.c 7 | 8 | INCLUDES = -I$(top_srcdir) 9 | 10 | noinst_HEADERS = qrstep.c 11 | 12 | TESTS = $(check_PROGRAMS) 13 | 14 | test_LDADD = libgsleigen.la ../test/libgsltest.la ../linalg/libgsllinalg.la ../permutation/libgslpermutation.la ../blas/libgslblas.la ../cblas/libgslcblas.la ../matrix/libgslmatrix.la ../vector/libgslvector.la ../block/libgslblock.la ../complex/libgslcomplex.la ../ieee-utils/libgslieeeutils.la ../sys/libgslsys.la ../err/libgslerr.la ../utils/libutils.la ../rng/libgslrng.la ../sort/libgslsort.la 15 | 16 | test_SOURCES = test.c 17 | 18 | 19 | -------------------------------------------------------------------------------- /multiroots/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*-makefile-*- 2 | 3 | noinst_LTLIBRARIES = libgslmultiroots.la 4 | 5 | pkginclude_HEADERS = gsl_multiroots.h 6 | 7 | noinst_HEADERS = enorm.c dogleg.c 8 | 9 | INCLUDES = -I$(top_srcdir) 10 | 11 | libgslmultiroots_la_SOURCES = fdjac.c fsolver.c fdfsolver.c convergence.c newton.c gnewton.c dnewton.c broyden.c hybrid.c hybridj.c 12 | 13 | check_PROGRAMS = test 14 | 15 | TESTS = $(check_PROGRAMS) 16 | 17 | test_SOURCES = test.c test_funcs.c test_funcs.h 18 | test_LDADD = libgslmultiroots.la ../linalg/libgsllinalg.la ../blas/libgslblas.la ../cblas/libgslcblas.la ../permutation/libgslpermutation.la ../matrix/libgslmatrix.la ../vector/libgslvector.la ../block/libgslblock.la ../complex/libgslcomplex.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la 19 | 20 | -------------------------------------------------------------------------------- /vector/gsl_vector_complex.h: -------------------------------------------------------------------------------- 1 | #ifndef __GSL_VECTOR_COMPLEX_H__ 2 | #define __GSL_VECTOR_COMPLEX_H__ 3 | 4 | #define GSL_VECTOR_REAL(z, i) ((z)->data[2*(i)*(z)->stride]) 5 | #define GSL_VECTOR_IMAG(z, i) ((z)->data[2*(i)*(z)->stride + 1]) 6 | 7 | #if GSL_RANGE_CHECK 8 | #define GSL_VECTOR_COMPLEX(zv, i) (((i) >= (zv)->size ? (gsl_error ("index out of range", __FILE__, __LINE__, GSL_EINVAL), 0):0 , *GSL_COMPLEX_AT((zv),(i)))) 9 | #else 10 | #define GSL_VECTOR_COMPLEX(zv, i) (GSL_COMPLEX_AT((zv),(i))) 11 | #endif 12 | 13 | #define GSL_COMPLEX_AT(zv,i) ((gsl_complex*)&((zv)->data[2*(i)*(zv)->stride])) 14 | #define GSL_COMPLEX_FLOAT_AT(zv,i) ((gsl_complex_float*)&((zv)->data[2*(i)*(zv)->stride])) 15 | #define GSL_COMPLEX_LONG_DOUBLE_AT(zv,i) ((gsl_complex_long_double*)&((zv)->data[2*(i)*(zv)->stride])) 16 | 17 | #endif /* __GSL_VECTOR_COMPLEX_H__ */ 18 | -------------------------------------------------------------------------------- /permutation/gsl_permute_vector.h: -------------------------------------------------------------------------------- 1 | #ifndef __GSL_PERMUTE_VECTOR_H__ 2 | #define __GSL_PERMUTE_VECTOR_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include 13 | #include 14 | 15 | #include 16 | #include 17 | 18 | #include 19 | #include 20 | 21 | #include 22 | #include 23 | 24 | #endif /* __GSL_PERMUTE_VECTOR_H__ */ 25 | -------------------------------------------------------------------------------- /monte/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | ########### next target ############### 4 | 5 | set(gslmonte_STAT_SRCS 6 | miser.c 7 | plain.c 8 | gsl_monte_vegas.h 9 | gsl_monte_miser.h 10 | gsl_monte_plain.h 11 | gsl_monte.h 12 | vegas.c) 13 | set(gslmonte_STAT_SRCS ${gslmonte_STAT_SRCS} PARENT_SCOPE) 14 | 15 | add_library(gslmonte STATIC EXCLUDE_FROM_ALL ${gslmonte_STAT_SRCS}) 16 | 17 | 18 | ########### next target ############### 19 | 20 | set(test_SRCS test.c) 21 | 22 | if(KDE4_BUILD_TESTS) 23 | 24 | add_executable(test ${test_SRCS}) 25 | 26 | target_link_libraries(test gslmonte gslrng gslieeeutils gslerr gsltest gslsys utils) 27 | 28 | endif(KDE4_BUILD_TESTS) 29 | 30 | ########### install files ############### 31 | 32 | install(FILES gsl_monte.h gsl_monte_vegas.h gsl_monte_miser.h gsl_monte_plain.h DESTINATION ${INSTALL_INC}/gsl) 33 | 34 | 35 | -------------------------------------------------------------------------------- /multifit/test_fn.c: -------------------------------------------------------------------------------- 1 | gsl_multifit_function_fdf 2 | make_fdf (int (* f) (const gsl_vector *, void *, gsl_vector *), 3 | int (* df) (const gsl_vector *, void *, gsl_matrix *), 4 | int (* fdf) (const gsl_vector *, void *, gsl_vector *, gsl_matrix *), 5 | size_t n, 6 | size_t p, 7 | void * params); 8 | 9 | gsl_multifit_function_fdf 10 | make_fdf (int (* f) (const gsl_vector *, void *, gsl_vector *), 11 | int (* df) (const gsl_vector *, void *, gsl_matrix *), 12 | int (* fdf) (const gsl_vector *, void *, gsl_vector *, gsl_matrix *), 13 | size_t n, 14 | size_t p, 15 | void * params) 16 | { 17 | gsl_multifit_function_fdf F_new; 18 | F_new.f = f; 19 | F_new.df = df; 20 | F_new.fdf = fdf; 21 | F_new.n = n; 22 | F_new.p = p; 23 | F_new.params = params; 24 | return F_new; 25 | } 26 | -------------------------------------------------------------------------------- /doc/examples/demo_fn.c: -------------------------------------------------------------------------------- 1 | double 2 | quadratic (double x, void *params) 3 | { 4 | struct quadratic_params *p 5 | = (struct quadratic_params *) params; 6 | 7 | double a = p->a; 8 | double b = p->b; 9 | double c = p->c; 10 | 11 | return (a * x + b) * x + c; 12 | } 13 | 14 | double 15 | quadratic_deriv (double x, void *params) 16 | { 17 | struct quadratic_params *p 18 | = (struct quadratic_params *) params; 19 | 20 | double a = p->a; 21 | double b = p->b; 22 | double c = p->c; 23 | 24 | return 2.0 * a * x + b; 25 | } 26 | 27 | void 28 | quadratic_fdf (double x, void *params, 29 | double *y, double *dy) 30 | { 31 | struct quadratic_params *p 32 | = (struct quadratic_params *) params; 33 | 34 | double a = p->a; 35 | double b = p->b; 36 | double c = p->c; 37 | 38 | *y = (a * x + b) * x + c; 39 | *dy = 2.0 * a * x + b; 40 | } 41 | -------------------------------------------------------------------------------- /bspline/bspline.h: -------------------------------------------------------------------------------- 1 | static inline size_t 2 | bspline_find_interval (const double x, int *flag, gsl_bspline_workspace * w); 3 | 4 | static inline int 5 | bspline_process_interval_for_eval (const double x, size_t * i, int flag, 6 | gsl_bspline_workspace * w); 7 | 8 | static void 9 | bspline_pppack_bsplvb (const gsl_vector * t, 10 | const size_t jhigh, 11 | const size_t index, 12 | const double x, 13 | const size_t left, 14 | size_t * j, 15 | gsl_vector * deltal, 16 | gsl_vector * deltar, gsl_vector * biatx); 17 | 18 | static void 19 | bspline_pppack_bsplvd (const gsl_vector * t, 20 | const size_t k, 21 | const double x, 22 | const size_t left, 23 | gsl_vector * deltal, 24 | gsl_vector * deltar, 25 | gsl_matrix * a, 26 | gsl_matrix * dbiatx, const size_t nderiv); 27 | -------------------------------------------------------------------------------- /histogram/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libgslhistogram.la 2 | 3 | pkginclude_HEADERS = gsl_histogram.h gsl_histogram2d.h 4 | 5 | INCLUDES = -I$(top_srcdir) 6 | 7 | libgslhistogram_la_SOURCES = add.c get.c init.c params.c reset.c file.c pdf.c gsl_histogram.h add2d.c get2d.c init2d.c params2d.c reset2d.c file2d.c pdf2d.c gsl_histogram2d.h calloc_range.c calloc_range2d.c copy.c copy2d.c maxval.c maxval2d.c oper.c oper2d.c stat.c stat2d.c 8 | 9 | noinst_HEADERS = urand.c find.c find2d.c 10 | 11 | check_PROGRAMS = test 12 | TESTS = $(check_PROGRAMS) 13 | 14 | EXTRA_DIST = urand.c 15 | 16 | test_SOURCES = test.c test1d.c test2d.c test1d_resample.c test2d_resample.c test1d_trap.c test2d_trap.c 17 | test_LDADD = libgslhistogram.la ../block/libgslblock.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la 18 | 19 | CLEANFILES = test.txt test.dat 20 | 21 | -------------------------------------------------------------------------------- /mkinstalldirs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # mkinstalldirs --- make directory hierarchy 3 | # Author: Noah Friedman 4 | # Created: 1993-05-16 5 | # Last modified: 1994-03-25 6 | # Public domain 7 | 8 | errstatus=0 9 | 10 | for file in ${1+"$@"} ; do 11 | set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` 12 | shift 13 | 14 | pathcomp= 15 | for d in ${1+"$@"} ; do 16 | pathcomp="$pathcomp$d" 17 | case "$pathcomp" in 18 | -* ) pathcomp=./$pathcomp ;; 19 | esac 20 | 21 | if test ! -d "$pathcomp"; then 22 | echo "mkdir $pathcomp" 1>&2 23 | mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$? 24 | fi 25 | 26 | if test ! -d "$pathcomp"; then 27 | errstatus=$lasterr 28 | fi 29 | 30 | pathcomp="$pathcomp/" 31 | done 32 | done 33 | 34 | exit $errstatus 35 | 36 | # mkinstalldirs ends here 37 | -------------------------------------------------------------------------------- /cblas/tests.c: -------------------------------------------------------------------------------- 1 | test_dot (); 2 | test_nrm2 (); 3 | test_asum (); 4 | test_amax (); 5 | test_axpy (); 6 | test_copy (); 7 | test_swap (); 8 | test_scal (); 9 | test_rotg (); 10 | test_rot (); 11 | test_rotmg (); 12 | test_rotm (); 13 | test_gemv (); 14 | test_gbmv (); 15 | test_trmv (); 16 | test_tbmv (); 17 | test_tpmv (); 18 | test_symv (); 19 | test_hemv (); 20 | test_hbmv (); 21 | test_sbmv (); 22 | test_hpmv (); 23 | test_spmv (); 24 | test_trsv (); 25 | test_tbsv (); 26 | test_tpsv (); 27 | test_ger (); 28 | test_syr (); 29 | test_her (); 30 | test_hpr (); 31 | test_spr (); 32 | test_syr2 (); 33 | test_spr2 (); 34 | test_her2 (); 35 | test_hpr2 (); 36 | test_gemm (); 37 | test_symm (); 38 | test_hemm (); 39 | test_syrk (); 40 | test_herk (); 41 | test_syr2k (); 42 | test_her2k (); 43 | test_trmm (); 44 | test_trsm (); 45 | -------------------------------------------------------------------------------- /linalg/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libgsllinalg.la 2 | 3 | pkginclude_HEADERS = gsl_linalg.h 4 | 5 | INCLUDES = -I$(top_srcdir) 6 | 7 | libgsllinalg_la_SOURCES = multiply.c exponential.c tridiag.c tridiag.h lu.c luc.c hh.c qr.c qrpt.c lq.c ptlq.c svd.c householder.c householdercomplex.c hessenberg.c hesstri.c cholesky.c choleskyc.c symmtd.c hermtd.c bidiag.c balance.c balancemat.c 8 | 9 | noinst_HEADERS = givens.c apply_givens.c svdstep.c tridiag.h 10 | 11 | TESTS = $(check_PROGRAMS) 12 | 13 | check_PROGRAMS = test 14 | 15 | test_LDADD = libgsllinalg.la ../blas/libgslblas.la ../cblas/libgslcblas.la ../permutation/libgslpermutation.la ../matrix/libgslmatrix.la ../vector/libgslvector.la ../block/libgslblock.la ../complex/libgslcomplex.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la 16 | 17 | test_SOURCES = test.c 18 | 19 | 20 | -------------------------------------------------------------------------------- /randist/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libgslrandist.la 2 | 3 | pkginclude_HEADERS= gsl_randist.h 4 | 5 | INCLUDES = -I$(top_srcdir) 6 | 7 | libgslrandist_la_SOURCES = bernoulli.c beta.c bigauss.c binomial.c cauchy.c chisq.c dirichlet.c discrete.c erlang.c exponential.c exppow.c fdist.c flat.c gamma.c gauss.c gausszig.c gausstail.c geometric.c gumbel.c hyperg.c laplace.c levy.c logarithmic.c logistic.c lognormal.c multinomial.c nbinomial.c pareto.c pascal.c poisson.c rayleigh.c shuffle.c sphere.c tdist.c weibull.c landau.c binomial_tpe.c 8 | 9 | TESTS = $(check_PROGRAMS) 10 | 11 | check_PROGRAMS = test 12 | 13 | test_SOURCES = test.c 14 | test_LDADD = libgslrandist.la ../rng/libgslrng.la ../specfunc/libgslspecfunc.la ../integration/libgslintegration.la ../complex/libgslcomplex.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc/examples/histogram.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int 6 | main (int argc, char **argv) 7 | { 8 | double a, b; 9 | size_t n; 10 | 11 | if (argc != 4) 12 | { 13 | printf ("Usage: gsl-histogram xmin xmax n\n" 14 | "Computes a histogram of the data " 15 | "on stdin using n bins from xmin " 16 | "to xmax\n"); 17 | exit (0); 18 | } 19 | 20 | a = atof (argv[1]); 21 | b = atof (argv[2]); 22 | n = atoi (argv[3]); 23 | 24 | { 25 | double x; 26 | gsl_histogram * h = gsl_histogram_alloc (n); 27 | gsl_histogram_set_ranges_uniform (h, a, b); 28 | 29 | while (fscanf (stdin, "%lg", &x) == 1) 30 | { 31 | gsl_histogram_increment (h, x); 32 | } 33 | gsl_histogram_fprintf (stdout, h, "%g", "%g"); 34 | gsl_histogram_free (h); 35 | } 36 | exit (0); 37 | } 38 | -------------------------------------------------------------------------------- /doc/examples/ntuplew.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | struct data 6 | { 7 | double x; 8 | double y; 9 | double z; 10 | }; 11 | 12 | int 13 | main (void) 14 | { 15 | const gsl_rng_type * T; 16 | gsl_rng * r; 17 | 18 | struct data ntuple_row; 19 | int i; 20 | 21 | gsl_ntuple *ntuple 22 | = gsl_ntuple_create ("test.dat", &ntuple_row, 23 | sizeof (ntuple_row)); 24 | 25 | gsl_rng_env_setup (); 26 | 27 | T = gsl_rng_default; 28 | r = gsl_rng_alloc (T); 29 | 30 | for (i = 0; i < 10000; i++) 31 | { 32 | ntuple_row.x = gsl_ran_ugaussian (r); 33 | ntuple_row.y = gsl_ran_ugaussian (r); 34 | ntuple_row.z = gsl_ran_ugaussian (r); 35 | 36 | gsl_ntuple_write (ntuple); 37 | } 38 | 39 | gsl_ntuple_close (ntuple); 40 | gsl_rng_free (r); 41 | 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /multifit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | ########### next target ############### 3 | 4 | set(gslmultifit_STAT_SRCS 5 | multilinear.c 6 | work.c 7 | lmder.c 8 | fsolver.c 9 | fdfsolver.c 10 | convergence.c 11 | gradient.c 12 | covar.c) 13 | set(gslmultifit_STAT_SRCS ${gslmultifit_STAT_SRCS} PARENT_SCOPE) 14 | 15 | add_library(gslmultifit STATIC EXCLUDE_FROM_ALL ${gslmultifit_STAT_SRCS}) 16 | 17 | 18 | ########### next target ############### 19 | 20 | set(test_SRCS test.c) 21 | 22 | if(KDE4_BUILD_TESTS) 23 | 24 | add_executable(test ${test_SRCS}) 25 | 26 | target_link_libraries(test gslmultifit gsllinalg gslpermutation gslblas gslcblas gslmatrix gslvector gslblock gslcomplex gslieeeutils gslerr gsltest utils gslsys) 27 | 28 | endif(KDE4_BUILD_TESTS) 29 | 30 | ########### install files ############### 31 | 32 | install(FILES gsl_multifit.h gsl_multifit_nlin.h DESTINATION ${INSTALL_INC}/gsl) 33 | 34 | -------------------------------------------------------------------------------- /block/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libgslblock.la 2 | 3 | check_PROGRAMS = test 4 | 5 | pkginclude_HEADERS = gsl_block.h gsl_block_char.h gsl_block_complex_double.h gsl_block_complex_float.h gsl_block_complex_long_double.h gsl_block_double.h gsl_block_float.h gsl_block_int.h gsl_block_long.h gsl_block_long_double.h gsl_block_short.h gsl_block_uchar.h gsl_block_uint.h gsl_block_ulong.h gsl_block_ushort.h gsl_check_range.h 6 | 7 | INCLUDES = -I$(top_srcdir) 8 | 9 | TESTS = $(check_PROGRAMS) 10 | 11 | test_LDADD = libgslblock.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la 12 | 13 | test_SOURCES = test.c 14 | 15 | CLEANFILES = test.txt test.dat 16 | 17 | noinst_HEADERS = block_source.c init_source.c fprintf_source.c fwrite_source.c test_complex_source.c test_source.c test_io.c test_complex_io.c 18 | 19 | libgslblock_la_SOURCES = init.c file.c block.c 20 | -------------------------------------------------------------------------------- /doc/examples/linalglu.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (void) 6 | { 7 | double a_data[] = { 0.18, 0.60, 0.57, 0.96, 8 | 0.41, 0.24, 0.99, 0.58, 9 | 0.14, 0.30, 0.97, 0.66, 10 | 0.51, 0.13, 0.19, 0.85 }; 11 | 12 | double b_data[] = { 1.0, 2.0, 3.0, 4.0 }; 13 | 14 | gsl_matrix_view m 15 | = gsl_matrix_view_array (a_data, 4, 4); 16 | 17 | gsl_vector_view b 18 | = gsl_vector_view_array (b_data, 4); 19 | 20 | gsl_vector *x = gsl_vector_alloc (4); 21 | 22 | int s; 23 | 24 | gsl_permutation * p = gsl_permutation_alloc (4); 25 | 26 | gsl_linalg_LU_decomp (&m.matrix, p, &s); 27 | 28 | gsl_linalg_LU_solve (&m.matrix, p, &b.vector, x); 29 | 30 | printf ("x = \n"); 31 | gsl_vector_fprintf (stdout, x, "%g"); 32 | 33 | gsl_permutation_free (p); 34 | gsl_vector_free (x); 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /doc/examples/fft.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #define REAL(z,i) ((z)[2*(i)]) 7 | #define IMAG(z,i) ((z)[2*(i)+1]) 8 | 9 | int 10 | main (void) 11 | { 12 | int i; double data[2*128]; 13 | 14 | for (i = 0; i < 128; i++) 15 | { 16 | REAL(data,i) = 0.0; IMAG(data,i) = 0.0; 17 | } 18 | 19 | REAL(data,0) = 1.0; 20 | 21 | for (i = 1; i <= 10; i++) 22 | { 23 | REAL(data,i) = REAL(data,128-i) = 1.0; 24 | } 25 | 26 | for (i = 0; i < 128; i++) 27 | { 28 | printf ("%d %e %e\n", i, 29 | REAL(data,i), IMAG(data,i)); 30 | } 31 | printf ("\n"); 32 | 33 | gsl_fft_complex_radix2_forward (data, 1, 128); 34 | 35 | for (i = 0; i < 128; i++) 36 | { 37 | printf ("%d %e %e\n", i, 38 | REAL(data,i)/sqrt(128), 39 | IMAG(data,i)/sqrt(128)); 40 | } 41 | 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /doc/examples/interp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | int 8 | main (void) 9 | { 10 | int i; 11 | double xi, yi, x[10], y[10]; 12 | 13 | printf ("#m=0,S=2\n"); 14 | 15 | for (i = 0; i < 10; i++) 16 | { 17 | x[i] = i + 0.5 * sin (i); 18 | y[i] = i + cos (i * i); 19 | printf ("%g %g\n", x[i], y[i]); 20 | } 21 | 22 | printf ("#m=1,S=0\n"); 23 | 24 | { 25 | gsl_interp_accel *acc 26 | = gsl_interp_accel_alloc (); 27 | gsl_spline *spline 28 | = gsl_spline_alloc (gsl_interp_cspline, 10); 29 | 30 | gsl_spline_init (spline, x, y, 10); 31 | 32 | for (xi = x[0]; xi < x[9]; xi += 0.01) 33 | { 34 | yi = gsl_spline_eval (spline, xi, acc); 35 | printf ("%g %g\n", xi, yi); 36 | } 37 | gsl_spline_free (spline); 38 | gsl_interp_accel_free (acc); 39 | } 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /doc/specfunc-pow-int.texi: -------------------------------------------------------------------------------- 1 | @cindex power function 2 | @cindex integer powers 3 | 4 | The following functions are equivalent to the function @code{gsl_pow_int} 5 | (@pxref{Small integer powers}) with an error estimate. These functions are 6 | declared in the header file @file{gsl_sf_pow_int.h}. 7 | 8 | @deftypefun double gsl_sf_pow_int (double @var{x}, int @var{n}) 9 | @deftypefunx int gsl_sf_pow_int_e (double @var{x}, int @var{n}, gsl_sf_result * @var{result}) 10 | These routines compute the power @math{x^n} for integer @var{n}. The 11 | power is computed using the minimum number of multiplications. For 12 | example, @math{x^8} is computed as @math{((x^2)^2)^2}, requiring only 3 13 | multiplications. For reasons of efficiency, these functions do not 14 | check for overflow or underflow conditions. 15 | @end deftypefun 16 | 17 | @example 18 | #include 19 | /* compute 3.0**12 */ 20 | double y = gsl_sf_pow_int(3.0, 12); 21 | @end example 22 | 23 | -------------------------------------------------------------------------------- /utils/strtoul.c: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1991 Free Software Foundation, Inc. 2 | This file is part of the GNU C Library. 3 | 4 | The GNU C Library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public License as 6 | published by the Free Software Foundation; either version 3 of the 7 | License, or (at your option) any later version. 8 | 9 | The GNU C Library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with the GNU C Library; see the file COPYING.LIB. If 16 | not, write to the Free Software Foundation, Inc., 675 Mass Ave, 17 | Cambridge, MA 02110-1301, USA. */ 18 | 19 | #define UNSIGNED 1 20 | 21 | #include 22 | -------------------------------------------------------------------------------- /block/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | ########### next target ############### 4 | 5 | set(gslblock_STAT_SRCS init.c file.c block.c) 6 | set(gslblock_STAT_SRCS ${gslblock_STAT_SRCS} PARENT_SCOPE) 7 | 8 | add_library(gslblock STATIC EXCLUDE_FROM_ALL ${gslblock_STAT_SRCS}) 9 | 10 | 11 | ########### next target ############### 12 | 13 | set(test_SRCS test.c) 14 | 15 | if(KDE4_BUILD_TESTS) 16 | 17 | add_executable(test ${test_SRCS}) 18 | 19 | target_link_libraries(test gslblock gslieeeutils gslerr gsltest gslsys utils) 20 | 21 | endif(KDE4_BUILD_TESTS) 22 | 23 | ########### install files ############### 24 | 25 | install(FILES gsl_block.h gsl_block_char.h gsl_block_complex_double.h gsl_block_complex_float.h gsl_block_complex_long_double.h gsl_block_double.h gsl_block_float.h gsl_block_int.h gsl_block_long.h gsl_block_long_double.h gsl_block_short.h gsl_block_uchar.h gsl_block_uint.h gsl_block_ulong.h gsl_block_ushort.h gsl_check_range.h DESTINATION ${INSTALL_INC}/gsl) 26 | 27 | -------------------------------------------------------------------------------- /interpolation/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | ########### next target ############### 4 | 5 | set(gslinterpolation_STAT_SRCS 6 | accel.c 7 | akima.c 8 | cspline.c 9 | interp.c 10 | linear.c 11 | integ_eval.h 12 | spline.c 13 | poly.c 14 | inline.c) 15 | set(gslinterpolation_STAT_SRCS ${gslinterpolation_STAT_SRCS} PARENT_SCOPE) 16 | 17 | add_library(gslinterpolation STATIC EXCLUDE_FROM_ALL ${gslinterpolation_STAT_SRCS}) 18 | 19 | 20 | ########### next target ############### 21 | 22 | set(test_SRCS test.c) 23 | 24 | if(KDE4_BUILD_TESTS) 25 | 26 | add_executable(test ${test_SRCS}) 27 | 28 | target_link_libraries(test gslinterpolation gslpoly gsllinalg gslpermutation gslblas gslmatrix gslvector gslblock gslcomplex gslcblas gslieeeutils gslerr gsltest gslsys utils) 29 | 30 | endif(KDE4_BUILD_TESTS) 31 | 32 | ########### install files ############### 33 | 34 | install(FILES gsl_interp.h gsl_spline.h DESTINATION ${INSTALL_INC}/gsl) 35 | 36 | -------------------------------------------------------------------------------- /multiroots/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | ########### next target ############### 3 | 4 | set(gslmultiroots_STAT_SRCS 5 | fdjac.c 6 | fsolver.c 7 | fdfsolver.c 8 | convergence.c 9 | newton.c 10 | gnewton.c 11 | dnewton.c 12 | broyden.c 13 | hybrid.c 14 | hybridj.c) 15 | set(gslmultiroots_STAT_SRCS ${gslmultiroots_STAT_SRCS} PARENT_SCOPE) 16 | 17 | add_library(gslmultiroots STATIC EXCLUDE_FROM_ALL ${gslmultiroots_STAT_SRCS}) 18 | 19 | 20 | ########### next target ############### 21 | 22 | set(test_SRCS test.c test_funcs.c test_funcs.h) 23 | 24 | if(KDE4_BUILD_TESTS) 25 | 26 | add_executable(test ${test_SRCS}) 27 | 28 | target_link_libraries(test gslmultiroots gsllinalg gslblas gslcblas gslpermutation gslmatrix gslvector gslblock gslcomplex gslieeeutils gslerr gsltest gslsys utils) 29 | 30 | endif(KDE4_BUILD_TESTS) 31 | 32 | ########### install files ############### 33 | 34 | install(FILES gsl_multiroots.h DESTINATION ${INSTALL_INC}/gsl) 35 | 36 | 37 | -------------------------------------------------------------------------------- /doc/examples/matrixw.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (void) 6 | { 7 | int i, j, k = 0; 8 | gsl_matrix * m = gsl_matrix_alloc (100, 100); 9 | gsl_matrix * a = gsl_matrix_alloc (100, 100); 10 | 11 | for (i = 0; i < 100; i++) 12 | for (j = 0; j < 100; j++) 13 | gsl_matrix_set (m, i, j, 0.23 + i + j); 14 | 15 | { 16 | FILE * f = fopen ("test.dat", "wb"); 17 | gsl_matrix_fwrite (f, m); 18 | fclose (f); 19 | } 20 | 21 | { 22 | FILE * f = fopen ("test.dat", "rb"); 23 | gsl_matrix_fread (f, a); 24 | fclose (f); 25 | } 26 | 27 | for (i = 0; i < 100; i++) 28 | for (j = 0; j < 100; j++) 29 | { 30 | double mij = gsl_matrix_get (m, i, j); 31 | double aij = gsl_matrix_get (a, i, j); 32 | if (mij != aij) k++; 33 | } 34 | 35 | gsl_matrix_free (m); 36 | gsl_matrix_free (a); 37 | 38 | printf ("differences = %d (should be zero)\n", k); 39 | return (k > 0); 40 | } 41 | -------------------------------------------------------------------------------- /ntuple/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libgslntuple.la 2 | 3 | pkginclude_HEADERS = gsl_ntuple.h 4 | 5 | INCLUDES = -I$(top_srcdir) 6 | 7 | libgslntuple_la_SOURCES = ntuple.c 8 | 9 | TESTS = $(check_PROGRAMS) 10 | 11 | check_PROGRAMS = test #demo demo1 12 | 13 | test_SOURCES = test.c 14 | test_LDADD = libgslntuple.la ../histogram/libgslhistogram.la ../block/libgslblock.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la 15 | 16 | #demo_SOURCES = demo.c 17 | #demo_LDADD = libgslntuple.la ../histogram/libgslhistogram.la ../block/libgslblock.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la 18 | 19 | #demo1_SOURCES = demo1.c 20 | #demo1_LDADD = libgslntuple.la ../histogram/libgslhistogram.la ../block/libgslblock.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la 21 | 22 | CLEANFILES = test.dat 23 | -------------------------------------------------------------------------------- /ode-initval/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | ########### next target ############### 3 | 4 | set(gslodeiv_STAT_SRCS 5 | control.c 6 | cstd.c 7 | cscal.c 8 | evolve.c 9 | step.c 10 | rk2.c 11 | rk2imp.c 12 | rk2simp.c 13 | rk4.c 14 | rk4imp.c 15 | rkf45.c 16 | rk8pd.c 17 | rkck.c 18 | bsimp.c 19 | gear1.c 20 | gear2.c) 21 | set(gslode-initval_STAT_SRCS ${gslodeiv_STAT_SRCS} PARENT_SCOPE) 22 | 23 | add_library(gslodeiv STATIC EXCLUDE_FROM_ALL ${gslodeiv_STAT_SRCS}) 24 | 25 | 26 | ########### next target ############### 27 | 28 | set(test_SRCS test.c) 29 | 30 | if(KDE4_BUILD_TESTS) 31 | 32 | add_executable(test ${test_SRCS}) 33 | 34 | target_link_libraries(test gslodeiv gsllinalg gslblas gslcblas gslmatrix gslpermutation gslvector gslblock gslcomplex gslieeeutils gslerr gsltest gslsys utils) 35 | 36 | endif(KDE4_BUILD_TESTS) 37 | 38 | ########### install files ############### 39 | 40 | install(FILES gsl_odeiv.h DESTINATION ${INSTALL_INC}/gsl) 41 | 42 | -------------------------------------------------------------------------------- /doc/examples/integration.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | double f (double x, void * params) { 6 | double alpha = *(double *) params; 7 | double f = log(alpha*x) / sqrt(x); 8 | return f; 9 | } 10 | 11 | int 12 | main (void) 13 | { 14 | gsl_integration_workspace * w 15 | = gsl_integration_workspace_alloc (1000); 16 | 17 | double result, error; 18 | double expected = -4.0; 19 | double alpha = 1.0; 20 | 21 | gsl_function F; 22 | F.function = &f; 23 | F.params = α 24 | 25 | gsl_integration_qags (&F, 0, 1, 0, 1e-7, 1000, 26 | w, &result, &error); 27 | 28 | printf ("result = % .18f\n", result); 29 | printf ("exact result = % .18f\n", expected); 30 | printf ("estimated error = % .18f\n", error); 31 | printf ("actual error = % .18f\n", result - expected); 32 | printf ("intervals = %d\n", w->size); 33 | 34 | gsl_integration_workspace_free (w); 35 | 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /siman/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | ########### next target ############### 3 | 4 | set(test_SRCS test.c) 5 | 6 | if(KDE4_BUILD_TESTS) 7 | 8 | add_executable(test ${test_SRCS}) 9 | 10 | target_link_libraries(test gslsiman gslrng gslieeeutils gslerr gsltest gslsys utils) 11 | 12 | 13 | endif(KDE4_BUILD_TESTS) 14 | 15 | ########### next target ############### 16 | 17 | set(siman_tsp_SRCS siman_tsp.c) 18 | 19 | add_executable(siman_tsp ${siman_tsp_SRCS}) 20 | 21 | target_link_libraries(siman_tsp gslsiman gslrng gslieeeutils gslerr gslsys utils) 22 | 23 | IF(UNIX) 24 | target_link_libraries(siman_tsp m) #~ok? 25 | ENDIF(UNIX) 26 | 27 | 28 | 29 | ########### next target ############### 30 | 31 | set(gslsiman_STAT_SRCS siman.c) 32 | set(gslsiman_STAT_SRCS ${gslsiman_STAT_SRCS} PARENT_SCOPE) 33 | 34 | 35 | add_library(gslsiman STATIC EXCLUDE_FROM_ALL ${gslsiman_STAT_SRCS}) 36 | 37 | 38 | ########### install files ############### 39 | 40 | install(FILES gsl_siman.h DESTINATION ${INSTALL_INC}/gsl) 41 | 42 | 43 | -------------------------------------------------------------------------------- /complex/inline.c: -------------------------------------------------------------------------------- 1 | /* complex/inline.c 2 | * 3 | * Copyright (C) 2008 Brian Gough 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 3 of the License, or (at 8 | * your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, but 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | /* Compile all the inline functions */ 21 | 22 | #define COMPILE_INLINE_STATIC 23 | #include "build.h" 24 | #include 25 | -------------------------------------------------------------------------------- /combination/inline.c: -------------------------------------------------------------------------------- 1 | /* combination/inline.c 2 | * 3 | * Copyright (C) 2008 Brian Gough 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 3 of the License, or (at 8 | * your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, but 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | /* Compile all the inline functions */ 21 | 22 | #define COMPILE_INLINE_STATIC 23 | #include "build.h" 24 | #include 25 | -------------------------------------------------------------------------------- /eigen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | ########### next target ############### 4 | 5 | set(gsleigen_STAT_SRCS 6 | jacobi.c 7 | symm.c 8 | symmv.c 9 | nonsymm.c 10 | nonsymmv.c 11 | herm.c 12 | hermv.c 13 | gensymm.c 14 | gensymmv.c 15 | genherm.c 16 | genhermv.c 17 | gen.c 18 | genv.c 19 | sort.c 20 | francis.c 21 | schur.c) 22 | set(gsleigen_STAT_SRCS ${gsleigen_STAT_SRCS} PARENT_SCOPE) 23 | 24 | add_library(gsleigen STATIC EXCLUDE_FROM_ALL ${gsleigen_STAT_SRCS}) 25 | 26 | 27 | ########### next target ############### 28 | 29 | set(test_SRCS test.c) 30 | 31 | if(KDE4_BUILD_TESTS) 32 | 33 | add_executable(test ${test_SRCS}) 34 | 35 | target_link_libraries(test gsleigen gsltest gsllinalg gslpermutation gslblas gslcblas gslmatrix gslvector gslblock gslcomplex gslieeeutils gslsys gslerr utils gslrng gslsort) 36 | 37 | endif(KDE4_BUILD_TESTS) 38 | 39 | ########### install files ############### 40 | 41 | install(FILES gsl_eigen.h DESTINATION ${INSTALL_INC}/gsl) 42 | 43 | -------------------------------------------------------------------------------- /integration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | ########### next target ############### 3 | 4 | set(gslintegration_STAT_SRCS 5 | qk15.c 6 | qk21.c 7 | qk31.c 8 | qk41.c 9 | qk51.c 10 | qk61.c 11 | qk.c 12 | qng.c 13 | qng.h 14 | qag.c 15 | qags.c 16 | qagp.c 17 | workspace.c 18 | qcheb.c 19 | qawc.c 20 | qmomo.c 21 | qaws.c 22 | qmomof.c 23 | qawo.c 24 | qawf.c) 25 | set(gslintegration_STAT_SRCS ${gslintegration_STAT_SRCS} PARENT_SCOPE) 26 | 27 | add_library(gslintegration STATIC EXCLUDE_FROM_ALL ${gslintegration_STAT_SRCS}) 28 | 29 | 30 | ########### next target ############### 31 | 32 | set(test_SRCS test.c tests.c tests.h) 33 | 34 | if(KDE4_BUILD_TESTS) 35 | 36 | add_executable(test ${test_SRCS}) 37 | 38 | target_link_libraries(test gslintegration gslieeeutils gslerr gsltest gslsys utils) 39 | 40 | endif(KDE4_BUILD_TESTS) 41 | 42 | ########### install files ############### 43 | 44 | install(FILES gsl_integration.h DESTINATION ${INSTALL_INC}/gsl) 45 | 46 | -------------------------------------------------------------------------------- /doc/specfunc-synchrotron.texi: -------------------------------------------------------------------------------- 1 | @cindex synchrotron functions 2 | 3 | The functions described in this section are declared in the header file 4 | @file{gsl_sf_synchrotron.h}. 5 | 6 | @deftypefun double gsl_sf_synchrotron_1 (double @var{x}) 7 | @deftypefunx int gsl_sf_synchrotron_1_e (double @var{x}, gsl_sf_result * @var{result}) 8 | These routines compute the first synchrotron function 9 | @c{$x \int_x^\infty dt K_{5/3}(t)$} 10 | @math{x \int_x^\infty dt K_@{5/3@}(t)} for @c{$x \ge 0$} 11 | @math{x >= 0}. 12 | @comment Domain: x >= 0.0 13 | @comment Exceptional Return Values: GSL_EDOM, GSL_EUNDRFLW 14 | @end deftypefun 15 | 16 | @deftypefun double gsl_sf_synchrotron_2 (double @var{x}) 17 | @deftypefunx int gsl_sf_synchrotron_2_e (double @var{x}, gsl_sf_result * @var{result}) 18 | These routines compute the second synchrotron function 19 | @c{$x K_{2/3}(x)$} 20 | @math{x K_@{2/3@}(x)} for @c{$x \ge 0$} 21 | @math{x >= 0}. 22 | @comment Domain: x >= 0.0 23 | @comment Exceptional Return Values: GSL_EDOM, GSL_EUNDRFLW 24 | @end deftypefun 25 | -------------------------------------------------------------------------------- /multimin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | ########### next target ############### 4 | 5 | set(gslmultimin_STAT_SRCS 6 | fdfminimizer.c 7 | steepest_descent.c 8 | conjugate_fr.c 9 | conjugate_pr.c 10 | convergence.c 11 | diff.c 12 | vector_bfgs.c 13 | vector_bfgs2.c 14 | fminimizer.c 15 | simplex.c 16 | simplex2.c) 17 | set(gslmultimin_STAT_SRCS ${gslmultimin_STAT_SRCS} PARENT_SCOPE) 18 | 19 | add_library(gslmultimin STATIC EXCLUDE_FROM_ALL ${gslmultimin_STAT_SRCS}) 20 | 21 | 22 | ########### next target ############### 23 | 24 | set(test_SRCS test.c test_funcs.c test_funcs.h) 25 | 26 | if(KDE4_BUILD_TESTS) 27 | 28 | add_executable(test ${test_SRCS}) 29 | 30 | target_link_libraries(test gslmultimin gslmin gslpoly gslblas gslcblas gsllinalg gslpermutation gslmatrix gslvector gslblock gslcomplex gslieeeutils gslerr gsltest gslsys utils) 31 | 32 | endif(KDE4_BUILD_TESTS) 33 | 34 | ########### install files ############### 35 | 36 | install(FILES gsl_multimin.h DESTINATION ${INSTALL_INC}/gsl) 37 | 38 | -------------------------------------------------------------------------------- /sys/fdiv.c: -------------------------------------------------------------------------------- 1 | /* sys/fdiv.c 2 | * 3 | * Copyright (C) 2001, 2007 Brian Gough 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 3 of the License, or (at 8 | * your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, but 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | double 25 | gsl_fdiv (const double x, const double y) 26 | { 27 | return x / y; 28 | } 29 | --------------------------------------------------------------------------------