slgsl-pre0.10.0-7/0002755000175000000620000000000015012561735012414 5ustar johnstaffslgsl-pre0.10.0-7/src/0002755000175000000620000000000015012561735013203 5ustar johnstaffslgsl-pre0.10.0-7/src/gsl-module.c0000644000175000000620000011516514713350753015431 0ustar johnstaff/* -*- mode: C; mode: fold; -*- */ /* Copyright (c) 2003, 2004, 2005 Massachusetts Institute of Technology This software was developed by the MIT Center for Space Research under contract SV1-61010 from the Smithsonian Institution. Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in the supporting documentation, and that the name of the Massachusetts Institute of Technology not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The Massachusetts Institute of Technology makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. THE MASSACHUSETTS INSTITUTE OF TECHNOLOGY DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE MASSACHUSETTS INSTITUTE OF TECHNOLOGY BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* Author: John E. Davis (jed@jedsoft.org) */ #include "config.h" #include #include #include #include #include #include "slgsl.h" #include "version.h" #ifdef __cplusplus extern "C" { #endif SLANG_MODULE(gsl); #ifdef __cplusplus } #endif /*{{{ Error Handling Routines */ #define MAX_ERRNO 128 #define SIZEOF_BITMAP (8 * sizeof(long)) #define NUM_BITMAPS (MAX_ERRNO/SIZEOF_BITMAP) typedef struct { unsigned long error; unsigned long warn; unsigned long ignore; SLang_Name_Type *callbacks[SIZEOF_BITMAP]; } Error_Bitmap_Type; static Error_Bitmap_Type Pos_Error_Bitmaps[NUM_BITMAPS]; static Error_Bitmap_Type Neg_Error_Bitmaps[NUM_BITMAPS]; static unsigned long Num_Errors; void slgsl_reset_errors (void) { unsigned int i; for (i = 0; i < NUM_BITMAPS; i++) { Pos_Error_Bitmaps[i].error = 0; Neg_Error_Bitmaps[i].error = 0; } Num_Errors = 0; } static void do_bitmap (const char *func, Error_Bitmap_Type *bitmaps, int dir) { unsigned int b; for (b = 0; b < NUM_BITMAPS; b++) { unsigned long e_bitmap = bitmaps[b].error; unsigned long w_bitmap = bitmaps[b].warn; SLang_Name_Type **callbacks = bitmaps[b].callbacks; unsigned int i = b * SIZEOF_BITMAP; while (e_bitmap) { if (e_bitmap & 1) { int gsl_errno = dir * (b * SIZEOF_BITMAP + i); if (callbacks[i] != NULL) { if ((-1 == SLang_start_arg_list ()) || (-1 == SLang_push_string (func)) || (-1 == SLang_push_integer (gsl_errno)) || (-1 == SLang_end_arg_list ()) || (-1 == SLexecute_function (callbacks[i]))) return; } else if (w_bitmap & 1) SLang_vmessage ("*** Warning: %s: %s\r\n", func, gsl_strerror (gsl_errno)); else SLang_verror (SL_INTRINSIC_ERROR, "%s: %s", func, gsl_strerror (gsl_errno)); } e_bitmap = e_bitmap >> 1; w_bitmap = w_bitmap >> 1; i++; } } } void slgsl_check_errors (const char *funct) { if (Num_Errors == 0) return; do_bitmap (funct, Pos_Error_Bitmaps, 1); do_bitmap (funct, Neg_Error_Bitmaps, -1); Num_Errors = 0; } static Error_Bitmap_Type *find_bitmap (int gsl_errno, int slerr, unsigned long *mask, unsigned int *ofsp) { Error_Bitmap_Type *bitmaps; int ofs; if (gsl_errno > 0) bitmaps = Pos_Error_Bitmaps; else { bitmaps = Neg_Error_Bitmaps; gsl_errno = -gsl_errno; } if (gsl_errno >= MAX_ERRNO) { SLang_verror (slerr, "GLS errno (%d) is larger than supported value (%d)\n", gsl_errno, MAX_ERRNO-1); return NULL; } bitmaps += gsl_errno/SIZEOF_BITMAP; ofs = gsl_errno % SIZEOF_BITMAP; *mask = (1L << ofs); if (ofsp != NULL) *ofsp = (unsigned int)ofs; return bitmaps; } static void err_handler (const char * reason, const char * file, int line, int gsl_errno) { Error_Bitmap_Type *bitmap; unsigned long mask; (void) reason; (void) file; (void) line; if (gsl_errno == 0) return; if (NULL == (bitmap = find_bitmap (gsl_errno, SL_APPLICATION_ERROR, &mask, NULL))) { Num_Errors++; return; } if (bitmap->ignore & mask) return; bitmap->error |= mask; Num_Errors++; } static int set_gsl_error_disposition (int gsl_errno, int how, SLang_Name_Type *callback) { Error_Bitmap_Type *bitmap; unsigned long mask; unsigned int ofs; if (NULL == (bitmap = find_bitmap (gsl_errno, SL_INVALID_PARM, &mask, &ofs))) return -1; bitmap->ignore &= ~mask; bitmap->warn &= ~mask; SLang_free_function (bitmap->callbacks[ofs]); /* NULL ok */ if (NULL != (bitmap->callbacks[ofs] = callback)) return -1; if (how == 0) bitmap->ignore |= mask; else if (how == 1) bitmap->warn |= mask; return 0; } static void set_error_disposition (void) { int gsl_errno; int how = 0; SLang_Name_Type *callback = NULL; if (SLang_peek_at_stack () == SLANG_INT_TYPE) { if (-1 == SLang_pop_integer (&how)) return; } else if (NULL == (callback = SLang_pop_function ())) return; if ((-1 == SLang_pop_integer (&gsl_errno)) || (-1 == set_gsl_error_disposition (gsl_errno, how, callback))) SLang_free_function (callback);/* NULL ok */ } /*}}}*/ /*{{{ Array popping routines */ static int pop_array (SLang_Array_Type **atp, SLtype type, unsigned int ndims) { SLang_Array_Type *at; *atp = 0; if (-1 == SLang_pop_array_of_type (&at, type)) return -1; if (at->num_dims != ndims) { SLang_verror (SL_INVALID_PARM, "Context requires a %d-d array", ndims); SLang_free_array (at); return -1; } *atp = at; return 0; } void slgsl_free_d_array (SLGSL_Double_Array_Type *a) { if (a->at != NULL) SLang_free_array (a->at); } int slgsl_push_d_array (SLGSL_Double_Array_Type *a, int do_free) { if (a->at != NULL) return SLang_push_array (a->at, do_free); return SLang_push_double (a->x); } void slgsl_free_i_array (SLGSL_Int_Array_Type *a) { if (a->at != NULL) SLang_free_array (a->at); } int slgsl_push_i_array (SLGSL_Int_Array_Type *a, int do_free) { if (a->at != NULL) return SLang_push_array (a->at, do_free); return SLang_push_integer (a->x); } int slgsl_create_d_array (SLGSL_Double_Array_Type *a, SLGSL_Double_Array_Type *b) { if (a->at != NULL) { if (NULL == (b->at = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, a->at->dims, a->at->num_dims))) return -1; b->xp = (double *)b->at->data; b->num_elements = b->at->num_elements; b->inc = 1; return 0; } b->inc = 0; b->xp = &b->x; b->num_elements = 1; b->at = NULL; return 0; } int slgsl_pop_d_array (SLGSL_Double_Array_Type *a, int array_required) { if (array_required || (SLang_peek_at_stack () == SLANG_ARRAY_TYPE)) { if (-1 == SLang_pop_array_of_type (&a->at, SLANG_DOUBLE_TYPE)) return -1; a->xp = (double *) a->at->data; a->inc = 1; a->num_elements = a->at->num_elements; return 0; } a->at = NULL; a->xp = &a->x; a->inc = 0; a->num_elements = 1; #if SLANG_VERSION < 20000 return SLang_pop_double (a->xp, NULL, NULL); #else return SLang_pop_double (a->xp); #endif } /* Complex wrappers */ void slgsl_free_c_array (SLGSL_Complex_Array_Type *a) { if (a->at != NULL) SLang_free_array (a->at); } int slgsl_push_c_array (SLGSL_Complex_Array_Type *a, int do_free) { if (a->at != NULL) return SLang_push_array (a->at, do_free); return SLang_push_complex (a->x[0], a->x[1]); } int slgsl_create_c_array (SLGSL_Complex_Array_Type *a, SLGSL_Complex_Array_Type *b) { if (a->at != NULL) { if (NULL == (b->at = SLang_create_array (SLANG_COMPLEX_TYPE, 0, NULL, a->at->dims, a->at->num_dims))) return -1; b->xp = (double *)b->at->data; b->num_elements = b->at->num_elements; b->inc = 1; return 0; } b->inc = 0; b->xp = (double*)&b->x; b->num_elements = 1; b->at = NULL; return 0; } int slgsl_pop_c_array (SLGSL_Complex_Array_Type *a, int array_required) { if (array_required || (SLang_peek_at_stack () == SLANG_ARRAY_TYPE)) { if (-1 == SLang_pop_array_of_type (&a->at, SLANG_COMPLEX_TYPE)) return -1; a->xp = (double *) a->at->data; a->inc = 1; a->num_elements = a->at->num_elements; return 0; } a->at = NULL; a->xp = a->x; a->inc = 0; a->num_elements = 1; return SLang_pop_complex (&a->x[0], &a->x[1]); } int slgsl_pop_i_array (SLGSL_Int_Array_Type *a, int array_required) { if (array_required || (SLang_peek_at_stack () == SLANG_ARRAY_TYPE)) { if (-1 == SLang_pop_array_of_type (&a->at, SLANG_INT_TYPE)) return -1; a->xp = (int *) a->at->data; a->inc = 1; a->num_elements = a->at->num_elements; return 0; } a->at = NULL; a->xp = &a->x; a->inc = 0; a->num_elements = 1; return SLang_pop_integer (a->xp); } int slgsl_pop_dd_array (SLGSL_Double_Array_Type *a, SLGSL_Double_Array_Type *b, int array_required) { if (-1 == slgsl_pop_d_array (b, array_required)) return -1; if (-1 == slgsl_pop_d_array (a, array_required)) return -1; if ((a->at != NULL) && (b->at != NULL) && (a->num_elements != b->num_elements)) { SLang_verror (SL_TYPE_MISMATCH, "This function requires arrays of the same size"); SLang_free_array (a->at); SLang_free_array (b->at); return -1; } return 0; } int slgsl_pop_id_array (SLGSL_Int_Array_Type *a, SLGSL_Double_Array_Type *b, int array_required) { if (-1 == slgsl_pop_d_array (b, array_required)) return -1; if (-1 == slgsl_pop_i_array (a, array_required)) return -1; if ((a->at != NULL) && (b->at != NULL) && (a->num_elements != b->num_elements)) { SLang_verror (SL_TYPE_MISMATCH, "This function requires arrays of the same size"); SLang_free_array (a->at); SLang_free_array (b->at); return -1; } return 0; } int slgsl_pop_idd_array (SLGSL_Int_Array_Type *a, SLGSL_Double_Array_Type *b, SLGSL_Double_Array_Type *c, int array_required) { if (-1 == slgsl_pop_dd_array (b, c, array_required)) return -1; if (-1 == slgsl_pop_i_array (a, array_required)) return -1; if (a->at != NULL) { if (((b->at != NULL) && (a->num_elements != b->num_elements)) || ((c->at != NULL) && (a->num_elements != c->num_elements))) { SLang_verror (SL_TYPE_MISMATCH, "This function requires arrays of the same size"); SLang_free_array (a->at); SLang_free_array (b->at); SLang_free_array (c->at); return -1; } } return 0; } int slgsl_pop_iid_array (SLGSL_Int_Array_Type *a, SLGSL_Int_Array_Type *b, SLGSL_Double_Array_Type *c, int array_required) { if (-1 == slgsl_pop_id_array (b, c, array_required)) return -1; if (-1 == slgsl_pop_i_array (a, array_required)) return -1; if (a->at != NULL) { if (((b->at != NULL) && (a->num_elements != b->num_elements)) || ((c->at != NULL) && (a->num_elements != c->num_elements))) { SLang_verror (SL_TYPE_MISMATCH, "This function requires arrays of the same size"); SLang_free_array (a->at); SLang_free_array (b->at); SLang_free_array (c->at); return -1; } } return 0; } int slgsl_pop_iidd_array (SLGSL_Int_Array_Type *a, SLGSL_Int_Array_Type *b, SLGSL_Double_Array_Type *c, SLGSL_Double_Array_Type *d, int array_required) { if (-1 == slgsl_pop_idd_array (b, c, d, array_required)) return -1; if (-1 == slgsl_pop_i_array (a, array_required)) return -1; if (a->at != NULL) { if (((b->at != NULL) && (a->at->num_elements != b->at->num_elements)) || ((c->at != NULL) && (a->at->num_elements != c->at->num_elements)) || ((d->at != NULL) && (a->at->num_elements != d->at->num_elements))) { SLang_verror (SL_TYPE_MISMATCH, "This function requires arrays of the same size"); SLang_free_array (a->at); SLang_free_array (b->at); SLang_free_array (c->at); SLang_free_array (d->at); return -1; } } return 0; } int slgsl_pop_ddd_array (SLGSL_Double_Array_Type *a, SLGSL_Double_Array_Type *b, SLGSL_Double_Array_Type *c, int array_required) { if (-1 == slgsl_pop_dd_array (b, c, array_required)) return -1; if (-1 == slgsl_pop_d_array (a, array_required)) return -1; if (a->at != NULL) { if (((b->at != NULL) && (a->num_elements != b->num_elements)) || ((c->at != NULL) && (a->num_elements != c->num_elements))) { SLang_verror (SL_TYPE_MISMATCH, "This function requires arrays of the same size"); SLang_free_array (a->at); SLang_free_array (b->at); SLang_free_array (c->at); return -1; } } return 0; } int slgsl_pop_dddd_array (SLGSL_Double_Array_Type *a, SLGSL_Double_Array_Type *b, SLGSL_Double_Array_Type *c, SLGSL_Double_Array_Type *d, int array_required) { if (-1 == slgsl_pop_ddd_array (b, c, d, array_required)) return -1; if (-1 == slgsl_pop_d_array (a, array_required)) return -1; if (a->at != NULL) { if (((b->at != NULL) && (a->num_elements != b->num_elements)) || ((c->at != NULL) && (a->num_elements != c->num_elements)) || ((d->at != NULL) && (a->num_elements != d->num_elements))) { SLang_verror (SL_TYPE_MISMATCH, "This function requires arrays of the same size"); SLang_free_array (a->at); SLang_free_array (b->at); SLang_free_array (c->at); SLang_free_array (d->at); return -1; } } return 0; } /*}}}*/ /*{{{ Utility functions for GLS Vector/Matrix types */ static void free_double_matrix (SLGSL_Matrix_Type *matrix) { if (matrix->at != NULL) SLang_free_array (matrix->at); else if (matrix->m.d.data != NULL) SLfree ((char *) matrix->m.d.data); } static int push_double_matrix (SLGSL_Matrix_Type *matrix) { SLang_Array_Type *at; SLtype type; gsl_matrix *m; SLindex_Type dims[2]; double *data; if (NULL != (at = matrix->at)) return SLang_push_array (at, 0); m = &matrix->m.d; type = SLANG_DOUBLE_TYPE; data = m->data; dims[0] = m->size1; dims[1] = m->size2; at = SLang_create_array (type, 0, data, dims, 2); if (at == NULL) return -1; /* stealing the data array */ m->data = NULL; return SLang_push_array (at, 1); } static int init_double_matrix (SLGSL_Matrix_Type *matrix, unsigned int n0, unsigned int n1, int copy, SLang_Array_Type *at) { gsl_matrix *m; m = &matrix->m.d; matrix->size1 = m->size1 = n0; matrix->size2 = m->size2 = n1; m->tda = n1; m->owner = 0; if ((at != NULL) && (copy == 0)) { m->data = (double *) at->data; matrix->at = at; } else { unsigned int nbytes = n0*n1*sizeof(double); if (NULL == (m->data = (double *)SLmalloc (nbytes))) return -1; if (at != NULL) memcpy ((char *)m->data, (char *)at->data, nbytes); matrix->at = NULL; } matrix->is_complex = 0; matrix->free_method = free_double_matrix; matrix->push_method = push_double_matrix; return 0; } static void free_complex_matrix (SLGSL_Matrix_Type *matrix) { if (matrix->at != NULL) SLang_free_array (matrix->at); else if (matrix->m.c.data != NULL) SLfree ((char *) matrix->m.c.data); } static int push_complex_matrix (SLGSL_Matrix_Type *matrix) { SLang_Array_Type *at; SLtype type; gsl_matrix_complex *c; SLindex_Type dims[2]; double *data; if (NULL != (at = matrix->at)) return SLang_push_array (at, 0); c = &matrix->m.c; type = SLANG_COMPLEX_TYPE; data = c->data; dims[0] = c->size1; dims[1] = c->size2; at = SLang_create_array (type, 0, data, dims, 2); if (at == NULL) return -1; /* stealing the data array */ c->data = NULL; return SLang_push_array (at, 1); } static int init_complex_matrix (SLGSL_Matrix_Type *matrix, unsigned int n0, unsigned int n1, int copy, SLang_Array_Type *at) { gsl_matrix_complex *c; c = &matrix->m.c; matrix->size1 = c->size1 = n0; matrix->size2 = c->size2 = n1; c->tda = n1; c->owner = 0; if ((at != NULL) && (copy == 0)) { c->data = (double *) at->data; matrix->at = at; } else { unsigned int nbytes = 2*n0*n1*sizeof(double); if (NULL == (c->data = (double *)SLmalloc (nbytes))) return -1; if (at != NULL) memcpy ((char *)c->data, (char *)at->data, nbytes); matrix->at = NULL; } matrix->is_complex = 1; matrix->free_method = free_complex_matrix; matrix->push_method = push_complex_matrix; return 0; } void slgsl_free_matrix (SLGSL_Matrix_Type *matrix) { if (matrix == NULL) return; (*matrix->free_method)(matrix); SLfree ((char *)matrix); } SLGSL_Matrix_Type *slgsl_new_matrix (SLtype type, unsigned int n0, unsigned int n1, int copy, SLang_Array_Type *at) { SLGSL_Matrix_Type *matrix; int status; if (NULL == (matrix = (SLGSL_Matrix_Type *)SLcalloc (1, sizeof (SLGSL_Matrix_Type)))) return NULL; if (type == SLANG_COMPLEX_TYPE) status = init_complex_matrix (matrix, n0, n1, copy, at); else status = init_double_matrix (matrix, n0, n1, copy, at); if (status == -1) { SLfree ((char *) matrix); return NULL; } return matrix; } int slgsl_push_matrix (SLGSL_Matrix_Type *matrix) { return (*matrix->push_method)(matrix); } int slgsl_pop_matrix (SLGSL_Matrix_Type **matrixp, SLtype type, int copy) { SLang_Array_Type *at; SLGSL_Matrix_Type *matrix; *matrixp = NULL; if (-1 == pop_array (&at, type, 2)) return -1; if (NULL == (matrix = slgsl_new_matrix (type, at->dims[0], at->dims[1], copy, at))) { SLang_free_array (at); return -1; } if (copy) SLang_free_array (at); *matrixp = matrix; return 0; } int slgsl_pop_square_matrix (SLGSL_Matrix_Type **matrixp, SLtype type, int copy) { SLGSL_Matrix_Type *matrix; if (-1 == slgsl_pop_matrix (&matrix, type, copy)) { *matrixp = NULL; return -1; } if (matrix->size1 != matrix->size2) { SLang_verror (SL_INVALID_PARM, "Expecting a square matrix"); slgsl_free_matrix (matrix); return -1; } *matrixp = matrix; return 0; } /* Functions to create/destroy vectors */ static void free_double_vector (SLGSL_Vector_Type *vector) { if (vector->at != NULL) SLang_free_array (vector->at); else if (vector->v.d.data != NULL) SLfree ((char *) vector->v.d.data); } static int push_double_vector (SLGSL_Vector_Type *vector) { SLang_Array_Type *at; SLtype type; gsl_vector *v; SLindex_Type dims[1]; double *data; if (NULL != (at = vector->at)) return SLang_push_array (at, 0); v = &vector->v.d; type = SLANG_DOUBLE_TYPE; data = v->data; dims[0] = v->size; at = SLang_create_array (type, 0, data, dims, 1); if (at == NULL) return -1; /* stealing the data array */ v->data = NULL; return SLang_push_array (at, 1); } static int init_double_vector (SLGSL_Vector_Type *vector, unsigned int n, int copy, SLang_Array_Type *at) { gsl_vector *v; v = &vector->v.d; vector->size = v->size = n; v->stride = 1; v->owner = 0; if ((at != NULL) && (copy == 0)) { v->data = (double *) at->data; vector->at = at; } else { unsigned int nbytes = n*sizeof(double); if (NULL == (v->data = (double *)SLmalloc (nbytes))) return -1; if (at != NULL) memcpy ((char *)v->data, (char *)at->data, nbytes); vector->at = NULL; } vector->is_complex = 0; vector->free_method = free_double_vector; vector->push_method = push_double_vector; return 0; } static void free_complex_vector (SLGSL_Vector_Type *vector) { if (vector->at != NULL) SLang_free_array (vector->at); else if (vector->v.c.data != NULL) SLfree ((char *) vector->v.c.data); } static int push_complex_vector (SLGSL_Vector_Type *vector) { SLang_Array_Type *at; SLtype type; gsl_vector_complex *v; SLindex_Type dims[1]; double *data; if (NULL != (at = vector->at)) return SLang_push_array (at, 0); v = &vector->v.c; type = SLANG_COMPLEX_TYPE; data = v->data; dims[0] = v->size; at = SLang_create_array (type, 0, data, dims, 1); if (at == NULL) return -1; /* stealing the data array */ v->data = NULL; return SLang_push_array (at, 1); } static int init_complex_vector (SLGSL_Vector_Type *vector, unsigned int n, int copy, SLang_Array_Type *at) { gsl_vector_complex *v; v = &vector->v.c; vector->size = v->size = n; v->stride = 1; v->owner = 0; if ((at != NULL) && (copy == 0)) { v->data = (double *) at->data; vector->at = at; } else { unsigned int nbytes = 2*n*sizeof(double); if (NULL == (v->data = (double *)SLmalloc (nbytes))) return -1; if (at != NULL) memcpy ((char *)v->data, (char *)at->data, nbytes); vector->at = NULL; } vector->is_complex = 0; vector->free_method = free_complex_vector; vector->push_method = push_complex_vector; return 0; } void slgsl_free_vector (SLGSL_Vector_Type *vector) { if (vector == NULL) return; (*vector->free_method)(vector); SLfree ((char *)vector); } SLGSL_Vector_Type *slgsl_new_vector (SLtype type, unsigned int n, int copy, SLang_Array_Type *at) { SLGSL_Vector_Type *vector; int status; if (NULL == (vector = (SLGSL_Vector_Type *)SLcalloc (1, sizeof (SLGSL_Vector_Type)))) return NULL; if (type == SLANG_COMPLEX_TYPE) status = init_complex_vector (vector, n, copy, at); else status = init_double_vector (vector, n, copy, at); if (status == -1) { SLfree ((char *) vector); return NULL; } return vector; } int slgsl_push_vector (SLGSL_Vector_Type *vector) { return (*vector->push_method)(vector); } int slgsl_assign_vector_to_ref (SLGSL_Vector_Type *vector, SLang_Ref_Type *ref) { SLang_Array_Type *at; int status; if (-1 == slgsl_push_vector (vector)) return -1; if (-1 == SLang_pop_array (&at, 0)) return -1; status = SLang_assign_to_ref (ref, SLANG_ARRAY_TYPE, (VOID_STAR)&at); SLang_free_array (at); return status; } int slgsl_pop_vector (SLGSL_Vector_Type **vectorp, SLtype type, int copy) { SLang_Array_Type *at; SLGSL_Vector_Type *vector; *vectorp = NULL; if (-1 == pop_array (&at, type, 1)) return -1; if (NULL == (vector = slgsl_new_vector (type, at->dims[0], copy, at))) { SLang_free_array (at); return -1; } if (copy) SLang_free_array (at); *vectorp = vector; return 0; } /*}}}*/ /*{{{ Vectorized routines for scalar functions */ static void do_d_d (double (*f)(double)) { SLGSL_Double_Array_Type a; SLang_Array_Type *in, *out; unsigned int i, n; double *xp, *yp; if (-1 == slgsl_pop_d_array (&a, 0)) return; if (NULL == (in = a.at)) { (void) SLang_push_double ((*f)(a.x)); return; } if (NULL == (out = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, in->dims, in->num_dims))) { SLang_free_array (in); return; } n = in->num_elements; xp = a.xp; yp = (double *) out->data; for (i = 0; i < n; i++) yp[i] = (*f)(xp[i]); (void) SLang_push_array (out, 1); SLang_free_array (in); } static void do_i_d (int (*f)(double)) { SLGSL_Double_Array_Type a; SLang_Array_Type *in, *out; unsigned int i, n; double *xp; int *yp; if (-1 == slgsl_pop_d_array (&a, 0)) return; if (NULL == (in = a.at)) { (void) SLang_push_integer ((*f)(a.x)); return; } if (NULL == (out = SLang_create_array (SLANG_INT_TYPE, 0, NULL, in->dims, in->num_dims))) { SLang_free_array (in); return; } n = in->num_elements; xp = a.xp; yp = (int *) out->data; for (i = 0; i < n; i++) yp[i] = (*f)(xp[i]); (void) SLang_push_array (out, 1); SLang_free_array (in); } static void do_d_dd (double (*f)(double, double)) { SLGSL_Double_Array_Type a, b; SLang_Array_Type *atz; unsigned int i, n; double *xp, *yp, *zp; unsigned int xinc, yinc; if (-1 == slgsl_pop_dd_array (&a, &b, 0)) return; if ((NULL == (atz = a.at)) && (NULL == (atz = b.at))) { (void) SLang_push_double ((*f)(a.x, b.x)); return; } atz = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, atz->dims, atz->num_dims); if (atz == NULL) { SLang_free_array (a.at); SLang_free_array (b.at); return; } n = atz->num_elements; zp = (double *) atz->data; xp = a.xp; yp = b.xp; xinc = a.inc; yinc = b.inc; for (i = 0; i < n; i++) { zp[i] = (*f)(*xp, *yp); xp += xinc; yp += yinc; } (void) SLang_push_array (atz, 1); SLang_free_array (a.at); SLang_free_array (b.at); } static void do_d_i (double (*f)(int)) { SLGSL_Int_Array_Type a; SLang_Array_Type *in, *out; unsigned int i, n; double *yp; int *xp; if (-1 == slgsl_pop_i_array (&a, 0)) return; if (NULL == (in = a.at)) { (void) SLang_push_double ((*f)(a.x)); return; } if (NULL == (out = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, in->dims, in->num_dims))) { SLang_free_array (in); return; } n = in->num_elements; xp = a.xp; yp = (double *) out->data; for (i = 0; i < n; i++) yp[i] = (*f)(xp[i]); (void) SLang_push_array (out, 1); SLang_free_array (in); } static void do_d_id (double (*f)(int, double)) { SLGSL_Double_Array_Type b; SLGSL_Int_Array_Type a; SLang_Array_Type *atz; unsigned int i, n; double *yp, *zp; int *xp; unsigned int xinc, yinc; if (-1 == slgsl_pop_id_array (&a, &b, 0)) return; if (NULL == (atz = a.at)) { if (b.at == NULL) { (void) SLang_push_double ((*f)(a.x, b.x)); return; } atz = b.at; } atz = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, atz->dims, atz->num_dims); if (atz == NULL) { SLang_free_array (a.at); SLang_free_array (b.at); return; } n = atz->num_elements; zp = (double *) atz->data; xp = a.xp; yp = b.xp; xinc = a.inc; yinc = b.inc; for (i = 0; i < n; i++) { zp[i] = (*f)(*xp, *yp); xp += xinc; yp += yinc; } (void) SLang_push_array (atz, 1); SLang_free_array (a.at); SLang_free_array (b.at); } static void do_d_idd (double (*f)(int, double, double)) { SLGSL_Int_Array_Type a; SLGSL_Double_Array_Type b, c; SLang_Array_Type *atz; unsigned int i, n; double *bp, *cp, *zp; int *ap; unsigned int ainc, binc, cinc; if (-1 == slgsl_pop_idd_array (&a, &b, &c, 0)) return; if ((NULL == (atz = a.at)) && (NULL == (atz = b.at)) && (NULL == (atz = c.at))) { (void) SLang_push_double ((*f)(a.x, b.x, c.x)); return; } atz = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, atz->dims, atz->num_dims); if (atz == NULL) { SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); return; } n = atz->num_elements; zp = (double *) atz->data; ap = a.xp; bp = b.xp; cp = c.xp; ainc = a.inc; binc = b.inc; cinc = c.inc; for (i = 0; i < n; i++) { zp[i] = (*f)(*ap, *bp, *cp); ap += ainc; bp += binc; cp += cinc; } (void) SLang_push_array (atz, 1); SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); } static void do_d_iid (double (*f)(int, int, double)) { SLGSL_Int_Array_Type a, b; SLGSL_Double_Array_Type c; SLang_Array_Type *atz; unsigned int i, n; double *cp, *zp; int *ap, *bp; unsigned int ainc, binc, cinc; if (-1 == slgsl_pop_iid_array (&a, &b, &c, 0)) return; if ((NULL == (atz = a.at)) && (NULL == (atz = b.at)) && (NULL == (atz = c.at))) { (void) SLang_push_double ((*f)(a.x, b.x, c.x)); return; } atz = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, atz->dims, atz->num_dims); if (atz == NULL) { SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); return; } n = atz->num_elements; zp = (double *) atz->data; ap = a.xp; bp = b.xp; cp = c.xp; ainc = a.inc; binc = b.inc; cinc = c.inc; for (i = 0; i < n; i++) { zp[i] = (*f)(*ap, *bp, *cp); ap += ainc; bp += binc; cp += cinc; } (void) SLang_push_array (atz, 1); SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); } static void do_d_iidd (double (*f)(int, int, double, double)) { SLGSL_Int_Array_Type a, b; SLGSL_Double_Array_Type c, d; SLang_Array_Type *atz; unsigned int i, n; double *cp, *dp, *zp; int *ap, *bp; unsigned int ainc, binc, cinc, dinc; if (-1 == slgsl_pop_iidd_array (&a, &b, &c, &d, 0)) return; if ((NULL == (atz = a.at)) && (NULL == (atz = b.at)) && (NULL == (atz = c.at)) && (NULL == (atz = d.at))) { (void) SLang_push_double ((*f)(a.x, b.x, c.x, d.x)); return; } atz = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, atz->dims, atz->num_dims); if (atz == NULL) { SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); SLang_free_array (d.at); return; } n = atz->num_elements; zp = (double *) atz->data; ap = a.xp; bp = b.xp; cp = c.xp; dp = d.xp; ainc = a.inc; binc = b.inc; cinc = c.inc; dinc = d.inc; for (i = 0; i < n; i++) { zp[i] = (*f)(*ap, *bp, *cp, *dp); ap += ainc; bp += binc; cp += cinc; dp += dinc; } (void) SLang_push_array (atz, 1); SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); SLang_free_array (d.at); } static void do_d_ddd (double (*f)(double, double, double)) { SLGSL_Double_Array_Type a, b, c; SLang_Array_Type *atz; unsigned int i, n; double *ap, *bp, *cp, *zp; unsigned int ainc, binc, cinc; if (-1 == slgsl_pop_ddd_array (&a, &b, &c, 0)) return; if ((NULL == (atz = a.at)) && (NULL == (atz = b.at)) && (NULL == (atz = c.at))) { (void) SLang_push_double ((*f)(a.x, b.x, c.x)); return; } atz = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, atz->dims, atz->num_dims); if (atz == NULL) { SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); return; } n = atz->num_elements; zp = (double *) atz->data; ap = a.xp; bp = b.xp; cp = c.xp; ainc = a.inc; binc = b.inc; cinc = c.inc; for (i = 0; i < n; i++) { zp[i] = (*f)(*ap, *bp, *cp); ap += ainc; bp += binc; cp += cinc; } (void) SLang_push_array (atz, 1); SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); } static void do_d_dddd (double (*f)(double, double, double, double)) { SLGSL_Double_Array_Type a, b, c, d; SLang_Array_Type *atz; unsigned int i, n; double *ap, *bp, *cp, *dp, *zp; unsigned int ainc, binc, cinc, dinc; if (-1 == slgsl_pop_dddd_array (&a, &b, &c, &d, 0)) return; if ((NULL == (atz = a.at)) && (NULL == (atz = b.at)) && (NULL == (atz = c.at)) && (NULL == (atz = d.at))) { (void) SLang_push_double ((*f)(a.x, b.x, c.x, d.x)); return; } atz = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, atz->dims, atz->num_dims); if (atz == NULL) { SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); SLang_free_array (d.at); return; } n = atz->num_elements; zp = (double *) atz->data; ap = a.xp; bp = b.xp; cp = c.xp; dp = c.xp; ainc = a.inc; binc = b.inc; cinc = c.inc; dinc = d.inc; for (i = 0; i < n; i++) { zp[i] = (*f)(*ap, *bp, *cp, *dp); ap += ainc; bp += binc; cp += cinc; dp += dinc; } (void) SLang_push_array (atz, 1); SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); SLang_free_array (d.at); } void slgsl_do_d_d_fun (const char *fun, double (*f)(double)) { if (SLang_Num_Function_Args != 1) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double)", fun); return; } slgsl_reset_errors (); do_d_d (f); slgsl_check_errors (fun); } void slgsl_do_d_i_fun (const char *fun, double (*f)(int)) { if (SLang_Num_Function_Args != 1) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(int)", fun); return; } slgsl_reset_errors (); do_d_i (f); slgsl_check_errors (fun); } void slgsl_do_d_dd_fun (const char *fun, double (*f)(double, double)) { if (SLang_Num_Function_Args != 2) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double, double)", fun); return; } slgsl_reset_errors (); do_d_dd (f); slgsl_check_errors (fun); } void slgsl_do_d_ddd_fun (const char *fun, double (*f)(double, double, double)) { if (SLang_Num_Function_Args != 3) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double, double, double)", fun); return; } slgsl_reset_errors (); do_d_ddd (f); slgsl_check_errors (fun); } void slgsl_do_d_dddd_fun (const char *fun, double (*f)(double, double, double,double)) { if (SLang_Num_Function_Args != 4) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double, double, double, double)", fun); return; } slgsl_reset_errors (); do_d_dddd (f); slgsl_check_errors (fun); } void slgsl_do_d_id_fun (const char *fun, double (*f)(int, double)) { if (SLang_Num_Function_Args != 2) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(int, double)", fun); return; } slgsl_reset_errors (); do_d_id (f); slgsl_check_errors (fun); } void slgsl_do_d_idd_fun (const char *fun, double (*f)(int, double, double)) { if (SLang_Num_Function_Args != 3) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(int, double, double)", fun); return; } slgsl_reset_errors (); do_d_idd (f); slgsl_check_errors (fun); } void slgsl_do_d_iid_fun (const char *fun, double (*f)(int, int, double)) { if (SLang_Num_Function_Args != 3) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(int, int, double)", fun); return; } slgsl_reset_errors (); do_d_iid (f); slgsl_check_errors (fun); } void slgsl_do_d_iidd_fun (const char *fun, double (*f)(int, int, double, double)) { if (SLang_Num_Function_Args != 3) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(int, int, double, double)", fun); return; } slgsl_reset_errors (); do_d_iidd (f); slgsl_check_errors (fun); } void slgsl_do_i_d_fun (const char *fun, int (*f)(double)) { if (SLang_Num_Function_Args != 1) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double)", fun); return; } slgsl_reset_errors (); do_i_d (f); slgsl_check_errors (fun); } /*}}}*/ typedef struct { const char *name; int (*init_fun) (char *); void (*deinit_fun) (void); int inited; } Module_Table_Type; static Module_Table_Type Module_Table [] = { {"gslcdf", init_gslcdf_module_ns, deinit_gslcdf_module, 0}, {"gslconst", init_gslconst_module_ns, deinit_gslconst_module, 0}, {"gslfft", init_gslfft_module_ns, deinit_gslfft_module, 0}, {"gslinterp", init_gslinterp_module_ns, deinit_gslinterp_module, 0}, {"gslmatrix", init_gslmatrix_module_ns, deinit_gslmatrix_module, 0}, {"gslrand", init_gslrand_module_ns, deinit_gslrand_module, 0}, {"gslsf", init_gslsf_module_ns, deinit_gslsf_module, 0}, {"gsldwt", init_gsldwt_module_ns, deinit_gsldwt_module, 0}, {"gslinteg", init_gslinteg_module_ns, deinit_gslinteg_module, 0}, {NULL, NULL, NULL, 0} }; static void import_module (const char *name, char *ns) { Module_Table_Type *module = Module_Table; while (module->name != NULL) { if (0 == strcmp (module->name, name)) { if (0 == module->init_fun (ns)) { module->inited++; return; } } module++; } SLang_verror (SL_Import_Error, "Module %s is unknown or unsupported", name); } void deinit_gsl_module (void) { Module_Table_Type *module; module = Module_Table; while (module->name != NULL) { if (module->inited) { module->deinit_fun (); module->inited = 0; } module++; } } static SLang_Intrin_Fun_Type Module_Intrinsics [] = { MAKE_INTRINSIC_0("gsl_set_error_disposition", set_error_disposition, SLANG_VOID_TYPE), MAKE_INTRINSIC_SS("gsl_import_module", import_module, SLANG_VOID_TYPE), SLANG_END_INTRIN_FUN_TABLE }; static SLang_Intrin_Var_Type Module_Variables [] = { MAKE_VARIABLE("_gsl_module_version_string", &Module_Version_String, SLANG_STRING_TYPE, 1), MAKE_VARIABLE("GSL_VERSION", &gsl_version, SLANG_STRING_TYPE, 1), SLANG_END_INTRIN_VAR_TABLE }; static SLang_IConstant_Type Module_IConstants [] = { MAKE_ICONSTANT("_gsl_module_version", MODULE_VERSION_NUMBER), MAKE_ICONSTANT("GSL_SUCCESS", GSL_SUCCESS), MAKE_ICONSTANT("GSL_FAILURE", GSL_FAILURE), MAKE_ICONSTANT("GSL_CONTINUE", GSL_CONTINUE), MAKE_ICONSTANT("GSL_EDOM", GSL_EDOM), MAKE_ICONSTANT("GSL_ERANGE", GSL_ERANGE), MAKE_ICONSTANT("GSL_EFAULT", GSL_EFAULT), MAKE_ICONSTANT("GSL_EINVAL", GSL_EINVAL), MAKE_ICONSTANT("GSL_EFAILED", GSL_EFAILED), MAKE_ICONSTANT("GSL_EFACTOR", GSL_EFACTOR), MAKE_ICONSTANT("GSL_ESANITY", GSL_ESANITY), MAKE_ICONSTANT("GSL_ENOMEM", GSL_ENOMEM), MAKE_ICONSTANT("GSL_EBADFUNC", GSL_EBADFUNC), MAKE_ICONSTANT("GSL_ERUNAWAY", GSL_ERUNAWAY), MAKE_ICONSTANT("GSL_EMAXITER", GSL_EMAXITER), MAKE_ICONSTANT("GSL_EZERODIV", GSL_EZERODIV), MAKE_ICONSTANT("GSL_EBADTOL", GSL_EBADTOL), MAKE_ICONSTANT("GSL_ETOL", GSL_ETOL), MAKE_ICONSTANT("GSL_EUNDRFLW", GSL_EUNDRFLW), MAKE_ICONSTANT("GSL_EOVRFLW", GSL_EOVRFLW), MAKE_ICONSTANT("GSL_ELOSS", GSL_ELOSS), MAKE_ICONSTANT("GSL_EROUND", GSL_EROUND), MAKE_ICONSTANT("GSL_EBADLEN", GSL_EBADLEN), MAKE_ICONSTANT("GSL_ENOTSQR", GSL_ENOTSQR), MAKE_ICONSTANT("GSL_ESING", GSL_ESING), MAKE_ICONSTANT("GSL_EDIVERGE", GSL_EDIVERGE), MAKE_ICONSTANT("GSL_EUNSUP", GSL_EUNSUP), MAKE_ICONSTANT("GSL_EUNIMPL", GSL_EUNIMPL), MAKE_ICONSTANT("GSL_ECACHE", GSL_ECACHE), MAKE_ICONSTANT("GSL_ETABLE", GSL_ETABLE), MAKE_ICONSTANT("GSL_ENOPROG", GSL_ENOPROG), MAKE_ICONSTANT("GSL_ENOPROGJ", GSL_ENOPROGJ), MAKE_ICONSTANT("GSL_ETOLF", GSL_ETOLF), MAKE_ICONSTANT("GSL_ETOLX", GSL_ETOLX), MAKE_ICONSTANT("GSL_ETOLG", GSL_ETOLG), MAKE_ICONSTANT("GSL_EOF", GSL_EOF), SLANG_END_ICONST_TABLE }; int init_gsl_module_ns (char *ns_name) { SLang_NameSpace_Type *ns = SLns_create_namespace (ns_name); static int initialized = 0; if (ns == NULL) return -1; if ( (-1 == SLns_add_intrin_var_table (ns, Module_Variables, NULL)) || (-1 == SLns_add_intrin_fun_table (ns, Module_Intrinsics, NULL)) || (-1 == SLns_add_iconstant_table (ns, Module_IConstants, NULL)) ) return -1; if (initialized == 0) { (void) gsl_set_error_handler (&err_handler); set_gsl_error_disposition (GSL_EDOM, 1, NULL); set_gsl_error_disposition (GSL_ERANGE, 1, NULL); initialized = 1; } return 0; } slgsl-pre0.10.0-7/src/config.hin0000644000175000000620000000042412105106006015130 0ustar johnstaff/* -*- c -*- */ /* Define this if have stdlib.h */ #undef HAVE_STDLIB_H /* Define this if you have unistd.h */ #undef HAVE_UNISTD_H /* Set these to the appropriate values */ #undef SIZEOF_SHORT #undef SIZEOF_INT #undef SIZEOF_LONG #undef SIZEOF_FLOAT #undef SIZEOF_DOUBLE slgsl-pre0.10.0-7/src/gsl.sl0000644000175000000620000000031714001614376014324 0ustar johnstaffrequire ("gslsf"); require ("gslconst"); require ("gslinterp"); require ("gslrand"); require ("gslcdf"); require ("gslfft"); require ("gslmatrix"); require ("gsldwt"); require ("gslinteg"); provide ("gsl"); slgsl-pre0.10.0-7/src/gslcore.sl0000644000175000000620000000042712105106006015164 0ustar johnstaffdefine _gslcore_import_module (name, ns) { if (ns == "") ns = "Global"; if (-1 == is_defined ("$ns->_${name}_module_version"$)) return; % already "imported" import ("gsl"); (@__get_reference("gsl_import_module"))(name, ns); } provide("gslcore"); slgsl-pre0.10.0-7/src/gslsf.sl0000644000175000000620000000013712105106006014642 0ustar johnstaffrequire ("gslcore"); _gslcore_import_module ("gslsf", current_namespace()); provide ("gslsf"); slgsl-pre0.10.0-7/src/gslinterp.sl0000644000175000000620000000014712105106006015534 0ustar johnstaffrequire ("gslcore"); _gslcore_import_module ("gslinterp", current_namespace()); provide ("gslinterp"); slgsl-pre0.10.0-7/src/gslcdf.sl0000644000175000000620000000014112105106006014761 0ustar johnstaffrequire ("gslcore"); _gslcore_import_module ("gslcdf", current_namespace()); provide ("gslcdf"); slgsl-pre0.10.0-7/src/gslconst.sl0000644000175000000620000000014512105106006015357 0ustar johnstaffrequire ("gslcore"); _gslcore_import_module ("gslconst", current_namespace()); provide ("gslconst"); slgsl-pre0.10.0-7/src/mkversion.sh0000755000175000000620000000010712105106006015535 0ustar johnstaffgrep "^#define MODULE_VERSION_NUMSTR" version.h | tr -dc '0123456789.' slgsl-pre0.10.0-7/src/version.h0000644000175000000620000000027115012561735015037 0ustar johnstaff#define MODULE_VERSION_STRING "pre0.10.0-7" #define MODULE_VERSION_NUMBER 1000 #define MODULE_VERSION_NUMSTR "0.10.0" static const char *Module_Version_String = MODULE_VERSION_STRING; slgsl-pre0.10.0-7/src/gslinterp-module.c0000644000175000000620000004145314001614376016643 0ustar johnstaff/* -*- mode: C; mode: fold; -*- */ /* Copyright (c) 2003, 2004, 2005 Massachusetts Institute of Technology This software was developed by the MIT Center for Space Research under contract SV1-61010 from the Smithsonian Institution. Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in the supporting documentation, and that the name of the Massachusetts Institute of Technology not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The Massachusetts Institute of Technology makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. THE MASSACHUSETTS INSTITUTE OF TECHNOLOGY DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE MASSACHUSETTS INSTITUTE OF TECHNOLOGY BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* Author: John E. Davis (jed@jedsoft.org) */ #include #include #include #include #include #include #include "slgsl.h" #include "version.h" #ifdef __cplusplus extern "C" { #endif /* SLANG_MODULE(gslinterp); */ #ifdef __cplusplus } #endif static int Interp_Type_Id = -1; typedef struct { gsl_interp *g; gsl_interp_accel *acc; SLang_Array_Type *at_xa; SLang_Array_Type *at_ya; } Interp_Type; static void free_interp_type (SLtype type, VOID_STAR f) { Interp_Type *it; (void) type; it = (Interp_Type *) f; if (it->acc != NULL) gsl_interp_accel_free (it->acc); if (it->g != NULL) gsl_interp_free (it->g); if (it->at_xa != NULL) SLang_free_array (it->at_xa); if (it->at_ya != NULL) SLang_free_array (it->at_ya); SLfree ((char *) it); } /* This function steals the at_xa and at_ya arrays upon sucess. Do not * free the arrays if successful. The arrays must be Double_Type and of * the same size. */ static Interp_Type *alloc_interp_type (const gsl_interp_type *ic, SLang_Array_Type *at_xa, SLang_Array_Type *at_ya) { Interp_Type *it; unsigned int na; double *xa, *ya; xa = (double *)at_xa->data; ya = (double *)at_ya->data; na = at_xa->num_elements; /* make sure the xa values are in ascending order */ if (na > 1) { double last = xa[0]; unsigned int i; for (i = 0; i < na; i++) { if (xa[i] < last) { SLang_verror (SL_INVALID_PARM, "The gsl interpolation routines require the xa array to be in ascending order."); return NULL; } last = xa[i]; } } if (NULL == (it = (Interp_Type *) SLmalloc (sizeof (Interp_Type)))) return NULL; memset ((char *) it, 0, sizeof (Interp_Type)); if (NULL == (it->g = gsl_interp_alloc (ic, na))) { free_interp_type (Interp_Type_Id, (VOID_STAR) it); return NULL; } if (gsl_interp_min_size (it->g) > na) { SLang_verror (SL_INVALID_PARM, "%s interpolation requires at least %u points.", gsl_interp_name (it->g), gsl_interp_min_size (it->g)); free_interp_type (Interp_Type_Id, (VOID_STAR) it); return NULL; } if ((NULL == (it->acc = gsl_interp_accel_alloc ())) || (GSL_SUCCESS != gsl_interp_init (it->g, xa, ya, na))) { free_interp_type (Interp_Type_Id, (VOID_STAR) it); return NULL; } it->at_xa = at_xa; it->at_ya = at_ya; return it; } static int do_interp_1 (double (*fun)(const gsl_interp *, const double [], const double [], double, gsl_interp_accel *), Interp_Type *it, double *x, double *fx, unsigned int numx) { gsl_interp *g; gsl_interp_accel *acc; unsigned int i; double *xa, *ya; g = it->g; acc = it->acc; xa = (double *) it->at_xa->data; ya = (double *) it->at_ya->data; for (i = 0; i < numx; i++) fx[i] = (*fun) (g, xa, ya, x[i], acc); return 0; } static int do_interp_integ_1 (Interp_Type *it, double *a, double *b, unsigned int num_a, double *result) { gsl_interp *g; gsl_interp_accel *acc; unsigned int i; double *xa, *ya; g = it->g; acc = it->acc; xa = (double *) it->at_xa->data; ya = (double *) it->at_ya->data; for (i = 0; i < num_a; i++) result[i] = gsl_interp_eval_integ (g, xa, ya, a[i], b[i], acc); return 0; } /* Syntax: y = interp_eval (GSL_Interp_Type, Double_Type x[]); */ static void do_interp_eval (double (*fun)(const gsl_interp *, const double [], const double [], double, gsl_interp_accel *)) { SLGSL_Double_Array_Type x, fx; SLang_MMT_Type *mmt; Interp_Type *it; if (-1 == slgsl_pop_d_array (&x, 0)) return; if (NULL == (mmt = SLang_pop_mmt (Interp_Type_Id))) { slgsl_free_d_array (&x); return; } if (NULL == (it = (Interp_Type *) SLang_object_from_mmt (mmt))) { SLang_free_mmt (mmt); slgsl_free_d_array (&x); return; } if (-1 == slgsl_create_d_array (&x, &fx)) { SLang_free_mmt (mmt); slgsl_free_d_array (&x); return; } if (0 == do_interp_1 (fun, it, x.xp, fx.xp, fx.num_elements)) (void) slgsl_push_d_array (&fx, 0); slgsl_free_d_array (&fx); slgsl_free_d_array (&x); SLang_free_mmt (mmt); } /* Usage: y = interp_integ (GSL_Interp_Type, a, b) */ static void interp_eval_integ (void) { SLGSL_Double_Array_Type y, a, b; SLang_MMT_Type *mmt; Interp_Type *it; if (SLang_Num_Function_Args != 3) { SLang_verror (SL_USAGE_ERROR, "Usage: y = interp_eval_integ (double x, double xa[], double ya[])"); return; } if (-1 == slgsl_pop_dd_array (&a, &b, 0)) return; if (NULL == (mmt = SLang_pop_mmt (Interp_Type_Id))) { slgsl_free_d_array (&a); slgsl_free_d_array (&b); return; } if (NULL == (it = (Interp_Type *) SLang_object_from_mmt (mmt))) { SLang_free_mmt (mmt); slgsl_free_d_array (&a); slgsl_free_d_array (&b); return; } if (-1 == slgsl_create_d_array (&a, &y)) { SLang_free_mmt (mmt); slgsl_free_d_array (&a); slgsl_free_d_array (&b); return; } if (0 == do_interp_integ_1 (it, a.xp, b.xp, a.num_elements, y.xp)) (void) slgsl_push_d_array (&y, 0); slgsl_free_d_array (&y); SLang_free_mmt (mmt); slgsl_free_d_array (&a); slgsl_free_d_array (&b); } /* Syntax: interp (newx, oldx, oldy) */ static void do_interp (double (*fun)(const gsl_interp *, const double [], const double [], double, gsl_interp_accel *), const gsl_interp_type *type) { SLGSL_Double_Array_Type xa, ya, x, fx; Interp_Type *it; if (-1 == slgsl_pop_dd_array (&xa, &ya, 1)) return; if (-1 == slgsl_pop_d_array (&x, 0)) { slgsl_free_d_array (&xa); slgsl_free_d_array (&ya); return; } if (-1 == slgsl_create_d_array (&x, &fx)) { slgsl_free_d_array (&x); slgsl_free_d_array (&xa); slgsl_free_d_array (&ya); return; } if (NULL == (it = alloc_interp_type (type, xa.at, ya.at))) { slgsl_free_d_array (&fx); slgsl_free_d_array (&x); slgsl_free_d_array (&xa); slgsl_free_d_array (&ya); return; } /* 'it' now owns xa->at and ya->at */ if (0 == do_interp_1 (fun, it, x.xp, fx.xp, fx.num_elements)) (void) slgsl_push_d_array (&fx, 0); slgsl_free_d_array (&fx); slgsl_free_d_array (&x); free_interp_type (Interp_Type_Id, (VOID_STAR) it); /* slgsl_free_d_array (&xa); */ /* slgsl_free_d_array (&ya); */ } #define INTERP_FUN(fun,type,name) \ static void name (void) \ { \ if (SLang_Num_Function_Args != 3) \ { \ SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double x, double xa[], double ya[])", #name); \ return; \ } \ slgsl_reset_errors (); \ do_interp (fun, type); \ slgsl_check_errors (#name); \ } INTERP_FUN(gsl_interp_eval, gsl_interp_linear, interp_linear) INTERP_FUN(gsl_interp_eval_deriv, gsl_interp_linear, interp_linear_deriv) INTERP_FUN(gsl_interp_eval_deriv2, gsl_interp_linear, interp_linear_deriv2) INTERP_FUN(gsl_interp_eval, gsl_interp_polynomial, interp_polynomial) INTERP_FUN(gsl_interp_eval_deriv, gsl_interp_polynomial, interp_polynomial_deriv) INTERP_FUN(gsl_interp_eval_deriv2, gsl_interp_polynomial, interp_polynomial_deriv2) INTERP_FUN(gsl_interp_eval, gsl_interp_cspline, interp_cspline) INTERP_FUN(gsl_interp_eval_deriv, gsl_interp_cspline, interp_cspline_deriv) INTERP_FUN(gsl_interp_eval_deriv2, gsl_interp_cspline, interp_cspline_deriv2) INTERP_FUN(gsl_interp_eval, gsl_interp_cspline_periodic, interp_cspline_periodic) INTERP_FUN(gsl_interp_eval_deriv, gsl_interp_cspline_periodic, interp_cspline_periodic_deriv) INTERP_FUN(gsl_interp_eval_deriv2, gsl_interp_cspline_periodic, interp_cspline_periodic_deriv2) INTERP_FUN(gsl_interp_eval, gsl_interp_akima, interp_akima) INTERP_FUN(gsl_interp_eval_deriv, gsl_interp_akima, interp_akima_deriv) INTERP_FUN(gsl_interp_eval_deriv2, gsl_interp_akima, interp_akima_deriv2) INTERP_FUN(gsl_interp_eval, gsl_interp_akima_periodic, interp_akima_periodic) INTERP_FUN(gsl_interp_eval_deriv, gsl_interp_akima_periodic, interp_akima_periodic_deriv) INTERP_FUN(gsl_interp_eval_deriv2, gsl_interp_akima_periodic, interp_akima_periodic_deriv2) static void do_interp_init (const gsl_interp_type *type) { SLGSL_Double_Array_Type x, y; Interp_Type *it; SLang_MMT_Type *mmt; if (-1 == slgsl_pop_dd_array (&x, &y, 1)) return; if (NULL == (it = alloc_interp_type (type, x.at, y.at))) return; if (NULL == (mmt = SLang_create_mmt (Interp_Type_Id, (VOID_STAR) it))) { free_interp_type (Interp_Type_Id, (VOID_STAR) it); return; } /* Unfortunately, SLang_create_mmt sets the ref_count to 0, which means * that no free is necessary if the push is successful. This is an * _undesirable_ slang feature that I ought to correct for slang 2. */ if (0 == SLang_push_mmt (mmt)) return; SLang_free_mmt (mmt); } /* Syntax: interp_integ (xa, ya, a, b) */ static void do_interp_integ (const gsl_interp_type *type) { SLGSL_Double_Array_Type xa, ya, a, b, result; Interp_Type *it; if (-1 == slgsl_pop_dd_array (&a, &b, 0)) return; if (-1 == slgsl_pop_dd_array (&xa, &ya, 1)) { slgsl_free_d_array (&a); slgsl_free_d_array (&b); return; } if (-1 == slgsl_create_d_array (&a, &result)) { slgsl_free_d_array (&xa); slgsl_free_d_array (&ya); slgsl_free_d_array (&a); slgsl_free_d_array (&b); return; } if (NULL == (it = alloc_interp_type (type, xa.at, ya.at))) { slgsl_free_d_array (&result); slgsl_free_d_array (&xa); slgsl_free_d_array (&ya); slgsl_free_d_array (&a); slgsl_free_d_array (&b); return; } /* 'it' now owns xa, ya */ if (0 == do_interp_integ_1 (it, a.xp, b.xp, a.num_elements, result.xp)) (void) slgsl_push_d_array (&result, 0); slgsl_free_d_array (&result); free_interp_type (Interp_Type_Id, (VOID_STAR) it); /* slgsl_free_d_array (&xa); */ /* slgsl_free_d_array (&ya); */ slgsl_free_d_array (&a); slgsl_free_d_array (&b); } #define INTEG_FUN(type,name) \ static void name (void) \ { \ if (SLang_Num_Function_Args != 4) \ { \ SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double xa[], double ya[], double a, double b)", #name); \ return; \ } \ slgsl_reset_errors (); \ do_interp_integ (type); \ slgsl_check_errors (#name); \ } INTEG_FUN(gsl_interp_linear,interp_linear_integ) INTEG_FUN(gsl_interp_polynomial,interp_polynomial_integ) INTEG_FUN(gsl_interp_cspline,interp_cspline_integ) INTEG_FUN(gsl_interp_cspline_periodic,interp_cspline_periodic_integ) INTEG_FUN(gsl_interp_akima,interp_akima_integ) INTEG_FUN(gsl_interp_akima_periodic,interp_akima_periodic_integ) #define INTERP_INIT_FUN(type,name) \ static void name (void) \ { \ if (SLang_Num_Function_Args != 2) \ { \ SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double xa[], double ya[])", #name); \ return; \ } \ slgsl_reset_errors (); \ do_interp_init (type); \ slgsl_check_errors (#name); \ } INTERP_INIT_FUN(gsl_interp_linear, interp_linear_init) INTERP_INIT_FUN(gsl_interp_polynomial,interp_polynomial_init) INTERP_INIT_FUN(gsl_interp_cspline,interp_cspline_init) INTERP_INIT_FUN(gsl_interp_cspline_periodic,interp_cspline_periodic_init) INTERP_INIT_FUN(gsl_interp_akima,interp_akima_init) INTERP_INIT_FUN(gsl_interp_akima_periodic,interp_akima_periodic_init) #define INTERP_EVAL_FUN(fun,name) \ static void name (void) \ { \ if (SLang_Num_Function_Args != 2) \ { \ SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(GSL_Interp_Type c, double x)", #name); \ return; \ } \ slgsl_reset_errors (); \ do_interp_eval (fun); \ slgsl_check_errors (#name); \ } INTERP_EVAL_FUN(gsl_interp_eval, interp_eval) INTERP_EVAL_FUN(gsl_interp_eval_deriv, interp_eval_deriv) INTERP_EVAL_FUN(gsl_interp_eval_deriv2, interp_eval_deriv2) #define V SLANG_VOID_TYPE static SLang_Intrin_Fun_Type Module_Intrinsics [] = { MAKE_INTRINSIC_0("interp_linear", interp_linear, V), MAKE_INTRINSIC_0("interp_linear_deriv", interp_linear_deriv, V), MAKE_INTRINSIC_0("interp_linear_deriv2", interp_linear_deriv2, V), MAKE_INTRINSIC_0("interp_linear_integ", interp_linear_integ, V), MAKE_INTRINSIC_0("interp_polynomial", interp_polynomial, V), MAKE_INTRINSIC_0("interp_polynomial_deriv", interp_polynomial_deriv, V), MAKE_INTRINSIC_0("interp_polynomial_deriv2", interp_polynomial_deriv2, V), MAKE_INTRINSIC_0("interp_polynomial_integ", interp_polynomial_integ, V), MAKE_INTRINSIC_0("interp_cspline", interp_cspline, V), MAKE_INTRINSIC_0("interp_cspline_deriv", interp_cspline_deriv, V), MAKE_INTRINSIC_0("interp_cspline_deriv2", interp_cspline_deriv2, V), MAKE_INTRINSIC_0("interp_cspline_integ", interp_cspline_integ, V), MAKE_INTRINSIC_0("interp_cspline_periodic", interp_cspline_periodic, V), MAKE_INTRINSIC_0("interp_cspline_periodic_deriv", interp_cspline_periodic_deriv, V), MAKE_INTRINSIC_0("interp_cspline_periodic_deriv2", interp_cspline_periodic_deriv2, V), MAKE_INTRINSIC_0("interp_cspline_periodic_integ", interp_cspline_periodic_integ, V), MAKE_INTRINSIC_0("interp_akima", interp_akima, V), MAKE_INTRINSIC_0("interp_akima_deriv", interp_akima_deriv, V), MAKE_INTRINSIC_0("interp_akima_deriv2", interp_akima_deriv2, V), MAKE_INTRINSIC_0("interp_akima_integ", interp_akima_integ, V), MAKE_INTRINSIC_0("interp_akima_periodic", interp_akima_periodic, V), MAKE_INTRINSIC_0("interp_akima_periodic_deriv", interp_akima_periodic_deriv, V), MAKE_INTRINSIC_0("interp_akima_periodic_deriv2", interp_akima_periodic_deriv2, V), MAKE_INTRINSIC_0("interp_akima_periodic_integ", interp_akima_periodic_integ, V), MAKE_INTRINSIC_0("interp_linear_init", interp_linear_init, V), MAKE_INTRINSIC_0("interp_polynomial_init", interp_polynomial_init, V), MAKE_INTRINSIC_0("interp_cspline_init", interp_cspline_init, V), MAKE_INTRINSIC_0("interp_cspline_periodic_init", interp_cspline_periodic_init, V), MAKE_INTRINSIC_0("interp_akima_init", interp_akima_init, V), MAKE_INTRINSIC_0("interp_akima_periodic_init", interp_akima_periodic_init, V), MAKE_INTRINSIC_0("interp_eval", interp_eval, V), MAKE_INTRINSIC_0("interp_eval_deriv", interp_eval_deriv, V), MAKE_INTRINSIC_0("interp_eval_deriv2", interp_eval_deriv2, V), MAKE_INTRINSIC_0("interp_eval_integ", interp_eval_integ, V), SLANG_END_INTRIN_FUN_TABLE }; #undef V static SLang_Intrin_Var_Type Module_Variables [] = { MAKE_VARIABLE("_gslinterp_module_version_string", &Module_Version_String, SLANG_STRING_TYPE, 1), SLANG_END_INTRIN_VAR_TABLE }; static SLang_IConstant_Type Module_IConstants [] = { MAKE_ICONSTANT("_gslinterp_module_version", MODULE_VERSION_NUMBER), SLANG_END_ICONST_TABLE }; int init_gslinterp_module_ns (char *ns_name) { SLang_Class_Type *cl; SLang_NameSpace_Type *ns = SLns_create_namespace (ns_name); if (ns == NULL) return -1; if (Interp_Type_Id == -1) { if (NULL == (cl = SLclass_allocate_class ("GSL_Interp_Type"))) return -1; (void) SLclass_set_destroy_function (cl, free_interp_type); if (-1 == SLclass_register_class (cl, SLANG_VOID_TYPE, sizeof (Interp_Type), SLANG_CLASS_TYPE_MMT)) return -1; Interp_Type_Id = SLclass_get_class_id (cl); } if ( (-1 == SLns_add_intrin_var_table (ns, Module_Variables, NULL)) || (-1 == SLns_add_intrin_fun_table (ns, Module_Intrinsics, NULL)) || (-1 == SLns_add_iconstant_table (ns, Module_IConstants, NULL)) ) return -1; return 0; } /* This function is optional */ void deinit_gslinterp_module (void) { } slgsl-pre0.10.0-7/src/gslmatrix.sl0000644000175000000620000000014712105106006015537 0ustar johnstaffrequire ("gslcore"); _gslcore_import_module ("gslmatrix", current_namespace()); provide ("gslmatrix"); slgsl-pre0.10.0-7/src/gslfft-module.c0000644000175000000620000001446713057673774016147 0ustar johnstaff/* -*- mode: C; mode: fold; -*- */ /* This file was automatically generated. */ /* Copyright (c) 2005 Massachusetts Institute of Technology This software was developed by the MIT Center for Space Research under contract SV1-61010 from the Smithsonian Institution. Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in the supporting documentation, and that the name of the Massachusetts Institute of Technology not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The Massachusetts Institute of Technology makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. THE MASSACHUSETTS INSTITUTE OF TECHNOLOGY DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE MASSACHUSETTS INSTITUTE OF TECHNOLOGY BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* Author: John E. Davis (jed@jedsoft.org) */ #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /* SLANG_MODULE(gslfft); */ #ifdef __cplusplus } #endif #include "slgsl.h" #include "version.h" #if SLANG_VERSION < 20000 typedef int SLindex_Type; typedef unsigned int SLuindex_Type; static int SLang_get_error (void) { return SLang_Error; } #endif static int pop_reusable_complex_array (SLang_Array_Type **atp) { SLang_Array_Type *at, *bt; SLtype type; *atp = NULL; type = SLang_peek_at_stack1 (); if (-1 == SLang_pop_array_of_type (&at, SLANG_COMPLEX_TYPE)) return -1; if ((type != SLANG_COMPLEX_TYPE) || ((at->num_refs == 1) && (0 == (at->flags & SLARR_DATA_VALUE_IS_READ_ONLY)))) { *atp = at; return 0; } if (NULL == (bt = SLang_create_array (SLANG_COMPLEX_TYPE, 0, NULL, at->dims, at->num_dims))) { SLang_free_array (at); return -1; } memcpy ((char *)bt->data, (char *)at->data, at->num_elements * at->sizeof_type); SLang_free_array (at); *atp = bt; return 0; } #if 0 static int do_fft_1d (SLang_Array_Type *at) { gsl_fft_complex_workspace *ws; gsl_fft_complex_wavetable *wt; SLindex_Type n = at->dims[0]; unsigned int stride = 1; int status; if (NULL == (wt = gsl_fft_complex_wavetable_alloc (n))) return -1; if (NULL == (ws = gsl_fft_complex_workspace_alloc (n))) { gsl_fft_complex_wavetable_free (wt); return -1; } status = gsl_fft_complex_forward ((double *)at->data, stride, n, wt, ws); gsl_fft_complex_wavetable_free (wt); gsl_fft_complex_workspace_free (ws); return status; } #endif static void fft_complex_intrin (void) { SLang_Array_Type *at; unsigned int stride; double norm; int dir; gsl_fft_direction dir_overkill; SLuindex_Type i; if (SLang_Num_Function_Args == 1) dir = 1; else if (SLang_Num_Function_Args == 2) { if (-1 == SLang_pop_integer (&dir)) return; if (dir == 0) { SLang_verror (SL_INVALID_PARM, "fft direction cannot be zero"); return; } } else { SLang_verror (SL_USAGE_ERROR, "y = fft (x, dir)"); return; } dir_overkill = (dir < 0) ? gsl_fft_forward : gsl_fft_backward; if (-1 == pop_reusable_complex_array (&at)) return; if (at->num_elements == 0) { (void) SLang_push_array (at, 1); return; } stride = 1; i = at->num_dims; norm = 1.0; while (i != 0) { SLuindex_Type nloops; SLindex_Type dims_i; SLuindex_Type data_jump, inc, count, count_max; gsl_fft_complex_workspace *ws; gsl_fft_complex_wavetable *wt; double *data; i--; dims_i = at->dims[i]; norm /= (double)dims_i; nloops = at->num_elements / (SLuindex_Type)dims_i; if (NULL == (wt = gsl_fft_complex_wavetable_alloc (dims_i))) goto return_error; if (NULL == (ws = gsl_fft_complex_workspace_alloc (dims_i))) { gsl_fft_complex_wavetable_free (wt); goto return_error; } data = (double *)at->data; count = 0; data_jump = 2*stride*(dims_i-1); count_max = stride; inc = 2; while (nloops) { nloops--; if ((0 != gsl_fft_complex_transform (data, stride, dims_i, wt, ws, dir_overkill)) || (0 != SLang_get_error ())) { gsl_fft_complex_wavetable_free (wt); gsl_fft_complex_workspace_free (ws); goto return_error; } data += inc; count++; if (count == count_max) { count = 0; data += data_jump; } } gsl_fft_complex_wavetable_free (wt); gsl_fft_complex_workspace_free (ws); stride *= dims_i; } if (dir == -1) { double *data = (double *)at->data; double *data_max = data + 2 * at->num_elements; while (data < data_max) { *data *= norm; data++; } } (void) SLang_push_array (at, 0); /* drop */ return_error: SLang_free_array (at); } #define V SLANG_VOID_TYPE static SLang_Intrin_Fun_Type Module_Intrinsics [] = { MAKE_INTRINSIC_0("_gsl_fft_complex", fft_complex_intrin, V), SLANG_END_INTRIN_FUN_TABLE }; #undef V static SLang_Intrin_Var_Type Module_Variables [] = { MAKE_VARIABLE("_gslfft_module_version_string", &Module_Version_String, SLANG_STRING_TYPE, 1), SLANG_END_INTRIN_VAR_TABLE }; static SLang_IConstant_Type Module_IConstants [] = { MAKE_ICONSTANT("_gslfft_module_version", MODULE_VERSION_NUMBER), SLANG_END_ICONST_TABLE }; int init_gslfft_module_ns (char *ns_name) { SLang_NameSpace_Type *ns = SLns_create_namespace (ns_name); if (ns == NULL) return -1; if ( (-1 == SLns_add_intrin_var_table (ns, Module_Variables, NULL)) || (-1 == SLns_add_intrin_fun_table (ns, Module_Intrinsics, NULL)) || (-1 == SLns_add_iconstant_table (ns, Module_IConstants, NULL)) ) return -1; return 0; } /* This function is optional */ void deinit_gslfft_module (void) { } slgsl-pre0.10.0-7/src/gsldwt-module.c0000644000175000000620000001234314001614376016134 0ustar johnstaff/* This file is part of the GSL S-Lang module. Author: Laurent Perez The S-Lang Library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The S-Lang Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include "slgsl.h" #include "version.h" #define DWT_DAUBECHIES 1 #define DWT_HAAR 2 #define DWT_BSPLINE 3 static void wavelet_transform (void) { int type; int nargs = SLang_Num_Function_Args; SLang_Array_Type *at = NULL, *x = NULL; size_t stride = 1; int dir = 1, centered = 0, k, retval, non_standard = 0; gsl_wavelet_direction dir_overkill; gsl_wavelet *w = NULL; gsl_wavelet_workspace *work = NULL; const gsl_wavelet_type *wavelet; switch (nargs) { case 2: if (-1 == SLang_pop_integer (&dir)) return; if (dir == 0) { SLang_verror (SL_INVALID_PARM, "dwt direction cannot be zero"); return; } /* fall through */ case 1: if (-1 == SLang_pop_array_of_type (&at, SLANG_DOUBLE_TYPE)) return; break; default: SLang_verror (SL_USAGE_ERROR, "y = dwt (x, dir)"); } if (-1 == SLang_get_int_qualifier ("type", &type, DWT_HAAR)) goto return_error; centered = 0; if (-1 == SLang_get_int_qualifier ("centered", ¢ered, 1)) goto return_error; switch (type) { case DWT_DAUBECHIES: wavelet = (centered ? gsl_wavelet_daubechies_centered : gsl_wavelet_daubechies); break; case DWT_HAAR: wavelet = (centered ? gsl_wavelet_haar_centered : gsl_wavelet_haar); break; case DWT_BSPLINE: wavelet = (centered ? gsl_wavelet_bspline_centered : gsl_wavelet_bspline); break; default: SLang_verror (SL_INVALID_PARM, "Wavelet type `%d' is unknown", type); goto return_error; } if (-1 == SLang_get_int_qualifier ("k", &k, 2)) goto return_error; if (1 == SLang_qualifier_exists ("nsf")) non_standard = 1; dir_overkill = (dir > 0) ? gsl_wavelet_forward : gsl_wavelet_backward; if (NULL == (w = gsl_wavelet_alloc (wavelet, k))) { SLang_verror (SL_INVALID_PARM, "Wrong 'k' value or insufficient memory"); goto return_error; } if (NULL == (work = gsl_wavelet_workspace_alloc (at->num_elements))) goto return_error; x = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, at->dims, at->num_dims); if (x == NULL) goto return_error; memcpy (x->data, at->data, at->num_elements * sizeof (double)); switch (at->num_dims) { case 1: retval = gsl_wavelet_transform (w, (double *)x->data, stride, x->dims [0], dir_overkill, work); break; case 2: if (non_standard == 1) retval = gsl_wavelet2d_nstransform (w, (double *)x->data, x->dims [0], x->dims[0], x->dims[1], dir_overkill, work); else retval = gsl_wavelet2d_transform (w, (double *)x->data, x->dims[0], x->dims[0], x->dims [1], dir_overkill, work); break; default: SLang_verror (SL_INVALID_PARM, "Context requires a 1-d or 2-d array"); goto return_error; } switch (retval) { case GSL_SUCCESS: (void) SLang_push_array (x, 0); break; case GSL_EINVAL: SLang_verror (SL_INVALID_PARM, "Array length(s) must be an integer power of 2"); break; default: SLang_verror (SL_UNKNOWN_ERROR, "Error in \"gsl_wavelet_transform\" function"); break; } /* drop */ return_error: SLang_free_array (x); /* NULL ok */ if (work != NULL) gsl_wavelet_workspace_free (work); if (w != NULL) gsl_wavelet_free (w); SLang_free_array (at); /* NULL ok */ } #define V SLANG_VOID_TYPE static SLang_Intrin_Fun_Type Module_Intrinsics [] = { MAKE_INTRINSIC_0("wavelet_transform", wavelet_transform, V), SLANG_END_INTRIN_FUN_TABLE }; #undef V static SLang_Intrin_Var_Type Module_Variables [] = { MAKE_VARIABLE("_gsldwt_module_version_string", &Module_Version_String, SLANG_STRING_TYPE, 1), SLANG_END_INTRIN_VAR_TABLE }; static SLang_IConstant_Type Module_IConstants [] = { MAKE_ICONSTANT("DWT_BSPLINE", DWT_BSPLINE), MAKE_ICONSTANT("DWT_DAUBECHIES", DWT_DAUBECHIES), MAKE_ICONSTANT("DWT_HAAR", DWT_HAAR), MAKE_ICONSTANT("_gsldwt_module_version", MODULE_VERSION_NUMBER), SLANG_END_ICONST_TABLE }; int init_gsldwt_module_ns (char *ns_name) { SLang_NameSpace_Type *ns = SLns_create_namespace (ns_name); if (ns == NULL) return -1; if ( (-1 == SLns_add_intrin_var_table (ns, Module_Variables, NULL)) || (-1 == SLns_add_intrin_fun_table (ns, Module_Intrinsics, NULL)) || (-1 == SLns_add_iconstant_table (ns, Module_IConstants, NULL)) ) return -1; return 0; } /* This function is optional */ void deinit_gsldwt_module (void) { } slgsl-pre0.10.0-7/src/gslconst-module.c0000644000175000000620000015447414713350753016506 0ustar johnstaff/* -*- mode: C; mode: fold; -*- */ /* This file was automatically generated. */ /* Copyright (c) 2003-2011 Massachusetts Institute of Technology This software was developed by the MIT Center for Space Research under contract SV1-61010 from the Smithsonian Institution. Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in the supporting documentation, and that the name of the Massachusetts Institute of Technology not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The Massachusetts Institute of Technology makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. THE MASSACHUSETTS INSTITUTE OF TECHNOLOGY DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE MASSACHUSETTS INSTITUTE OF TECHNOLOGY BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* Author: John E. Davis (jed@jedsoft.org) */ #include #include #include #include #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /* SLANG_MODULE(gslconst); */ #ifdef __cplusplus } #endif #include "slgsl.h" #include "version.h" #define MODULE_HAS_DCONSTANTS #define _GSLCONST_MODULE_C_ #ifdef MODULE_HAS_INTRINSICS /*{{{ Helper Functions */ #ifdef _GSLSF_MODULE_C_ static gsl_mode_t Default_GSL_Mode = GSL_PREC_SINGLE; static int get_gsl_precision (void) { return (int) Default_GSL_Mode; } static void set_gsl_precision (int *pp) { int p = *pp; if ((p == GSL_PREC_SINGLE) || (p == GSL_PREC_DOUBLE) || (p == GSL_PREC_APPROX)) Default_GSL_Mode = p; } static int get_gsl_mode (gsl_mode_t *mp, int from_stack) { if (from_stack) { int mode; if (-1 == SLang_pop_integer (&mode)) return -1; *mp = (gsl_mode_t) mode; } *mp = Default_GSL_Mode; return 0; } static void do_d_dm (double (*f)(double, gsl_mode_t), gsl_mode_t m) { SLGSL_Double_Array_Type a; SLang_Array_Type *in, *out; unsigned int i, n; double *xp, *yp; if (-1 == slgsl_pop_d_array (&a, 0)) return; if (NULL == (in = a.at)) { (void) SLang_push_double ((*f)(a.x, m)); return; } if (NULL == (out = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, in->dims, in->num_dims))) { SLang_free_array (in); return; } n = in->num_elements; xp = a.xp; yp = (double *) out->data; for (i = 0; i < n; i++) yp[i] = (*f)(xp[i], m); (void) SLang_push_array (out, 1); SLang_free_array (in); } static void do_d_ddm (double (*f)(double, double, gsl_mode_t), gsl_mode_t m) { SLGSL_Double_Array_Type a, b; SLang_Array_Type *atz; unsigned int i, n; double *xp, *yp, *zp; unsigned int xinc, yinc; if (-1 == slgsl_pop_dd_array (&a, &b, 0)) return; if ((NULL == (atz = a.at)) && (NULL == (atz = b.at))) { (void) SLang_push_double ((*f)(a.x, b.x, m)); return; } atz = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, atz->dims, atz->num_dims); if (atz == NULL) { SLang_free_array (a.at); SLang_free_array (b.at); return; } n = atz->num_elements; zp = (double *) atz->data; xp = a.xp; yp = b.xp; xinc = a.inc; yinc = b.inc; for (i = 0; i < n; i++) { zp[i] = (*f)(*xp, *yp, m); xp += xinc; yp += yinc; } (void) SLang_push_array (atz, 1); SLang_free_array (a.at); SLang_free_array (b.at); } static void do_d_dddm (double (*f)(double, double, double, gsl_mode_t), gsl_mode_t m) { SLGSL_Double_Array_Type a, b, c; SLang_Array_Type *atz; unsigned int i, n; double *ap, *bp, *cp, *zp; unsigned int ainc, binc, cinc; if (-1 == slgsl_pop_ddd_array (&a, &b, &c, 0)) return; if ((NULL == (atz = a.at)) && (NULL == (atz = b.at)) && (NULL == (atz = c.at))) { (void) SLang_push_double ((*f)(a.x, b.x, c.x, m)); return; } atz = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, atz->dims, atz->num_dims); if (atz == NULL) { SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); return; } n = atz->num_elements; zp = (double *) atz->data; ap = a.xp; bp = b.xp; cp = c.xp; ainc = a.inc; binc = b.inc; cinc = c.inc; for (i = 0; i < n; i++) { zp[i] = (*f)(*ap, *bp, *cp, m); ap += ainc; bp += binc; cp += cinc; } (void) SLang_push_array (atz, 1); SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); } static void do_d_ddddm (double (*f)(double, double, double, double, gsl_mode_t), gsl_mode_t m) { SLGSL_Double_Array_Type a, b, c, d; SLang_Array_Type *atz; unsigned int i, n; double *ap, *bp, *cp, *dp, *zp; unsigned int ainc, binc, cinc, dinc; if (-1 == slgsl_pop_dddd_array (&a, &b, &c, &d, 0)) return; if ((NULL == (atz = a.at)) && (NULL == (atz = b.at)) && (NULL == (atz = c.at)) && (NULL == (atz = d.at))) { (void) SLang_push_double ((*f)(a.x, b.x, c.x, d.x, m)); return; } atz = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, atz->dims, atz->num_dims); if (atz == NULL) { SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); SLang_free_array (d.at); return; } n = atz->num_elements; zp = (double *) atz->data; ap = a.xp; bp = b.xp; cp = c.xp; dp = d.xp; ainc = a.inc; binc = b.inc; cinc = c.inc; dinc = d.inc; for (i = 0; i < n; i++) { zp[i] = (*f)(*ap, *bp, *cp, *dp, m); ap += ainc; bp += binc; cp += cinc; dp += dinc; } (void) SLang_push_array (atz, 1); SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); SLang_free_array (d.at); } static void do_d_dm_fun (const char *fun, double (*f)(double, gsl_mode_t)) { gsl_mode_t m; if (SLang_Num_Function_Args < 1) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double[,mode])", fun); return; } if (-1 == get_gsl_mode (&m, SLang_Num_Function_Args-1)) return; slgsl_reset_errors (); do_d_dm (f,m); slgsl_check_errors (fun); } static void do_d_ddm_fun (const char *fun, double (*f)(double, double, gsl_mode_t)) { gsl_mode_t m; if (SLang_Num_Function_Args < 2) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double, double [,mode])", fun); return; } if (-1 == get_gsl_mode (&m, SLang_Num_Function_Args-2)) return; slgsl_reset_errors (); do_d_ddm (f,m); slgsl_check_errors (fun); } static void do_d_dddm_fun (const char *fun, double (*f)(double, double, double, gsl_mode_t)) { gsl_mode_t m; if (SLang_Num_Function_Args < 3) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double, double, double[,mode])", fun); return; } if (-1 == get_gsl_mode (&m, SLang_Num_Function_Args-3)) return; slgsl_reset_errors (); do_d_dddm (f,m); slgsl_check_errors (fun); } static void do_d_ddddm_fun (const char *fun, double (*f)(double,double,double,double,gsl_mode_t)) { gsl_mode_t m; if (SLang_Num_Function_Args < 4) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double, double, double, double [,mode])", fun); return; } if (-1 == get_gsl_mode (&m, SLang_Num_Function_Args-4)) return; slgsl_reset_errors (); do_d_ddddm (f,m); slgsl_check_errors (fun); } static void do_c_c_fun (const char *fun, int (*f)(double, double, gsl_sf_result*, gsl_sf_result*)) { SLGSL_Complex_Array_Type a; SLang_Array_Type *in, *out; unsigned int i, n; gsl_sf_result gsl_zr, gsl_zi; double *xp, *yp; if (SLang_Num_Function_Args < 1) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(complex)", fun); return; } if (-1 == slgsl_pop_c_array (&a, 0)) return; if (NULL == (in = a.at)) { (void) (*f)(a.x[0], a.x[1], &gsl_zr, &gsl_zi); (void) SLang_push_complex (gsl_zr.val, gsl_zi.val); return; } if (NULL == (out = SLang_create_array (SLANG_COMPLEX_TYPE, 0, NULL, in->dims, in->num_dims))) { SLang_free_array (in); return; } n = in->num_elements; xp = a.xp; yp = (double *) out->data; for (i = 0; i < 2*n; i+=2) { (void) (*f)(xp[i], xp[i+1], &gsl_zr, &gsl_zi); yp[i] = gsl_zr.val; yp[i+1] = gsl_zi.val; } (void) SLang_push_array (out, 1); SLang_free_array (in); } #endif /* _GSLSF_MODULE_C_ */ /* Macros to aid in wrapping the functions */ #define SLF(f) f##_intrin #define D_FD(f,n) \ static void SLF(f) (void) { slgsl_do_d_d_fun (n,f); } #define D_FDD(f,n) \ static void SLF(f) (void) { slgsl_do_d_dd_fun (n,f); } #define D_FDDD(f,n) \ static void SLF(f) (void) { slgsl_do_d_ddd_fun (n,f); } #define D_FDDDD(f,n) \ static void SLF(f) (void) { slgsl_do_d_dddd_fun (n,f); } #define D_FDM(f,n) \ static void SLF(f) (void) { do_d_dm_fun (n,f); } #define D_FDDM(f,n) \ static void SLF(f) (void) { do_d_ddm_fun (n,f); } #define D_FDDDM(f,n) \ static void SLF(f) (void) { do_d_dddm_fun (n,f); } #define D_FDDDDM(f,n) \ static void SLF(f) (void) { do_d_ddddm_fun (n,f); } #define D_FI(f,n) \ static void SLF(f) (void) { slgsl_do_d_i_fun (n,f); } #define D_FID(f,n) \ static void SLF(f) (void) { slgsl_do_d_id_fun (n,f); } #define D_FIDD(f,n) \ static void SLF(f) (void) { slgsl_do_d_idd_fun (n,f); } #define D_FIID(f,n) \ static void SLF(f) (void) { slgsl_do_d_iid_fun (n,f); } #define D_FIIDD(f,n) \ static void SLF(f) (void) { slgsl_do_d_iidd_fun (n,f); } #define I_FD(f,n) \ static void SLF(f) (void) { slgsl_do_i_d_fun (n,f); } /* Complex wrappers */ #define C_FC(f,n) \ static void SLF(f) (void) { do_c_c_fun (n,f); } /*}}}*/ #define V SLANG_VOID_TYPE static SLang_Intrin_Fun_Type Module_Intrinsics [] = { #ifdef _GSLSF_MODULE_C_ MAKE_INTRINSIC_0("gslsf_get_precision", get_gsl_precision, SLANG_INT_TYPE), MAKE_INTRINSIC_I("gslsf_set_precision", set_gsl_precision, SLANG_VOID_TYPE), #endif SLANG_END_INTRIN_FUN_TABLE }; #undef V #endif /* MODULE_HAS_INTRINSICS */ static SLang_Intrin_Var_Type Module_Variables [] = { MAKE_VARIABLE("_gslconst_module_version_string", &Module_Version_String, SLANG_STRING_TYPE, 1), MAKE_VARIABLE("GSL_VERSION", &gsl_version, SLANG_STRING_TYPE, 1), SLANG_END_INTRIN_VAR_TABLE }; static SLang_IConstant_Type Module_IConstants [] = { MAKE_ICONSTANT("_gslconst_module_version", MODULE_VERSION_NUMBER), #ifdef _GSLSF_MODULE_C_ MAKE_ICONSTANT("GSL_PREC_SINGLE", GSL_PREC_SINGLE), MAKE_ICONSTANT("GSL_PREC_DOUBLE", GSL_PREC_DOUBLE), MAKE_ICONSTANT("GSL_PREC_APPROX", GSL_PREC_APPROX), #endif SLANG_END_ICONST_TABLE }; #ifdef MODULE_HAS_DCONSTANTS static SLang_DConstant_Type Module_DConstants [] = { #ifdef GSL_CONST_CGSM_ACRE MAKE_DCONSTANT("CONST_CGSM_ACRE", GSL_CONST_CGSM_ACRE), #endif #ifdef GSL_CONST_CGSM_ANGSTROM MAKE_DCONSTANT("CONST_CGSM_ANGSTROM", GSL_CONST_CGSM_ANGSTROM), #endif #ifdef GSL_CONST_CGSM_ASTRONOMICAL_UNIT MAKE_DCONSTANT("CONST_CGSM_ASTRONOMICAL_UNIT", GSL_CONST_CGSM_ASTRONOMICAL_UNIT), #endif #ifdef GSL_CONST_CGSM_BAR MAKE_DCONSTANT("CONST_CGSM_BAR", GSL_CONST_CGSM_BAR), #endif #ifdef GSL_CONST_CGSM_BARN MAKE_DCONSTANT("CONST_CGSM_BARN", GSL_CONST_CGSM_BARN), #endif #ifdef GSL_CONST_CGSM_BOHR_MAGNETON MAKE_DCONSTANT("CONST_CGSM_BOHR_MAGNETON", GSL_CONST_CGSM_BOHR_MAGNETON), #endif #ifdef GSL_CONST_CGSM_BOHR_RADIUS MAKE_DCONSTANT("CONST_CGSM_BOHR_RADIUS", GSL_CONST_CGSM_BOHR_RADIUS), #endif #ifdef GSL_CONST_CGSM_BOLTZMANN MAKE_DCONSTANT("CONST_CGSM_BOLTZMANN", GSL_CONST_CGSM_BOLTZMANN), #endif #ifdef GSL_CONST_CGSM_BTU MAKE_DCONSTANT("CONST_CGSM_BTU", GSL_CONST_CGSM_BTU), #endif #ifdef GSL_CONST_CGSM_CALORIE MAKE_DCONSTANT("CONST_CGSM_CALORIE", GSL_CONST_CGSM_CALORIE), #endif #ifdef GSL_CONST_CGSM_CANADIAN_GALLON MAKE_DCONSTANT("CONST_CGSM_CANADIAN_GALLON", GSL_CONST_CGSM_CANADIAN_GALLON), #endif #ifdef GSL_CONST_CGSM_CARAT MAKE_DCONSTANT("CONST_CGSM_CARAT", GSL_CONST_CGSM_CARAT), #endif #ifdef GSL_CONST_CGSM_CUP MAKE_DCONSTANT("CONST_CGSM_CUP", GSL_CONST_CGSM_CUP), #endif #ifdef GSL_CONST_CGSM_CURIE MAKE_DCONSTANT("CONST_CGSM_CURIE", GSL_CONST_CGSM_CURIE), #endif #ifdef GSL_CONST_CGSM_DAY MAKE_DCONSTANT("CONST_CGSM_DAY", GSL_CONST_CGSM_DAY), #endif #ifdef GSL_CONST_CGSM_DYNE MAKE_DCONSTANT("CONST_CGSM_DYNE", GSL_CONST_CGSM_DYNE), #endif #ifdef GSL_CONST_CGSM_ELECTRON_CHARGE MAKE_DCONSTANT("CONST_CGSM_ELECTRON_CHARGE", GSL_CONST_CGSM_ELECTRON_CHARGE), #endif #ifdef GSL_CONST_CGSM_ELECTRON_MAGNETIC_MOMENT MAKE_DCONSTANT("CONST_CGSM_ELECTRON_MAGNETIC_MOMENT", GSL_CONST_CGSM_ELECTRON_MAGNETIC_MOMENT), #endif #ifdef GSL_CONST_CGSM_ELECTRON_VOLT MAKE_DCONSTANT("CONST_CGSM_ELECTRON_VOLT", GSL_CONST_CGSM_ELECTRON_VOLT), #endif #ifdef GSL_CONST_CGSM_ERG MAKE_DCONSTANT("CONST_CGSM_ERG", GSL_CONST_CGSM_ERG), #endif #ifdef GSL_CONST_CGSM_FARADAY MAKE_DCONSTANT("CONST_CGSM_FARADAY", GSL_CONST_CGSM_FARADAY), #endif #ifdef GSL_CONST_CGSM_FATHOM MAKE_DCONSTANT("CONST_CGSM_FATHOM", GSL_CONST_CGSM_FATHOM), #endif #ifdef GSL_CONST_CGSM_FLUID_OUNCE MAKE_DCONSTANT("CONST_CGSM_FLUID_OUNCE", GSL_CONST_CGSM_FLUID_OUNCE), #endif #ifdef GSL_CONST_CGSM_FOOT MAKE_DCONSTANT("CONST_CGSM_FOOT", GSL_CONST_CGSM_FOOT), #endif #ifdef GSL_CONST_CGSM_FOOTCANDLE MAKE_DCONSTANT("CONST_CGSM_FOOTCANDLE", GSL_CONST_CGSM_FOOTCANDLE), #endif #ifdef GSL_CONST_CGSM_FOOTLAMBERT MAKE_DCONSTANT("CONST_CGSM_FOOTLAMBERT", GSL_CONST_CGSM_FOOTLAMBERT), #endif #ifdef GSL_CONST_CGSM_GRAM_FORCE MAKE_DCONSTANT("CONST_CGSM_GRAM_FORCE", GSL_CONST_CGSM_GRAM_FORCE), #endif #ifdef GSL_CONST_CGSM_GRAVITATIONAL_CONSTANT MAKE_DCONSTANT("CONST_CGSM_GRAVITATIONAL_CONSTANT", GSL_CONST_CGSM_GRAVITATIONAL_CONSTANT), #endif #ifdef GSL_CONST_CGSM_GRAV_ACCEL MAKE_DCONSTANT("CONST_CGSM_GRAV_ACCEL", GSL_CONST_CGSM_GRAV_ACCEL), #endif #ifdef GSL_CONST_CGSM_HECTARE MAKE_DCONSTANT("CONST_CGSM_HECTARE", GSL_CONST_CGSM_HECTARE), #endif #ifdef GSL_CONST_CGSM_HORSEPOWER MAKE_DCONSTANT("CONST_CGSM_HORSEPOWER", GSL_CONST_CGSM_HORSEPOWER), #endif #ifdef GSL_CONST_CGSM_HOUR MAKE_DCONSTANT("CONST_CGSM_HOUR", GSL_CONST_CGSM_HOUR), #endif #ifdef GSL_CONST_CGSM_INCH MAKE_DCONSTANT("CONST_CGSM_INCH", GSL_CONST_CGSM_INCH), #endif #ifdef GSL_CONST_CGSM_INCH_OF_MERCURY MAKE_DCONSTANT("CONST_CGSM_INCH_OF_MERCURY", GSL_CONST_CGSM_INCH_OF_MERCURY), #endif #ifdef GSL_CONST_CGSM_INCH_OF_WATER MAKE_DCONSTANT("CONST_CGSM_INCH_OF_WATER", GSL_CONST_CGSM_INCH_OF_WATER), #endif #ifdef GSL_CONST_CGSM_JOULE MAKE_DCONSTANT("CONST_CGSM_JOULE", GSL_CONST_CGSM_JOULE), #endif #ifdef GSL_CONST_CGSM_KILOMETERS_PER_HOUR MAKE_DCONSTANT("CONST_CGSM_KILOMETERS_PER_HOUR", GSL_CONST_CGSM_KILOMETERS_PER_HOUR), #endif #ifdef GSL_CONST_CGSM_KILOPOUND_FORCE MAKE_DCONSTANT("CONST_CGSM_KILOPOUND_FORCE", GSL_CONST_CGSM_KILOPOUND_FORCE), #endif #ifdef GSL_CONST_CGSM_KNOT MAKE_DCONSTANT("CONST_CGSM_KNOT", GSL_CONST_CGSM_KNOT), #endif #ifdef GSL_CONST_CGSM_LAMBERT MAKE_DCONSTANT("CONST_CGSM_LAMBERT", GSL_CONST_CGSM_LAMBERT), #endif #ifdef GSL_CONST_CGSM_LIGHT_YEAR MAKE_DCONSTANT("CONST_CGSM_LIGHT_YEAR", GSL_CONST_CGSM_LIGHT_YEAR), #endif #ifdef GSL_CONST_CGSM_LITER MAKE_DCONSTANT("CONST_CGSM_LITER", GSL_CONST_CGSM_LITER), #endif #ifdef GSL_CONST_CGSM_LUMEN MAKE_DCONSTANT("CONST_CGSM_LUMEN", GSL_CONST_CGSM_LUMEN), #endif #ifdef GSL_CONST_CGSM_LUX MAKE_DCONSTANT("CONST_CGSM_LUX", GSL_CONST_CGSM_LUX), #endif #ifdef GSL_CONST_CGSM_MASS_ELECTRON MAKE_DCONSTANT("CONST_CGSM_MASS_ELECTRON", GSL_CONST_CGSM_MASS_ELECTRON), #endif #ifdef GSL_CONST_CGSM_MASS_MUON MAKE_DCONSTANT("CONST_CGSM_MASS_MUON", GSL_CONST_CGSM_MASS_MUON), #endif #ifdef GSL_CONST_CGSM_MASS_NEUTRON MAKE_DCONSTANT("CONST_CGSM_MASS_NEUTRON", GSL_CONST_CGSM_MASS_NEUTRON), #endif #ifdef GSL_CONST_CGSM_MASS_PROTON MAKE_DCONSTANT("CONST_CGSM_MASS_PROTON", GSL_CONST_CGSM_MASS_PROTON), #endif #ifdef GSL_CONST_CGSM_METER_OF_MERCURY MAKE_DCONSTANT("CONST_CGSM_METER_OF_MERCURY", GSL_CONST_CGSM_METER_OF_MERCURY), #endif #ifdef GSL_CONST_CGSM_METRIC_TON MAKE_DCONSTANT("CONST_CGSM_METRIC_TON", GSL_CONST_CGSM_METRIC_TON), #endif #ifdef GSL_CONST_CGSM_MICRON MAKE_DCONSTANT("CONST_CGSM_MICRON", GSL_CONST_CGSM_MICRON), #endif #ifdef GSL_CONST_CGSM_MIL MAKE_DCONSTANT("CONST_CGSM_MIL", GSL_CONST_CGSM_MIL), #endif #ifdef GSL_CONST_CGSM_MILE MAKE_DCONSTANT("CONST_CGSM_MILE", GSL_CONST_CGSM_MILE), #endif #ifdef GSL_CONST_CGSM_MILES_PER_HOUR MAKE_DCONSTANT("CONST_CGSM_MILES_PER_HOUR", GSL_CONST_CGSM_MILES_PER_HOUR), #endif #ifdef GSL_CONST_CGSM_MINUTE MAKE_DCONSTANT("CONST_CGSM_MINUTE", GSL_CONST_CGSM_MINUTE), #endif #ifdef GSL_CONST_CGSM_MOLAR_GAS MAKE_DCONSTANT("CONST_CGSM_MOLAR_GAS", GSL_CONST_CGSM_MOLAR_GAS), #endif #ifdef GSL_CONST_CGSM_NAUTICAL_MILE MAKE_DCONSTANT("CONST_CGSM_NAUTICAL_MILE", GSL_CONST_CGSM_NAUTICAL_MILE), #endif #ifdef GSL_CONST_CGSM_NEWTON MAKE_DCONSTANT("CONST_CGSM_NEWTON", GSL_CONST_CGSM_NEWTON), #endif #ifdef GSL_CONST_CGSM_NUCLEAR_MAGNETON MAKE_DCONSTANT("CONST_CGSM_NUCLEAR_MAGNETON", GSL_CONST_CGSM_NUCLEAR_MAGNETON), #endif #ifdef GSL_CONST_CGSM_OUNCE_MASS MAKE_DCONSTANT("CONST_CGSM_OUNCE_MASS", GSL_CONST_CGSM_OUNCE_MASS), #endif #ifdef GSL_CONST_CGSM_PARSEC MAKE_DCONSTANT("CONST_CGSM_PARSEC", GSL_CONST_CGSM_PARSEC), #endif #ifdef GSL_CONST_CGSM_PHOT MAKE_DCONSTANT("CONST_CGSM_PHOT", GSL_CONST_CGSM_PHOT), #endif #ifdef GSL_CONST_CGSM_PINT MAKE_DCONSTANT("CONST_CGSM_PINT", GSL_CONST_CGSM_PINT), #endif #ifdef GSL_CONST_CGSM_PLANCKS_CONSTANT_H MAKE_DCONSTANT("CONST_CGSM_PLANCKS_CONSTANT_H", GSL_CONST_CGSM_PLANCKS_CONSTANT_H), #endif #ifdef GSL_CONST_CGSM_PLANCKS_CONSTANT_HBAR MAKE_DCONSTANT("CONST_CGSM_PLANCKS_CONSTANT_HBAR", GSL_CONST_CGSM_PLANCKS_CONSTANT_HBAR), #endif #ifdef GSL_CONST_CGSM_POINT MAKE_DCONSTANT("CONST_CGSM_POINT", GSL_CONST_CGSM_POINT), #endif #ifdef GSL_CONST_CGSM_POISE MAKE_DCONSTANT("CONST_CGSM_POISE", GSL_CONST_CGSM_POISE), #endif #ifdef GSL_CONST_CGSM_POUNDAL MAKE_DCONSTANT("CONST_CGSM_POUNDAL", GSL_CONST_CGSM_POUNDAL), #endif #ifdef GSL_CONST_CGSM_POUND_FORCE MAKE_DCONSTANT("CONST_CGSM_POUND_FORCE", GSL_CONST_CGSM_POUND_FORCE), #endif #ifdef GSL_CONST_CGSM_POUND_MASS MAKE_DCONSTANT("CONST_CGSM_POUND_MASS", GSL_CONST_CGSM_POUND_MASS), #endif #ifdef GSL_CONST_CGSM_PROTON_MAGNETIC_MOMENT MAKE_DCONSTANT("CONST_CGSM_PROTON_MAGNETIC_MOMENT", GSL_CONST_CGSM_PROTON_MAGNETIC_MOMENT), #endif #ifdef GSL_CONST_CGSM_PSI MAKE_DCONSTANT("CONST_CGSM_PSI", GSL_CONST_CGSM_PSI), #endif #ifdef GSL_CONST_CGSM_QUART MAKE_DCONSTANT("CONST_CGSM_QUART", GSL_CONST_CGSM_QUART), #endif #ifdef GSL_CONST_CGSM_RAD MAKE_DCONSTANT("CONST_CGSM_RAD", GSL_CONST_CGSM_RAD), #endif #ifdef GSL_CONST_CGSM_ROENTGEN MAKE_DCONSTANT("CONST_CGSM_ROENTGEN", GSL_CONST_CGSM_ROENTGEN), #endif #ifdef GSL_CONST_CGSM_RYDBERG MAKE_DCONSTANT("CONST_CGSM_RYDBERG", GSL_CONST_CGSM_RYDBERG), #endif #ifdef GSL_CONST_CGSM_SOLAR_MASS MAKE_DCONSTANT("CONST_CGSM_SOLAR_MASS", GSL_CONST_CGSM_SOLAR_MASS), #endif #ifdef GSL_CONST_CGSM_SPEED_OF_LIGHT MAKE_DCONSTANT("CONST_CGSM_SPEED_OF_LIGHT", GSL_CONST_CGSM_SPEED_OF_LIGHT), #endif #ifdef GSL_CONST_CGSM_STANDARD_GAS_VOLUME MAKE_DCONSTANT("CONST_CGSM_STANDARD_GAS_VOLUME", GSL_CONST_CGSM_STANDARD_GAS_VOLUME), #endif #ifdef GSL_CONST_CGSM_STD_ATMOSPHERE MAKE_DCONSTANT("CONST_CGSM_STD_ATMOSPHERE", GSL_CONST_CGSM_STD_ATMOSPHERE), #endif #ifdef GSL_CONST_CGSM_STEFAN_BOLTZMANN_CONSTANT MAKE_DCONSTANT("CONST_CGSM_STEFAN_BOLTZMANN_CONSTANT", GSL_CONST_CGSM_STEFAN_BOLTZMANN_CONSTANT), #endif #ifdef GSL_CONST_CGSM_STILB MAKE_DCONSTANT("CONST_CGSM_STILB", GSL_CONST_CGSM_STILB), #endif #ifdef GSL_CONST_CGSM_STOKES MAKE_DCONSTANT("CONST_CGSM_STOKES", GSL_CONST_CGSM_STOKES), #endif #ifdef GSL_CONST_CGSM_TABLESPOON MAKE_DCONSTANT("CONST_CGSM_TABLESPOON", GSL_CONST_CGSM_TABLESPOON), #endif #ifdef GSL_CONST_CGSM_TEASPOON MAKE_DCONSTANT("CONST_CGSM_TEASPOON", GSL_CONST_CGSM_TEASPOON), #endif #ifdef GSL_CONST_CGSM_TEXPOINT MAKE_DCONSTANT("CONST_CGSM_TEXPOINT", GSL_CONST_CGSM_TEXPOINT), #endif #ifdef GSL_CONST_CGSM_THERM MAKE_DCONSTANT("CONST_CGSM_THERM", GSL_CONST_CGSM_THERM), #endif #ifdef GSL_CONST_CGSM_THOMSON_CROSS_SECTION MAKE_DCONSTANT("CONST_CGSM_THOMSON_CROSS_SECTION", GSL_CONST_CGSM_THOMSON_CROSS_SECTION), #endif #ifdef GSL_CONST_CGSM_TON MAKE_DCONSTANT("CONST_CGSM_TON", GSL_CONST_CGSM_TON), #endif #ifdef GSL_CONST_CGSM_TORR MAKE_DCONSTANT("CONST_CGSM_TORR", GSL_CONST_CGSM_TORR), #endif #ifdef GSL_CONST_CGSM_TROY_OUNCE MAKE_DCONSTANT("CONST_CGSM_TROY_OUNCE", GSL_CONST_CGSM_TROY_OUNCE), #endif #ifdef GSL_CONST_CGSM_UK_GALLON MAKE_DCONSTANT("CONST_CGSM_UK_GALLON", GSL_CONST_CGSM_UK_GALLON), #endif #ifdef GSL_CONST_CGSM_UK_TON MAKE_DCONSTANT("CONST_CGSM_UK_TON", GSL_CONST_CGSM_UK_TON), #endif #ifdef GSL_CONST_CGSM_UNIFIED_ATOMIC_MASS MAKE_DCONSTANT("CONST_CGSM_UNIFIED_ATOMIC_MASS", GSL_CONST_CGSM_UNIFIED_ATOMIC_MASS), #endif #ifdef GSL_CONST_CGSM_US_GALLON MAKE_DCONSTANT("CONST_CGSM_US_GALLON", GSL_CONST_CGSM_US_GALLON), #endif #ifdef GSL_CONST_CGSM_WEEK MAKE_DCONSTANT("CONST_CGSM_WEEK", GSL_CONST_CGSM_WEEK), #endif #ifdef GSL_CONST_CGSM_YARD MAKE_DCONSTANT("CONST_CGSM_YARD", GSL_CONST_CGSM_YARD), #endif #ifdef GSL_CONST_CGS_ACRE MAKE_DCONSTANT("CONST_CGS_ACRE", GSL_CONST_CGS_ACRE), #endif #ifdef GSL_CONST_CGS_ANGSTROM MAKE_DCONSTANT("CONST_CGS_ANGSTROM", GSL_CONST_CGS_ANGSTROM), #endif #ifdef GSL_CONST_CGS_ASTRONOMICAL_UNIT MAKE_DCONSTANT("CONST_CGS_ASTRONOMICAL_UNIT", GSL_CONST_CGS_ASTRONOMICAL_UNIT), #endif #ifdef GSL_CONST_CGS_BAR MAKE_DCONSTANT("CONST_CGS_BAR", GSL_CONST_CGS_BAR), #endif #ifdef GSL_CONST_CGS_BARN MAKE_DCONSTANT("CONST_CGS_BARN", GSL_CONST_CGS_BARN), #endif #ifdef GSL_CONST_CGS_BOHR_RADIUS MAKE_DCONSTANT("CONST_CGS_BOHR_RADIUS", GSL_CONST_CGS_BOHR_RADIUS), #endif #ifdef GSL_CONST_CGS_BOLTZMANN MAKE_DCONSTANT("CONST_CGS_BOLTZMANN", GSL_CONST_CGS_BOLTZMANN), #endif #ifdef GSL_CONST_CGS_BTU MAKE_DCONSTANT("CONST_CGS_BTU", GSL_CONST_CGS_BTU), #endif #ifdef GSL_CONST_CGS_CALORIE MAKE_DCONSTANT("CONST_CGS_CALORIE", GSL_CONST_CGS_CALORIE), #endif #ifdef GSL_CONST_CGS_CANADIAN_GALLON MAKE_DCONSTANT("CONST_CGS_CANADIAN_GALLON", GSL_CONST_CGS_CANADIAN_GALLON), #endif #ifdef GSL_CONST_CGS_CARAT MAKE_DCONSTANT("CONST_CGS_CARAT", GSL_CONST_CGS_CARAT), #endif #ifdef GSL_CONST_CGS_CUP MAKE_DCONSTANT("CONST_CGS_CUP", GSL_CONST_CGS_CUP), #endif #ifdef GSL_CONST_CGS_CURIE MAKE_DCONSTANT("CONST_CGS_CURIE", GSL_CONST_CGS_CURIE), #endif #ifdef GSL_CONST_CGS_DAY MAKE_DCONSTANT("CONST_CGS_DAY", GSL_CONST_CGS_DAY), #endif #ifdef GSL_CONST_CGS_DYNE MAKE_DCONSTANT("CONST_CGS_DYNE", GSL_CONST_CGS_DYNE), #endif #ifdef GSL_CONST_CGS_ELECTRON_VOLT MAKE_DCONSTANT("CONST_CGS_ELECTRON_VOLT", GSL_CONST_CGS_ELECTRON_VOLT), #endif #ifdef GSL_CONST_CGS_ERG MAKE_DCONSTANT("CONST_CGS_ERG", GSL_CONST_CGS_ERG), #endif #ifdef GSL_CONST_CGS_FATHOM MAKE_DCONSTANT("CONST_CGS_FATHOM", GSL_CONST_CGS_FATHOM), #endif #ifdef GSL_CONST_CGS_FLUID_OUNCE MAKE_DCONSTANT("CONST_CGS_FLUID_OUNCE", GSL_CONST_CGS_FLUID_OUNCE), #endif #ifdef GSL_CONST_CGS_FOOT MAKE_DCONSTANT("CONST_CGS_FOOT", GSL_CONST_CGS_FOOT), #endif #ifdef GSL_CONST_CGS_FOOTCANDLE MAKE_DCONSTANT("CONST_CGS_FOOTCANDLE", GSL_CONST_CGS_FOOTCANDLE), #endif #ifdef GSL_CONST_CGS_FOOTLAMBERT MAKE_DCONSTANT("CONST_CGS_FOOTLAMBERT", GSL_CONST_CGS_FOOTLAMBERT), #endif #ifdef GSL_CONST_CGS_GRAM_FORCE MAKE_DCONSTANT("CONST_CGS_GRAM_FORCE", GSL_CONST_CGS_GRAM_FORCE), #endif #ifdef GSL_CONST_CGS_GRAVITATIONAL_CONSTANT MAKE_DCONSTANT("CONST_CGS_GRAVITATIONAL_CONSTANT", GSL_CONST_CGS_GRAVITATIONAL_CONSTANT), #endif #ifdef GSL_CONST_CGS_GRAV_ACCEL MAKE_DCONSTANT("CONST_CGS_GRAV_ACCEL", GSL_CONST_CGS_GRAV_ACCEL), #endif #ifdef GSL_CONST_CGS_HECTARE MAKE_DCONSTANT("CONST_CGS_HECTARE", GSL_CONST_CGS_HECTARE), #endif #ifdef GSL_CONST_CGS_HORSEPOWER MAKE_DCONSTANT("CONST_CGS_HORSEPOWER", GSL_CONST_CGS_HORSEPOWER), #endif #ifdef GSL_CONST_CGS_HOUR MAKE_DCONSTANT("CONST_CGS_HOUR", GSL_CONST_CGS_HOUR), #endif #ifdef GSL_CONST_CGS_INCH MAKE_DCONSTANT("CONST_CGS_INCH", GSL_CONST_CGS_INCH), #endif #ifdef GSL_CONST_CGS_INCH_OF_MERCURY MAKE_DCONSTANT("CONST_CGS_INCH_OF_MERCURY", GSL_CONST_CGS_INCH_OF_MERCURY), #endif #ifdef GSL_CONST_CGS_INCH_OF_WATER MAKE_DCONSTANT("CONST_CGS_INCH_OF_WATER", GSL_CONST_CGS_INCH_OF_WATER), #endif #ifdef GSL_CONST_CGS_JOULE MAKE_DCONSTANT("CONST_CGS_JOULE", GSL_CONST_CGS_JOULE), #endif #ifdef GSL_CONST_CGS_KILOMETERS_PER_HOUR MAKE_DCONSTANT("CONST_CGS_KILOMETERS_PER_HOUR", GSL_CONST_CGS_KILOMETERS_PER_HOUR), #endif #ifdef GSL_CONST_CGS_KILOPOUND_FORCE MAKE_DCONSTANT("CONST_CGS_KILOPOUND_FORCE", GSL_CONST_CGS_KILOPOUND_FORCE), #endif #ifdef GSL_CONST_CGS_KNOT MAKE_DCONSTANT("CONST_CGS_KNOT", GSL_CONST_CGS_KNOT), #endif #ifdef GSL_CONST_CGS_LAMBERT MAKE_DCONSTANT("CONST_CGS_LAMBERT", GSL_CONST_CGS_LAMBERT), #endif #ifdef GSL_CONST_CGS_LIGHT_YEAR MAKE_DCONSTANT("CONST_CGS_LIGHT_YEAR", GSL_CONST_CGS_LIGHT_YEAR), #endif #ifdef GSL_CONST_CGS_LITER MAKE_DCONSTANT("CONST_CGS_LITER", GSL_CONST_CGS_LITER), #endif #ifdef GSL_CONST_CGS_LUMEN MAKE_DCONSTANT("CONST_CGS_LUMEN", GSL_CONST_CGS_LUMEN), #endif #ifdef GSL_CONST_CGS_LUX MAKE_DCONSTANT("CONST_CGS_LUX", GSL_CONST_CGS_LUX), #endif #ifdef GSL_CONST_CGS_MASS_ELECTRON MAKE_DCONSTANT("CONST_CGS_MASS_ELECTRON", GSL_CONST_CGS_MASS_ELECTRON), #endif #ifdef GSL_CONST_CGS_MASS_MUON MAKE_DCONSTANT("CONST_CGS_MASS_MUON", GSL_CONST_CGS_MASS_MUON), #endif #ifdef GSL_CONST_CGS_MASS_NEUTRON MAKE_DCONSTANT("CONST_CGS_MASS_NEUTRON", GSL_CONST_CGS_MASS_NEUTRON), #endif #ifdef GSL_CONST_CGS_MASS_PROTON MAKE_DCONSTANT("CONST_CGS_MASS_PROTON", GSL_CONST_CGS_MASS_PROTON), #endif #ifdef GSL_CONST_CGS_METER_OF_MERCURY MAKE_DCONSTANT("CONST_CGS_METER_OF_MERCURY", GSL_CONST_CGS_METER_OF_MERCURY), #endif #ifdef GSL_CONST_CGS_METRIC_TON MAKE_DCONSTANT("CONST_CGS_METRIC_TON", GSL_CONST_CGS_METRIC_TON), #endif #ifdef GSL_CONST_CGS_MICRON MAKE_DCONSTANT("CONST_CGS_MICRON", GSL_CONST_CGS_MICRON), #endif #ifdef GSL_CONST_CGS_MIL MAKE_DCONSTANT("CONST_CGS_MIL", GSL_CONST_CGS_MIL), #endif #ifdef GSL_CONST_CGS_MILE MAKE_DCONSTANT("CONST_CGS_MILE", GSL_CONST_CGS_MILE), #endif #ifdef GSL_CONST_CGS_MILES_PER_HOUR MAKE_DCONSTANT("CONST_CGS_MILES_PER_HOUR", GSL_CONST_CGS_MILES_PER_HOUR), #endif #ifdef GSL_CONST_CGS_MINUTE MAKE_DCONSTANT("CONST_CGS_MINUTE", GSL_CONST_CGS_MINUTE), #endif #ifdef GSL_CONST_CGS_MOLAR_GAS MAKE_DCONSTANT("CONST_CGS_MOLAR_GAS", GSL_CONST_CGS_MOLAR_GAS), #endif #ifdef GSL_CONST_CGS_NAUTICAL_MILE MAKE_DCONSTANT("CONST_CGS_NAUTICAL_MILE", GSL_CONST_CGS_NAUTICAL_MILE), #endif #ifdef GSL_CONST_CGS_NEWTON MAKE_DCONSTANT("CONST_CGS_NEWTON", GSL_CONST_CGS_NEWTON), #endif #ifdef GSL_CONST_CGS_OUNCE_MASS MAKE_DCONSTANT("CONST_CGS_OUNCE_MASS", GSL_CONST_CGS_OUNCE_MASS), #endif #ifdef GSL_CONST_CGS_PARSEC MAKE_DCONSTANT("CONST_CGS_PARSEC", GSL_CONST_CGS_PARSEC), #endif #ifdef GSL_CONST_CGS_PHOT MAKE_DCONSTANT("CONST_CGS_PHOT", GSL_CONST_CGS_PHOT), #endif #ifdef GSL_CONST_CGS_PINT MAKE_DCONSTANT("CONST_CGS_PINT", GSL_CONST_CGS_PINT), #endif #ifdef GSL_CONST_CGS_PLANCKS_CONSTANT_H MAKE_DCONSTANT("CONST_CGS_PLANCKS_CONSTANT_H", GSL_CONST_CGS_PLANCKS_CONSTANT_H), #endif #ifdef GSL_CONST_CGS_PLANCKS_CONSTANT_HBAR MAKE_DCONSTANT("CONST_CGS_PLANCKS_CONSTANT_HBAR", GSL_CONST_CGS_PLANCKS_CONSTANT_HBAR), #endif #ifdef GSL_CONST_CGS_POINT MAKE_DCONSTANT("CONST_CGS_POINT", GSL_CONST_CGS_POINT), #endif #ifdef GSL_CONST_CGS_POISE MAKE_DCONSTANT("CONST_CGS_POISE", GSL_CONST_CGS_POISE), #endif #ifdef GSL_CONST_CGS_POUNDAL MAKE_DCONSTANT("CONST_CGS_POUNDAL", GSL_CONST_CGS_POUNDAL), #endif #ifdef GSL_CONST_CGS_POUND_FORCE MAKE_DCONSTANT("CONST_CGS_POUND_FORCE", GSL_CONST_CGS_POUND_FORCE), #endif #ifdef GSL_CONST_CGS_POUND_MASS MAKE_DCONSTANT("CONST_CGS_POUND_MASS", GSL_CONST_CGS_POUND_MASS), #endif #ifdef GSL_CONST_CGS_PSI MAKE_DCONSTANT("CONST_CGS_PSI", GSL_CONST_CGS_PSI), #endif #ifdef GSL_CONST_CGS_QUART MAKE_DCONSTANT("CONST_CGS_QUART", GSL_CONST_CGS_QUART), #endif #ifdef GSL_CONST_CGS_RAD MAKE_DCONSTANT("CONST_CGS_RAD", GSL_CONST_CGS_RAD), #endif #ifdef GSL_CONST_CGS_ROENTGEN MAKE_DCONSTANT("CONST_CGS_ROENTGEN", GSL_CONST_CGS_ROENTGEN), #endif #ifdef GSL_CONST_CGS_RYDBERG MAKE_DCONSTANT("CONST_CGS_RYDBERG", GSL_CONST_CGS_RYDBERG), #endif #ifdef GSL_CONST_CGS_SOLAR_MASS MAKE_DCONSTANT("CONST_CGS_SOLAR_MASS", GSL_CONST_CGS_SOLAR_MASS), #endif #ifdef GSL_CONST_CGS_SPEED_OF_LIGHT MAKE_DCONSTANT("CONST_CGS_SPEED_OF_LIGHT", GSL_CONST_CGS_SPEED_OF_LIGHT), #endif #ifdef GSL_CONST_CGS_STANDARD_GAS_VOLUME MAKE_DCONSTANT("CONST_CGS_STANDARD_GAS_VOLUME", GSL_CONST_CGS_STANDARD_GAS_VOLUME), #endif #ifdef GSL_CONST_CGS_STD_ATMOSPHERE MAKE_DCONSTANT("CONST_CGS_STD_ATMOSPHERE", GSL_CONST_CGS_STD_ATMOSPHERE), #endif #ifdef GSL_CONST_CGS_STEFAN_BOLTZMANN_CONSTANT MAKE_DCONSTANT("CONST_CGS_STEFAN_BOLTZMANN_CONSTANT", GSL_CONST_CGS_STEFAN_BOLTZMANN_CONSTANT), #endif #ifdef GSL_CONST_CGS_STILB MAKE_DCONSTANT("CONST_CGS_STILB", GSL_CONST_CGS_STILB), #endif #ifdef GSL_CONST_CGS_STOKES MAKE_DCONSTANT("CONST_CGS_STOKES", GSL_CONST_CGS_STOKES), #endif #ifdef GSL_CONST_CGS_TABLESPOON MAKE_DCONSTANT("CONST_CGS_TABLESPOON", GSL_CONST_CGS_TABLESPOON), #endif #ifdef GSL_CONST_CGS_TEASPOON MAKE_DCONSTANT("CONST_CGS_TEASPOON", GSL_CONST_CGS_TEASPOON), #endif #ifdef GSL_CONST_CGS_TEXPOINT MAKE_DCONSTANT("CONST_CGS_TEXPOINT", GSL_CONST_CGS_TEXPOINT), #endif #ifdef GSL_CONST_CGS_THERM MAKE_DCONSTANT("CONST_CGS_THERM", GSL_CONST_CGS_THERM), #endif #ifdef GSL_CONST_CGS_THOMSON_CROSS_SECTION MAKE_DCONSTANT("CONST_CGS_THOMSON_CROSS_SECTION", GSL_CONST_CGS_THOMSON_CROSS_SECTION), #endif #ifdef GSL_CONST_CGS_TON MAKE_DCONSTANT("CONST_CGS_TON", GSL_CONST_CGS_TON), #endif #ifdef GSL_CONST_CGS_TORR MAKE_DCONSTANT("CONST_CGS_TORR", GSL_CONST_CGS_TORR), #endif #ifdef GSL_CONST_CGS_TROY_OUNCE MAKE_DCONSTANT("CONST_CGS_TROY_OUNCE", GSL_CONST_CGS_TROY_OUNCE), #endif #ifdef GSL_CONST_CGS_UK_GALLON MAKE_DCONSTANT("CONST_CGS_UK_GALLON", GSL_CONST_CGS_UK_GALLON), #endif #ifdef GSL_CONST_CGS_UK_TON MAKE_DCONSTANT("CONST_CGS_UK_TON", GSL_CONST_CGS_UK_TON), #endif #ifdef GSL_CONST_CGS_UNIFIED_ATOMIC_MASS MAKE_DCONSTANT("CONST_CGS_UNIFIED_ATOMIC_MASS", GSL_CONST_CGS_UNIFIED_ATOMIC_MASS), #endif #ifdef GSL_CONST_CGS_US_GALLON MAKE_DCONSTANT("CONST_CGS_US_GALLON", GSL_CONST_CGS_US_GALLON), #endif #ifdef GSL_CONST_CGS_WEEK MAKE_DCONSTANT("CONST_CGS_WEEK", GSL_CONST_CGS_WEEK), #endif #ifdef GSL_CONST_CGS_YARD MAKE_DCONSTANT("CONST_CGS_YARD", GSL_CONST_CGS_YARD), #endif #ifdef GSL_CONST_MKSA_ACRE MAKE_DCONSTANT("CONST_MKSA_ACRE", GSL_CONST_MKSA_ACRE), #endif #ifdef GSL_CONST_MKSA_ANGSTROM MAKE_DCONSTANT("CONST_MKSA_ANGSTROM", GSL_CONST_MKSA_ANGSTROM), #endif #ifdef GSL_CONST_MKSA_ASTRONOMICAL_UNIT MAKE_DCONSTANT("CONST_MKSA_ASTRONOMICAL_UNIT", GSL_CONST_MKSA_ASTRONOMICAL_UNIT), #endif #ifdef GSL_CONST_MKSA_BAR MAKE_DCONSTANT("CONST_MKSA_BAR", GSL_CONST_MKSA_BAR), #endif #ifdef GSL_CONST_MKSA_BARN MAKE_DCONSTANT("CONST_MKSA_BARN", GSL_CONST_MKSA_BARN), #endif #ifdef GSL_CONST_MKSA_BOHR_MAGNETON MAKE_DCONSTANT("CONST_MKSA_BOHR_MAGNETON", GSL_CONST_MKSA_BOHR_MAGNETON), #endif #ifdef GSL_CONST_MKSA_BOHR_RADIUS MAKE_DCONSTANT("CONST_MKSA_BOHR_RADIUS", GSL_CONST_MKSA_BOHR_RADIUS), #endif #ifdef GSL_CONST_MKSA_BOLTZMANN MAKE_DCONSTANT("CONST_MKSA_BOLTZMANN", GSL_CONST_MKSA_BOLTZMANN), #endif #ifdef GSL_CONST_MKSA_BTU MAKE_DCONSTANT("CONST_MKSA_BTU", GSL_CONST_MKSA_BTU), #endif #ifdef GSL_CONST_MKSA_CALORIE MAKE_DCONSTANT("CONST_MKSA_CALORIE", GSL_CONST_MKSA_CALORIE), #endif #ifdef GSL_CONST_MKSA_CANADIAN_GALLON MAKE_DCONSTANT("CONST_MKSA_CANADIAN_GALLON", GSL_CONST_MKSA_CANADIAN_GALLON), #endif #ifdef GSL_CONST_MKSA_CARAT MAKE_DCONSTANT("CONST_MKSA_CARAT", GSL_CONST_MKSA_CARAT), #endif #ifdef GSL_CONST_MKSA_CUP MAKE_DCONSTANT("CONST_MKSA_CUP", GSL_CONST_MKSA_CUP), #endif #ifdef GSL_CONST_MKSA_CURIE MAKE_DCONSTANT("CONST_MKSA_CURIE", GSL_CONST_MKSA_CURIE), #endif #ifdef GSL_CONST_MKSA_DAY MAKE_DCONSTANT("CONST_MKSA_DAY", GSL_CONST_MKSA_DAY), #endif #ifdef GSL_CONST_MKSA_DEBYE MAKE_DCONSTANT("CONST_MKSA_DEBYE", GSL_CONST_MKSA_DEBYE), #endif #ifdef GSL_CONST_MKSA_DYNE MAKE_DCONSTANT("CONST_MKSA_DYNE", GSL_CONST_MKSA_DYNE), #endif #ifdef GSL_CONST_MKSA_ELECTRON_CHARGE MAKE_DCONSTANT("CONST_MKSA_ELECTRON_CHARGE", GSL_CONST_MKSA_ELECTRON_CHARGE), #endif #ifdef GSL_CONST_MKSA_ELECTRON_MAGNETIC_MOMENT MAKE_DCONSTANT("CONST_MKSA_ELECTRON_MAGNETIC_MOMENT", GSL_CONST_MKSA_ELECTRON_MAGNETIC_MOMENT), #endif #ifdef GSL_CONST_MKSA_ELECTRON_VOLT MAKE_DCONSTANT("CONST_MKSA_ELECTRON_VOLT", GSL_CONST_MKSA_ELECTRON_VOLT), #endif #ifdef GSL_CONST_MKSA_ERG MAKE_DCONSTANT("CONST_MKSA_ERG", GSL_CONST_MKSA_ERG), #endif #ifdef GSL_CONST_MKSA_FARADAY MAKE_DCONSTANT("CONST_MKSA_FARADAY", GSL_CONST_MKSA_FARADAY), #endif #ifdef GSL_CONST_MKSA_FATHOM MAKE_DCONSTANT("CONST_MKSA_FATHOM", GSL_CONST_MKSA_FATHOM), #endif #ifdef GSL_CONST_MKSA_FLUID_OUNCE MAKE_DCONSTANT("CONST_MKSA_FLUID_OUNCE", GSL_CONST_MKSA_FLUID_OUNCE), #endif #ifdef GSL_CONST_MKSA_FOOT MAKE_DCONSTANT("CONST_MKSA_FOOT", GSL_CONST_MKSA_FOOT), #endif #ifdef GSL_CONST_MKSA_FOOTCANDLE MAKE_DCONSTANT("CONST_MKSA_FOOTCANDLE", GSL_CONST_MKSA_FOOTCANDLE), #endif #ifdef GSL_CONST_MKSA_FOOTLAMBERT MAKE_DCONSTANT("CONST_MKSA_FOOTLAMBERT", GSL_CONST_MKSA_FOOTLAMBERT), #endif #ifdef GSL_CONST_MKSA_GAUSS MAKE_DCONSTANT("CONST_MKSA_GAUSS", GSL_CONST_MKSA_GAUSS), #endif #ifdef GSL_CONST_MKSA_GRAM_FORCE MAKE_DCONSTANT("CONST_MKSA_GRAM_FORCE", GSL_CONST_MKSA_GRAM_FORCE), #endif #ifdef GSL_CONST_MKSA_GRAVITATIONAL_CONSTANT MAKE_DCONSTANT("CONST_MKSA_GRAVITATIONAL_CONSTANT", GSL_CONST_MKSA_GRAVITATIONAL_CONSTANT), #endif #ifdef GSL_CONST_MKSA_GRAV_ACCEL MAKE_DCONSTANT("CONST_MKSA_GRAV_ACCEL", GSL_CONST_MKSA_GRAV_ACCEL), #endif #ifdef GSL_CONST_MKSA_HECTARE MAKE_DCONSTANT("CONST_MKSA_HECTARE", GSL_CONST_MKSA_HECTARE), #endif #ifdef GSL_CONST_MKSA_HORSEPOWER MAKE_DCONSTANT("CONST_MKSA_HORSEPOWER", GSL_CONST_MKSA_HORSEPOWER), #endif #ifdef GSL_CONST_MKSA_HOUR MAKE_DCONSTANT("CONST_MKSA_HOUR", GSL_CONST_MKSA_HOUR), #endif #ifdef GSL_CONST_MKSA_INCH MAKE_DCONSTANT("CONST_MKSA_INCH", GSL_CONST_MKSA_INCH), #endif #ifdef GSL_CONST_MKSA_INCH_OF_MERCURY MAKE_DCONSTANT("CONST_MKSA_INCH_OF_MERCURY", GSL_CONST_MKSA_INCH_OF_MERCURY), #endif #ifdef GSL_CONST_MKSA_INCH_OF_WATER MAKE_DCONSTANT("CONST_MKSA_INCH_OF_WATER", GSL_CONST_MKSA_INCH_OF_WATER), #endif #ifdef GSL_CONST_MKSA_JOULE MAKE_DCONSTANT("CONST_MKSA_JOULE", GSL_CONST_MKSA_JOULE), #endif #ifdef GSL_CONST_MKSA_KILOMETERS_PER_HOUR MAKE_DCONSTANT("CONST_MKSA_KILOMETERS_PER_HOUR", GSL_CONST_MKSA_KILOMETERS_PER_HOUR), #endif #ifdef GSL_CONST_MKSA_KILOPOUND_FORCE MAKE_DCONSTANT("CONST_MKSA_KILOPOUND_FORCE", GSL_CONST_MKSA_KILOPOUND_FORCE), #endif #ifdef GSL_CONST_MKSA_KNOT MAKE_DCONSTANT("CONST_MKSA_KNOT", GSL_CONST_MKSA_KNOT), #endif #ifdef GSL_CONST_MKSA_LAMBERT MAKE_DCONSTANT("CONST_MKSA_LAMBERT", GSL_CONST_MKSA_LAMBERT), #endif #ifdef GSL_CONST_MKSA_LIGHT_YEAR MAKE_DCONSTANT("CONST_MKSA_LIGHT_YEAR", GSL_CONST_MKSA_LIGHT_YEAR), #endif #ifdef GSL_CONST_MKSA_LITER MAKE_DCONSTANT("CONST_MKSA_LITER", GSL_CONST_MKSA_LITER), #endif #ifdef GSL_CONST_MKSA_LUMEN MAKE_DCONSTANT("CONST_MKSA_LUMEN", GSL_CONST_MKSA_LUMEN), #endif #ifdef GSL_CONST_MKSA_LUX MAKE_DCONSTANT("CONST_MKSA_LUX", GSL_CONST_MKSA_LUX), #endif #ifdef GSL_CONST_MKSA_MASS_ELECTRON MAKE_DCONSTANT("CONST_MKSA_MASS_ELECTRON", GSL_CONST_MKSA_MASS_ELECTRON), #endif #ifdef GSL_CONST_MKSA_MASS_MUON MAKE_DCONSTANT("CONST_MKSA_MASS_MUON", GSL_CONST_MKSA_MASS_MUON), #endif #ifdef GSL_CONST_MKSA_MASS_NEUTRON MAKE_DCONSTANT("CONST_MKSA_MASS_NEUTRON", GSL_CONST_MKSA_MASS_NEUTRON), #endif #ifdef GSL_CONST_MKSA_MASS_PROTON MAKE_DCONSTANT("CONST_MKSA_MASS_PROTON", GSL_CONST_MKSA_MASS_PROTON), #endif #ifdef GSL_CONST_MKSA_METER_OF_MERCURY MAKE_DCONSTANT("CONST_MKSA_METER_OF_MERCURY", GSL_CONST_MKSA_METER_OF_MERCURY), #endif #ifdef GSL_CONST_MKSA_METRIC_TON MAKE_DCONSTANT("CONST_MKSA_METRIC_TON", GSL_CONST_MKSA_METRIC_TON), #endif #ifdef GSL_CONST_MKSA_MICRON MAKE_DCONSTANT("CONST_MKSA_MICRON", GSL_CONST_MKSA_MICRON), #endif #ifdef GSL_CONST_MKSA_MIL MAKE_DCONSTANT("CONST_MKSA_MIL", GSL_CONST_MKSA_MIL), #endif #ifdef GSL_CONST_MKSA_MILE MAKE_DCONSTANT("CONST_MKSA_MILE", GSL_CONST_MKSA_MILE), #endif #ifdef GSL_CONST_MKSA_MILES_PER_HOUR MAKE_DCONSTANT("CONST_MKSA_MILES_PER_HOUR", GSL_CONST_MKSA_MILES_PER_HOUR), #endif #ifdef GSL_CONST_MKSA_MINUTE MAKE_DCONSTANT("CONST_MKSA_MINUTE", GSL_CONST_MKSA_MINUTE), #endif #ifdef GSL_CONST_MKSA_MOLAR_GAS MAKE_DCONSTANT("CONST_MKSA_MOLAR_GAS", GSL_CONST_MKSA_MOLAR_GAS), #endif #ifdef GSL_CONST_MKSA_NAUTICAL_MILE MAKE_DCONSTANT("CONST_MKSA_NAUTICAL_MILE", GSL_CONST_MKSA_NAUTICAL_MILE), #endif #ifdef GSL_CONST_MKSA_NEWTON MAKE_DCONSTANT("CONST_MKSA_NEWTON", GSL_CONST_MKSA_NEWTON), #endif #ifdef GSL_CONST_MKSA_NUCLEAR_MAGNETON MAKE_DCONSTANT("CONST_MKSA_NUCLEAR_MAGNETON", GSL_CONST_MKSA_NUCLEAR_MAGNETON), #endif #ifdef GSL_CONST_MKSA_OUNCE_MASS MAKE_DCONSTANT("CONST_MKSA_OUNCE_MASS", GSL_CONST_MKSA_OUNCE_MASS), #endif #ifdef GSL_CONST_MKSA_PARSEC MAKE_DCONSTANT("CONST_MKSA_PARSEC", GSL_CONST_MKSA_PARSEC), #endif #ifdef GSL_CONST_MKSA_PHOT MAKE_DCONSTANT("CONST_MKSA_PHOT", GSL_CONST_MKSA_PHOT), #endif #ifdef GSL_CONST_MKSA_PINT MAKE_DCONSTANT("CONST_MKSA_PINT", GSL_CONST_MKSA_PINT), #endif #ifdef GSL_CONST_MKSA_PLANCKS_CONSTANT_H MAKE_DCONSTANT("CONST_MKSA_PLANCKS_CONSTANT_H", GSL_CONST_MKSA_PLANCKS_CONSTANT_H), #endif #ifdef GSL_CONST_MKSA_PLANCKS_CONSTANT_HBAR MAKE_DCONSTANT("CONST_MKSA_PLANCKS_CONSTANT_HBAR", GSL_CONST_MKSA_PLANCKS_CONSTANT_HBAR), #endif #ifdef GSL_CONST_MKSA_POINT MAKE_DCONSTANT("CONST_MKSA_POINT", GSL_CONST_MKSA_POINT), #endif #ifdef GSL_CONST_MKSA_POISE MAKE_DCONSTANT("CONST_MKSA_POISE", GSL_CONST_MKSA_POISE), #endif #ifdef GSL_CONST_MKSA_POUNDAL MAKE_DCONSTANT("CONST_MKSA_POUNDAL", GSL_CONST_MKSA_POUNDAL), #endif #ifdef GSL_CONST_MKSA_POUND_FORCE MAKE_DCONSTANT("CONST_MKSA_POUND_FORCE", GSL_CONST_MKSA_POUND_FORCE), #endif #ifdef GSL_CONST_MKSA_POUND_MASS MAKE_DCONSTANT("CONST_MKSA_POUND_MASS", GSL_CONST_MKSA_POUND_MASS), #endif #ifdef GSL_CONST_MKSA_PROTON_MAGNETIC_MOMENT MAKE_DCONSTANT("CONST_MKSA_PROTON_MAGNETIC_MOMENT", GSL_CONST_MKSA_PROTON_MAGNETIC_MOMENT), #endif #ifdef GSL_CONST_MKSA_PSI MAKE_DCONSTANT("CONST_MKSA_PSI", GSL_CONST_MKSA_PSI), #endif #ifdef GSL_CONST_MKSA_QUART MAKE_DCONSTANT("CONST_MKSA_QUART", GSL_CONST_MKSA_QUART), #endif #ifdef GSL_CONST_MKSA_RAD MAKE_DCONSTANT("CONST_MKSA_RAD", GSL_CONST_MKSA_RAD), #endif #ifdef GSL_CONST_MKSA_ROENTGEN MAKE_DCONSTANT("CONST_MKSA_ROENTGEN", GSL_CONST_MKSA_ROENTGEN), #endif #ifdef GSL_CONST_MKSA_RYDBERG MAKE_DCONSTANT("CONST_MKSA_RYDBERG", GSL_CONST_MKSA_RYDBERG), #endif #ifdef GSL_CONST_MKSA_SOLAR_MASS MAKE_DCONSTANT("CONST_MKSA_SOLAR_MASS", GSL_CONST_MKSA_SOLAR_MASS), #endif #ifdef GSL_CONST_MKSA_SPEED_OF_LIGHT MAKE_DCONSTANT("CONST_MKSA_SPEED_OF_LIGHT", GSL_CONST_MKSA_SPEED_OF_LIGHT), #endif #ifdef GSL_CONST_MKSA_STANDARD_GAS_VOLUME MAKE_DCONSTANT("CONST_MKSA_STANDARD_GAS_VOLUME", GSL_CONST_MKSA_STANDARD_GAS_VOLUME), #endif #ifdef GSL_CONST_MKSA_STD_ATMOSPHERE MAKE_DCONSTANT("CONST_MKSA_STD_ATMOSPHERE", GSL_CONST_MKSA_STD_ATMOSPHERE), #endif #ifdef GSL_CONST_MKSA_STEFAN_BOLTZMANN_CONSTANT MAKE_DCONSTANT("CONST_MKSA_STEFAN_BOLTZMANN_CONSTANT", GSL_CONST_MKSA_STEFAN_BOLTZMANN_CONSTANT), #endif #ifdef GSL_CONST_MKSA_STILB MAKE_DCONSTANT("CONST_MKSA_STILB", GSL_CONST_MKSA_STILB), #endif #ifdef GSL_CONST_MKSA_STOKES MAKE_DCONSTANT("CONST_MKSA_STOKES", GSL_CONST_MKSA_STOKES), #endif #ifdef GSL_CONST_MKSA_TABLESPOON MAKE_DCONSTANT("CONST_MKSA_TABLESPOON", GSL_CONST_MKSA_TABLESPOON), #endif #ifdef GSL_CONST_MKSA_TEASPOON MAKE_DCONSTANT("CONST_MKSA_TEASPOON", GSL_CONST_MKSA_TEASPOON), #endif #ifdef GSL_CONST_MKSA_TEXPOINT MAKE_DCONSTANT("CONST_MKSA_TEXPOINT", GSL_CONST_MKSA_TEXPOINT), #endif #ifdef GSL_CONST_MKSA_THERM MAKE_DCONSTANT("CONST_MKSA_THERM", GSL_CONST_MKSA_THERM), #endif #ifdef GSL_CONST_MKSA_THOMSON_CROSS_SECTION MAKE_DCONSTANT("CONST_MKSA_THOMSON_CROSS_SECTION", GSL_CONST_MKSA_THOMSON_CROSS_SECTION), #endif #ifdef GSL_CONST_MKSA_TON MAKE_DCONSTANT("CONST_MKSA_TON", GSL_CONST_MKSA_TON), #endif #ifdef GSL_CONST_MKSA_TORR MAKE_DCONSTANT("CONST_MKSA_TORR", GSL_CONST_MKSA_TORR), #endif #ifdef GSL_CONST_MKSA_TROY_OUNCE MAKE_DCONSTANT("CONST_MKSA_TROY_OUNCE", GSL_CONST_MKSA_TROY_OUNCE), #endif #ifdef GSL_CONST_MKSA_UK_GALLON MAKE_DCONSTANT("CONST_MKSA_UK_GALLON", GSL_CONST_MKSA_UK_GALLON), #endif #ifdef GSL_CONST_MKSA_UK_TON MAKE_DCONSTANT("CONST_MKSA_UK_TON", GSL_CONST_MKSA_UK_TON), #endif #ifdef GSL_CONST_MKSA_UNIFIED_ATOMIC_MASS MAKE_DCONSTANT("CONST_MKSA_UNIFIED_ATOMIC_MASS", GSL_CONST_MKSA_UNIFIED_ATOMIC_MASS), #endif #ifdef GSL_CONST_MKSA_US_GALLON MAKE_DCONSTANT("CONST_MKSA_US_GALLON", GSL_CONST_MKSA_US_GALLON), #endif #ifdef GSL_CONST_MKSA_VACUUM_PERMEABILITY MAKE_DCONSTANT("CONST_MKSA_VACUUM_PERMEABILITY", GSL_CONST_MKSA_VACUUM_PERMEABILITY), #endif #ifdef GSL_CONST_MKSA_VACUUM_PERMITTIVITY MAKE_DCONSTANT("CONST_MKSA_VACUUM_PERMITTIVITY", GSL_CONST_MKSA_VACUUM_PERMITTIVITY), #endif #ifdef GSL_CONST_MKSA_WEEK MAKE_DCONSTANT("CONST_MKSA_WEEK", GSL_CONST_MKSA_WEEK), #endif #ifdef GSL_CONST_MKSA_YARD MAKE_DCONSTANT("CONST_MKSA_YARD", GSL_CONST_MKSA_YARD), #endif #ifdef GSL_CONST_MKS_ACRE MAKE_DCONSTANT("CONST_MKS_ACRE", GSL_CONST_MKS_ACRE), #endif #ifdef GSL_CONST_MKS_ANGSTROM MAKE_DCONSTANT("CONST_MKS_ANGSTROM", GSL_CONST_MKS_ANGSTROM), #endif #ifdef GSL_CONST_MKS_ASTRONOMICAL_UNIT MAKE_DCONSTANT("CONST_MKS_ASTRONOMICAL_UNIT", GSL_CONST_MKS_ASTRONOMICAL_UNIT), #endif #ifdef GSL_CONST_MKS_BAR MAKE_DCONSTANT("CONST_MKS_BAR", GSL_CONST_MKS_BAR), #endif #ifdef GSL_CONST_MKS_BARN MAKE_DCONSTANT("CONST_MKS_BARN", GSL_CONST_MKS_BARN), #endif #ifdef GSL_CONST_MKS_BOHR_MAGNETON MAKE_DCONSTANT("CONST_MKS_BOHR_MAGNETON", GSL_CONST_MKS_BOHR_MAGNETON), #endif #ifdef GSL_CONST_MKS_BOHR_RADIUS MAKE_DCONSTANT("CONST_MKS_BOHR_RADIUS", GSL_CONST_MKS_BOHR_RADIUS), #endif #ifdef GSL_CONST_MKS_BOLTZMANN MAKE_DCONSTANT("CONST_MKS_BOLTZMANN", GSL_CONST_MKS_BOLTZMANN), #endif #ifdef GSL_CONST_MKS_BTU MAKE_DCONSTANT("CONST_MKS_BTU", GSL_CONST_MKS_BTU), #endif #ifdef GSL_CONST_MKS_CALORIE MAKE_DCONSTANT("CONST_MKS_CALORIE", GSL_CONST_MKS_CALORIE), #endif #ifdef GSL_CONST_MKS_CANADIAN_GALLON MAKE_DCONSTANT("CONST_MKS_CANADIAN_GALLON", GSL_CONST_MKS_CANADIAN_GALLON), #endif #ifdef GSL_CONST_MKS_CARAT MAKE_DCONSTANT("CONST_MKS_CARAT", GSL_CONST_MKS_CARAT), #endif #ifdef GSL_CONST_MKS_CUP MAKE_DCONSTANT("CONST_MKS_CUP", GSL_CONST_MKS_CUP), #endif #ifdef GSL_CONST_MKS_CURIE MAKE_DCONSTANT("CONST_MKS_CURIE", GSL_CONST_MKS_CURIE), #endif #ifdef GSL_CONST_MKS_DAY MAKE_DCONSTANT("CONST_MKS_DAY", GSL_CONST_MKS_DAY), #endif #ifdef GSL_CONST_MKS_DEBYE MAKE_DCONSTANT("CONST_MKS_DEBYE", GSL_CONST_MKS_DEBYE), #endif #ifdef GSL_CONST_MKS_DYNE MAKE_DCONSTANT("CONST_MKS_DYNE", GSL_CONST_MKS_DYNE), #endif #ifdef GSL_CONST_MKS_ELECTRON_CHARGE MAKE_DCONSTANT("CONST_MKS_ELECTRON_CHARGE", GSL_CONST_MKS_ELECTRON_CHARGE), #endif #ifdef GSL_CONST_MKS_ELECTRON_MAGNETIC_MOMENT MAKE_DCONSTANT("CONST_MKS_ELECTRON_MAGNETIC_MOMENT", GSL_CONST_MKS_ELECTRON_MAGNETIC_MOMENT), #endif #ifdef GSL_CONST_MKS_ELECTRON_VOLT MAKE_DCONSTANT("CONST_MKS_ELECTRON_VOLT", GSL_CONST_MKS_ELECTRON_VOLT), #endif #ifdef GSL_CONST_MKS_ERG MAKE_DCONSTANT("CONST_MKS_ERG", GSL_CONST_MKS_ERG), #endif #ifdef GSL_CONST_MKS_FARADAY MAKE_DCONSTANT("CONST_MKS_FARADAY", GSL_CONST_MKS_FARADAY), #endif #ifdef GSL_CONST_MKS_FATHOM MAKE_DCONSTANT("CONST_MKS_FATHOM", GSL_CONST_MKS_FATHOM), #endif #ifdef GSL_CONST_MKS_FLUID_OUNCE MAKE_DCONSTANT("CONST_MKS_FLUID_OUNCE", GSL_CONST_MKS_FLUID_OUNCE), #endif #ifdef GSL_CONST_MKS_FOOT MAKE_DCONSTANT("CONST_MKS_FOOT", GSL_CONST_MKS_FOOT), #endif #ifdef GSL_CONST_MKS_FOOTCANDLE MAKE_DCONSTANT("CONST_MKS_FOOTCANDLE", GSL_CONST_MKS_FOOTCANDLE), #endif #ifdef GSL_CONST_MKS_FOOTLAMBERT MAKE_DCONSTANT("CONST_MKS_FOOTLAMBERT", GSL_CONST_MKS_FOOTLAMBERT), #endif #ifdef GSL_CONST_MKS_GAUSS MAKE_DCONSTANT("CONST_MKS_GAUSS", GSL_CONST_MKS_GAUSS), #endif #ifdef GSL_CONST_MKS_GRAM_FORCE MAKE_DCONSTANT("CONST_MKS_GRAM_FORCE", GSL_CONST_MKS_GRAM_FORCE), #endif #ifdef GSL_CONST_MKS_GRAVITATIONAL_CONSTANT MAKE_DCONSTANT("CONST_MKS_GRAVITATIONAL_CONSTANT", GSL_CONST_MKS_GRAVITATIONAL_CONSTANT), #endif #ifdef GSL_CONST_MKS_GRAV_ACCEL MAKE_DCONSTANT("CONST_MKS_GRAV_ACCEL", GSL_CONST_MKS_GRAV_ACCEL), #endif #ifdef GSL_CONST_MKS_HECTARE MAKE_DCONSTANT("CONST_MKS_HECTARE", GSL_CONST_MKS_HECTARE), #endif #ifdef GSL_CONST_MKS_HORSEPOWER MAKE_DCONSTANT("CONST_MKS_HORSEPOWER", GSL_CONST_MKS_HORSEPOWER), #endif #ifdef GSL_CONST_MKS_HOUR MAKE_DCONSTANT("CONST_MKS_HOUR", GSL_CONST_MKS_HOUR), #endif #ifdef GSL_CONST_MKS_INCH MAKE_DCONSTANT("CONST_MKS_INCH", GSL_CONST_MKS_INCH), #endif #ifdef GSL_CONST_MKS_INCH_OF_MERCURY MAKE_DCONSTANT("CONST_MKS_INCH_OF_MERCURY", GSL_CONST_MKS_INCH_OF_MERCURY), #endif #ifdef GSL_CONST_MKS_INCH_OF_WATER MAKE_DCONSTANT("CONST_MKS_INCH_OF_WATER", GSL_CONST_MKS_INCH_OF_WATER), #endif #ifdef GSL_CONST_MKS_JOULE MAKE_DCONSTANT("CONST_MKS_JOULE", GSL_CONST_MKS_JOULE), #endif #ifdef GSL_CONST_MKS_KILOMETERS_PER_HOUR MAKE_DCONSTANT("CONST_MKS_KILOMETERS_PER_HOUR", GSL_CONST_MKS_KILOMETERS_PER_HOUR), #endif #ifdef GSL_CONST_MKS_KILOPOUND_FORCE MAKE_DCONSTANT("CONST_MKS_KILOPOUND_FORCE", GSL_CONST_MKS_KILOPOUND_FORCE), #endif #ifdef GSL_CONST_MKS_KNOT MAKE_DCONSTANT("CONST_MKS_KNOT", GSL_CONST_MKS_KNOT), #endif #ifdef GSL_CONST_MKS_LAMBERT MAKE_DCONSTANT("CONST_MKS_LAMBERT", GSL_CONST_MKS_LAMBERT), #endif #ifdef GSL_CONST_MKS_LIGHT_YEAR MAKE_DCONSTANT("CONST_MKS_LIGHT_YEAR", GSL_CONST_MKS_LIGHT_YEAR), #endif #ifdef GSL_CONST_MKS_LITER MAKE_DCONSTANT("CONST_MKS_LITER", GSL_CONST_MKS_LITER), #endif #ifdef GSL_CONST_MKS_LUMEN MAKE_DCONSTANT("CONST_MKS_LUMEN", GSL_CONST_MKS_LUMEN), #endif #ifdef GSL_CONST_MKS_LUX MAKE_DCONSTANT("CONST_MKS_LUX", GSL_CONST_MKS_LUX), #endif #ifdef GSL_CONST_MKS_MASS_ELECTRON MAKE_DCONSTANT("CONST_MKS_MASS_ELECTRON", GSL_CONST_MKS_MASS_ELECTRON), #endif #ifdef GSL_CONST_MKS_MASS_MUON MAKE_DCONSTANT("CONST_MKS_MASS_MUON", GSL_CONST_MKS_MASS_MUON), #endif #ifdef GSL_CONST_MKS_MASS_NEUTRON MAKE_DCONSTANT("CONST_MKS_MASS_NEUTRON", GSL_CONST_MKS_MASS_NEUTRON), #endif #ifdef GSL_CONST_MKS_MASS_PROTON MAKE_DCONSTANT("CONST_MKS_MASS_PROTON", GSL_CONST_MKS_MASS_PROTON), #endif #ifdef GSL_CONST_MKS_METER_OF_MERCURY MAKE_DCONSTANT("CONST_MKS_METER_OF_MERCURY", GSL_CONST_MKS_METER_OF_MERCURY), #endif #ifdef GSL_CONST_MKS_METRIC_TON MAKE_DCONSTANT("CONST_MKS_METRIC_TON", GSL_CONST_MKS_METRIC_TON), #endif #ifdef GSL_CONST_MKS_MICRON MAKE_DCONSTANT("CONST_MKS_MICRON", GSL_CONST_MKS_MICRON), #endif #ifdef GSL_CONST_MKS_MIL MAKE_DCONSTANT("CONST_MKS_MIL", GSL_CONST_MKS_MIL), #endif #ifdef GSL_CONST_MKS_MILE MAKE_DCONSTANT("CONST_MKS_MILE", GSL_CONST_MKS_MILE), #endif #ifdef GSL_CONST_MKS_MILES_PER_HOUR MAKE_DCONSTANT("CONST_MKS_MILES_PER_HOUR", GSL_CONST_MKS_MILES_PER_HOUR), #endif #ifdef GSL_CONST_MKS_MINUTE MAKE_DCONSTANT("CONST_MKS_MINUTE", GSL_CONST_MKS_MINUTE), #endif #ifdef GSL_CONST_MKS_MOLAR_GAS MAKE_DCONSTANT("CONST_MKS_MOLAR_GAS", GSL_CONST_MKS_MOLAR_GAS), #endif #ifdef GSL_CONST_MKS_NAUTICAL_MILE MAKE_DCONSTANT("CONST_MKS_NAUTICAL_MILE", GSL_CONST_MKS_NAUTICAL_MILE), #endif #ifdef GSL_CONST_MKS_NEWTON MAKE_DCONSTANT("CONST_MKS_NEWTON", GSL_CONST_MKS_NEWTON), #endif #ifdef GSL_CONST_MKS_NUCLEAR_MAGNETON MAKE_DCONSTANT("CONST_MKS_NUCLEAR_MAGNETON", GSL_CONST_MKS_NUCLEAR_MAGNETON), #endif #ifdef GSL_CONST_MKS_OUNCE_MASS MAKE_DCONSTANT("CONST_MKS_OUNCE_MASS", GSL_CONST_MKS_OUNCE_MASS), #endif #ifdef GSL_CONST_MKS_PARSEC MAKE_DCONSTANT("CONST_MKS_PARSEC", GSL_CONST_MKS_PARSEC), #endif #ifdef GSL_CONST_MKS_PHOT MAKE_DCONSTANT("CONST_MKS_PHOT", GSL_CONST_MKS_PHOT), #endif #ifdef GSL_CONST_MKS_PINT MAKE_DCONSTANT("CONST_MKS_PINT", GSL_CONST_MKS_PINT), #endif #ifdef GSL_CONST_MKS_PLANCKS_CONSTANT_H MAKE_DCONSTANT("CONST_MKS_PLANCKS_CONSTANT_H", GSL_CONST_MKS_PLANCKS_CONSTANT_H), #endif #ifdef GSL_CONST_MKS_PLANCKS_CONSTANT_HBAR MAKE_DCONSTANT("CONST_MKS_PLANCKS_CONSTANT_HBAR", GSL_CONST_MKS_PLANCKS_CONSTANT_HBAR), #endif #ifdef GSL_CONST_MKS_POINT MAKE_DCONSTANT("CONST_MKS_POINT", GSL_CONST_MKS_POINT), #endif #ifdef GSL_CONST_MKS_POISE MAKE_DCONSTANT("CONST_MKS_POISE", GSL_CONST_MKS_POISE), #endif #ifdef GSL_CONST_MKS_POUNDAL MAKE_DCONSTANT("CONST_MKS_POUNDAL", GSL_CONST_MKS_POUNDAL), #endif #ifdef GSL_CONST_MKS_POUND_FORCE MAKE_DCONSTANT("CONST_MKS_POUND_FORCE", GSL_CONST_MKS_POUND_FORCE), #endif #ifdef GSL_CONST_MKS_POUND_MASS MAKE_DCONSTANT("CONST_MKS_POUND_MASS", GSL_CONST_MKS_POUND_MASS), #endif #ifdef GSL_CONST_MKS_PROTON_MAGNETIC_MOMENT MAKE_DCONSTANT("CONST_MKS_PROTON_MAGNETIC_MOMENT", GSL_CONST_MKS_PROTON_MAGNETIC_MOMENT), #endif #ifdef GSL_CONST_MKS_PSI MAKE_DCONSTANT("CONST_MKS_PSI", GSL_CONST_MKS_PSI), #endif #ifdef GSL_CONST_MKS_QUART MAKE_DCONSTANT("CONST_MKS_QUART", GSL_CONST_MKS_QUART), #endif #ifdef GSL_CONST_MKS_RAD MAKE_DCONSTANT("CONST_MKS_RAD", GSL_CONST_MKS_RAD), #endif #ifdef GSL_CONST_MKS_ROENTGEN MAKE_DCONSTANT("CONST_MKS_ROENTGEN", GSL_CONST_MKS_ROENTGEN), #endif #ifdef GSL_CONST_MKS_RYDBERG MAKE_DCONSTANT("CONST_MKS_RYDBERG", GSL_CONST_MKS_RYDBERG), #endif #ifdef GSL_CONST_MKS_SOLAR_MASS MAKE_DCONSTANT("CONST_MKS_SOLAR_MASS", GSL_CONST_MKS_SOLAR_MASS), #endif #ifdef GSL_CONST_MKS_SPEED_OF_LIGHT MAKE_DCONSTANT("CONST_MKS_SPEED_OF_LIGHT", GSL_CONST_MKS_SPEED_OF_LIGHT), #endif #ifdef GSL_CONST_MKS_STANDARD_GAS_VOLUME MAKE_DCONSTANT("CONST_MKS_STANDARD_GAS_VOLUME", GSL_CONST_MKS_STANDARD_GAS_VOLUME), #endif #ifdef GSL_CONST_MKS_STD_ATMOSPHERE MAKE_DCONSTANT("CONST_MKS_STD_ATMOSPHERE", GSL_CONST_MKS_STD_ATMOSPHERE), #endif #ifdef GSL_CONST_MKS_STEFAN_BOLTZMANN_CONSTANT MAKE_DCONSTANT("CONST_MKS_STEFAN_BOLTZMANN_CONSTANT", GSL_CONST_MKS_STEFAN_BOLTZMANN_CONSTANT), #endif #ifdef GSL_CONST_MKS_STILB MAKE_DCONSTANT("CONST_MKS_STILB", GSL_CONST_MKS_STILB), #endif #ifdef GSL_CONST_MKS_STOKES MAKE_DCONSTANT("CONST_MKS_STOKES", GSL_CONST_MKS_STOKES), #endif #ifdef GSL_CONST_MKS_TABLESPOON MAKE_DCONSTANT("CONST_MKS_TABLESPOON", GSL_CONST_MKS_TABLESPOON), #endif #ifdef GSL_CONST_MKS_TEASPOON MAKE_DCONSTANT("CONST_MKS_TEASPOON", GSL_CONST_MKS_TEASPOON), #endif #ifdef GSL_CONST_MKS_TEXPOINT MAKE_DCONSTANT("CONST_MKS_TEXPOINT", GSL_CONST_MKS_TEXPOINT), #endif #ifdef GSL_CONST_MKS_THERM MAKE_DCONSTANT("CONST_MKS_THERM", GSL_CONST_MKS_THERM), #endif #ifdef GSL_CONST_MKS_THOMSON_CROSS_SECTION MAKE_DCONSTANT("CONST_MKS_THOMSON_CROSS_SECTION", GSL_CONST_MKS_THOMSON_CROSS_SECTION), #endif #ifdef GSL_CONST_MKS_TON MAKE_DCONSTANT("CONST_MKS_TON", GSL_CONST_MKS_TON), #endif #ifdef GSL_CONST_MKS_TORR MAKE_DCONSTANT("CONST_MKS_TORR", GSL_CONST_MKS_TORR), #endif #ifdef GSL_CONST_MKS_TROY_OUNCE MAKE_DCONSTANT("CONST_MKS_TROY_OUNCE", GSL_CONST_MKS_TROY_OUNCE), #endif #ifdef GSL_CONST_MKS_UK_GALLON MAKE_DCONSTANT("CONST_MKS_UK_GALLON", GSL_CONST_MKS_UK_GALLON), #endif #ifdef GSL_CONST_MKS_UK_TON MAKE_DCONSTANT("CONST_MKS_UK_TON", GSL_CONST_MKS_UK_TON), #endif #ifdef GSL_CONST_MKS_UNIFIED_ATOMIC_MASS MAKE_DCONSTANT("CONST_MKS_UNIFIED_ATOMIC_MASS", GSL_CONST_MKS_UNIFIED_ATOMIC_MASS), #endif #ifdef GSL_CONST_MKS_US_GALLON MAKE_DCONSTANT("CONST_MKS_US_GALLON", GSL_CONST_MKS_US_GALLON), #endif #ifdef GSL_CONST_MKS_VACUUM_PERMEABILITY MAKE_DCONSTANT("CONST_MKS_VACUUM_PERMEABILITY", GSL_CONST_MKS_VACUUM_PERMEABILITY), #endif #ifdef GSL_CONST_MKS_VACUUM_PERMITTIVITY MAKE_DCONSTANT("CONST_MKS_VACUUM_PERMITTIVITY", GSL_CONST_MKS_VACUUM_PERMITTIVITY), #endif #ifdef GSL_CONST_MKS_WEEK MAKE_DCONSTANT("CONST_MKS_WEEK", GSL_CONST_MKS_WEEK), #endif #ifdef GSL_CONST_MKS_YARD MAKE_DCONSTANT("CONST_MKS_YARD", GSL_CONST_MKS_YARD), #endif #ifdef GSL_CONST_NUM_ATTO MAKE_DCONSTANT("CONST_NUM_ATTO", GSL_CONST_NUM_ATTO), #endif #ifdef GSL_CONST_NUM_AVOGADRO MAKE_DCONSTANT("CONST_NUM_AVOGADRO", GSL_CONST_NUM_AVOGADRO), #endif #ifdef GSL_CONST_NUM_EXA MAKE_DCONSTANT("CONST_NUM_EXA", GSL_CONST_NUM_EXA), #endif #ifdef GSL_CONST_NUM_FEMTO MAKE_DCONSTANT("CONST_NUM_FEMTO", GSL_CONST_NUM_FEMTO), #endif #ifdef GSL_CONST_NUM_FINE_STRUCTURE MAKE_DCONSTANT("CONST_NUM_FINE_STRUCTURE", GSL_CONST_NUM_FINE_STRUCTURE), #endif #ifdef GSL_CONST_NUM_GIGA MAKE_DCONSTANT("CONST_NUM_GIGA", GSL_CONST_NUM_GIGA), #endif #ifdef GSL_CONST_NUM_KILO MAKE_DCONSTANT("CONST_NUM_KILO", GSL_CONST_NUM_KILO), #endif #ifdef GSL_CONST_NUM_MEGA MAKE_DCONSTANT("CONST_NUM_MEGA", GSL_CONST_NUM_MEGA), #endif #ifdef GSL_CONST_NUM_MICRO MAKE_DCONSTANT("CONST_NUM_MICRO", GSL_CONST_NUM_MICRO), #endif #ifdef GSL_CONST_NUM_MILLI MAKE_DCONSTANT("CONST_NUM_MILLI", GSL_CONST_NUM_MILLI), #endif #ifdef GSL_CONST_NUM_NANO MAKE_DCONSTANT("CONST_NUM_NANO", GSL_CONST_NUM_NANO), #endif #ifdef GSL_CONST_NUM_PETA MAKE_DCONSTANT("CONST_NUM_PETA", GSL_CONST_NUM_PETA), #endif #ifdef GSL_CONST_NUM_PICO MAKE_DCONSTANT("CONST_NUM_PICO", GSL_CONST_NUM_PICO), #endif #ifdef GSL_CONST_NUM_TERA MAKE_DCONSTANT("CONST_NUM_TERA", GSL_CONST_NUM_TERA), #endif #ifdef GSL_CONST_NUM_YOCTO MAKE_DCONSTANT("CONST_NUM_YOCTO", GSL_CONST_NUM_YOCTO), #endif #ifdef GSL_CONST_NUM_YOTTA MAKE_DCONSTANT("CONST_NUM_YOTTA", GSL_CONST_NUM_YOTTA), #endif #ifdef GSL_CONST_NUM_ZEPTO MAKE_DCONSTANT("CONST_NUM_ZEPTO", GSL_CONST_NUM_ZEPTO), #endif #ifdef GSL_CONST_NUM_ZETTA MAKE_DCONSTANT("CONST_NUM_ZETTA", GSL_CONST_NUM_ZETTA), #endif SLANG_END_DCONST_TABLE }; #endif int init_gslconst_module_ns (char *ns_name) { SLang_NameSpace_Type *ns = SLns_create_namespace (ns_name); if (ns == NULL) return -1; if ( (-1 == SLns_add_intrin_var_table (ns, Module_Variables, NULL)) #ifdef MODULE_HAS_INTRINSICS || (-1 == SLns_add_intrin_fun_table (ns, Module_Intrinsics, NULL)) #endif || (-1 == SLns_add_iconstant_table (ns, Module_IConstants, NULL)) #ifdef MODULE_HAS_DCONSTANTS || (-1 == SLns_add_dconstant_table (ns, Module_DConstants, NULL)) #endif ) return -1; return 0; } /* This function is optional */ void deinit_gslconst_module (void) { } slgsl-pre0.10.0-7/src/gslrand.sl0000644000175000000620000000014312105106006015153 0ustar johnstaffrequire ("gslcore"); _gslcore_import_module ("gslrand", current_namespace()); provide ("gslrand"); slgsl-pre0.10.0-7/src/gsldwt.sl0000644000175000000620000000014112320462336015035 0ustar johnstaffrequire ("gslcore"); _gslcore_import_module ("gsldwt", current_namespace()); provide ("gsldwt"); slgsl-pre0.10.0-7/src/Makefile.in0000644000175000000620000001501215012561735015245 0ustar johnstaff# -*- sh -*----------------------------------------------------------------- # List of modules and associated .sl files to install #--------------------------------------------------------------------------- MODULES = gsl-module.so OFILES = gsl-module.o gslinterp-module.o gslrand-module.o \ gslfft-module.o gslmatrix-module.o gslcdf-module.o gslconst-module.o \ gslsf-module.o gsldwt-module.o gslinteg-module.o # SL_FILES = gsl.sl gslcore.sl gslsf.sl gslconst.sl gslinterp.sl gslrand.sl \ gslcdf.sl gslfft.sl gslmatrix.sl gsldwt.sl gslinteg.sl HLP_FILES = ../doc/help/slgsl.hlp DOC_FILES = ../doc/index.html ../COPYRIGHT ../ChangeLog MODULE_VERSION = `./mkversion.sh` #--------------------------------------------------------------------------- # Installation Directories #--------------------------------------------------------------------------- prefix = @prefix@ exec_prefix = @exec_prefix@ datarootdir = @datarootdir@ MODULE_INSTALL_DIR = @MODULE_INSTALL_DIR@ SL_FILES_INSTALL_DIR = @SL_FILES_INSTALL_DIR@ HLP_FILES_INSTALL_DIR = $(SL_FILES_INSTALL_DIR)/help DOC_FILES_INSTALL_DIR = $(datarootdir)/doc/slang-gsl #--------------------------------------------------------------------------- # C Compiler to create a shared library #--------------------------------------------------------------------------- CC = @CC@ CFLAGS = @CFLAGS@ @SLANG_DLL_CFLAGS@ LDFLAGS = @LDFLAGS@ CC_SHARED = @CC_SHARED@ #--------------------------------------------------------------------------- # Location of the S-Lang library and its include file #--------------------------------------------------------------------------- SLANG_INC = @SLANG_INC@ SLANG_LIB = @SLANG_LIB@ -lslang #--------------------------------------------------------------------------- # Additional Libraries required by the module #--------------------------------------------------------------------------- GSL_INC = @GSL_INC@ GSL_LIB = @GSL_LIB@ -lgsl -lgslcblas MODULE_LIBS = $(GSL_LIB) RPATH = @RPATH@ #--------------------------------------------------------------------------- # Misc Programs required for installation #--------------------------------------------------------------------------- INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_MODULE = @INSTALL_MODULE@ MKINSDIR = ../autoconf/mkinsdir.sh RM = rm -f LN = ln -s #--------------------------------------------------------------------------- # DESTDIR is designed to facilitate making packages. Normally it is empty #--------------------------------------------------------------------------- DESTDIR = DEST_MODULE_INSTALL_DIR = $(DESTDIR)$(MODULE_INSTALL_DIR) DEST_SL_FILES_INSTALL_DIR = $(DESTDIR)$(SL_FILES_INSTALL_DIR) DEST_HLP_FILES_INSTALL_DIR = $(DESTDIR)$(HLP_FILES_INSTALL_DIR) DEST_DOC_FILES_INSTALL_DIR = $(DESTDIR)$(DOC_FILES_INSTALL_DIR) #--------------------------------------------------------------------------- UPDATE_VERSION_SCRIPT = $(HOME)/bin/update_changes_version #--------------------------------------------------------------------------- LIBS = $(SLANG_LIB) $(MODULE_LIBS) $(RPATH) $(DL_LIB) -lm INCS = $(SLANG_INC) $(GSL_INC) DEPS = config.h version.h slgsl.h # COMPILE = $(CC_SHARED) -c $(INCS) # all: $(MODULES) config.h: sysconf.h gslvers.out cp sysconf.h config.h cat gslvers.out >> config.h gslvers.out: gslvers ./gslvers > gslvers.out gslvers: gslvers.c $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(INCS) gslvers.c -o gslvers $(LIBS) #--------------------------------------------------------------------------- # Put Rules to create the modules here #--------------------------------------------------------------------------- gsl-module.so: $(OFILES) $(CC_SHARED) $(LDFLAGS) $(OFILES) -o gsl-module.so $(LIBS) gsl-module.o: gsl-module.c $(DEPS) $(COMPILE) gsl-module.c gslconst-module.o: gslconst-module.c $(DEPS) $(COMPILE) gslconst-module.c gslsf-module.o: gslsf-module.c $(DEPS) $(COMPILE) gslsf-module.c gslinterp-module.o: gslinterp-module.c $(DEPS) $(COMPILE) gslinterp-module.c gslrand-module.o: gslrand-module.c $(DEPS) $(COMPILE) gslrand-module.c gslcdf-module.o: gslcdf-module.c $(DEPS) $(COMPILE) gslcdf-module.c gslfft-module.o: gslfft-module.c $(DEPS) $(COMPILE) gslfft-module.c gslmatrix-module.o: gslmatrix-module.c $(DEPS) $(COMPILE) gslmatrix-module.c gsldwt-module.o: gsldwt-module.c $(DEPS) $(COMPILE) gsldwt-module.c gslinteg-module.o: gslinteg-module.c $(DEPS) $(COMPILE) gslinteg-module.c version.h: ../changes.txt if [ -x $(UPDATE_VERSION_SCRIPT) ]; then \ $(UPDATE_VERSION_SCRIPT) ../changes.txt ./version.h; \ fi #--------------------------------------------------------------------------- # Regression tests #--------------------------------------------------------------------------- check: @failed=0; \ for X in tests/test_*.sl; \ do \ slsh $$X || failed=1; \ done; \ exit $$failed #--------------------------------------------------------------------------- # Installation Rules #--------------------------------------------------------------------------- install-directories-stamp: install_directories touch install-directories-stamp install_directories: $(MKINSDIR) $(DEST_MODULE_INSTALL_DIR) $(MKINSDIR) $(DEST_SL_FILES_INSTALL_DIR) $(MKINSDIR) $(DEST_HLP_FILES_INSTALL_DIR) $(MKINSDIR) $(DEST_DOC_FILES_INSTALL_DIR) install_modules: install-directories-stamp @for X in $(MODULES); \ do \ Y=$$X.$(MODULE_VERSION); \ YDEST=$(DEST_MODULE_INSTALL_DIR)/$$Y; \ echo $(INSTALL_MODULE) $$X $$YDEST; \ $(INSTALL_MODULE) $$X $$YDEST; \ if [ "$$?" != "0" ]; then \ exit 1; \ fi; \ $(RM) $(DEST_MODULE_INSTALL_DIR)/$$X; \ $(LN) $$Y $(DEST_MODULE_INSTALL_DIR)/$$X; \ done install_slfiles: install-directories-stamp @for X in $(SL_FILES); \ do \ echo $(INSTALL_DATA) $$X $(DEST_SL_FILES_INSTALL_DIR); \ $(INSTALL_DATA) $$X $(DEST_SL_FILES_INSTALL_DIR); \ if [ "$$?" != "0" ]; then \ exit 1; \ fi; \ done install_hlpfiles: install-directories-stamp @for X in $(HLP_FILES); \ do \ echo $(INSTALL_DATA) $$X $(DEST_HLP_FILES_INSTALL_DIR); \ $(INSTALL_DATA) $$X $(DEST_HLP_FILES_INSTALL_DIR); \ if [ "$$?" != "0" ]; then \ exit 1; \ fi; \ done install_docfiles: install-directories-stamp @for X in $(DOC_FILES); \ do \ echo $(INSTALL_DATA) $$X $(DEST_DOC_FILES_INSTALL_DIR); \ $(INSTALL_DATA) $$X $(DEST_DOC_FILES_INSTALL_DIR); \ if [ "$$?" != "0" ]; then \ exit 1; \ fi; \ done install: all install_modules install_slfiles \ install_hlpfiles install_docfiles clean: -/bin/rm -f $(MODULES) $(OFILES) *~ \#* gslvers gslvers.out config.h -/bin/rm -f install-directories-stamp distclean: clean -/bin/rm -f sysconf.h Makefile config.h slgsl-pre0.10.0-7/src/gslinteg.sl0000644000175000000620000000014514001614376015352 0ustar johnstaffrequire ("gslcore"); _gslcore_import_module ("gslinteg", current_namespace()); provide ("gslinteg"); slgsl-pre0.10.0-7/src/gslrand-module.c0000644000175000000620000006742313057673774016314 0ustar johnstaff/* -*- mode: C; mode: fold; -*- */ /* Copyright (c) 2004, 2005 Massachusetts Institute of Technology This software was developed by the MIT Center for Space Research under contract SV1-61010 from the Smithsonian Institution. Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in the supporting documentation, and that the name of the Massachusetts Institute of Technology not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The Massachusetts Institute of Technology makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. THE MASSACHUSETTS INSTITUTE OF TECHNOLOGY DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE MASSACHUSETTS INSTITUTE OF TECHNOLOGY BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* Author: John E. Davis (jed@jedsoft.org) */ #include #include #include #include #include #include #include "slgsl.h" #include "version.h" #ifdef __cplusplus extern "C" { #endif /* SLANG_MODULE(gslrand); */ #ifdef __cplusplus } #endif #if SLANG_VERSION < 20000 # define POP_DOUBLE SLang_pop_double #else # define POP_DOUBLE(x,y,z) SLang_pop_double(x) #endif static int Rand_Type_Id = -1; static const gsl_rng_type **Available_Generators; static const gsl_rng_type **get_available_generators (void) { if (Available_Generators == NULL) { Available_Generators = gsl_rng_types_setup (); if (Available_Generators == NULL) { SLang_verror (SL_INTRINSIC_ERROR, "No random number generators are available"); return NULL; } } return Available_Generators; } static void rng_get_rng_types (void) { SLang_Array_Type *at; const gsl_rng_type **list; int i, num; char **names; list = get_available_generators (); if (list == NULL) return; num = 0; while (list[num] != NULL) num++; if (NULL == (at = SLang_create_array (SLANG_STRING_TYPE, 1, NULL, &num, 1))) return; names = (char **) at->data; for (i = 0; i < num; i++) { const char *name = (char *) list[i]->name; if (name == NULL) name = ""; if (NULL == (names[i] = SLang_create_slstring (name))) { SLang_free_array (at); return; } } (void) SLang_push_array (at, 1); } typedef struct { const gsl_rng_type *gen_type; const gsl_rng *gen; } Rand_Type; static void free_rand_type (Rand_Type *r) { if (r == NULL) return; if (r->gen != NULL) gsl_rng_free ((gsl_rng *) r->gen); SLfree ((char *)r); } static Rand_Type *alloc_rand_type (const char *name) { const gsl_rng_type **types, *g; Rand_Type *r; types = get_available_generators (); if (types == NULL) return NULL; if (name == NULL) g = gsl_rng_default; else while (1) { g = *types++; if (g == NULL) { SLang_verror (SL_NOT_IMPLEMENTED, "Random number generator %s is not supported. Check spelling\n", name); return NULL; } if (0 == strcmp (name, g->name)) break; } if (NULL == (r = (Rand_Type *)SLmalloc (sizeof (Rand_Type)))) return NULL; memset ((char *) r, 0, sizeof (Rand_Type)); r->gen_type = g; if (NULL == (r->gen = gsl_rng_alloc (g))) { free_rand_type (r); return NULL; } return r; } static Rand_Type *Default_Generator; static Rand_Type *get_default_generator (void) { if (Default_Generator == NULL) Default_Generator = alloc_rand_type (NULL); return Default_Generator; } /* intrinsics here */ static void set_default_generator (char *name) { if (Default_Generator != NULL) free_rand_type (Default_Generator); Default_Generator = alloc_rand_type (name); } static Rand_Type *pop_rand_type (SLang_MMT_Type **mmtp) { SLang_MMT_Type *mmt; Rand_Type *r; if (NULL == (mmt = SLang_pop_mmt (Rand_Type_Id))) { *mmtp = NULL; return NULL; } if (NULL == (r = (Rand_Type *) SLang_object_from_mmt (mmt))) { SLang_free_mmt (mmt); *mmtp = NULL; return NULL; } *mmtp = mmt; return r; } static int pop_n_doubles (int n, double *d) { double *dmax = d + n; while (dmax > d) { dmax--; if (-1 == POP_DOUBLE (dmax, NULL, NULL)) return -1; } return 0; } /* This function will is used in situations where both the integer and the * generator are optional, but the N doubles are required, e.g., * * x = f ({d}); nargs = nds * x[] = ran_ugaussian ({d},n); nargs = nds+1 * x = ran_ugaussian (gen,{d}); nargs = nds+1 * x[] = ran_ugaussian (gen, {d}, n); nargs = nds+2 * * If the generator was not given, then the default will be used. * It is up to the caller to ensure that nds <= nargs <= nds+2 */ static Rand_Type *pop_rand_nds_and_int (int nargs, int nds, SLang_MMT_Type **mmtp, double *ds, int *ip) { SLang_MMT_Type *mmt; Rand_Type *r; *mmtp = NULL; *ip = -1; if (nargs == nds + 2) { if (-1 == SLang_pop_integer (ip)) return NULL; if (-1 == pop_n_doubles (nds, ds)) return NULL; if (NULL != (r = pop_rand_type (&mmt))) *mmtp = mmt; return r; } if (nargs == nds) { if (-1 == pop_n_doubles (nds, ds)) return NULL; return get_default_generator (); } /* nargs = nds + 1 : * There are two possibilities: * case 1: rng d1 d2 ... dn * case 2: d1 d2 ... dn i */ if (-1 == SLroll_stack (-nargs)) return NULL; r = NULL; mmt = NULL; if (Rand_Type_Id == SLang_peek_at_stack ()) { /* case 1 */ if (NULL == (r = pop_rand_type (&mmt))) return NULL; *mmtp = mmt; if (-1 == pop_n_doubles (nds, ds)) { SLang_free_mmt (mmt); *mmtp = NULL; return NULL; } return r; } /* case 2 */ *mmtp = NULL; if (-1 == SLroll_stack (nargs)) return NULL; if (-1 == SLang_pop_integer (ip)) return NULL; if (-1 == pop_n_doubles (nds, ds)) { SLang_free_mmt (mmt); return NULL; } return get_default_generator (); } static void rng_alloc (void) { Rand_Type *r; SLang_MMT_Type *mmt; char *name; if (SLang_Num_Function_Args == 1) { if (-1 == SLang_pop_slstring (&name)) return; } else name = NULL; r = alloc_rand_type (name); SLang_free_slstring (name); /* NULL ok */ if (r == NULL) return; if (NULL == (mmt = SLang_create_mmt (Rand_Type_Id, (VOID_STAR) r))) { free_rand_type (r); return; } /* Unfortunately, SLang_create_mmt sets the ref_count to 0, which means * that no free is necessary if the push is successful. This is an * _undesirable_ slang feature that I ought to correct for slang 2. */ if (0 == SLang_push_mmt (mmt)) return; SLang_free_mmt (mmt); } static void rng_set (void) { unsigned long seed; SLang_MMT_Type *mmt = NULL; Rand_Type *r; if ((SLang_Num_Function_Args < 1) || (SLang_Num_Function_Args > 2)) { SLang_verror (SL_USAGE_ERROR, "Usage: y = rng_set ([GSL_Rng_Type gen,] ULong_Type seed)"); return; } if (-1 == SLang_pop_ulong (&seed)) return; if (SLang_Num_Function_Args == 1) r = get_default_generator (); else r = pop_rand_type (&mmt); if (r == NULL) return; gsl_rng_set (r->gen, seed); if (mmt != NULL) SLang_free_mmt (mmt); } static void do_rng_d (double (*f)(const gsl_rng *), const gsl_rng *r, int num) { SLang_Array_Type *out; unsigned int i, n; double *yp; if (num < 0) { (void) SLang_push_double ((*f)(r)); return; } if (NULL == (out = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, &num, 1))) return; yp = (double *) out->data; n = (unsigned int) num; for (i = 0; i < n; i++) yp[i] = (*f)(r); (void) SLang_push_array (out, 1); } static void do_rng_d_fun (const char *fun, double (*f)(const gsl_rng *)) { SLang_MMT_Type *mmt; Rand_Type *r; int n = -1; if (SLang_Num_Function_Args > 2) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s([GSL_Rng_Type] [,num])", fun); return; } if (NULL == (r = pop_rand_nds_and_int (SLang_Num_Function_Args, 0, &mmt, NULL, &n))) return; slgsl_reset_errors (); do_rng_d (f, r->gen, n); slgsl_check_errors (fun); if (mmt != NULL) SLang_free_mmt (mmt); } static void do_rng_ul (unsigned long (*f)(const gsl_rng *), const gsl_rng *r, int num) { SLang_Array_Type *out; unsigned int i, n; unsigned long *yp; if (num < 0) { (void) SLang_push_ulong ((*f)(r)); return; } if (NULL == (out = SLang_create_array (SLANG_ULONG_TYPE, 0, NULL, &num, 1))) return; yp = (unsigned long *) out->data; n = (unsigned int) num; for (i = 0; i < n; i++) yp[i] = (*f)(r); (void) SLang_push_array (out, 1); } static void do_rng_ulong_fun (const char *fun, unsigned long (*f)(const gsl_rng *)) { SLang_MMT_Type *mmt; Rand_Type *r; int n; if (SLang_Num_Function_Args > 2) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s([GSL_Rng_Type] [,num])", fun); return; } if (NULL == (r = pop_rand_nds_and_int (SLang_Num_Function_Args, 0, &mmt, NULL, &n))) return; slgsl_reset_errors (); do_rng_ul (f, r->gen, n); slgsl_check_errors (fun); if (mmt != NULL) SLang_free_mmt (mmt); } static void do_simple_rng_ulong_fun (const char *fun, unsigned long (*f)(const gsl_rng *)) { SLang_MMT_Type *mmt = NULL; Rand_Type *r; if ((SLang_Num_Function_Args > 1) || (SLang_Num_Function_Args < 0)) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s([GSL_Rng_Type])", fun); return; } if (SLang_Num_Function_Args == 1) r = pop_rand_type (&mmt); else r = get_default_generator (); slgsl_reset_errors (); (void) SLang_push_ulong ((*f) (r->gen)); slgsl_check_errors (fun); if (mmt != NULL) SLang_free_mmt (mmt); } static void rng_max (void) { do_simple_rng_ulong_fun ("rng_max", &gsl_rng_max); } static void rng_min (void) { do_simple_rng_ulong_fun ("rng_min", &gsl_rng_min); } static void rng_get (void) { do_rng_ulong_fun ("rng_get", &gsl_rng_get); } static void do_ran_dist_d (double (*f)(const gsl_rng *, double), const gsl_rng *r, double a, int num) { SLang_Array_Type *out; unsigned int i, n; double *yp; if (num < 0) { (void) SLang_push_double ((*f)(r, a)); return; } if (NULL == (out = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, &num, 1))) return; yp = (double *) out->data; n = (unsigned int) num; for (i = 0; i < n; i++) yp[i] = (*f)(r,a); (void) SLang_push_array (out, 1); } static void do_ran_dist_dd (double (*f)(const gsl_rng *, double, double), const gsl_rng *r, double a, double b, int num) { SLang_Array_Type *out; unsigned int i, n; double *yp; if (num < 0) { (void) SLang_push_double ((*f)(r, a, b)); return; } if (NULL == (out = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, &num, 1))) return; yp = (double *) out->data; n = (unsigned int) num; for (i = 0; i < n; i++) yp[i] = (*f)(r,a,b); (void) SLang_push_array (out, 1); } static void do_ran_dist_d_fun (const char *fun, double (*f)(const gsl_rng *,double)) { SLang_MMT_Type *mmt; Rand_Type *r; double a; int n; if ((SLang_Num_Function_Args < 1) || (SLang_Num_Function_Args > 3)) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s([GSL_Rng_Type,] double [,num])", fun); return; } if (NULL == (r = pop_rand_nds_and_int (SLang_Num_Function_Args, 1, &mmt, &a, &n))) return; slgsl_reset_errors (); do_ran_dist_d (f, r->gen, a, n); slgsl_check_errors (fun); if (mmt != NULL) SLang_free_mmt (mmt); } static void do_ran_dist_dd_fun (const char *fun, double (*f)(const gsl_rng *,double, double)) { SLang_MMT_Type *mmt; Rand_Type *r; double ds[2]; int n; if ((SLang_Num_Function_Args < 2) || (SLang_Num_Function_Args > 4)) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s([GSL_Rng_Type,] double, double [,num])", fun); return; } if (NULL == (r = pop_rand_nds_and_int (SLang_Num_Function_Args, 2, &mmt, ds, &n))) return; slgsl_reset_errors (); do_ran_dist_dd (f, r->gen, ds[0], ds[1], n); slgsl_check_errors (fun); if (mmt != NULL) SLang_free_mmt (mmt); } static void do_u_ran_dist_d (unsigned int (*f)(const gsl_rng *, double), const gsl_rng *r, double a, int num) { SLang_Array_Type *out; unsigned int i, n; unsigned int *yp; if (num < 0) { (void) SLang_push_uinteger ((*f)(r, a)); return; } if (NULL == (out = SLang_create_array (SLANG_UINT_TYPE, 0, NULL, &num, 1))) return; yp = (unsigned int *) out->data; n = (unsigned int) num; for (i = 0; i < n; i++) yp[i] = (*f)(r,a); (void) SLang_push_array (out, 1); } static void do_u_ran_dist_dd (unsigned int (*f)(const gsl_rng *, double, double), const gsl_rng *r, double a, double b, int num) { SLang_Array_Type *out; unsigned int i, n; unsigned int *yp; if (num < 0) { (void) SLang_push_uinteger ((*f)(r, a, b)); return; } if (NULL == (out = SLang_create_array (SLANG_UINT_TYPE, 0, NULL, &num, 1))) return; yp = (unsigned int *) out->data; n = (unsigned int) num; for (i = 0; i < n; i++) yp[i] = (*f)(r,a,b); (void) SLang_push_array (out, 1); } static void do_u_ran_dist_d_fun (const char *fun, unsigned int (*f)(const gsl_rng *,double)) { SLang_MMT_Type *mmt; Rand_Type *r; double a; int n; if ((SLang_Num_Function_Args < 1) || (SLang_Num_Function_Args > 3)) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s([GSL_Rng_Type,] double [,num])", fun); return; } if (NULL == (r = pop_rand_nds_and_int (SLang_Num_Function_Args, 1, &mmt, &a, &n))) return; slgsl_reset_errors (); do_u_ran_dist_d (f, r->gen, a, n); slgsl_check_errors (fun); if (mmt != NULL) SLang_free_mmt (mmt); } static void do_u_ran_dist_dd_fun (const char *fun, unsigned int (*f)(const gsl_rng *,double,double)) { SLang_MMT_Type *mmt; Rand_Type *r; double ds[2]; int n; if ((SLang_Num_Function_Args < 2) || (SLang_Num_Function_Args > 4)) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s([GSL_Rng_Type,] double, double [,num])", fun); return; } if (NULL == (r = pop_rand_nds_and_int (SLang_Num_Function_Args, 2, &mmt, ds, &n))) return; slgsl_reset_errors (); do_u_ran_dist_dd (f, r->gen, ds[0], ds[1], n); slgsl_check_errors (fun); if (mmt != NULL) SLang_free_mmt (mmt); } #define USE_RAN_BINOMIAL #ifdef USE_RAN_BINOMIAL static unsigned int u_dd_gsl_ran_binomial (const gsl_rng *r, double p, double n) { return gsl_ran_binomial (r, p, (unsigned int) n); } #endif #if 0 static double d_d_gsl_ran_gamma_int (const gsl_rng *r, double a) { return gsl_ran_gamma_int (r, (unsigned int) a); } static double d_dd_gsl_ran_pascal (const gsl_rng *r, double p, double n) { return gsl_ran_pascal (r, p, (unsigned int) n); } #endif #define SLF(f) f##_intrin #define D_F(f,n) \ static void SLF(f) (void) { do_rng_d_fun (n,f); } #define D_FD(f,n) \ static void SLF(f) (void) { do_ran_dist_d_fun (n,f); } #define D_FDD(f,n) \ static void SLF(f) (void) { do_ran_dist_dd_fun (n,f); } #define U_FD(f,n) \ static void SLF(f) (void) { do_u_ran_dist_d_fun (n,f); } #define U_FDD(f,n) \ static void SLF(f) (void) { do_u_ran_dist_dd_fun (n,f); } D_F(gsl_rng_uniform, "rng_uniform") D_F(gsl_rng_uniform_pos, "rng_uniform_pos") D_F(gsl_ran_ugaussian, "ran_ugaussian") D_F(gsl_ran_ugaussian_ratio_method, "ran_ugaussian_ratio_method") D_F(gsl_ran_landau, "ran_landau") D_FD(gsl_ran_cauchy,"ran_cauchy") D_FD(gsl_ran_chisq,"ran_chisq") D_FD(gsl_ran_exponential,"ran_exponential") D_FD(gsl_ran_gaussian,"ran_gaussian") D_FD(gsl_ran_gaussian_ratio_method,"ran_gaussian_ratio_method") D_FD(gsl_ran_laplace,"ran_laplace") D_FD(gsl_ran_logistic,"ran_logistic") D_FD(gsl_ran_rayleigh,"ran_rayleigh") D_FD(gsl_ran_tdist,"ran_tdist") D_FD(gsl_ran_ugaussian_tail,"ran_ugaussian_tail") /* D_FD(d_d_gsl_ran_gamma_int, "ran_gamma_int") */ D_FDD(gsl_ran_beta,"ran_beta") D_FDD(gsl_ran_erlang,"ran_erlang") D_FDD(gsl_ran_exppow,"ran_exppow") D_FDD(gsl_ran_fdist,"ran_fdist") D_FDD(gsl_ran_flat,"ran_flat") D_FDD(gsl_ran_gamma,"ran_gamma") D_FDD(gsl_ran_gaussian_tail,"ran_gaussian_tail") D_FDD(gsl_ran_gumbel1,"ran_gumbel1") D_FDD(gsl_ran_gumbel2,"ran_gumbel2") D_FDD(gsl_ran_levy,"ran_levy") D_FDD(gsl_ran_lognormal,"ran_lognormal") D_FDD(gsl_ran_pareto,"ran_pareto") D_FDD(gsl_ran_rayleigh_tail,"ran_rayleigh_tail") D_FDD(gsl_ran_weibull,"ran_weibull") /* D_FDD(d_dd_gsl_ran_pascal, "ran_pascal") */ U_FD(gsl_ran_bernoulli, "ran_bernoulli") U_FD(gsl_ran_geometric, "ran_geometric") U_FD(gsl_ran_logarithmic, "ran_logarithmic") U_FD(gsl_ran_poisson, "ran_poisson") U_FDD(gsl_ran_negative_binomial,"ran_negative_binomial") #ifdef USE_RAN_BINOMIAL U_FDD(u_dd_gsl_ran_binomial,"ran_binomial") #endif #if 0 ; /* make indentation work again */ #endif /* The pdf functions */ #define PDF_D_FD(f,n) \ static void SLF(f) (void) { slgsl_do_d_d_fun (n,f); } #define PDF_D_FDD(f,n) \ static void SLF(f) (void) { slgsl_do_d_dd_fun (n,f); } #define PDF_D_FDDD(f,n) \ static void SLF(f) (void) { slgsl_do_d_ddd_fun (n,f); } #define PDF_D_FDDDD(f,n) \ static void SLF(f) (void) { slgsl_do_d_dddd_fun (n,f); } #define PDF_D_UD(f,n) \ static void SLF(f) (void) { not_implemented (n); } #define PDF_D_UDD(f) \ static void SLF(f) (void) { not_implemented (n); } #define PDF_D_UDU(f) \ static void SLF(f) (void) { not_implemented (n); } #define PDF_D_UUUU(f) \ static void SLF(f) (void) { not_implemented (n); } /* PDF_D_FUD(gsl_ran_bernoulli_pdf, "bernoulli_pdf") */ PDF_D_FDDD(gsl_ran_beta_pdf, "beta_pdf") #ifdef USE_RAN_BINOMIAL /* PDF_D_FUDU(gsl_ran_binomial_pdf, "binomial_pdf") */ #endif PDF_D_FDD(gsl_ran_exponential_pdf, "exponential_pdf") PDF_D_FDDD(gsl_ran_exppow_pdf, "exppow_pdf") PDF_D_FDD(gsl_ran_cauchy_pdf, "cauchy_pdf") PDF_D_FDD(gsl_ran_chisq_pdf, "chisq_pdf") /* dirichlet_pdf */ PDF_D_FDDD(gsl_ran_erlang_pdf, "erlang_pdf") PDF_D_FDDD(gsl_ran_fdist_pdf, "fdist_pdf") PDF_D_FDDD(gsl_ran_flat_pdf, "flat_pdf") PDF_D_FDDD(gsl_ran_gamma_pdf, "gamma_pdf") PDF_D_FDD(gsl_ran_gaussian_pdf, "gaussian_pdf") PDF_D_FD(gsl_ran_ugaussian_pdf, "ugaussian_pdf") PDF_D_FDDD(gsl_ran_gaussian_tail_pdf, "gaussian_tail_pdf") PDF_D_FDD(gsl_ran_ugaussian_tail_pdf, "ugaussian_tail_pdf") /* PDF_D_FDDDDD(gsl_ran_bivariate_gaussian_pdf, "bivariate_gaussian_pdf") */ PDF_D_FD(gsl_ran_landau_pdf, "landau_pdf") /* PDF_D_UD(gsl_ran_geometric_pdf, "geometric_pdf") */ /* PDF_D_UUUU(gsl_ran_hypergeometric_pdf, "hypergeometric_pdf") */ PDF_D_FDDD(gsl_ran_gumbel1_pdf, "gumbel1_pdf") PDF_D_FDDD(gsl_ran_gumbel2_pdf, "gumbel2_pdf") PDF_D_FDD(gsl_ran_logistic_pdf, "logistic_pdf") PDF_D_FDDD(gsl_ran_lognormal_pdf, "lognormal_pdf") /* PDF_D_UD(gsl_ran_logarithmic_pdf, "logarithmic_pdf") */ /* multinomial_pdf */ /* PDF_D_UDD(gsl_ran_negative_binomial_pdf, "negative_binomial_pdf") */ /* PDF_D_UDU(gsl_ran_pascal_pdf, "pascal_pdf") */ PDF_D_FDDD(gsl_ran_pareto_pdf, "pareto_pdf") /* PDF_D_FUD(gsl_ran_poisson_pdf, "poisson_pdf") */ PDF_D_FDD(gsl_ran_rayleigh_pdf, "rayleigh_pdf") PDF_D_FDDD(gsl_ran_rayleigh_tail_pdf, "rayleigh_tail_pdf") PDF_D_FDD(gsl_ran_tdist_pdf, "tdist_pdf") PDF_D_FDD(gsl_ran_laplace_pdf, "laplace_pdf") PDF_D_FDDD(gsl_ran_weibull_pdf, "weibull_pdf") /* discrete_pdf */ /* static void bivariate_gaussian_pdf (){} */ static void ran_bivariate_gaussian (void) { SLang_MMT_Type *mmt; Rand_Type *r; double ds[3]; SLang_Array_Type *at_x = NULL, *at_y = NULL; double *xp, *yp; SLindex_Type i, num; double sx, sy, rho; const gsl_rng *rng; const char *fun = "ran_bivariate_gaussian"; if ((SLang_Num_Function_Args < 3) || (SLang_Num_Function_Args > 5)) { SLang_verror (SL_USAGE_ERROR, "Usage: (x,y)=%s([GSL_Rng_Type,] sx, sy, rho, [,num])", fun); return; } if (NULL == (r = pop_rand_nds_and_int (SLang_Num_Function_Args, 3, &mmt, ds, &num))) return; sx = ds[0]; sy = ds[1]; rho = ds[2]; rng = r->gen; if (num < 0) { double x, y; slgsl_reset_errors (); gsl_ran_bivariate_gaussian (rng, sx, sy, rho, &x, &y); slgsl_check_errors (fun); (void) SLang_push_double (x); (void) SLang_push_double (y); goto free_return; } if ((NULL == (at_x = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, &num, 1))) || (NULL == (at_y = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, &num, 1)))) goto free_return; xp = (double *) at_x->data; yp = (double *) at_y->data; slgsl_reset_errors (); for (i = 0; i < num; i++) gsl_ran_bivariate_gaussian (rng, sx, sy, rho, xp+i, yp+i); slgsl_check_errors (fun); (void) SLang_push_array (at_x, 0); (void) SLang_push_array (at_y, 0); /* drop */ free_return: if (mmt != NULL) SLang_free_mmt (mmt); if (at_x != NULL) SLang_free_array (at_x); if (at_y != NULL) SLang_free_array (at_y); } #define V SLANG_VOID_TYPE static SLang_Intrin_Fun_Type Module_Intrinsics [] = { MAKE_INTRINSIC_0("rng_get_rng_types", rng_get_rng_types, V), MAKE_INTRINSIC_0("rng_alloc", rng_alloc, V), MAKE_INTRINSIC_0("rng_set", rng_set, V), MAKE_INTRINSIC_0("rng_get", rng_get, V), MAKE_INTRINSIC_0("rng_uniform", SLF(gsl_rng_uniform), V), MAKE_INTRINSIC_0("rng_uniform_pos", SLF(gsl_rng_uniform_pos), V), MAKE_INTRINSIC_S("rng_set_default", set_default_generator, V), MAKE_INTRINSIC_0("rng_max", rng_max, V), MAKE_INTRINSIC_0("rng_min", rng_min, V), MAKE_INTRINSIC_0("ran_bernoulli", SLF(gsl_ran_bernoulli), V), MAKE_INTRINSIC_0("ran_beta", SLF(gsl_ran_beta), V), #ifdef USE_RAN_BINOMIAL MAKE_INTRINSIC_0("ran_binomial", SLF(u_dd_gsl_ran_binomial), V), #endif MAKE_INTRINSIC_0("ran_bivariate_gaussian", ran_bivariate_gaussian, V), MAKE_INTRINSIC_0("ran_cauchy", SLF(gsl_ran_cauchy), V), MAKE_INTRINSIC_0("ran_chisq", SLF(gsl_ran_chisq), V), MAKE_INTRINSIC_0("ran_erlang", SLF(gsl_ran_erlang), V), MAKE_INTRINSIC_0("ran_exponential", SLF(gsl_ran_exponential), V), MAKE_INTRINSIC_0("ran_exppow", SLF(gsl_ran_exppow), V), MAKE_INTRINSIC_0("ran_fdist", SLF(gsl_ran_fdist), V), MAKE_INTRINSIC_0("ran_flat", SLF(gsl_ran_flat), V), MAKE_INTRINSIC_0("ran_gamma", SLF(gsl_ran_gamma), V), /* MAKE_INTRINSIC_0("ran_gamma_int", SLF(d_d_gsl_ran_gamma_int), V), */ MAKE_INTRINSIC_0("ran_gaussian", SLF(gsl_ran_gaussian), V), MAKE_INTRINSIC_0("ran_gaussian_ratio_method", SLF(gsl_ran_gaussian_ratio_method), V), MAKE_INTRINSIC_0("ran_gaussian_tail", SLF(gsl_ran_gaussian_tail), V), MAKE_INTRINSIC_0("ran_geometric", SLF(gsl_ran_geometric), V), MAKE_INTRINSIC_0("ran_gumbel1", SLF(gsl_ran_gumbel1), V), MAKE_INTRINSIC_0("ran_gumbel2", SLF(gsl_ran_gumbel2), V), MAKE_INTRINSIC_0("ran_landau", SLF(gsl_ran_landau), V), MAKE_INTRINSIC_0("ran_laplace", SLF(gsl_ran_laplace), V), MAKE_INTRINSIC_0("ran_levy", SLF(gsl_ran_levy), V), MAKE_INTRINSIC_0("ran_logarithmic", SLF(gsl_ran_logarithmic), V), MAKE_INTRINSIC_0("ran_logistic", SLF(gsl_ran_logistic), V), MAKE_INTRINSIC_0("ran_lognormal", SLF(gsl_ran_lognormal), V), MAKE_INTRINSIC_0("ran_negative_binomial", SLF(gsl_ran_negative_binomial), V), MAKE_INTRINSIC_0("ran_pareto", SLF(gsl_ran_pareto), V), /* MAKE_INTRINSIC_0("ran_pascal", SLF(d_dd_gsl_ran_pascal), V), */ MAKE_INTRINSIC_0("ran_poisson", SLF(gsl_ran_poisson), V), MAKE_INTRINSIC_0("ran_rayleigh", SLF(gsl_ran_rayleigh), V), MAKE_INTRINSIC_0("ran_rayleigh_tail", SLF(gsl_ran_rayleigh_tail), V), MAKE_INTRINSIC_0("ran_tdist", SLF(gsl_ran_tdist), V), MAKE_INTRINSIC_0("ran_ugaussian", SLF(gsl_ran_ugaussian), V), MAKE_INTRINSIC_0("ran_ugaussian_ratio_method", SLF(gsl_ran_ugaussian_ratio_method), V), MAKE_INTRINSIC_0("ran_ugaussian_tail", SLF(gsl_ran_ugaussian_tail), V), MAKE_INTRINSIC_0("ran_weibull", SLF(gsl_ran_weibull), V), /* The pdfs */ /* MAKE_INTRINSIC_0("bernoulli_pdf", SLF(gsl_ran_bernoulli_pdf), V), */ MAKE_INTRINSIC_0("beta_pdf", SLF(gsl_ran_beta_pdf), V), #ifdef USE_RAN_BINOMIAL /* MAKE_INTRINSIC_0("binomial_pdf", SLF(gsl_ran_binomial_pdf), V), */ #endif MAKE_INTRINSIC_0("exponential_pdf", SLF(gsl_ran_exponential_pdf), V), MAKE_INTRINSIC_0("exppow_pdf", SLF(gsl_ran_exppow_pdf), V), MAKE_INTRINSIC_0("cauchy_pdf", SLF(gsl_ran_cauchy_pdf), V), MAKE_INTRINSIC_0("chisq_pdf", SLF(gsl_ran_chisq_pdf), V), /* dirichlet_pdf */ MAKE_INTRINSIC_0("erlang_pdf", SLF(gsl_ran_erlang_pdf), V), MAKE_INTRINSIC_0("fdist_pdf", SLF(gsl_ran_fdist_pdf), V), MAKE_INTRINSIC_0("flat_pdf", SLF(gsl_ran_flat_pdf), V), MAKE_INTRINSIC_0("gamma_pdf", SLF(gsl_ran_gamma_pdf), V), MAKE_INTRINSIC_0("gaussian_pdf", SLF(gsl_ran_gaussian_pdf), V), MAKE_INTRINSIC_0("ugaussian_pdf", SLF(gsl_ran_ugaussian_pdf), V), MAKE_INTRINSIC_0("gaussian_tail_pdf", SLF(gsl_ran_gaussian_tail_pdf), V), MAKE_INTRINSIC_0("ugaussian_tail_pdf", SLF(gsl_ran_ugaussian_tail_pdf), V), /* MAKE_INTRINSIC_0("bivariate_gaussian_pdf", SLF(gsl_ran_bivariate_gaussian_pdf), V), */ MAKE_INTRINSIC_0("landau_pdf", SLF(gsl_ran_landau_pdf), V), /* MAKE_INTRINSIC_0("geometric_pdf", SLF(gsl_ran_geometric_pdf), V), */ /* MAKE_INTRINSIC_0("hypergeometric_pdf", SLF(gsl_ran_hypergeometric_pdf), V), */ MAKE_INTRINSIC_0("gumbel1_pdf", SLF(gsl_ran_gumbel1_pdf), V), MAKE_INTRINSIC_0("gumbel2_pdf", SLF(gsl_ran_gumbel2_pdf), V), MAKE_INTRINSIC_0("logistic_pdf", SLF(gsl_ran_logistic_pdf), V), MAKE_INTRINSIC_0("lognormal_pdf", SLF(gsl_ran_lognormal_pdf), V), /* MAKE_INTRINSIC_0("logarithmic_pdf", SLF(gsl_ran_logarithmic_pdf), V), */ /* multinomial_pdf */ /* MAKE_INTRINSIC_0("negative_binomial_pdf", SLF(gsl_ran_negative_binomial_pdf), V), */ /* MAKE_INTRINSIC_0("pascal_pdf", SLF(gsl_ran_pascal_pdf), V), */ MAKE_INTRINSIC_0("pareto_pdf", SLF(gsl_ran_pareto_pdf), V), /* MAKE_INTRINSIC_0("poisson_pdf", SLF(gsl_ran_poisson_pdf), V), */ MAKE_INTRINSIC_0("rayleigh_pdf", SLF(gsl_ran_rayleigh_pdf), V), MAKE_INTRINSIC_0("rayleigh_tail_pdf", SLF(gsl_ran_rayleigh_tail_pdf), V), MAKE_INTRINSIC_0("tdist_pdf", SLF(gsl_ran_tdist_pdf), V), MAKE_INTRINSIC_0("laplace_pdf", SLF(gsl_ran_laplace_pdf), V), MAKE_INTRINSIC_0("weibull_pdf", SLF(gsl_ran_weibull_pdf), V), /* discrete_pdf */ SLANG_END_INTRIN_FUN_TABLE }; #undef V static SLang_Intrin_Var_Type Module_Variables [] = { MAKE_VARIABLE("_gslrand_module_version_string", &Module_Version_String, SLANG_STRING_TYPE, 1), SLANG_END_INTRIN_VAR_TABLE }; static SLang_IConstant_Type Module_IConstants [] = { MAKE_ICONSTANT("_gslrand_module_version", MODULE_VERSION_NUMBER), SLANG_END_ICONST_TABLE }; static void destroy_rand_type (SLtype type, VOID_STAR vr) { (void) type; free_rand_type ((Rand_Type *)vr); } int init_gslrand_module_ns (char *ns_name) { SLang_Class_Type *cl; SLang_NameSpace_Type *ns = SLns_create_namespace (ns_name); if (ns == NULL) return -1; if (Rand_Type_Id == -1) { if (NULL == (cl = SLclass_allocate_class ("GSL_Rand_Type"))) return -1; (void) SLclass_set_destroy_function (cl, destroy_rand_type); if (-1 == SLclass_register_class (cl, SLANG_VOID_TYPE, sizeof (Rand_Type), SLANG_CLASS_TYPE_MMT)) return -1; (void) gsl_rng_env_setup (); Rand_Type_Id = SLclass_get_class_id (cl); } if ( (-1 == SLns_add_intrin_var_table (ns, Module_Variables, NULL)) || (-1 == SLns_add_intrin_fun_table (ns, Module_Intrinsics, NULL)) || (-1 == SLns_add_iconstant_table (ns, Module_IConstants, NULL)) ) return -1; return 0; } /* This function is optional */ void deinit_gslrand_module (void) { } slgsl-pre0.10.0-7/src/tests/0002755000175000000620000000000014001614376014342 5ustar johnstaffslgsl-pre0.10.0-7/src/tests/test_import.sl0000644000175000000620000000117012105106006017235 0ustar johnstaffprepend_to_slang_load_path ("."); set_import_module_path (".:" + get_import_module_path ()); private define test_ns (module, ns) { require (module, ns); if (-1 != is_defined ("$ns->_${module}_module_version"$)) { () = fprintf (stderr, "*** ERROR: %s did not load into %s\n", module, ns); } } private variable Modules = { "gslrand", "gslcdf", "gslsf", "gslmatrix", "gslconst", "gslfft", "gslinterp" }; define slsh_main () { foreach (Modules) { variable module = (); loop (3) test_ns (module, "Global"); loop (3) test_ns (module, "foo"); loop (3) test_ns (module, "bar"); } } slgsl-pre0.10.0-7/src/tests/test_interp.sl0000644000175000000620000000702314001614376017242 0ustar johnstaffprepend_to_slang_load_path ("."); set_import_module_path (".:" + get_import_module_path ()); require ("gslinterp"); static define make_xy_table (x, y) { variable t = struct { x, y }; t.x = x; t.y = y; return t; } static define my_interp_linear (x, xa, ya) { variable o = interp_linear_init (xa, ya); loop (10) () = interp_eval (o, x); return interp_eval (o, x); } static define my_interp_linear_deriv (x, xa, ya) { return interp_eval_deriv (interp_linear_init (xa, ya), x); } static define my_interp_linear_integ (xa, ya, a, b) { return interp_eval_integ (interp_linear_init (xa, ya), a, b); } static define my_interp_cspline (x, xa, ya) { variable o = interp_cspline_init (xa, ya); loop (10) () = interp_eval (o, x); return interp_eval (o, x); } static define my_interp_cspline_deriv (x, xa, ya) { return interp_eval_deriv (interp_cspline_init (xa, ya), x); } static define my_interp_cspline_integ (xa, ya, a, b) { return interp_eval_integ (interp_cspline_init (xa, ya), a, b); } static define test_interp (data_table, fun, test_table) { variable y = (@fun) (test_table.x, data_table.x, data_table.y); variable diff_y = y - test_table.y; if (length (where (abs (diff_y) > 1e-10))) vmessage ("failed %S", fun); } static define test_interp_integ (data_table, fun, test_table) { variable zeros = @test_table.x; zeros[*] = 0; variable y = (@fun) (data_table.x, data_table.y, zeros, test_table.x); variable diff_y = y - test_table.y; if (length (where (abs (diff_y) > 1e-10))) vmessage ("failed %S, max diff = %g", fun, max(diff_y)); } static define test_cspline () { variable data_x = [ 0.0, 1.0, 2.0 ]; variable data_y = [ 0.0, 1.0, 2.0 ]; variable test_x = [ 0.0, 0.5, 1.0, 2.0 ]; variable test_y = [ 0.0, 0.5, 1.0, 2.0 ]; variable test_dy = [ 1.0, 1.0, 1.0, 1.0 ]; variable test_iy = [ 0.0, 0.125, 0.5, 2.0 ]; variable data_table = make_xy_table(data_x, data_y); variable test_table = make_xy_table(test_x, test_y); variable test_d_table = make_xy_table(test_x, test_dy); variable test_i_table = make_xy_table(test_x, test_iy); test_interp (data_table, &interp_cspline, test_table); test_interp (data_table, &my_interp_cspline, test_table); test_interp (data_table, &interp_cspline_deriv, test_d_table); test_interp (data_table, &my_interp_cspline_deriv, test_d_table); test_interp_integ (data_table, &interp_cspline_integ, test_i_table); test_interp_integ (data_table, &my_interp_cspline_integ, test_i_table); } static define test_linear () { variable data_x = [ 0.0, 1.0, 2.0, 3.0 ]; variable data_y = [ 0.0, 1.0, 2.0, 3.0 ]; variable test_x = [ 0.0, 0.5, 1.0, 1.5, 2.5, 3.0 ]; variable test_y = [ 0.0, 0.5, 1.0, 1.5, 2.5, 3.0 ]; variable test_dy = [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]; variable test_iy = [ 0.0, 0.125, 0.5, 9.0/8.0, 25.0/8.0, 9.0/2.0 ]; variable data_table = make_xy_table(data_x, data_y); variable test_table = make_xy_table(test_x, test_y); variable test_d_table = make_xy_table(test_x, test_dy); variable test_i_table = make_xy_table(test_x, test_iy); test_interp (data_table, &interp_linear, test_table); test_interp (data_table, &my_interp_linear, test_table); test_interp (data_table, &interp_linear_deriv, test_d_table); test_interp (data_table, &my_interp_linear_deriv, test_d_table); test_interp_integ (data_table, &interp_linear_integ, test_i_table); test_interp_integ (data_table, &my_interp_linear_integ, test_i_table); } test_cspline (); test_linear (); exit (0); slgsl-pre0.10.0-7/src/tests/test_fft.sl0000644000175000000620000001510212320462336016514 0ustar johnstaffprepend_to_slang_load_path ("."); set_import_module_path (".:" + get_import_module_path ()); require ("gslfft"); require ("gslrand"); private define correlate1d_wrap (a, kern) { variable na = length (a); variable nk = length (kern); variable b = a*0.0f; variable i, j = ([0:nk-1] - nk/2) + na; _for i (0, na-1, 1) b[i] = sum (kern*a[(i+j) mod na]); return b; } private define correlate2d_wrap (a, kern) { variable ny = array_shape (a)[0]; variable nx = array_shape (a)[1]; variable my = array_shape (kern)[0]; variable mx = array_shape (kern)[1]; variable b = a*0.0f; variable ii = ([0:mx-1] - mx/2) + nx; variable jj = ([0:my-1] - my/2) + ny; variable i, j; _for j (0, ny-1, 1) { _for i (0, nx-1, 1) { b[j,i] = sum (kern * a[(j+jj) mod ny, (i+ii) mod nx]); } } return b; } #if (1) private define correlate1d_reflect (a, kern) { variable na = length (a); variable nk = length (kern); variable b = a*0.0f; variable i, j, j0 = nk/2; % do brute-force indexing for to better catch errors in the % correlate function. _for i (0, na-1, 1) { variable s = 0.0; _for j (0, nk-1, 1) { variable k = j-j0+i; if (k < 0) k = -k; if (k >= na) k = na-(k-na+2); s += kern[j]*a[k]; } b[i] = s; } return b; } #endif private define correlate2d_reflect (a, kern) { variable ny = array_shape (a)[0]; variable nx = array_shape (a)[1]; variable my = array_shape (kern)[0]; variable mx = array_shape (kern)[1]; variable b = a*0.0f; variable ky0 = my/2; variable kx0 = mx/2; variable i, j, kx, ky; _for j (0, ny-1, 1) { _for i (0, nx-1, 1) { variable s = 0.0; _for ky (0, my-1, 1) { variable jj = ky-ky0+j; if (jj < 0) jj = -jj; if (jj >= ny) jj = ny-(jj-ny+2); _for kx (0, mx-1, 1) { variable ii = kx-kx0+i; if (ii < 0) ii = -ii; if (ii >= nx) ii = nx-(ii-nx+2); s += kern[ky,kx]*a[jj,ii]; } } b[j,i] = s; } } return b; } private define correlate1d_nearest (a, kern) { variable na = length (a); variable nk = length (kern); variable b = a*0.0f; variable i, j, j0 = nk/2; % do brute-force indexing to better catch errors in the % correlate function. _for i (0, na-1, 1) { variable s = 0.0; _for j (0, nk-1, 1) { variable k = j-j0+i; if (k < 0) k = 0; if (k >= na) k = na-1; s += kern[j]*a[k]; } b[i] = s; } return b; } private define correlate2d_nearest (a, kern) { variable ny = array_shape (a)[0]; variable nx = array_shape (a)[1]; variable my = array_shape (kern)[0]; variable mx = array_shape (kern)[1]; variable b = a*0.0f; variable ky0 = my/2; variable kx0 = mx/2; variable i, j, kx, ky; _for j (0, ny-1, 1) { _for i (0, nx-1, 1) { variable s = 0.0; _for ky (0, my-1, 1) { variable jj = ky-ky0+j; if (jj < 0) jj = 0; if (jj >= ny) jj = ny-1; _for kx (0, mx-1, 1) { variable ii = kx-kx0+i; if (ii < 0) ii = 0; if (ii >= nx) ii = nx-1; s += kern[ky,kx]*a[jj,ii]; } } b[j,i] = s; } } return b; } private variable Num_Failed = 0; private define failed () { variable args = __pop_list (_NARGS); () = fprintf (stderr, __push_list(args)); () = fputs ("\n", stderr); Num_Failed++; } define test_correlate1d () { variable a = [1:10]; variable k = [-1,1,2]; variable b1, b2; b1 = correlate1d_wrap (a, k); b2 = correlate(a,k; wrap); if (any (not feqs(b1,b2,1e-6,1e-7))) failed ("correlate on a 1d array using 'wrap' appears to have failed"); %print (b1-b2); b1 = correlate1d_reflect (a, k); b2 = correlate(a,k; reflect); if (any (not feqs(b1,b2,1e-6,1e-7))) failed ("correlate on a 1d array using 'reflect' appears to have failed"); %print (b1); print(""); print (b2); b1 = correlate1d_nearest (a, k); b2 = correlate(a,k; nearest); if (any (not feqs(b1,b2,1e-6,1e-7))) failed ("correlate on a 1d array using 'nearest' appears to have failed"); } define test_correlate2d () { variable nx = 22, ny = 33; variable a = _reshape ([1:ny*nx], [ny,nx]); variable i, j; _for j (0, ny-1, 1) _for i (0, nx-1, 1) a[j,i] = 10*(j+1) + (i+1); variable kx = 6, ky = 7; variable k = Double_Type[ky,kx]; k[*,*] = (rng_uniform(kx*ky)-0.5); variable b1, b2; b1 = correlate2d_wrap (a, k); b2 = correlate(a,k; wrap); if (any (not feqs(b1,b2,1e-6,1e-7))) failed ("correlate on a 2d array using 'wrap' appears to have failed"); b1 = correlate2d_reflect (a, k); b2 = correlate(a,k; reflect); if (any (not feqs(b1,b2,1e-6,1e-7))) failed ("correlate on a 2d array using 'reflect' appears to have failed"); b1 = correlate2d_nearest (a, k); b2 = correlate(a,k; nearest); if (any (not feqs(b1,b2,1e-6,1e-7))) failed ("correlate on a 2d array using 'nearest' appears to have failed"); } test_correlate1d (); test_correlate2d (); private define g(x, x0,sigma) { variable f = (exp(-0.5*sqr((x-x0)/sigma)) / (sigma * sqrt (2*PI))); return f/sum(f); } private define test_simple_convolve1d () { variable a = [1, 1, 1, 1, 0, 0]; variable b = [0, 0, 1, 1, 0, 0]; % c_i = \sum_j=0^N a_j*b_{i-j} % c_0 = a_0*b_0 + a_1*b{-1} + ... a_5*b{-5} % = a*b[[-6:-1]]; % c_1 = a_1*b variable c = [1, 0, 1, 2, 2, 2]; variable cc = 0.0*a; _for (0, length(cc)-1, 1) { variable i = (); variable s = 0.0; _for (0, length(cc)-1, 1) { variable j = (); s += a[j]*b[i-j]; } cc[i] = s; } variable ab = convolve (a, b; center=0, wrap); if (any (abs(ab-c) > 1e-12)) { failed ("simple convolve1d failed: maxdiff=%S\n", maxabs(ab-c)); c *= 1.0; print (ab, &ab); print (c, &c); c = strreplace (c, "\n", " "); ab = strreplace (ab, "\n", " "); failed (" got: %S", ab); failed ("expected: %S", c); print (cc); } } test_simple_convolve1d (); private define test_convolve1d (n) { variable x = [-200:200:#n]; variable sa=1, sk=2; variable sigma_expect = sqrt(sa^2+sk^2); variable a, k, c; a = g(x, 0, sa); k = g(x, 0, sk); k /= sum(k); c = convolve (a, k); variable b = g(x, 0, sigma_expect); % even kernels are always problematic since centering is ambiguous. % For those, just check the sum ifnot (n mod 2) { c = sum(c); b = sum(b); } if (any (abs(c-b) > 1e-12)) failed ("convolve 1d for n=$n may have failed: maxdiff=%g\n"$, maxabs(c-b)); } test_convolve1d (8); test_convolve1d (9); exit (Num_Failed); slgsl-pre0.10.0-7/src/tests/test_err.sl0000644000175000000620000000100712105106006016512 0ustar johnstaffprepend_to_slang_load_path ("."); set_import_module_path ("."); require ("gslsf"); static variable Callback_Called; static define domain_callback (func, code) { if (code != GSL_EDOM) { () = fprintf (stderr, "domain_callback: expecting GSL_EDOM\n"); exit (1); } Callback_Called = 1; } gsl_set_error_disposition (GSL_EDOM, &domain_callback); Callback_Called = 0; () = log_1plusx (-10); if (Callback_Called == 0) { () = fprintf (stderr, "domain_callback NOT called\n"); exit (1); } exit (0); slgsl-pre0.10.0-7/src/tests/test_integ.sl0000644000175000000620000000442614001614376017053 0ustar johnstaffprepend_to_slang_load_path ("."); set_import_module_path (path_dirname(__FILE__) + "/.." + ":" + get_import_module_path()); require ("gslinteg"); private define func (x) { % Int from 0->1 is exp(0) - exp(1) return exp(-abs(x)); } private define polyfunc (x, parms) { return x^parms[0]; } private define funct1 (x, parms) { variable m = parms[0]; return x^m + 1.0; } define slsh_main () { variable s = integration_qng (&func, -5, 5, 1e-12, 1e-12); print (s); s = integration_qag (&func, -5, 5, 1e-12, 1e-12, 32, 6); print (s); s = integration_qags (&func, -5, 5, 1e-12, 1e-12, 32); print (s); s = integration_qagp (&func, [-5:5:#10], 1e-12, 1e-12, 32); print (s); s = integration_qagi (&func, 1e-12, 1e-12, 32); print (s); s = integration_qagiu (&func, -5, 1e-12, 1e-12, 32); print (s); s = integration_qagil (&func, 5, 1e-12, 1e-12, 32); print (s); s = integration_qawc (&func, -5, 5, 0, 1e-12, 1e-12, 32); print (s); variable gl = integration_glfixed_alloc (3); s = integration_glfixed (&polyfunc, {3}, 0, 1, gl); % Result is int_0^1 x^3 dx = 1^4/4 = 0.25 print (s); print (gl); variable m = 10, n = 6; variable ft = integration_fixed_alloc ("hermite", n, 0, 1, 0, 0); s = integration_fixed (&funct1, {m}, ft); print (s); print (ft); variable q = integration_qaws_alloc (0, 0, 0, 0); s = integration_qaws (&func, -5, 5, 1e-12, 1e-12, 64, q); print (s); print (q); q = integration_qawo_alloc (0, 5.0, GSL_INTEG_COSINE, 5); s = integration_qawo (&func, 0, 1e-12, 1e-12, 64, q); print (s); print (q); s = integration_qawf (&func, 0, 1e-12, 64, q); print (s); s = integration_cquad (&func, -5, 5, 1e-12, 1e-12, 100); print (s); s = integration_romberg (&func, -5, 5, 1e-12, 1e-12, 10); print (s); } define example_func (x, parms) { variable alpha = parms[0]; return log (alpha*x)/sqrt(x); } define slsh_main () { variable alpha = 1.0; variable parms = {alpha}; variable res = integration_qags (&example_func, parms, 0, 1, 0, 1e-7, 1000); vmessage ("Result = %S", res.result); vmessage ("Function calls: %S", res.neval); vmessage ("Status: %S", res.status); vmessage ("Abserror: %S", res.abserr); } slgsl-pre0.10.0-7/src/tests/test_rand.sl0000644000175000000620000000257712105106006016663 0ustar johnstaffprepend_to_slang_load_path ("."); set_import_module_path (".:" + get_import_module_path ()); require ("gslrand"); define test_gaussian () { variable a, b, r = rng_alloc (); rng_set (r, 0); rng_set (0); a = ran_ugaussian (r, 1000); if (length (a) != 1000) { () = fprintf (stderr, "Failed: got %d elements instead of 1000", length (a)); exit (1); } b = ran_ugaussian (1000); if (length (where (a != b))) { () = fprintf (stderr, "Failed: ran_ugaussian(1000)"); exit (1); } a = ran_ugaussian (r, 1000); foreach (a) { b = (); if (b != ran_ugaussian ()) { () = fprintf (stderr, "Failed: ran_ugaussian()"); exit (1); } } a = ran_gaussian (r, 2.0, 1000); if (length (a) != 1000) { () = fprintf (stderr, "Failed2: got %d elements instead of 1000", length (a)); exit (1); } b = ran_gaussian (2, 1000); if (length (b) != 1000) { () = fprintf (stderr, "Failed3: got %d elements instead of 1000", length (b)); exit (1); } if (length (where (a != b))) { () = fprintf (stderr, "Failed: ran_ugaussian(1000)"); exit (1); } a = ran_gaussian (r, 2.0, 1000); foreach (a) { b = (); if (b != ran_gaussian (2.0)) { () = fprintf (stderr, "Failed: ran_gaussian(2.0)"); exit (1); } } } test_gaussian (); exit (0); slgsl-pre0.10.0-7/src/gslinteg-module.c0000644000175000000620000011317214074757130016454 0ustar johnstaff/* -*- mode: c; mode: fold; -*- */ /* Copyright (C) 2021 John E. Davis This file is part of the GSL S-Lang module. The S-Lang Library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The S-Lang Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include "slgsl.h" #include "version.h" typedef struct { SLang_Name_Type *slfunc; SLang_List_Type *parms; double a, b, c; SLang_Array_Type *pts_array; int limit_type; double epsabs; double epsrel; unsigned long neval; } Func_Callback_Type; static double integrand_func_callback (double x, void *parms) { Func_Callback_Type *f = (Func_Callback_Type *)parms; double y; f->neval++; if ((-1 == SLang_start_arg_list ()) || (-1 == SLang_push_double (x)) || ((f->parms != NULL) && (-1 == SLang_push_list (f->parms, 0))) || (-1 == SLang_end_arg_list ()) || (-1 == SLexecute_function (f->slfunc)) || (-1 == SLang_pop_double (&y))) return -1.0; return y; } static void free_func_callback (Func_Callback_Type *f) { SLang_free_list (f->parms); /* NULL ok */ SLang_free_array (f->pts_array); /* NULL ok */ SLang_free_function (f->slfunc); } #define LIMIT_TYPE_NONE (0) #define LIMIT_TYPE_BOTH (1) #define LIMIT_TYPE_UPPER (2) #define LIMIT_TYPE_LOWER (3) #define LIMIT_TYPE_C (4) #define LIMIT_TYPE_PTS (5) static int pop_func_callback (Func_Callback_Type *f, int has_eps, int has_parms, int limit_type) { memset ((char *)f, 0, sizeof (Func_Callback_Type)); switch (has_eps) { case 2: if (-1 == SLang_pop_double (&f->epsrel)) return -1; /* fall through */ case 1: if (-1 == SLang_pop_double (&f->epsabs)) return -1; break; default: break; } switch (limit_type) { case LIMIT_TYPE_NONE: break; case LIMIT_TYPE_UPPER: if (-1 == SLang_pop_double (&f->b)) return -1; break; case LIMIT_TYPE_C: if (-1 == SLang_pop_double (&f->c)) return -1; /* fall through */ case LIMIT_TYPE_BOTH: if (-1 == SLang_pop_double (&f->b)) return -1; /* fall through */ case LIMIT_TYPE_LOWER: if (-1 == SLang_pop_double (&f->a)) return -1; break; case LIMIT_TYPE_PTS: { SLang_Array_Type *at; SLuindex_Type i, n; double *pts; if (-1 == SLang_pop_array_of_type (&at, SLANG_DOUBLE_TYPE)) return -1; n = at->num_elements; if (n < 2) { SLang_verror (SL_InvalidParm_Error, "pts array must have at least 2 values"); return -1; } pts = (double *) at->data; for (i = 1; i < n; i++) { if (pts[i-1] >= pts[i]) { SLang_verror (SL_InvalidParm_Error, "The pts array must be monotonically increasing"); SLang_free_array (at); return -1; } } f->pts_array = at; } break; } f->limit_type = limit_type; if ((has_parms && (-1 == SLang_pop_list (&f->parms))) || (NULL == (f->slfunc = SLang_pop_function ()))) { free_func_callback (f); return -1; } return 0; } typedef struct { double result; double abserr; unsigned long neval; int status; } Integ_Result_Type; static SLang_CStruct_Field_Type Integ_Result_Type_Struct [] = { MAKE_CSTRUCT_FLOAT_FIELD(Integ_Result_Type, result, "result", 0), MAKE_CSTRUCT_FLOAT_FIELD(Integ_Result_Type, abserr, "abserr", 0), MAKE_CSTRUCT_INT_FIELD(Integ_Result_Type, neval, "neval", 0), MAKE_CSTRUCT_INT_FIELD(Integ_Result_Type, status, "status", 0), SLANG_END_CSTRUCT_TABLE }; static int push_integ_result (Func_Callback_Type *f, double result, double abserr, int status) { Integ_Result_Type r; r.result = result; r.abserr = abserr; r.status = status; r.neval = f->neval; return SLang_push_cstruct ((VOID_STAR) &r, Integ_Result_Type_Struct); } /* args: (func, {parms}, a, b, epsabs, epsrel) */ static void integrate_qng (void) /*{{{*/ { Func_Callback_Type fc; gsl_function f; size_t neval; double y, abserr; int status, has_parms; if ((SLang_Num_Function_Args < 5) || (SLang_Num_Function_Args > 6)) { SLang_verror (SL_USAGE_ERROR, "Usage: res = integrate_qng (&func, [{opt-parms-list},] a, b, epsabs, relabs)"); return; } has_parms = (SLang_Num_Function_Args == 6); if (-1 == pop_func_callback (&fc, 2, has_parms, LIMIT_TYPE_BOTH)) return; f.function = integrand_func_callback; f.params = (void *)&fc; status = gsl_integration_qng (&f, fc.a, fc.b, fc.epsabs, fc.epsrel, &y, &abserr, &neval); (void) push_integ_result (&fc, y, abserr, status); free_func_callback (&fc); } /*}}}*/ /* args: func, [parms,] a, b, epsabs, epsrel, limit, key */ static void integrate_qag (void) /*{{{*/ { Func_Callback_Type fc; gsl_function f; gsl_integration_workspace *w; double y, abserr; unsigned int limit; int key, has_parms, status; if ((SLang_Num_Function_Args < 7) || (SLang_Num_Function_Args > 8)) { SLang_verror (SL_USAGE_ERROR, "Usage: res = integrate_qag (&func, [{opt-parms-list},] a, b, epsabs, relabs, limit, key)"); return; } has_parms = (SLang_Num_Function_Args == 8); if (-1 == SLang_pop_int (&key)) return; switch (key) { case GSL_INTEG_GAUSS15: case GSL_INTEG_GAUSS21: case GSL_INTEG_GAUSS31: case GSL_INTEG_GAUSS41: case GSL_INTEG_GAUSS51: case GSL_INTEG_GAUSS61: break; default: SLang_verror (SL_InvalidParm_Error, "Unsupported key in qag: %d\n", key); return; } if (-1 == SLang_pop_uint (&limit)) return; if (-1 == pop_func_callback (&fc, 2, has_parms, LIMIT_TYPE_BOTH)) return; f.function = integrand_func_callback; f.params = (void *)&fc; if (NULL == (w = gsl_integration_workspace_alloc (limit))) { free_func_callback (&fc); return; } status = gsl_integration_qag (&f, fc.a, fc.b, fc.epsabs, fc.epsrel, limit, key, w, &y, &abserr); gsl_integration_workspace_free (w); (void) push_integ_result (&fc, y, abserr, status); free_func_callback (&fc); } /*}}}*/ /* args: func, [parms,] a, b, epsabs, epsrel, limit */ static void integrate_qags (void) /*{{{*/ { Func_Callback_Type fc; gsl_function f; gsl_integration_workspace *w; double y, abserr; unsigned int limit; int has_parms, status; if ((SLang_Num_Function_Args < 6) || (SLang_Num_Function_Args > 7)) { SLang_verror (SL_USAGE_ERROR, "Usage: res = integrate_qags (&func, [{opt-parms-list},] a, b, epsabs, epsrel, limit)"); return; } has_parms = (SLang_Num_Function_Args == 7); if (-1 == SLang_pop_uint (&limit)) return; if (-1 == pop_func_callback (&fc, 2, has_parms, LIMIT_TYPE_BOTH)) return; f.function = integrand_func_callback; f.params = (void *)&fc; if (NULL == (w = gsl_integration_workspace_alloc (limit))) { free_func_callback (&fc); return; } status = gsl_integration_qags (&f, fc.a, fc.b, fc.epsabs, fc.epsrel, limit, w, &y, &abserr); gsl_integration_workspace_free (w); (void) push_integ_result (&fc, y, abserr, status); free_func_callback (&fc); } /*}}}*/ /* args: func, [parms,] [pts-array], epsabs, epsrel, limit */ static void integrate_qagp (void) /*{{{*/ { Func_Callback_Type fc; gsl_function f; gsl_integration_workspace *w; double y, abserr; unsigned int limit; int has_parms, status; if ((SLang_Num_Function_Args < 5) || (SLang_Num_Function_Args > 6)) { SLang_verror (SL_USAGE_ERROR, "Usage: res = integrate_qagp (&func, [{opt-parms-list},] pts-array, epsabs, epsrel, limit)"); return; } has_parms = (SLang_Num_Function_Args == 6); if (-1 == SLang_pop_uint (&limit)) return; if (-1 == pop_func_callback (&fc, 2, has_parms, LIMIT_TYPE_PTS)) return; f.function = integrand_func_callback; f.params = (void *)&fc; if (NULL == (w = gsl_integration_workspace_alloc (limit))) { free_func_callback (&fc); return; } status = gsl_integration_qagp (&f, (double *)fc.pts_array->data, fc.pts_array->num_elements, fc.epsabs, fc.epsrel, limit, w, &y, &abserr); gsl_integration_workspace_free (w); (void) push_integ_result (&fc, y, abserr, status); free_func_callback (&fc); } /*}}}*/ /* args: func, [parms,] epsabs, epsrel, limit */ static void integrate_qagi (void) /*{{{*/ { Func_Callback_Type fc; gsl_function f; gsl_integration_workspace *w; double y, abserr; unsigned int limit; int has_parms, status; if ((SLang_Num_Function_Args < 4) || (SLang_Num_Function_Args > 5)) { SLang_verror (SL_USAGE_ERROR, "Usage: res = integrate_qagi (&func, [{opt-parms-list},] epsabs, epsrel, limit)"); return; } has_parms = (SLang_Num_Function_Args == 5); if (-1 == SLang_pop_uint (&limit)) return; if (-1 == pop_func_callback (&fc, 2, has_parms, LIMIT_TYPE_NONE)) return; f.function = integrand_func_callback; f.params = (void *)&fc; if (NULL == (w = gsl_integration_workspace_alloc (limit))) { free_func_callback (&fc); return; } status = gsl_integration_qagi (&f, fc.epsabs, fc.epsrel, limit, w, &y, &abserr); gsl_integration_workspace_free (w); (void) push_integ_result (&fc, y, abserr, status); free_func_callback (&fc); } /*}}}*/ /* args: func, [parms,] a, epsabs, epsrel, limit */ static void integrate_qagiu (void) /*{{{*/ { Func_Callback_Type fc; gsl_function f; gsl_integration_workspace *w; double y, abserr; unsigned int limit; int has_parms, status; if ((SLang_Num_Function_Args < 5) || (SLang_Num_Function_Args > 6)) { SLang_verror (SL_USAGE_ERROR, "Usage: res = integrate_qagiu (&func, [{opt-parms-list},] a, epsabs, epsrel, limit)"); return; } has_parms = (SLang_Num_Function_Args == 6); if (-1 == SLang_pop_uint (&limit)) return; if (-1 == pop_func_callback (&fc, 2, has_parms, LIMIT_TYPE_LOWER)) return; f.function = integrand_func_callback; f.params = (void *)&fc; if (NULL == (w = gsl_integration_workspace_alloc (limit))) { free_func_callback (&fc); return; } status = gsl_integration_qagiu (&f, fc.a, fc.epsabs, fc.epsrel, limit, w, &y, &abserr); gsl_integration_workspace_free (w); (void) push_integ_result (&fc, y, abserr, status); free_func_callback (&fc); } /*}}}*/ /* args: func, [parms,] b, epsabs, epsrel, limit */ static void integrate_qagil (void) /*{{{*/ { Func_Callback_Type fc; gsl_function f; gsl_integration_workspace *w; double y, abserr; unsigned int limit; int has_parms, status; if ((SLang_Num_Function_Args < 5) || (SLang_Num_Function_Args > 6)) { SLang_verror (SL_USAGE_ERROR, "Usage: res = integrate_qagil (&func, [{opt-parms-list},] b, epsabs, epsrel, limit)"); return; } has_parms = (SLang_Num_Function_Args == 6); if (-1 == SLang_pop_uint (&limit)) return; if (-1 == pop_func_callback (&fc, 2, has_parms, LIMIT_TYPE_UPPER)) return; f.function = integrand_func_callback; f.params = (void *)&fc; if (NULL == (w = gsl_integration_workspace_alloc (limit))) { free_func_callback (&fc); return; } status = gsl_integration_qagiu (&f, fc.b, fc.epsabs, fc.epsrel, limit, w, &y, &abserr); gsl_integration_workspace_free (w); (void) push_integ_result (&fc, y, abserr, status); free_func_callback (&fc); } /*}}}*/ /* args: func, [parms,] a, b, c, epsabs, epsrel, limit */ static void integrate_qawc (void) /*{{{*/ { Func_Callback_Type fc; gsl_function f; gsl_integration_workspace *w; double y, abserr; unsigned int limit; int has_parms, status; if ((SLang_Num_Function_Args < 7) || (SLang_Num_Function_Args > 8)) { SLang_verror (SL_USAGE_ERROR, "Usage: res = integrate_qawc (&func, [{opt-parms-list},] a, b, c, epsabs, epsrel, limit)"); return; } has_parms = (SLang_Num_Function_Args == 8); if (-1 == SLang_pop_uint (&limit)) return; if (-1 == pop_func_callback (&fc, 2, has_parms, LIMIT_TYPE_C)) return; f.function = integrand_func_callback; f.params = (void *)&fc; if (NULL == (w = gsl_integration_workspace_alloc (limit))) { free_func_callback (&fc); return; } status = gsl_integration_qawc (&f, fc.a, fc.b, fc.c, fc.epsabs, fc.epsrel, limit, w, &y, &abserr); gsl_integration_workspace_free (w); (void) push_integ_result (&fc, y, abserr, status); free_func_callback (&fc); } /*}}}*/ /* args: func, [parms,] a, b, epsabs, epsrel, limit */ static void integrate_cquad (void) /*{{{*/ { Func_Callback_Type fc; gsl_function f; gsl_integration_cquad_workspace *w; double y, abserr; size_t nevals; unsigned int limit; int has_parms, status; if ((SLang_Num_Function_Args < 6) || (SLang_Num_Function_Args > 7)) { SLang_verror (SL_USAGE_ERROR, "Usage: res = integrate_cquad (&func, [{opt-parms-list},] a, b, epsabs, epsrel, limit)"); return; } has_parms = (SLang_Num_Function_Args == 7); if (-1 == SLang_pop_uint (&limit)) return; if (-1 == pop_func_callback (&fc, 2, has_parms, LIMIT_TYPE_BOTH)) return; f.function = integrand_func_callback; f.params = (void *)&fc; if (NULL == (w = gsl_integration_cquad_workspace_alloc(limit))) { free_func_callback (&fc); return; } status = gsl_integration_cquad (&f, fc.a, fc.b, fc.epsabs, fc.epsrel, w, &y, &abserr, &nevals); gsl_integration_cquad_workspace_free (w); (void) push_integ_result (&fc, y, abserr, status); free_func_callback (&fc); } /*}}}*/ /* args: func, [parms,] a, b, epsabs, epsrel, limit */ static void integrate_romberg (void) /*{{{*/ { Func_Callback_Type fc; gsl_function f; gsl_integration_romberg_workspace *w; double y; size_t nevals; unsigned int limit; int has_parms, status; if ((SLang_Num_Function_Args < 6) || (SLang_Num_Function_Args > 7)) { SLang_verror (SL_USAGE_ERROR, "Usage: res = integrate_romberg (&func, [{opt-parms-list},] a, b, epsabs, epsrel, limit)"); return; } has_parms = (SLang_Num_Function_Args == 7); if (-1 == SLang_pop_uint (&limit)) return; if (-1 == pop_func_callback (&fc, 2, has_parms, LIMIT_TYPE_BOTH)) return; f.function = integrand_func_callback; f.params = (void *)&fc; if (NULL == (w = gsl_integration_romberg_alloc(limit))) { free_func_callback (&fc); return; } status = gsl_integration_romberg (&f, fc.a, fc.b, fc.epsabs, fc.epsrel, &y, &nevals, w); gsl_integration_romberg_free (w); (void) push_integ_result (&fc, y, -1, status); free_func_callback (&fc); } /*}}}*/ /*{{{ Fixed Point Quadratures */ typedef struct { gsl_integration_fixed_workspace *workspace; const gsl_integration_fixed_type *obj; /* not malloced */ const char *name; double a, b, alpha, beta; size_t n; } Fixed_Integ_Type; static int Fixed_Integ_Type_Id = -1; typedef struct { const char *name; const gsl_integration_fixed_type **fixedobj; int id; } Fixed_Type_Def_Table_Type; static Fixed_Type_Def_Table_Type Fixed_Type_Def_Table[] = { #define FIXED_TYPE_LEGENDRE (1) {"legendre", &gsl_integration_fixed_legendre, FIXED_TYPE_LEGENDRE}, #define FIXED_TYPE_CHEBYSHEV (2) {"chebyshev", &gsl_integration_fixed_chebyshev, FIXED_TYPE_CHEBYSHEV}, #define FIXED_TYPE_GEGENBAUER (3) {"gegenbauer", &gsl_integration_fixed_gegenbauer, FIXED_TYPE_GEGENBAUER}, #define FIXED_TYPE_JACOBI (4) {"jacobi", &gsl_integration_fixed_jacobi, FIXED_TYPE_JACOBI}, #define FIXED_TYPE_LAGUERRE (5) {"laguerre", &gsl_integration_fixed_laguerre, FIXED_TYPE_LAGUERRE}, #define FIXED_TYPE_HERMITE (6) {"hermite", &gsl_integration_fixed_hermite, FIXED_TYPE_HERMITE}, #define FIXED_TYPE_EXPONENTIAL (7) {"exponential", &gsl_integration_fixed_exponential, FIXED_TYPE_EXPONENTIAL}, #define FIXED_TYPE_RATIONAL (8) {"rational", &gsl_integration_fixed_rational, FIXED_TYPE_RATIONAL}, #define FIXED_TYPE_CHEBYSHEV2 (9) {"chebyshev2", &gsl_integration_fixed_chebyshev2, FIXED_TYPE_CHEBYSHEV2}, {NULL, NULL, -1} }; static Fixed_Type_Def_Table_Type *lookup_fixed_type (const char *name) { Fixed_Type_Def_Table_Type *ent; ent = Fixed_Type_Def_Table; while (ent->name != NULL) { if (0 == strcmp (ent->name, name)) return ent; ent++; } SLang_verror (SL_InvalidParm_Error, "fixed integration type %s is unknown/unsupported", name); return NULL; } static Fixed_Integ_Type * alloc_fixed_integration_type (const char *name, double a, double b, double alpha, double beta, size_t n) { Fixed_Integ_Type *ft; Fixed_Type_Def_Table_Type *ent; if (NULL == (ent = lookup_fixed_type (name))) return NULL; switch (ent->id) { case FIXED_TYPE_LEGENDRE: if (b <= a) goto constraint_error; break; case FIXED_TYPE_CHEBYSHEV: if (b <= a) goto constraint_error; break; case FIXED_TYPE_GEGENBAUER: if ((a <= -1) || (a <= b)) goto constraint_error; break; case FIXED_TYPE_JACOBI: if ((alpha <= -1) || (beta <= -1) || (b <= a)) goto constraint_error; break; case FIXED_TYPE_LAGUERRE: if ((alpha <= -1) || (b <= 0)) goto constraint_error; break; case FIXED_TYPE_HERMITE: if ((alpha <= -1) || (b <= 0)) goto constraint_error; break; case FIXED_TYPE_EXPONENTIAL: if ((alpha <= -1) || (b <= a)) goto constraint_error; break; case FIXED_TYPE_RATIONAL: if ((alpha <= 1) || (alpha + beta + 2*n >= 0) || (a + b <= 0)) goto constraint_error; break; case FIXED_TYPE_CHEBYSHEV2: if (b <= a) goto constraint_error; break; default: SLang_verror (SL_INTERNAL_ERROR, "Fixed Type %s is not implemented", ent->name); return NULL; } if (NULL == (ft = (Fixed_Integ_Type *) SLmalloc (sizeof (Fixed_Integ_Type)))) return NULL; memset ((char *) ft, 0, sizeof (Fixed_Integ_Type)); ft->obj = *ent->fixedobj; ft->a = a; ft->b = b; ft->alpha = alpha; ft->beta = beta; ft->n = n; ft->name = ent->name; if (NULL == (ft->workspace = gsl_integration_fixed_alloc (ft->obj, n, a, b, alpha, beta))) { SLang_verror (SL_Malloc_Error, "gsl_integration_fixed_alloc failed"); SLfree ((char *)ft); return NULL; } return ft; constraint_error: SLang_verror (SL_InvalidParm_Error, "Constraints for fixed integration type %s are not satisfied", ent->name); return NULL; } static void free_fixed_integ_type (SLtype type, VOID_STAR f) { Fixed_Integ_Type *ft; (void) type; ft = (Fixed_Integ_Type *) f; if (ft->workspace != NULL) gsl_integration_fixed_free (ft->workspace); SLfree ((char *) ft); } static void new_fixed_integ_type (void) { Fixed_Integ_Type *ft; SLang_MMT_Type *mmt; double a, b, alpha, beta; unsigned long n; char *name; if (SLang_Num_Function_Args != 6) { SLang_verror (SL_USAGE_ERROR, "\ Usage: obj = integration_fixed_alloc (fixedtype, n, a, b, alpha, beta);\n\ fixedtype is one of:\n\ \"legendre\", \"chebyshev\", \"gegenbauer\", \"jacobi\", \"laguerre\",\n\ \"hermite\", \"exponential\", \"rational\", \"chebyshev2\""); return; } if ((-1 == SLang_pop_double (&beta)) || (-1 == SLang_pop_double (&alpha)) || (-1 == SLang_pop_double (&b)) || (-1 == SLang_pop_double (&a)) || (-1 == SLang_pop_ulong (&n)) || (-1 == SLang_pop_slstring (&name))) return; if (NULL == (ft = alloc_fixed_integration_type (name, a, b, alpha, beta, n))) { SLang_free_slstring (name); return; } if (NULL == (mmt = SLang_create_mmt (Fixed_Integ_Type_Id, (VOID_STAR) ft))) { free_fixed_integ_type (Fixed_Integ_Type_Id, (VOID_STAR) ft); SLang_free_slstring (name); return; } if (-1 == SLang_push_mmt (mmt)) { SLang_free_mmt (mmt); /* drop */ } SLang_free_slstring (name); } static void integrate_fixed (void) { Func_Callback_Type fc; gsl_function f; SLang_MMT_Type *mmt; Fixed_Integ_Type *ft; double y; int has_parms, status; if ((SLang_Num_Function_Args < 2 ) || (SLang_Num_Function_Args > 3)) { SLang_verror (SL_USAGE_ERROR, "\ Usage: res = integration_fixed (&func, [{opt-parms-list},] fixed_obj);\n\ fixed_obj is the object previously created by the integration_fixed function"); return; } has_parms = (SLang_Num_Function_Args == 3); if (NULL == (mmt = SLang_pop_mmt (Fixed_Integ_Type_Id))) return; if (NULL == (ft = (Fixed_Integ_Type *) SLang_object_from_mmt (mmt))) { SLang_free_mmt (mmt); return; } if (-1 == pop_func_callback (&fc, 0, has_parms, LIMIT_TYPE_NONE)) { SLang_free_mmt (mmt); return; } f.function = integrand_func_callback; f.params = (void *)&fc; status = gsl_integration_fixed (&f, &y, ft->workspace); (void) push_integ_result (&fc, y, -1, status); free_func_callback (&fc); SLang_free_mmt (mmt); } static char *fixed_integ_type_string_method (SLtype type, VOID_STAR f) { SLang_MMT_Type *mmt; Fixed_Integ_Type *ft; char buf[256]; (void) type; mmt = *(SLang_MMT_Type **)f; if (NULL == (ft = (Fixed_Integ_Type *) SLang_object_from_mmt (mmt))) return NULL; (void) SLsnprintf (buf, sizeof (buf), "GSL_Integ_Fixed_Type:%s", ft->name); return SLmake_string (buf); } static int register_fixed_integ_type (void) { SLang_Class_Type *cl; if (NULL == (cl = SLclass_allocate_class ("GSL_Integ_Fixed_Type"))) return -1; (void) SLclass_set_destroy_function (cl, free_fixed_integ_type); (void) SLclass_set_string_function (cl, fixed_integ_type_string_method); if (-1 == SLclass_register_class (cl, SLANG_VOID_TYPE, sizeof (Fixed_Integ_Type), SLANG_CLASS_TYPE_MMT)) return -1; Fixed_Integ_Type_Id = SLclass_get_class_id (cl); return 0; } /*}}}*/ /*{{{ Gauss-Legendre integration */ typedef struct { gsl_integration_glfixed_table *glfixed_table; size_t n; } GLFixed_Integ_Type; static int GLFixed_Integ_Type_Id = -1; static void free_glfixed_integ_type (SLtype type, VOID_STAR f) { GLFixed_Integ_Type *gl; (void) type; gl = (GLFixed_Integ_Type *) f; if (gl->glfixed_table != NULL) gsl_integration_glfixed_table_free (gl->glfixed_table); SLfree ((char *) gl); } static void new_glfixed_integ_type (void) { GLFixed_Integ_Type *gl; SLang_MMT_Type *mmt; unsigned long n; if (SLang_Num_Function_Args != 1) { SLang_verror (SL_USAGE_ERROR, "Usage: obj = integration_glfixed_alloc(n)"); return; } if (-1 == SLang_pop_ulong (&n)) return; if (NULL == (gl = (GLFixed_Integ_Type *) SLmalloc (sizeof (GLFixed_Integ_Type)))) return; memset ((char *) gl, 0, sizeof (GLFixed_Integ_Type)); if (NULL == (gl->glfixed_table = gsl_integration_glfixed_table_alloc (n))) { SLang_verror (SL_RunTime_Error, "gsl_integration_glfixed_table failed"); SLfree ((char *)gl); return; } gl->n = n; if (NULL == (mmt = SLang_create_mmt (GLFixed_Integ_Type_Id, (VOID_STAR) gl))) { free_glfixed_integ_type (GLFixed_Integ_Type_Id, (VOID_STAR) gl); return; } if (-1 == SLang_push_mmt (mmt)) SLang_free_mmt (mmt); } static void integrate_glfixed (void) { Func_Callback_Type fc; gsl_function f; SLang_MMT_Type *mmt; GLFixed_Integ_Type *gl; double y; int has_parms; if ((SLang_Num_Function_Args < 4 ) || (SLang_Num_Function_Args > 5)) { SLang_verror (SL_USAGE_ERROR, "\ Usage: res = integration_glfixed (&func, [{opt-parms-list},] a, b, glfixed_obj);\n\ glfixed_table is the table previously created by the integration_glfixed_alloc function"); return; } has_parms = (SLang_Num_Function_Args == 5); if (NULL == (mmt = SLang_pop_mmt (GLFixed_Integ_Type_Id))) return; if (NULL == (gl = (GLFixed_Integ_Type *) SLang_object_from_mmt (mmt))) { SLang_free_mmt (mmt); return; } if (-1 == pop_func_callback (&fc, 0, has_parms, LIMIT_TYPE_BOTH)) { SLang_free_mmt (mmt); return; } f.function = integrand_func_callback; f.params = (void *)&fc; y = gsl_integration_glfixed (&f, fc.a, fc.b, gl->glfixed_table); (void) push_integ_result (&fc, y, -1, 0); free_func_callback (&fc); SLang_free_mmt (mmt); } static char *glfixed_integ_type_string_method (SLtype type, VOID_STAR f) { SLang_MMT_Type *mmt; GLFixed_Integ_Type *gl; char buf[256]; (void) type; mmt = *(SLang_MMT_Type **)f; if (NULL == (gl = (GLFixed_Integ_Type *) SLang_object_from_mmt (mmt))) return NULL; (void) SLsnprintf (buf, sizeof (buf), "GSL_Integ_GLFixed_Type:%lu", gl->n); return SLmake_string (buf); } static int register_glfixed_integ_type (void) { SLang_Class_Type *cl; if (NULL == (cl = SLclass_allocate_class ("GSL_Integ_GLFixed_Type"))) return -1; (void) SLclass_set_destroy_function (cl, free_glfixed_integ_type); (void) SLclass_set_string_function (cl, glfixed_integ_type_string_method); if (-1 == SLclass_register_class (cl, SLANG_VOID_TYPE, sizeof (GLFixed_Integ_Type), SLANG_CLASS_TYPE_MMT)) return -1; GLFixed_Integ_Type_Id = SLclass_get_class_id (cl); return 0; } /*}}}*/ /*{{{ QAWS adaptive integration for singular functions */ typedef struct { gsl_integration_qaws_table *qaws_table; double alpha, beta; int mu, nu; } QAWS_Integ_Type; static int QAWS_Integ_Type_Id = -1; static void free_qaws_integ_type (SLtype type, VOID_STAR f) { QAWS_Integ_Type *q; (void) type; q = (QAWS_Integ_Type *) f; if (q->qaws_table != NULL) gsl_integration_qaws_table_free (q->qaws_table); SLfree ((char *) q); } static void new_qaws_integ_type (void) { QAWS_Integ_Type *q; double alpha, beta; int mu, nu; SLang_MMT_Type *mmt; if (SLang_Num_Function_Args != 4) { SLang_verror (SL_USAGE_ERROR, "Usage: qaws_table = integration_qaws_alloc(alpha, beta, mu, nu)"); return; } if ((-1 == SLang_pop_int (&nu)) || (-1 == SLang_pop_int (&mu)) || (-1 == SLang_pop_double (&beta)) || (-1 == SLang_pop_double (&alpha))) return; if (((mu != 1) && (mu != 0)) || ((nu != 1) && (nu != 0)) || (alpha <= -1) || (beta <= -1)) { SLang_verror (SL_InvalidParm_Error, "QAWS integration table parameters are invalid"); return; } if (NULL == (q = (QAWS_Integ_Type *) SLmalloc (sizeof (QAWS_Integ_Type)))) return; memset ((char *) q, 0, sizeof (QAWS_Integ_Type)); if (NULL == (q->qaws_table = gsl_integration_qaws_table_alloc (alpha, beta, mu, nu))) { SLang_verror (SL_RunTime_Error, "gsl_integration_qaws_table_alloc failed"); SLfree ((char *)q); return; } q->alpha = alpha; q->beta = beta; q->mu = mu; q->nu = nu; if (NULL == (mmt = SLang_create_mmt (QAWS_Integ_Type_Id, (VOID_STAR) q))) { free_qaws_integ_type (QAWS_Integ_Type_Id, (VOID_STAR) q); return; } if (-1 == SLang_push_mmt (mmt)) SLang_free_mmt (mmt); } static void integrate_qaws (void) { Func_Callback_Type fc; gsl_function f; SLang_MMT_Type *mmt; QAWS_Integ_Type *q; gsl_integration_workspace *w; double y, abserr; unsigned int limit; int status, has_parms; if ((SLang_Num_Function_Args < 7 ) || (SLang_Num_Function_Args > 8)) { SLang_verror (SL_USAGE_ERROR, "\ Usage: res = integration_qaws (&func, [{opt-parms-list},] a, b, epsabs, epsrel, limit, qaws_table);\n\ qaws_table is the table previously created by the integration_qaws_alloc function"); return; } has_parms = (SLang_Num_Function_Args == 8); if (NULL == (mmt = SLang_pop_mmt (QAWS_Integ_Type_Id))) return; if ((NULL == (q = (QAWS_Integ_Type *) SLang_object_from_mmt (mmt))) || (-1 == SLang_pop_uint (&limit)) || (-1 == pop_func_callback (&fc, 2, has_parms, LIMIT_TYPE_BOTH))) { SLang_free_mmt (mmt); return; } if (NULL == (w = gsl_integration_workspace_alloc (limit))) { free_func_callback (&fc); SLang_free_mmt (mmt); return; } f.function = integrand_func_callback; f.params = (void *)&fc; status = gsl_integration_qaws (&f, fc.a, fc.b, q->qaws_table, fc.epsabs, fc.epsrel, limit, w, &y, &abserr); gsl_integration_workspace_free (w); (void) push_integ_result (&fc, y, abserr, status); free_func_callback (&fc); SLang_free_mmt (mmt); } static char *qaws_integ_type_string_method (SLtype type, VOID_STAR f) { SLang_MMT_Type *mmt; GLFixed_Integ_Type *gl; char buf[256]; (void) type; mmt = *(SLang_MMT_Type **)f; if (NULL == (gl = (GLFixed_Integ_Type *) SLang_object_from_mmt (mmt))) return NULL; (void) SLsnprintf (buf, sizeof (buf), "GSL_QAWS_Integ_Type"); return SLmake_string (buf); } static int register_qaws_integ_type (void) { SLang_Class_Type *cl; if (NULL == (cl = SLclass_allocate_class ("GSL_QAWS_Integ_Type"))) return -1; (void) SLclass_set_destroy_function (cl, free_qaws_integ_type); (void) SLclass_set_string_function (cl, qaws_integ_type_string_method); if (-1 == SLclass_register_class (cl, SLANG_VOID_TYPE, sizeof (QAWS_Integ_Type), SLANG_CLASS_TYPE_MMT)) return -1; QAWS_Integ_Type_Id = SLclass_get_class_id (cl); return 0; } /*}}}*/ /*{{{ QAWO adaptive integration for oscillatory functions */ typedef struct { gsl_integration_qawo_table *qawo_table; double omega, L; int type; size_t n; } QAWO_Integ_Type; static int QAWO_Integ_Type_Id = -1; static void free_qawo_integ_type (SLtype type, VOID_STAR f) { QAWO_Integ_Type *q; (void) type; q = (QAWO_Integ_Type *) f; if (q->qawo_table != NULL) gsl_integration_qawo_table_free (q->qawo_table); SLfree ((char *) q); } static void new_qawo_integ_type (void) { QAWO_Integ_Type *q; double omega, L; unsigned long n; int type; SLang_MMT_Type *mmt; if (SLang_Num_Function_Args != 4) { SLang_verror (SL_USAGE_ERROR, "\ Usage: qawo_table = integration_qawo_alloc(omega, L, type, n);\n\ type is one of: GSL_INTEG_COSINE, GSL_INTEG_SINE"); return; } if ((-1 == SLang_pop_ulong (&n)) || (-1 == SLang_pop_int (&type)) || (-1 == SLang_pop_double (&L)) || (-1 == SLang_pop_double (&omega))) return; if ((type != (int)GSL_INTEG_SINE) && (type != (int)GSL_INTEG_COSINE)) { SLang_verror (SL_InvalidParm_Error, "integration_qawo_alloc: type must be one of GSL_INTEG_SINE/COSINE"); return; } if (NULL == (q = (QAWO_Integ_Type *) SLmalloc (sizeof (QAWO_Integ_Type)))) return; memset ((char *) q, 0, sizeof (QAWO_Integ_Type)); if (NULL == (q->qawo_table = gsl_integration_qawo_table_alloc (omega, L, (enum gsl_integration_qawo_enum)type, n))) { SLang_verror (SL_RunTime_Error, "gsl_integration_qawo_table_alloc failed"); SLfree ((char *)q); return; } q->omega = omega; q->L = L; q->type = type; q->n = n; if (NULL == (mmt = SLang_create_mmt (QAWO_Integ_Type_Id, (VOID_STAR) q))) { free_qawo_integ_type (QAWO_Integ_Type_Id, (VOID_STAR) q); return; } if (-1 == SLang_push_mmt (mmt)) SLang_free_mmt (mmt); } static void integrate_qawo (void) { Func_Callback_Type fc; gsl_function f; SLang_MMT_Type *mmt; QAWO_Integ_Type *q; gsl_integration_workspace *w; double y, abserr; unsigned int limit; int status, has_parms; if ((SLang_Num_Function_Args < 6 ) || (SLang_Num_Function_Args > 7)) { SLang_verror (SL_USAGE_ERROR, "\ Usage: res = integration_qawo (&func, [{opt-parms-list},] a, epsabs, epsrel, limit, qawo_table);\n\ qawo_table is the table previously created by the integration_qawo_alloc function"); return; } has_parms = (SLang_Num_Function_Args == 7); if (NULL == (mmt = SLang_pop_mmt (QAWO_Integ_Type_Id))) return; if ((NULL == (q = (QAWO_Integ_Type *) SLang_object_from_mmt (mmt))) || (-1 == SLang_pop_uint (&limit)) || (-1 == pop_func_callback (&fc, 2, has_parms, LIMIT_TYPE_LOWER))) { SLang_free_mmt (mmt); return; } if (NULL == (w = gsl_integration_workspace_alloc (limit))) { free_func_callback (&fc); SLang_free_mmt (mmt); return; } f.function = integrand_func_callback; f.params = (void *)&fc; status = gsl_integration_qawo (&f, fc.a, fc.epsabs, fc.epsrel, limit, w, q->qawo_table, &y, &abserr); gsl_integration_workspace_free (w); (void) push_integ_result (&fc, y, abserr, status); free_func_callback (&fc); SLang_free_mmt (mmt); } static void integrate_qawf (void) { Func_Callback_Type fc; gsl_function f; SLang_MMT_Type *mmt; QAWO_Integ_Type *q; gsl_integration_workspace *w, *w_cycle; double y, abserr; unsigned int limit; int status, has_parms; if ((SLang_Num_Function_Args < 5 ) || (SLang_Num_Function_Args > 6)) { SLang_verror (SL_USAGE_ERROR, "\ Usage: res = integration_qawf (&func, [{opt-parms-list},] a, epsabs, limit, qawo_table);\n\ qawo_table is the table previously created by the integration_qawo_alloc function"); return; } has_parms = (SLang_Num_Function_Args == 6); if (NULL == (mmt = SLang_pop_mmt (QAWO_Integ_Type_Id))) return; if ((NULL == (q = (QAWO_Integ_Type *) SLang_object_from_mmt (mmt))) || (-1 == SLang_pop_uint (&limit)) || (-1 == pop_func_callback (&fc, 1, has_parms, LIMIT_TYPE_LOWER))) { SLang_free_mmt (mmt); return; } if (NULL == (w = gsl_integration_workspace_alloc (limit))) { free_func_callback (&fc); SLang_free_mmt (mmt); return; } if (NULL == (w_cycle = gsl_integration_workspace_alloc (limit))) { gsl_integration_workspace_free (w); free_func_callback (&fc); SLang_free_mmt (mmt); return; } f.function = integrand_func_callback; f.params = (void *)&fc; status = gsl_integration_qawf (&f, fc.a, fc.epsabs, limit, w, w_cycle, q->qawo_table, &y, &abserr); gsl_integration_workspace_free (w_cycle); gsl_integration_workspace_free (w); (void) push_integ_result (&fc, y, abserr, status); free_func_callback (&fc); SLang_free_mmt (mmt); } static char *qawo_integ_type_string_method (SLtype type, VOID_STAR f) { SLang_MMT_Type *mmt; GLFixed_Integ_Type *gl; char buf[256]; (void) type; mmt = *(SLang_MMT_Type **)f; if (NULL == (gl = (GLFixed_Integ_Type *) SLang_object_from_mmt (mmt))) return NULL; (void) SLsnprintf (buf, sizeof (buf), "GSL_QAWO_Integ_Type"); return SLmake_string (buf); } static int register_qawo_integ_type (void) { SLang_Class_Type *cl; if (NULL == (cl = SLclass_allocate_class ("GSL_QAWO_Integ_Type"))) return -1; (void) SLclass_set_destroy_function (cl, free_qawo_integ_type); (void) SLclass_set_string_function (cl, qawo_integ_type_string_method); if (-1 == SLclass_register_class (cl, SLANG_VOID_TYPE, sizeof (QAWO_Integ_Type), SLANG_CLASS_TYPE_MMT)) return -1; QAWO_Integ_Type_Id = SLclass_get_class_id (cl); return 0; } /*}}}*/ #define V SLANG_VOID_TYPE static SLang_Intrin_Fun_Type Module_Intrinsics [] = { MAKE_INTRINSIC_0("integration_qng", integrate_qng, V), MAKE_INTRINSIC_0("integration_qag", integrate_qag, V), MAKE_INTRINSIC_0("integration_qags", integrate_qags, V), MAKE_INTRINSIC_0("integration_qagp", integrate_qagp, V), MAKE_INTRINSIC_0("integration_qagi", integrate_qagi, V), MAKE_INTRINSIC_0("integration_qagiu", integrate_qagiu, V), MAKE_INTRINSIC_0("integration_qagil", integrate_qagil, V), MAKE_INTRINSIC_0("integration_qawc", integrate_qawc, V), MAKE_INTRINSIC_0("integration_cquad", integrate_cquad, V), MAKE_INTRINSIC_0("integration_romberg", integrate_romberg, V), MAKE_INTRINSIC_0("integration_fixed_alloc", new_fixed_integ_type, V), MAKE_INTRINSIC_0("integration_fixed", integrate_fixed, V), MAKE_INTRINSIC_0("integration_glfixed_alloc", new_glfixed_integ_type, V), MAKE_INTRINSIC_0("integration_glfixed", integrate_glfixed, V), MAKE_INTRINSIC_0("integration_qaws_alloc", new_qaws_integ_type, V), MAKE_INTRINSIC_0("integration_qaws", integrate_qaws, V), MAKE_INTRINSIC_0("integration_qawo_alloc", new_qawo_integ_type, V), MAKE_INTRINSIC_0("integration_qawo", integrate_qawo, V), MAKE_INTRINSIC_0("integration_qawf", integrate_qawf, V), SLANG_END_INTRIN_FUN_TABLE }; #undef V static SLang_Intrin_Var_Type Module_Variables [] = { MAKE_VARIABLE("_gslinteg_module_version_string", &Module_Version_String, SLANG_STRING_TYPE, 1), SLANG_END_INTRIN_VAR_TABLE }; static SLang_IConstant_Type Module_IConstants [] = { MAKE_ICONSTANT("_gslinteg_module_version", MODULE_VERSION_NUMBER), MAKE_ICONSTANT("GSL_INTEG_SINE", GSL_INTEG_SINE), MAKE_ICONSTANT("GSL_INTEG_COSINE", GSL_INTEG_COSINE), MAKE_ICONSTANT("GSL_INTEG_GAUSS15", GSL_INTEG_GAUSS15), MAKE_ICONSTANT("GSL_INTEG_GAUSS21", GSL_INTEG_GAUSS21), MAKE_ICONSTANT("GSL_INTEG_GAUSS31", GSL_INTEG_GAUSS31), MAKE_ICONSTANT("GSL_INTEG_GAUSS41", GSL_INTEG_GAUSS41), MAKE_ICONSTANT("GSL_INTEG_GAUSS51", GSL_INTEG_GAUSS51), MAKE_ICONSTANT("GSL_INTEG_GAUSS61", GSL_INTEG_GAUSS61), SLANG_END_ICONST_TABLE }; int init_gslinteg_module_ns (char *ns_name) { SLang_NameSpace_Type *ns = SLns_create_namespace (ns_name); if (ns == NULL) return -1; if (Fixed_Integ_Type_Id == -1) { if (-1 == register_fixed_integ_type ()) return -1; if (-1 == register_glfixed_integ_type ()) return -1; if (-1 == register_qaws_integ_type ()) return -1; if (-1 == register_qawo_integ_type ()) return -1; } if ( (-1 == SLns_add_intrin_var_table (ns, Module_Variables, NULL)) || (-1 == SLns_add_intrin_fun_table (ns, Module_Intrinsics, NULL)) || (-1 == SLns_add_iconstant_table (ns, Module_IConstants, NULL)) ) return -1; return 0; } /* This function is optional */ void deinit_gslinteg_module (void) { } slgsl-pre0.10.0-7/src/gslcore-module.c0000644000175000000620000011441514713350753016277 0ustar johnstaff/* -*- mode: C; mode: fold; -*- */ /* Copyright (c) 2003, 2004, 2005 Massachusetts Institute of Technology This software was developed by the MIT Center for Space Research under contract SV1-61010 from the Smithsonian Institution. Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in the supporting documentation, and that the name of the Massachusetts Institute of Technology not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The Massachusetts Institute of Technology makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. THE MASSACHUSETTS INSTITUTE OF TECHNOLOGY DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE MASSACHUSETTS INSTITUTE OF TECHNOLOGY BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* Author: John E. Davis (jed@jedsoft.org) */ #include #include #include #include #include "slgsl.h" #include "version.h" #ifdef __cplusplus extern "C" { #endif SLANG_MODULE(gslcore); #ifdef __cplusplus } #endif /*{{{ Error Handling Routines */ #define MAX_ERRNO 128 #define SIZEOF_BITMAP (8 * sizeof(long)) #define NUM_BITMAPS (MAX_ERRNO/SIZEOF_BITMAP) typedef struct { unsigned long error; unsigned long warn; unsigned long ignore; SLang_Name_Type *callbacks[SIZEOF_BITMAP]; } Error_Bitmap_Type; static Error_Bitmap_Type Pos_Error_Bitmaps[NUM_BITMAPS]; static Error_Bitmap_Type Neg_Error_Bitmaps[NUM_BITMAPS]; static unsigned long Num_Errors; void slgsl_reset_errors (void) { unsigned int i; for (i = 0; i < NUM_BITMAPS; i++) { Pos_Error_Bitmaps[i].error = 0; Neg_Error_Bitmaps[i].error = 0; } Num_Errors = 0; } static void do_bitmap (char *func, Error_Bitmap_Type *bitmaps, int dir) { unsigned int b; for (b = 0; b < NUM_BITMAPS; b++) { unsigned long e_bitmap = bitmaps[b].error; unsigned long w_bitmap = bitmaps[b].warn; SLang_Name_Type **callbacks = bitmaps[b].callbacks; unsigned int i = b * SIZEOF_BITMAP; while (e_bitmap) { if (e_bitmap & 1) { int gsl_errno = dir * (b * SIZEOF_BITMAP + i); if (callbacks[i] != NULL) { if ((-1 == SLang_start_arg_list ()) || (-1 == SLang_push_string (func)) || (-1 == SLang_push_integer (gsl_errno)) || (-1 == SLang_start_arg_list ()) || (-1 == SLexecute_function (callbacks[i]))) return; } else if (w_bitmap & 1) SLang_vmessage ("*** Warning: %s: %s\r\n", func, gsl_strerror (gsl_errno)); else SLang_verror (SL_INTRINSIC_ERROR, "%s: %s", func, gsl_strerror (gsl_errno)); } e_bitmap = e_bitmap >> 1; w_bitmap = w_bitmap >> 1; i++; } } } void slgsl_check_errors (const char *funct) { if (Num_Errors == 0) return; do_bitmap (funct, Pos_Error_Bitmaps, 1); do_bitmap (funct, Neg_Error_Bitmaps, -1); Num_Errors = 0; } static Error_Bitmap_Type *find_bitmap (int gsl_errno, int slerr, unsigned long *mask, unsigned int *ofsp) { Error_Bitmap_Type *bitmaps; int ofs; if (gsl_errno > 0) bitmaps = Pos_Error_Bitmaps; else { bitmaps = Neg_Error_Bitmaps; gsl_errno = -gsl_errno; } if (gsl_errno >= MAX_ERRNO) { SLang_verror (slerr, "GLS errno (%d) is larger than supported value (%d)\n", gsl_errno, MAX_ERRNO-1); return NULL; } bitmaps += gsl_errno/SIZEOF_BITMAP; ofs = gsl_errno % SIZEOF_BITMAP; *mask = (1L << ofs); if (ofsp != NULL) *ofsp = (unsigned int)ofs; return bitmaps; } static void err_handler (const char * reason, const char * file, int line, int gsl_errno) { Error_Bitmap_Type *bitmap; unsigned long mask; (void) reason; (void) file; (void) line; if (gsl_errno == 0) return; if (NULL == (bitmap = find_bitmap (gsl_errno, SL_APPLICATION_ERROR, &mask, NULL))) { Num_Errors++; return; } if (bitmap->ignore & mask) return; bitmap->error |= mask; Num_Errors++; } static int set_gsl_error_disposition (int gsl_errno, int how, SLang_Name_Type *callback) { Error_Bitmap_Type *bitmap; unsigned long mask; unsigned int ofs; if (NULL == (bitmap = find_bitmap (gsl_errno, SL_INVALID_PARM, &mask, &ofs))) return -1; bitmap->ignore &= ~mask; bitmap->warn &= ~mask; SLang_free_function (bitmap->callbacks[ofs]); /* NULL ok */ if (NULL != (bitmap->callbacks[ofs] = callback)) return -1; if (how == 0) bitmap->ignore |= mask; else if (how == 1) bitmap->warn |= mask; return 0; } static void set_error_disposition (void) { int gsl_errno; int how = 0; SLang_Name_Type *callback = NULL; if (SLang_peek_at_stack () == SLANG_INT_TYPE) { if (-1 == SLang_pop_integer (&how)) return; } else if (NULL == (callback = SLang_pop_function ())) return; if ((-1 == SLang_pop_integer (&gsl_errno)) || (-1 == set_gsl_error_disposition (gsl_errno, how, callback))) SLang_free_function (callback);/* NULL ok */ } /*}}}*/ /*{{{ Array popping routines */ static int pop_array (SLang_Array_Type **atp, SLtype type, unsigned int ndims) { SLang_Array_Type *at; *atp = 0; if (-1 == SLang_pop_array_of_type (&at, type)) return -1; if (at->num_dims != ndims) { SLang_verror (SL_INVALID_PARM, "Context requires a %d-d array", ndims); SLang_free_array (at); return -1; } *atp = at; return 0; } void slgsl_free_d_array (SLGSL_Double_Array_Type *a) { if (a->at != NULL) SLang_free_array (a->at); } int slgsl_push_d_array (SLGSL_Double_Array_Type *a, int do_free) { if (a->at != NULL) return SLang_push_array (a->at, do_free); return SLang_push_double (a->x); } void slgsl_free_i_array (SLGSL_Int_Array_Type *a) { if (a->at != NULL) SLang_free_array (a->at); } int slgsl_push_i_array (SLGSL_Int_Array_Type *a, int do_free) { if (a->at != NULL) return SLang_push_array (a->at, do_free); return SLang_push_integer (a->x); } int slgsl_create_d_array (SLGSL_Double_Array_Type *a, SLGSL_Double_Array_Type *b) { if (a->at != NULL) { if (NULL == (b->at = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, a->at->dims, a->at->num_dims))) return -1; b->xp = (double *)b->at->data; b->num_elements = b->at->num_elements; b->inc = 1; return 0; } b->inc = 0; b->xp = &b->x; b->num_elements = 1; b->at = NULL; return 0; } int slgsl_pop_d_array (SLGSL_Double_Array_Type *a, int array_required) { if (array_required || (SLang_peek_at_stack () == SLANG_ARRAY_TYPE)) { if (-1 == SLang_pop_array_of_type (&a->at, SLANG_DOUBLE_TYPE)) return -1; a->xp = (double *) a->at->data; a->inc = 1; a->num_elements = a->at->num_elements; return 0; } a->at = NULL; a->xp = &a->x; a->inc = 0; a->num_elements = 1; #if SLANG_VERSION < 20000 return SLang_pop_double (a->xp, NULL, NULL); #else return SLang_pop_double (a->xp); #endif } /* Complex wrappers */ void slgsl_free_c_array (SLGSL_Complex_Array_Type *a) { if (a->at != NULL) SLang_free_array (a->at); } int slgsl_push_c_array (SLGSL_Complex_Array_Type *a, int do_free) { if (a->at != NULL) return SLang_push_array (a->at, do_free); return SLang_push_complex (a->x[0], a->x[1]); } int slgsl_create_c_array (SLGSL_Complex_Array_Type *a, SLGSL_Complex_Array_Type *b) { if (a->at != NULL) { if (NULL == (b->at = SLang_create_array (SLANG_COMPLEX_TYPE, 0, NULL, a->at->dims, a->at->num_dims))) return -1; b->xp = (double *)b->at->data; b->num_elements = b->at->num_elements; b->inc = 1; return 0; } b->inc = 0; b->xp = &b->x; b->num_elements = 1; b->at = NULL; return 0; } int slgsl_pop_c_array (SLGSL_Complex_Array_Type *a, int array_required) { if (array_required || (SLang_peek_at_stack () == SLANG_ARRAY_TYPE)) { if (-1 == SLang_pop_array_of_type (&a->at, SLANG_COMPLEX_TYPE)) return -1; a->xp = (double *) a->at->data; a->inc = 1; a->num_elements = a->at->num_elements; return 0; } a->at = NULL; a->xp = a->x; a->inc = 0; a->num_elements = 1; return SLang_pop_complex (&a->x[0], &a->x[1]); } int slgsl_pop_i_array (SLGSL_Int_Array_Type *a, int array_required) { if (array_required || (SLang_peek_at_stack () == SLANG_ARRAY_TYPE)) { if (-1 == SLang_pop_array_of_type (&a->at, SLANG_INT_TYPE)) return -1; a->xp = (int *) a->at->data; a->inc = 1; a->num_elements = a->at->num_elements; return 0; } a->at = NULL; a->xp = &a->x; a->inc = 0; a->num_elements = 1; return SLang_pop_integer (a->xp); } int slgsl_pop_dd_array (SLGSL_Double_Array_Type *a, SLGSL_Double_Array_Type *b, int array_required) { if (-1 == slgsl_pop_d_array (b, array_required)) return -1; if (-1 == slgsl_pop_d_array (a, array_required)) return -1; if ((a->at != NULL) && (b->at != NULL) && (a->num_elements != b->num_elements)) { SLang_verror (SL_TYPE_MISMATCH, "This function requires arrays of the same size"); SLang_free_array (a->at); SLang_free_array (b->at); return -1; } return 0; } int slgsl_pop_id_array (SLGSL_Int_Array_Type *a, SLGSL_Double_Array_Type *b, int array_required) { if (-1 == slgsl_pop_d_array (b, array_required)) return -1; if (-1 == slgsl_pop_i_array (a, array_required)) return -1; if ((a->at != NULL) && (b->at != NULL) && (a->num_elements != b->num_elements)) { SLang_verror (SL_TYPE_MISMATCH, "This function requires arrays of the same size"); SLang_free_array (a->at); SLang_free_array (b->at); return -1; } return 0; } int slgsl_pop_idd_array (SLGSL_Int_Array_Type *a, SLGSL_Double_Array_Type *b, SLGSL_Double_Array_Type *c, int array_required) { if (-1 == slgsl_pop_dd_array (b, c, array_required)) return -1; if (-1 == slgsl_pop_i_array (a, array_required)) return -1; if (a->at != NULL) { if (((b->at != NULL) && (a->num_elements != b->num_elements)) || ((c->at != NULL) && (a->num_elements != c->num_elements))) { SLang_verror (SL_TYPE_MISMATCH, "This function requires arrays of the same size"); SLang_free_array (a->at); SLang_free_array (b->at); SLang_free_array (c->at); return -1; } } return 0; } int slgsl_pop_iid_array (SLGSL_Int_Array_Type *a, SLGSL_Int_Array_Type *b, SLGSL_Double_Array_Type *c, int array_required) { if (-1 == slgsl_pop_id_array (b, c, array_required)) return -1; if (-1 == slgsl_pop_i_array (a, array_required)) return -1; if (a->at != NULL) { if (((b->at != NULL) && (a->num_elements != b->num_elements)) || ((c->at != NULL) && (a->num_elements != c->num_elements))) { SLang_verror (SL_TYPE_MISMATCH, "This function requires arrays of the same size"); SLang_free_array (a->at); SLang_free_array (b->at); SLang_free_array (c->at); return -1; } } return 0; } int slgsl_pop_iidd_array (SLGSL_Int_Array_Type *a, SLGSL_Int_Array_Type *b, SLGSL_Double_Array_Type *c, SLGSL_Double_Array_Type *d, int array_required) { if (-1 == slgsl_pop_idd_array (b, c, d, array_required)) return -1; if (-1 == slgsl_pop_i_array (a, array_required)) return -1; if (a->at != NULL) { if (((b->at != NULL) && (a->at->num_elements != b->at->num_elements)) || ((c->at != NULL) && (a->at->num_elements != c->at->num_elements)) || ((d->at != NULL) && (a->at->num_elements != d->at->num_elements))) { SLang_verror (SL_TYPE_MISMATCH, "This function requires arrays of the same size"); SLang_free_array (a->at); SLang_free_array (b->at); SLang_free_array (c->at); SLang_free_array (d->at); return -1; } } return 0; } int slgsl_pop_ddd_array (SLGSL_Double_Array_Type *a, SLGSL_Double_Array_Type *b, SLGSL_Double_Array_Type *c, int array_required) { if (-1 == slgsl_pop_dd_array (b, c, array_required)) return -1; if (-1 == slgsl_pop_d_array (a, array_required)) return -1; if (a->at != NULL) { if (((b->at != NULL) && (a->num_elements != b->num_elements)) || ((c->at != NULL) && (a->num_elements != c->num_elements))) { SLang_verror (SL_TYPE_MISMATCH, "This function requires arrays of the same size"); SLang_free_array (a->at); SLang_free_array (b->at); SLang_free_array (c->at); return -1; } } return 0; } int slgsl_pop_dddd_array (SLGSL_Double_Array_Type *a, SLGSL_Double_Array_Type *b, SLGSL_Double_Array_Type *c, SLGSL_Double_Array_Type *d, int array_required) { if (-1 == slgsl_pop_ddd_array (b, c, d, array_required)) return -1; if (-1 == slgsl_pop_d_array (a, array_required)) return -1; if (a->at != NULL) { if (((b->at != NULL) && (a->num_elements != b->num_elements)) || ((c->at != NULL) && (a->num_elements != c->num_elements)) || ((d->at != NULL) && (a->num_elements != d->num_elements))) { SLang_verror (SL_TYPE_MISMATCH, "This function requires arrays of the same size"); SLang_free_array (a->at); SLang_free_array (b->at); SLang_free_array (c->at); SLang_free_array (d->at); return -1; } } return 0; } /*}}}*/ /*{{{ Utility functions for GLS Vector/Matrix types */ static void free_double_matrix (SLGSL_Matrix_Type *matrix) { if (matrix->at != NULL) SLang_free_array (matrix->at); else if (matrix->m.d.data != NULL) SLfree ((char *) matrix->m.d.data); } static int push_double_matrix (SLGSL_Matrix_Type *matrix) { SLang_Array_Type *at; SLtype type; gsl_matrix *m; SLindex_Type dims[2]; double *data; if (NULL != (at = matrix->at)) return SLang_push_array (at, 0); m = &matrix->m.d; type = SLANG_DOUBLE_TYPE; data = m->data; dims[0] = m->size1; dims[1] = m->size2; at = SLang_create_array (type, 0, data, dims, 2); if (at == NULL) return -1; /* stealing the data array */ m->data = NULL; return SLang_push_array (at, 1); } static int init_double_matrix (SLGSL_Matrix_Type *matrix, unsigned int n0, unsigned int n1, int copy, SLang_Array_Type *at) { gsl_matrix *m; m = &matrix->m.d; matrix->size1 = m->size1 = n0; matrix->size2 = m->size2 = n1; m->tda = n1; m->owner = 0; if ((at != NULL) && (copy == 0)) { m->data = (double *) at->data; matrix->at = at; } else { unsigned int nbytes = n0*n1*sizeof(double); if (NULL == (m->data = (double *)SLmalloc (nbytes))) return -1; if (at != NULL) memcpy ((char *)m->data, (char *)at->data, nbytes); matrix->at = NULL; } matrix->is_complex = 0; matrix->free_method = free_double_matrix; matrix->push_method = push_double_matrix; return 0; } static void free_complex_matrix (SLGSL_Matrix_Type *matrix) { if (matrix->at != NULL) SLang_free_array (matrix->at); else if (matrix->m.c.data != NULL) SLfree ((char *) matrix->m.c.data); } static int push_complex_matrix (SLGSL_Matrix_Type *matrix) { SLang_Array_Type *at; SLtype type; gsl_matrix_complex *c; SLindex_Type dims[2]; double *data; if (NULL != (at = matrix->at)) return SLang_push_array (at, 0); c = &matrix->m.c; type = SLANG_COMPLEX_TYPE; data = c->data; dims[0] = c->size1; dims[1] = c->size2; at = SLang_create_array (type, 0, data, dims, 2); if (at == NULL) return -1; /* stealing the data array */ c->data = NULL; return SLang_push_array (at, 1); } static int init_complex_matrix (SLGSL_Matrix_Type *matrix, unsigned int n0, unsigned int n1, int copy, SLang_Array_Type *at) { gsl_matrix_complex *c; c = &matrix->m.c; matrix->size1 = c->size1 = n0; matrix->size2 = c->size2 = n1; c->tda = n1; c->owner = 0; if ((at != NULL) && (copy == 0)) { c->data = (double *) at->data; matrix->at = at; } else { unsigned int nbytes = 2*n0*n1*sizeof(double); if (NULL == (c->data = (double *)SLmalloc (nbytes))) return -1; if (at != NULL) memcpy ((char *)c->data, (char *)at->data, nbytes); matrix->at = NULL; } matrix->is_complex = 1; matrix->free_method = free_complex_matrix; matrix->push_method = push_complex_matrix; return 0; } void slgsl_free_matrix (SLGSL_Matrix_Type *matrix) { if (matrix == NULL) return; (*matrix->free_method)(matrix); SLfree ((char *)matrix); } SLGSL_Matrix_Type *slgsl_new_matrix (SLtype type, unsigned int n0, unsigned int n1, int copy, SLang_Array_Type *at) { SLGSL_Matrix_Type *matrix; int status; if (NULL == (matrix = (SLGSL_Matrix_Type *)SLcalloc (1, sizeof (SLGSL_Matrix_Type)))) return NULL; if (type == SLANG_COMPLEX_TYPE) status = init_complex_matrix (matrix, n0, n1, copy, at); else status = init_double_matrix (matrix, n0, n1, copy, at); if (status == -1) { SLfree ((char *) matrix); return NULL; } return matrix; } int slgsl_push_matrix (SLGSL_Matrix_Type *matrix) { return (*matrix->push_method)(matrix); } int slgsl_pop_matrix (SLGSL_Matrix_Type **matrixp, SLtype type, int copy) { SLang_Array_Type *at; SLGSL_Matrix_Type *matrix; *matrixp = NULL; if (-1 == pop_array (&at, type, 2)) return -1; if (NULL == (matrix = new_matrix (type, at->dims[0], at->dims[1], copy, at))) { SLang_free_array (at); return -1; } if (copy) SLang_free_array (at); *matrixp = matrix; return 0; } int slgsl_pop_square_matrix (SLGSL_Matrix_Type **matrixp, SLtype type, int copy) { SLGSL_Matrix_Type *matrix; if (-1 == pop_matrix (&matrix, type, copy)) { *matrixp = NULL; return -1; } if (matrix->size1 != matrix->size2) { SLang_verror (SL_INVALID_PARM, "Expecting a square matrix"); free_matrix (matrix); return -1; } *matrixp = matrix; return 0; } /* Functions to create/destroy vectors */ static void free_double_vector (SLGSL_Vector_Type *vector) { if (vector->at != NULL) SLang_free_array (vector->at); else if (vector->v.d.data != NULL) SLfree ((char *) vector->v.d.data); } static int push_double_vector (SLGSL_Vector_Type *vector) { SLang_Array_Type *at; SLtype type; gsl_vector *v; SLindex_Type dims[1]; double *data; if (NULL != (at = vector->at)) return SLang_push_array (at, 0); v = &vector->v.d; type = SLANG_DOUBLE_TYPE; data = v->data; dims[0] = v->size; at = SLang_create_array (type, 0, data, dims, 1); if (at == NULL) return -1; /* stealing the data array */ v->data = NULL; return SLang_push_array (at, 1); } static int init_double_vector (SLGSL_Vector_Type *vector, unsigned int n, int copy, SLang_Array_Type *at) { gsl_vector *v; v = &vector->v.d; vector->size = v->size = n; v->stride = 1; v->owner = 0; if ((at != NULL) && (copy == 0)) { v->data = (double *) at->data; vector->at = at; } else { unsigned int nbytes = n*sizeof(double); if (NULL == (v->data = (double *)SLmalloc (nbytes))) return -1; if (at != NULL) memcpy ((char *)v->data, (char *)at->data, nbytes); vector->at = NULL; } vector->is_complex = 0; vector->free_method = free_double_vector; vector->push_method = push_double_vector; return 0; } static void free_complex_vector (SLGSL_Vector_Type *vector) { if (vector->at != NULL) SLang_free_array (vector->at); else if (vector->v.c.data != NULL) SLfree ((char *) vector->v.c.data); } static int push_complex_vector (SLGSL_Vector_Type *vector) { SLang_Array_Type *at; SLtype type; gsl_vector_complex *v; SLindex_Type dims[1]; double *data; if (NULL != (at = vector->at)) return SLang_push_array (at, 0); v = &vector->v.c; type = SLANG_COMPLEX_TYPE; data = v->data; dims[0] = v->size; at = SLang_create_array (type, 0, data, dims, 1); if (at == NULL) return -1; /* stealing the data array */ v->data = NULL; return SLang_push_array (at, 1); } static int init_complex_vector (SLGSL_Vector_Type *vector, unsigned int n, int copy, SLang_Array_Type *at) { gsl_vector_complex *v; v = &vector->v.c; vector->size = v->size = n; v->stride = 1; v->owner = 0; if ((at != NULL) && (copy == 0)) { v->data = (double *) at->data; vector->at = at; } else { unsigned int nbytes = 2*n*sizeof(double); if (NULL == (v->data = (double *)SLmalloc (nbytes))) return -1; if (at != NULL) memcpy ((char *)v->data, (char *)at->data, nbytes); vector->at = NULL; } vector->is_complex = 0; vector->free_method = free_complex_vector; vector->push_method = push_complex_vector; return 0; } void slgsl_free_vector (SLGSL_Vector_Type *vector) { if (vector == NULL) return; (*vector->free_method)(vector); SLfree ((char *)vector); } SLGSL_Vector_Type *slgsl_new_vector (SLtype type, unsigned int n, int copy, SLang_Array_Type *at) { SLGSL_Vector_Type *vector; int status; if (NULL == (vector = (SLGSL_Vector_Type *)SLcalloc (1, sizeof (SLGSL_Vector_Type)))) return NULL; if (type == SLANG_COMPLEX_TYPE) status = init_complex_vector (vector, n, copy, at); else status = init_double_vector (vector, n, copy, at); if (status == -1) { SLfree ((char *) vector); return NULL; } return vector; } int slgsl_push_vector (SLGSL_Vector_Type *vector) { return (*vector->push_method)(vector); } int slgsl_assign_vector_to_ref (SLGSL_Vector_Type *vector, SLang_Ref_Type *ref) { SLang_Array_Type *at; int status; if (-1 == push_vector (vector)) return -1; if (-1 == SLang_pop_array (&at, 0)) return -1; status = SLang_assign_to_ref (ref, SLANG_ARRAY_TYPE, (VOID_STAR)&at); SLang_free_array (at); return status; } int slgsl_pop_vector (SLGSL_Vector_Type **vectorp, SLtype type, int copy) { SLang_Array_Type *at; SLGSL_Vector_Type *vector; *vectorp = NULL; if (-1 == pop_array (&at, type, 1)) return -1; if (NULL == (vector = new_vector (type, at->dims[0], copy, at))) { SLang_free_array (at); return -1; } if (copy) SLang_free_array (at); *vectorp = vector; return 0; } /*}}}*/ /*{{{ Vectorized routines for scalar functions */ static void do_d_d (double (*f)(double)) { SLGSL_Double_Array_Type a; SLang_Array_Type *in, *out; unsigned int i, n; double *xp, *yp; if (-1 == slgsl_pop_d_array (&a, 0)) return; if (NULL == (in = a.at)) { (void) SLang_push_double ((*f)(a.x)); return; } if (NULL == (out = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, in->dims, in->num_dims))) { SLang_free_array (in); return; } n = in->num_elements; xp = a.xp; yp = (double *) out->data; for (i = 0; i < n; i++) yp[i] = (*f)(xp[i]); (void) SLang_push_array (out, 1); SLang_free_array (in); } static void do_i_d (int (*f)(double)) { SLGSL_Double_Array_Type a; SLang_Array_Type *in, *out; unsigned int i, n; double *xp; int *yp; if (-1 == slgsl_pop_d_array (&a, 0)) return; if (NULL == (in = a.at)) { (void) SLang_push_integer ((*f)(a.x)); return; } if (NULL == (out = SLang_create_array (SLANG_INT_TYPE, 0, NULL, in->dims, in->num_dims))) { SLang_free_array (in); return; } n = in->num_elements; xp = a.xp; yp = (int *) out->data; for (i = 0; i < n; i++) yp[i] = (*f)(xp[i]); (void) SLang_push_array (out, 1); SLang_free_array (in); } static void do_d_dd (double (*f)(double, double)) { SLGSL_Double_Array_Type a, b; SLang_Array_Type *atz; unsigned int i, n; double *xp, *yp, *zp; unsigned int xinc, yinc; if (-1 == slgsl_pop_dd_array (&a, &b, 0)) return; if ((NULL == (atz = a.at)) && (NULL == (atz = b.at))) { (void) SLang_push_double ((*f)(a.x, b.x)); return; } atz = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, atz->dims, atz->num_dims); if (atz == NULL) { SLang_free_array (a.at); SLang_free_array (b.at); return; } n = atz->num_elements; zp = (double *) atz->data; xp = a.xp; yp = b.xp; xinc = a.inc; yinc = b.inc; for (i = 0; i < n; i++) { zp[i] = (*f)(*xp, *yp); xp += xinc; yp += yinc; } (void) SLang_push_array (atz, 1); SLang_free_array (a.at); SLang_free_array (b.at); } static void do_d_i (double (*f)(int)) { SLGSL_Int_Array_Type a; SLang_Array_Type *in, *out; unsigned int i, n; double *yp; int *xp; if (-1 == slgsl_pop_i_array (&a, 0)) return; if (NULL == (in = a.at)) { (void) SLang_push_double ((*f)(a.x)); return; } if (NULL == (out = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, in->dims, in->num_dims))) { SLang_free_array (in); return; } n = in->num_elements; xp = a.xp; yp = (double *) out->data; for (i = 0; i < n; i++) yp[i] = (*f)(xp[i]); (void) SLang_push_array (out, 1); SLang_free_array (in); } static void do_d_id (double (*f)(int, double)) { SLGSL_Double_Array_Type b; SLGSL_Int_Array_Type a; SLang_Array_Type *atz; unsigned int i, n; double *yp, *zp; int *xp; unsigned int xinc, yinc; if (-1 == slgsl_pop_id_array (&a, &b, 0)) return; if (NULL == (atz = a.at)) { if (b.at == NULL) { (void) SLang_push_double ((*f)(a.x, b.x)); return; } atz = b.at; } atz = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, atz->dims, atz->num_dims); if (atz == NULL) { SLang_free_array (a.at); SLang_free_array (b.at); return; } n = atz->num_elements; zp = (double *) atz->data; xp = a.xp; yp = b.xp; xinc = a.inc; yinc = b.inc; for (i = 0; i < n; i++) { zp[i] = (*f)(*xp, *yp); xp += xinc; yp += yinc; } (void) SLang_push_array (atz, 1); SLang_free_array (a.at); SLang_free_array (b.at); } static void do_d_idd (double (*f)(int, double, double)) { SLGSL_Int_Array_Type a; SLGSL_Double_Array_Type b, c; SLang_Array_Type *atz; unsigned int i, n; double *bp, *cp, *zp; int *ap; unsigned int ainc, binc, cinc; if (-1 == slgsl_pop_idd_array (&a, &b, &c, 0)) return; if ((NULL == (atz = a.at)) && (NULL == (atz = b.at)) && (NULL == (atz = c.at))) { (void) SLang_push_double ((*f)(a.x, b.x, c.x)); return; } atz = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, atz->dims, atz->num_dims); if (atz == NULL) { SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); return; } n = atz->num_elements; zp = (double *) atz->data; ap = a.xp; bp = b.xp; cp = c.xp; ainc = a.inc; binc = b.inc; cinc = c.inc; for (i = 0; i < n; i++) { zp[i] = (*f)(*ap, *bp, *cp); ap += ainc; bp += binc; cp += cinc; } (void) SLang_push_array (atz, 1); SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); } static void do_d_iid (double (*f)(int, int, double)) { SLGSL_Int_Array_Type a, b; SLGSL_Double_Array_Type c; SLang_Array_Type *atz; unsigned int i, n; double *cp, *zp; int *ap, *bp; unsigned int ainc, binc, cinc; if (-1 == slgsl_pop_iid_array (&a, &b, &c, 0)) return; if ((NULL == (atz = a.at)) && (NULL == (atz = b.at)) && (NULL == (atz = c.at))) { (void) SLang_push_double ((*f)(a.x, b.x, c.x)); return; } atz = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, atz->dims, atz->num_dims); if (atz == NULL) { SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); return; } n = atz->num_elements; zp = (double *) atz->data; ap = a.xp; bp = b.xp; cp = c.xp; ainc = a.inc; binc = b.inc; cinc = c.inc; for (i = 0; i < n; i++) { zp[i] = (*f)(*ap, *bp, *cp); ap += ainc; bp += binc; cp += cinc; } (void) SLang_push_array (atz, 1); SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); } static void do_d_iidd (double (*f)(int, int, double, double)) { SLGSL_Int_Array_Type a, b; SLGSL_Double_Array_Type c, d; SLang_Array_Type *atz; unsigned int i, n; double *cp, *dp, *zp; int *ap, *bp; unsigned int ainc, binc, cinc, dinc; if (-1 == slgsl_pop_iidd_array (&a, &b, &c, &d, 0)) return; if ((NULL == (atz = a.at)) && (NULL == (atz = b.at)) && (NULL == (atz = c.at)) && (NULL == (atz = d.at))) { (void) SLang_push_double ((*f)(a.x, b.x, c.x, d.x)); return; } atz = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, atz->dims, atz->num_dims); if (atz == NULL) { SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); SLang_free_array (d.at); return; } n = atz->num_elements; zp = (double *) atz->data; ap = a.xp; bp = b.xp; cp = c.xp; dp = d.xp; ainc = a.inc; binc = b.inc; cinc = c.inc; dinc = d.inc; for (i = 0; i < n; i++) { zp[i] = (*f)(*ap, *bp, *cp, *dp); ap += ainc; bp += binc; cp += cinc; dp += dinc; } (void) SLang_push_array (atz, 1); SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); SLang_free_array (d.at); } static void do_d_ddd (double (*f)(double, double, double)) { SLGSL_Double_Array_Type a, b, c; SLang_Array_Type *atz; unsigned int i, n; double *ap, *bp, *cp, *zp; unsigned int ainc, binc, cinc; if (-1 == slgsl_pop_ddd_array (&a, &b, &c, 0)) return; if ((NULL == (atz = a.at)) && (NULL == (atz = b.at)) && (NULL == (atz = c.at))) { (void) SLang_push_double ((*f)(a.x, b.x, c.x)); return; } atz = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, atz->dims, atz->num_dims); if (atz == NULL) { SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); return; } n = atz->num_elements; zp = (double *) atz->data; ap = a.xp; bp = b.xp; cp = c.xp; ainc = a.inc; binc = b.inc; cinc = c.inc; for (i = 0; i < n; i++) { zp[i] = (*f)(*ap, *bp, *cp); ap += ainc; bp += binc; cp += cinc; } (void) SLang_push_array (atz, 1); SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); } static void do_d_dddd (double (*f)(double, double, double, double)) { SLGSL_Double_Array_Type a, b, c, d; SLang_Array_Type *atz; unsigned int i, n; double *ap, *bp, *cp, *dp, *zp; unsigned int ainc, binc, cinc, dinc; if (-1 == slgsl_pop_dddd_array (&a, &b, &c, &d, 0)) return; if ((NULL == (atz = a.at)) && (NULL == (atz = b.at)) && (NULL == (atz = c.at)) && (NULL == (atz = d.at))) { (void) SLang_push_double ((*f)(a.x, b.x, c.x, d.x)); return; } atz = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, atz->dims, atz->num_dims); if (atz == NULL) { SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); SLang_free_array (d.at); return; } n = atz->num_elements; zp = (double *) atz->data; ap = a.xp; bp = b.xp; cp = c.xp; dp = c.xp; ainc = a.inc; binc = b.inc; cinc = c.inc; dinc = d.inc; for (i = 0; i < n; i++) { zp[i] = (*f)(*ap, *bp, *cp, *dp); ap += ainc; bp += binc; cp += cinc; dp += dinc; } (void) SLang_push_array (atz, 1); SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); SLang_free_array (d.at); } void slgsl_do_d_d_fun (char *fun, double (*f)(double)) { if (SLang_Num_Function_Args != 1) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double)", fun); return; } slgsl_reset_errors (); do_d_d (f); slgsl_check_errors (fun); } void slgsl_do_d_i_fun (char *fun, double (*f)(int)) { if (SLang_Num_Function_Args != 1) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(int)", fun); return; } slgsl_reset_errors (); do_d_i (f); slgsl_check_errors (fun); } void slgsl_do_d_dd_fun (char *fun, double (*f)(double, double)) { if (SLang_Num_Function_Args != 2) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double, double)", fun); return; } slgsl_reset_errors (); do_d_dd (f); slgsl_check_errors (fun); } void slgsl_do_d_ddd_fun (char *fun, double (*f)(double, double, double)) { if (SLang_Num_Function_Args != 3) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double, double, double)", fun); return; } slgsl_reset_errors (); do_d_ddd (f); slgsl_check_errors (fun); } void slgsl_do_d_dddd_fun (char *fun, double (*f)(double, double, double,double)) { if (SLang_Num_Function_Args != 4) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double, double, double, double)", fun); return; } slgsl_reset_errors (); do_d_dddd (f); slgsl_check_errors (fun); } void slgsl_do_d_id_fun (char *fun, double (*f)(int, double)) { if (SLang_Num_Function_Args != 2) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(int, double)", fun); return; } slgsl_reset_errors (); do_d_id (f); slgsl_check_errors (fun); } void slgsl_do_d_idd_fun (char *fun, double (*f)(int, double, double)) { if (SLang_Num_Function_Args != 3) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(int, double, double)", fun); return; } slgsl_reset_errors (); do_d_idd (f); slgsl_check_errors (fun); } void slgsl_do_d_iid_fun (char *fun, double (*f)(int, int, double)) { if (SLang_Num_Function_Args != 3) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(int, int, double)", fun); return; } slgsl_reset_errors (); do_d_iid (f); slgsl_check_errors (fun); } void slgsl_do_d_iidd_fun (char *fun, double (*f)(int, int, double, double)) { if (SLang_Num_Function_Args != 3) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(int, int, double, double)", fun); return; } slgsl_reset_errors (); do_d_iidd (f); slgsl_check_errors (fun); } void slgsl_do_i_d_fun (char *fun, int (*f)(double)) { if (SLang_Num_Function_Args != 1) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double)", fun); return; } slgsl_reset_errors (); do_i_d (f); slgsl_check_errors (fun); } /* Complex functions */ static void do_c_c (int (*f)(double, double, gsl_sf_result*, gsl_sf_result*)) { SLGSL_Complex_Array_Type a; SLang_Array_Type *in, *out; unsigned int i, n; gsl_sf_result gsl_zr, gsl_zi; double *xp, *yp, zr, zi; if (-1 == slgsl_pop_c_array (&a, 0)) return; if (NULL == (in = a.at)) { (void) (*f)(a.x[0], a.x[1], &gsl_zr, gsl_zi); (void) SLang_push_complex (gsl_zr.val, gsl_zi.val); return; } if (NULL == (out = SLang_create_array (SLANG_COMPLEX_TYPE, 0, NULL, in->dims, in->num_dims))) { SLang_free_array (in); return; } n = in->num_elements; xp = a.xp; yp = (double *) out->data; for (i = 0; i < 2*n; i+=2) { (void) (*f)(xp[i], xp[i+1], &gsl_zr, &gsl_zi); yp[i] = gsl_zr.val; yp[i+1] = gsl_zi.val; } (void) SLang_push_array (out, 1); SLang_free_array (in); } void slgsl_do_c_c_fun (const char *fun, int (*f)(double, double, gsl_sf_result*, gsl_sf_result*)) { if (SLang_Num_Function_Args != 1) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(complex)", fun); return; } slgsl_reset_errors (); do_c_c (f); slgsl_check_errors (fun); } /*}}}*/ static SLang_Intrin_Fun_Type Module_Intrinsics [] = { MAKE_INTRINSIC_0("gsl_set_error_disposition", set_error_disposition, SLANG_VOID_TYPE), SLANG_END_INTRIN_FUN_TABLE }; static SLang_Intrin_Var_Type Module_Variables [] = { MAKE_VARIABLE("_gslcore_module_version_string", &Module_Version_String, SLANG_STRING_TYPE, 1), MAKE_VARIABLE("GSL_VERSION", &gsl_version, SLANG_STRING_TYPE, 1), SLANG_END_INTRIN_VAR_TABLE }; static SLang_IConstant_Type Module_IConstants [] = { MAKE_ICONSTANT("_gslcore_module_version", MODULE_VERSION_NUMBER), MAKE_ICONSTANT("GSL_SUCCESS", GSL_SUCCESS), MAKE_ICONSTANT("GSL_FAILURE", GSL_FAILURE), MAKE_ICONSTANT("GSL_CONTINUE", GSL_CONTINUE), MAKE_ICONSTANT("GSL_EDOM", GSL_EDOM), MAKE_ICONSTANT("GSL_ERANGE", GSL_ERANGE), MAKE_ICONSTANT("GSL_EFAULT", GSL_EFAULT), MAKE_ICONSTANT("GSL_EINVAL", GSL_EINVAL), MAKE_ICONSTANT("GSL_EFAILED", GSL_EFAILED), MAKE_ICONSTANT("GSL_EFACTOR", GSL_EFACTOR), MAKE_ICONSTANT("GSL_ESANITY", GSL_ESANITY), MAKE_ICONSTANT("GSL_ENOMEM", GSL_ENOMEM), MAKE_ICONSTANT("GSL_EBADFUNC", GSL_EBADFUNC), MAKE_ICONSTANT("GSL_ERUNAWAY", GSL_ERUNAWAY), MAKE_ICONSTANT("GSL_EMAXITER", GSL_EMAXITER), MAKE_ICONSTANT("GSL_EZERODIV", GSL_EZERODIV), MAKE_ICONSTANT("GSL_EBADTOL", GSL_EBADTOL), MAKE_ICONSTANT("GSL_ETOL", GSL_ETOL), MAKE_ICONSTANT("GSL_EUNDRFLW", GSL_EUNDRFLW), MAKE_ICONSTANT("GSL_EOVRFLW", GSL_EOVRFLW), MAKE_ICONSTANT("GSL_ELOSS", GSL_ELOSS), MAKE_ICONSTANT("GSL_EROUND", GSL_EROUND), MAKE_ICONSTANT("GSL_EBADLEN", GSL_EBADLEN), MAKE_ICONSTANT("GSL_ENOTSQR", GSL_ENOTSQR), MAKE_ICONSTANT("GSL_ESING", GSL_ESING), MAKE_ICONSTANT("GSL_EDIVERGE", GSL_EDIVERGE), MAKE_ICONSTANT("GSL_EUNSUP", GSL_EUNSUP), MAKE_ICONSTANT("GSL_EUNIMPL", GSL_EUNIMPL), MAKE_ICONSTANT("GSL_ECACHE", GSL_ECACHE), MAKE_ICONSTANT("GSL_ETABLE", GSL_ETABLE), MAKE_ICONSTANT("GSL_ENOPROG", GSL_ENOPROG), MAKE_ICONSTANT("GSL_ENOPROGJ", GSL_ENOPROGJ), MAKE_ICONSTANT("GSL_ETOLF", GSL_ETOLF), MAKE_ICONSTANT("GSL_ETOLX", GSL_ETOLX), MAKE_ICONSTANT("GSL_ETOLG", GSL_ETOLG), MAKE_ICONSTANT("GSL_EOF", GSL_EOF), SLANG_END_ICONST_TABLE }; int init_gslcore_module_ns (char *ns_name) { SLang_NameSpace_Type *ns = SLns_create_namespace (ns_name); static int initialized = 0; if (ns == NULL) return -1; if ( (-1 == SLns_add_intrin_var_table (ns, Module_Variables, NULL)) || (-1 == SLns_add_intrin_fun_table (ns, Module_Intrinsics, NULL)) || (-1 == SLns_add_iconstant_table (ns, Module_IConstants, NULL)) ) return -1; if (initialized == 0) { (void) gsl_set_error_handler (&err_handler); set_gsl_error_disposition (GSL_EDOM, 1, NULL); set_gsl_error_disposition (GSL_ERANGE, 1, NULL); initialized = 1; } return 0; } /* This function is optional */ void deinit_gslcore_module (void) { } slgsl-pre0.10.0-7/src/gslsf-module.c0000644000175000000620000010145514713350753015757 0ustar johnstaff/* -*- mode: C; mode: fold; -*- */ /* This file was automatically generated. */ /* Copyright (c) 2003-2011 Massachusetts Institute of Technology This software was developed by the MIT Center for Space Research under contract SV1-61010 from the Smithsonian Institution. Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in the supporting documentation, and that the name of the Massachusetts Institute of Technology not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The Massachusetts Institute of Technology makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. THE MASSACHUSETTS INSTITUTE OF TECHNOLOGY DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE MASSACHUSETTS INSTITUTE OF TECHNOLOGY BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* Author: John E. Davis (jed@jedsoft.org) */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /* SLANG_MODULE(gslsf); */ #ifdef __cplusplus } #endif #include "slgsl.h" #include "version.h" #define MODULE_HAS_INTRINSICS #define _GSLSF_MODULE_C_ #ifdef MODULE_HAS_INTRINSICS /*{{{ Helper Functions */ #ifdef _GSLSF_MODULE_C_ static gsl_mode_t Default_GSL_Mode = GSL_PREC_SINGLE; static int get_gsl_precision (void) { return (int) Default_GSL_Mode; } static void set_gsl_precision (int *pp) { int p = *pp; if ((p == GSL_PREC_SINGLE) || (p == GSL_PREC_DOUBLE) || (p == GSL_PREC_APPROX)) Default_GSL_Mode = p; } static int get_gsl_mode (gsl_mode_t *mp, int from_stack) { if (from_stack) { int mode; if (-1 == SLang_pop_integer (&mode)) return -1; *mp = (gsl_mode_t) mode; } *mp = Default_GSL_Mode; return 0; } static void do_d_dm (double (*f)(double, gsl_mode_t), gsl_mode_t m) { SLGSL_Double_Array_Type a; SLang_Array_Type *in, *out; unsigned int i, n; double *xp, *yp; if (-1 == slgsl_pop_d_array (&a, 0)) return; if (NULL == (in = a.at)) { (void) SLang_push_double ((*f)(a.x, m)); return; } if (NULL == (out = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, in->dims, in->num_dims))) { SLang_free_array (in); return; } n = in->num_elements; xp = a.xp; yp = (double *) out->data; for (i = 0; i < n; i++) yp[i] = (*f)(xp[i], m); (void) SLang_push_array (out, 1); SLang_free_array (in); } static void do_d_ddm (double (*f)(double, double, gsl_mode_t), gsl_mode_t m) { SLGSL_Double_Array_Type a, b; SLang_Array_Type *atz; unsigned int i, n; double *xp, *yp, *zp; unsigned int xinc, yinc; if (-1 == slgsl_pop_dd_array (&a, &b, 0)) return; if ((NULL == (atz = a.at)) && (NULL == (atz = b.at))) { (void) SLang_push_double ((*f)(a.x, b.x, m)); return; } atz = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, atz->dims, atz->num_dims); if (atz == NULL) { SLang_free_array (a.at); SLang_free_array (b.at); return; } n = atz->num_elements; zp = (double *) atz->data; xp = a.xp; yp = b.xp; xinc = a.inc; yinc = b.inc; for (i = 0; i < n; i++) { zp[i] = (*f)(*xp, *yp, m); xp += xinc; yp += yinc; } (void) SLang_push_array (atz, 1); SLang_free_array (a.at); SLang_free_array (b.at); } static void do_d_dddm (double (*f)(double, double, double, gsl_mode_t), gsl_mode_t m) { SLGSL_Double_Array_Type a, b, c; SLang_Array_Type *atz; unsigned int i, n; double *ap, *bp, *cp, *zp; unsigned int ainc, binc, cinc; if (-1 == slgsl_pop_ddd_array (&a, &b, &c, 0)) return; if ((NULL == (atz = a.at)) && (NULL == (atz = b.at)) && (NULL == (atz = c.at))) { (void) SLang_push_double ((*f)(a.x, b.x, c.x, m)); return; } atz = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, atz->dims, atz->num_dims); if (atz == NULL) { SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); return; } n = atz->num_elements; zp = (double *) atz->data; ap = a.xp; bp = b.xp; cp = c.xp; ainc = a.inc; binc = b.inc; cinc = c.inc; for (i = 0; i < n; i++) { zp[i] = (*f)(*ap, *bp, *cp, m); ap += ainc; bp += binc; cp += cinc; } (void) SLang_push_array (atz, 1); SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); } static void do_d_ddddm (double (*f)(double, double, double, double, gsl_mode_t), gsl_mode_t m) { SLGSL_Double_Array_Type a, b, c, d; SLang_Array_Type *atz; unsigned int i, n; double *ap, *bp, *cp, *dp, *zp; unsigned int ainc, binc, cinc, dinc; if (-1 == slgsl_pop_dddd_array (&a, &b, &c, &d, 0)) return; if ((NULL == (atz = a.at)) && (NULL == (atz = b.at)) && (NULL == (atz = c.at)) && (NULL == (atz = d.at))) { (void) SLang_push_double ((*f)(a.x, b.x, c.x, d.x, m)); return; } atz = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, atz->dims, atz->num_dims); if (atz == NULL) { SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); SLang_free_array (d.at); return; } n = atz->num_elements; zp = (double *) atz->data; ap = a.xp; bp = b.xp; cp = c.xp; dp = d.xp; ainc = a.inc; binc = b.inc; cinc = c.inc; dinc = d.inc; for (i = 0; i < n; i++) { zp[i] = (*f)(*ap, *bp, *cp, *dp, m); ap += ainc; bp += binc; cp += cinc; dp += dinc; } (void) SLang_push_array (atz, 1); SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); SLang_free_array (d.at); } static void do_d_dm_fun (const char *fun, double (*f)(double, gsl_mode_t)) { gsl_mode_t m; if (SLang_Num_Function_Args < 1) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double[,mode])", fun); return; } if (-1 == get_gsl_mode (&m, SLang_Num_Function_Args-1)) return; slgsl_reset_errors (); do_d_dm (f,m); slgsl_check_errors (fun); } static void do_d_ddm_fun (const char *fun, double (*f)(double, double, gsl_mode_t)) { gsl_mode_t m; if (SLang_Num_Function_Args < 2) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double, double [,mode])", fun); return; } if (-1 == get_gsl_mode (&m, SLang_Num_Function_Args-2)) return; slgsl_reset_errors (); do_d_ddm (f,m); slgsl_check_errors (fun); } static void do_d_dddm_fun (const char *fun, double (*f)(double, double, double, gsl_mode_t)) { gsl_mode_t m; if (SLang_Num_Function_Args < 3) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double, double, double[,mode])", fun); return; } if (-1 == get_gsl_mode (&m, SLang_Num_Function_Args-3)) return; slgsl_reset_errors (); do_d_dddm (f,m); slgsl_check_errors (fun); } static void do_d_ddddm_fun (const char *fun, double (*f)(double,double,double,double,gsl_mode_t)) { gsl_mode_t m; if (SLang_Num_Function_Args < 4) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double, double, double, double [,mode])", fun); return; } if (-1 == get_gsl_mode (&m, SLang_Num_Function_Args-4)) return; slgsl_reset_errors (); do_d_ddddm (f,m); slgsl_check_errors (fun); } static void do_c_c_fun (const char *fun, int (*f)(double, double, gsl_sf_result*, gsl_sf_result*)) { SLGSL_Complex_Array_Type a; SLang_Array_Type *in, *out; unsigned int i, n; gsl_sf_result gsl_zr, gsl_zi; double *xp, *yp; if (SLang_Num_Function_Args < 1) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(complex)", fun); return; } if (-1 == slgsl_pop_c_array (&a, 0)) return; if (NULL == (in = a.at)) { (void) (*f)(a.x[0], a.x[1], &gsl_zr, &gsl_zi); (void) SLang_push_complex (gsl_zr.val, gsl_zi.val); return; } if (NULL == (out = SLang_create_array (SLANG_COMPLEX_TYPE, 0, NULL, in->dims, in->num_dims))) { SLang_free_array (in); return; } n = in->num_elements; xp = a.xp; yp = (double *) out->data; for (i = 0; i < 2*n; i+=2) { (void) (*f)(xp[i], xp[i+1], &gsl_zr, &gsl_zi); yp[i] = gsl_zr.val; yp[i+1] = gsl_zi.val; } (void) SLang_push_array (out, 1); SLang_free_array (in); } #endif /* _GSLSF_MODULE_C_ */ /* Macros to aid in wrapping the functions */ #define SLF(f) f##_intrin #define D_FD(f,n) \ static void SLF(f) (void) { slgsl_do_d_d_fun (n,f); } #define D_FDD(f,n) \ static void SLF(f) (void) { slgsl_do_d_dd_fun (n,f); } #define D_FDDD(f,n) \ static void SLF(f) (void) { slgsl_do_d_ddd_fun (n,f); } #define D_FDDDD(f,n) \ static void SLF(f) (void) { slgsl_do_d_dddd_fun (n,f); } #define D_FDM(f,n) \ static void SLF(f) (void) { do_d_dm_fun (n,f); } #define D_FDDM(f,n) \ static void SLF(f) (void) { do_d_ddm_fun (n,f); } #define D_FDDDM(f,n) \ static void SLF(f) (void) { do_d_dddm_fun (n,f); } #define D_FDDDDM(f,n) \ static void SLF(f) (void) { do_d_ddddm_fun (n,f); } #define D_FI(f,n) \ static void SLF(f) (void) { slgsl_do_d_i_fun (n,f); } #define D_FID(f,n) \ static void SLF(f) (void) { slgsl_do_d_id_fun (n,f); } #define D_FIDD(f,n) \ static void SLF(f) (void) { slgsl_do_d_idd_fun (n,f); } #define D_FIID(f,n) \ static void SLF(f) (void) { slgsl_do_d_iid_fun (n,f); } #define D_FIIDD(f,n) \ static void SLF(f) (void) { slgsl_do_d_iidd_fun (n,f); } #define I_FD(f,n) \ static void SLF(f) (void) { slgsl_do_i_d_fun (n,f); } /* Complex wrappers */ #define C_FC(f,n) \ static void SLF(f) (void) { do_c_c_fun (n,f); } /*}}}*/ C_FC(gsl_sf_complex_cos_e,"cos_complex") C_FC(gsl_sf_complex_log_e,"log_complex") C_FC(gsl_sf_complex_logsin_e,"logsin_complex") C_FC(gsl_sf_complex_sin_e,"sin_complex") C_FC(gsl_sf_lngamma_complex_e,"lngamma_complex") D_FDDDDM(gsl_sf_ellint_RJ,"ellint_RJ") D_FDDDM(gsl_sf_ellint_P,"ellint_P") D_FDDDM(gsl_sf_ellint_RD,"ellint_RD") D_FDDDM(gsl_sf_ellint_RF,"ellint_RF") D_FDDM(gsl_sf_ellint_D,"ellint_D") D_FDDM(gsl_sf_ellint_E,"ellint_E") D_FDDM(gsl_sf_ellint_F,"ellint_F") D_FDDM(gsl_sf_ellint_Pcomp,"ellint_Pcomp") D_FDDM(gsl_sf_ellint_RC,"ellint_RC") D_FDM(gsl_sf_airy_Ai,"airy_Ai") D_FDM(gsl_sf_airy_Ai_deriv,"airy_Ai_deriv") D_FDM(gsl_sf_airy_Ai_deriv_scaled,"airy_Ai_deriv_scaled") D_FDM(gsl_sf_airy_Ai_scaled,"airy_Ai_scaled") D_FDM(gsl_sf_airy_Bi,"airy_Bi") D_FDM(gsl_sf_airy_Bi_deriv,"airy_Bi_deriv") D_FDM(gsl_sf_airy_Bi_deriv_scaled,"airy_Bi_deriv_scaled") D_FDM(gsl_sf_airy_Bi_scaled,"airy_Bi_scaled") D_FDM(gsl_sf_ellint_Dcomp,"ellint_Dcomp") D_FDM(gsl_sf_ellint_Ecomp,"ellint_Ecomp") D_FDM(gsl_sf_ellint_Kcomp,"ellint_Kcomp") D_FIIDD(gsl_sf_hydrogenicR,"hydrogenicR") D_FIIDD(gsl_sf_mathieu_Mc,"mathieu_Mc") D_FIIDD(gsl_sf_mathieu_Ms,"mathieu_Ms") D_FIID(gsl_sf_hermite_func_der,"hermite_func_der") D_FIID(gsl_sf_hermite_phys_der,"hermite_phys_der") D_FIID(gsl_sf_hermite_prob_der,"hermite_prob_der") D_FIID(gsl_sf_hyperg_1F1_int,"hyperg_1F1_int") D_FIID(gsl_sf_hyperg_U_int,"hyperg_U_int") D_FIID(gsl_sf_legendre_Plm,"legendre_Plm") D_FIID(gsl_sf_legendre_sphPlm,"legendre_sphPlm") D_FIDD(gsl_sf_conicalP_cyl_reg,"conicalP_cyl_reg") D_FIDD(gsl_sf_conicalP_sph_reg,"conicalP_sph_reg") D_FIDD(gsl_sf_gegenpoly_n,"gegenpoly_n") D_FIDD(gsl_sf_laguerre_n,"laguerre_n") D_FIDD(gsl_sf_legendre_H3d,"legendre_H3d") D_FIDD(gsl_sf_mathieu_ce,"mathieu_ce") D_FIDD(gsl_sf_mathieu_se,"mathieu_se") D_FID(gsl_sf_bessel_In,"bessel_In") D_FID(gsl_sf_bessel_In_scaled,"bessel_In_scaled") D_FID(gsl_sf_bessel_Jn,"bessel_Jn") D_FID(gsl_sf_bessel_Kn,"bessel_Kn") D_FID(gsl_sf_bessel_Kn_scaled,"bessel_Kn_scaled") D_FID(gsl_sf_bessel_Yn,"bessel_Yn") D_FID(gsl_sf_bessel_il_scaled,"bessel_il_scaled") D_FID(gsl_sf_bessel_jl,"bessel_jl") D_FID(gsl_sf_bessel_kl_scaled,"bessel_kl_scaled") D_FID(gsl_sf_bessel_yl,"bessel_yl") D_FID(gsl_sf_expint_En,"expint_En") D_FID(gsl_sf_expint_En_scaled,"expint_En_scaled") D_FID(gsl_sf_exprel_n,"exprel_n") D_FID(gsl_sf_fermi_dirac_int,"fermi_dirac_int") D_FID(gsl_sf_hermite_func,"hermite_func") D_FID(gsl_sf_hermite_phys,"hermite_phys") D_FID(gsl_sf_hermite_prob,"hermite_prob") D_FID(gsl_sf_legendre_Pl,"legendre_Pl") D_FID(gsl_sf_legendre_Ql,"legendre_Ql") D_FID(gsl_sf_mathieu_a,"mathieu_a") D_FID(gsl_sf_mathieu_b,"mathieu_b") D_FID(gsl_sf_psi_n,"psi_n") D_FID(gsl_sf_taylorcoeff,"taylorcoeff") D_FI(gsl_sf_eta_int,"eta_int") D_FI(gsl_sf_psi_1_int,"psi_1_int") D_FI(gsl_sf_psi_int,"psi_int") D_FI(gsl_sf_zeta_int,"zeta_int") D_FI(gsl_sf_zetam1_int,"zetam1_int") D_FDDDD(gsl_sf_hyperg_2F1,"hyperg_2F1") D_FDDDD(gsl_sf_hyperg_2F1_conj,"hyperg_2F1_conj") D_FDDDD(gsl_sf_hyperg_2F1_conj_renorm,"hyperg_2F1_conj_renorm") D_FDDDD(gsl_sf_hyperg_2F1_renorm,"hyperg_2F1_renorm") D_FDDD(gsl_sf_beta_inc,"beta_inc") D_FDDD(gsl_sf_hyperg_1F1,"hyperg_1F1") D_FDDD(gsl_sf_hyperg_2F0,"hyperg_2F0") D_FDDD(gsl_sf_hyperg_U,"hyperg_U") D_FDD(gsl_sf_bessel_Inu,"bessel_Inu") D_FDD(gsl_sf_bessel_Inu_scaled,"bessel_Inu_scaled") D_FDD(gsl_sf_bessel_Jnu,"bessel_Jnu") D_FDD(gsl_sf_bessel_Knu,"bessel_Knu") D_FDD(gsl_sf_bessel_Knu_scaled,"bessel_Knu_scaled") D_FDD(gsl_sf_bessel_Ynu,"bessel_Ynu") D_FDD(gsl_sf_bessel_lnKnu,"bessel_lnKnu") D_FDD(gsl_sf_beta,"beta") D_FDD(gsl_sf_conicalP_0,"conicalP_0") D_FDD(gsl_sf_conicalP_1,"conicalP_1") D_FDD(gsl_sf_conicalP_half,"conicalP_half") D_FDD(gsl_sf_conicalP_mhalf,"conicalP_mhalf") D_FDD(gsl_sf_exp_mult,"exp_mult") D_FDD(gsl_sf_fermi_dirac_inc_0,"fermi_dirac_inc_0") D_FDD(gsl_sf_gamma_inc,"gamma_inc") D_FDD(gsl_sf_gamma_inc_P,"gamma_inc_P") D_FDD(gsl_sf_gamma_inc_Q,"gamma_inc_Q") D_FDD(gsl_sf_gegenpoly_1,"gegenpoly_1") D_FDD(gsl_sf_gegenpoly_2,"gegenpoly_2") D_FDD(gsl_sf_gegenpoly_3,"gegenpoly_3") D_FDD(gsl_sf_hydrogenicR_1,"hydrogenicR_1") D_FDD(gsl_sf_hyperg_0F1,"hyperg_0F1") D_FDD(gsl_sf_hzeta,"hzeta") D_FDD(gsl_sf_laguerre_1,"laguerre_1") D_FDD(gsl_sf_laguerre_2,"laguerre_2") D_FDD(gsl_sf_laguerre_3,"laguerre_3") D_FDD(gsl_sf_legendre_H3d_0,"legendre_H3d_0") D_FDD(gsl_sf_legendre_H3d_1,"legendre_H3d_1") D_FDD(gsl_sf_lnbeta,"lnbeta") D_FDD(gsl_sf_lnpoch,"lnpoch") D_FDD(gsl_sf_poch,"poch") D_FDD(gsl_sf_pochrel,"pochrel") D_FD(gsl_sf_Chi,"Chi") D_FD(gsl_sf_Ci,"Ci") D_FD(gsl_sf_Shi,"Shi") D_FD(gsl_sf_Si,"Si") D_FD(gsl_sf_angle_restrict_pos,"angle_restrict_pos") D_FD(gsl_sf_angle_restrict_symm,"angle_restrict_symm") D_FD(gsl_sf_atanint,"atanint") D_FD(gsl_sf_bessel_I0,"bessel_I0") D_FD(gsl_sf_bessel_I0_scaled,"bessel_I0_scaled") D_FD(gsl_sf_bessel_I1,"bessel_I1") D_FD(gsl_sf_bessel_I1_scaled,"bessel_I1_scaled") D_FD(gsl_sf_bessel_J0,"bessel_J0") D_FD(gsl_sf_bessel_J1,"bessel_J1") D_FD(gsl_sf_bessel_K0,"bessel_K0") D_FD(gsl_sf_bessel_K0_scaled,"bessel_K0_scaled") D_FD(gsl_sf_bessel_K1,"bessel_K1") D_FD(gsl_sf_bessel_K1_scaled,"bessel_K1_scaled") D_FD(gsl_sf_bessel_Y0,"bessel_Y0") D_FD(gsl_sf_bessel_Y1,"bessel_Y1") D_FD(gsl_sf_bessel_i0_scaled,"bessel_i0_scaled") D_FD(gsl_sf_bessel_i1_scaled,"bessel_i1_scaled") D_FD(gsl_sf_bessel_i2_scaled,"bessel_i2_scaled") D_FD(gsl_sf_bessel_j0,"bessel_j0") D_FD(gsl_sf_bessel_j1,"bessel_j1") D_FD(gsl_sf_bessel_j2,"bessel_j2") D_FD(gsl_sf_bessel_k0_scaled,"bessel_k0_scaled") D_FD(gsl_sf_bessel_k1_scaled,"bessel_k1_scaled") D_FD(gsl_sf_bessel_k2_scaled,"bessel_k2_scaled") D_FD(gsl_sf_bessel_y0,"bessel_y0") D_FD(gsl_sf_bessel_y1,"bessel_y1") D_FD(gsl_sf_bessel_y2,"bessel_y2") D_FD(gsl_sf_clausen,"clausen") D_FD(gsl_sf_cos_pi,"cos_pi") D_FD(gsl_sf_dawson,"dawson") D_FD(gsl_sf_debye_1,"debye_1") D_FD(gsl_sf_debye_2,"debye_2") D_FD(gsl_sf_debye_3,"debye_3") D_FD(gsl_sf_debye_4,"debye_4") D_FD(gsl_sf_debye_5,"debye_5") D_FD(gsl_sf_debye_6,"debye_6") D_FD(gsl_sf_dilog,"dilog") D_FD(gsl_sf_erf,"erf") D_FD(gsl_sf_erf_Q,"erf_Q") D_FD(gsl_sf_erf_Z,"erf_Z") D_FD(gsl_sf_erfc,"erfc") D_FD(gsl_sf_eta,"eta") D_FD(gsl_sf_expint_3,"expint_3") D_FD(gsl_sf_expint_E1,"expint_E1") D_FD(gsl_sf_expint_E1_scaled,"expint_E1_scaled") D_FD(gsl_sf_expint_E2,"expint_E2") D_FD(gsl_sf_expint_E2_scaled,"expint_E2_scaled") D_FD(gsl_sf_expint_Ei,"expint_Ei") D_FD(gsl_sf_expint_Ei_scaled,"expint_Ei_scaled") D_FD(gsl_sf_expm1,"expm1") D_FD(gsl_sf_exprel,"exprel") D_FD(gsl_sf_exprel_2,"exprel_2") D_FD(gsl_sf_fermi_dirac_0,"fermi_dirac_0") D_FD(gsl_sf_fermi_dirac_1,"fermi_dirac_1") D_FD(gsl_sf_fermi_dirac_2,"fermi_dirac_2") D_FD(gsl_sf_fermi_dirac_3half,"fermi_dirac_3half") D_FD(gsl_sf_fermi_dirac_half,"fermi_dirac_half") D_FD(gsl_sf_fermi_dirac_m1,"fermi_dirac_m1") D_FD(gsl_sf_fermi_dirac_mhalf,"fermi_dirac_mhalf") D_FD(gsl_sf_gamma,"gamma") D_FD(gsl_sf_gammainv,"gammainv") D_FD(gsl_sf_gammastar,"gammastar") D_FD(gsl_sf_hazard,"hazard") D_FD(gsl_sf_lambert_W0,"lambert_W0") D_FD(gsl_sf_lambert_Wm1,"lambert_Wm1") D_FD(gsl_sf_legendre_P1,"legendre_P1") D_FD(gsl_sf_legendre_P2,"legendre_P2") D_FD(gsl_sf_legendre_P3,"legendre_P3") D_FD(gsl_sf_legendre_Q0,"legendre_Q0") D_FD(gsl_sf_legendre_Q1,"legendre_Q1") D_FD(gsl_sf_lncosh,"lncosh") D_FD(gsl_sf_lngamma,"lngamma") D_FD(gsl_sf_lnsinh,"lnsinh") D_FD(gsl_sf_log_1plusx,"log_1plusx") D_FD(gsl_sf_log_1plusx_mx,"log_1plusx_mx") D_FD(gsl_sf_log_abs,"log_abs") D_FD(gsl_sf_log_erfc,"log_erfc") D_FD(gsl_sf_psi,"psi") D_FD(gsl_sf_psi_1,"psi_1") D_FD(gsl_sf_psi_1piy,"psi_1piy") D_FD(gsl_sf_sin_pi,"sin_pi") D_FD(gsl_sf_sinc,"sinc") D_FD(gsl_sf_synchrotron_1,"synchrotron_1") D_FD(gsl_sf_synchrotron_2,"synchrotron_2") D_FD(gsl_sf_transport_2,"transport_2") D_FD(gsl_sf_transport_3,"transport_3") D_FD(gsl_sf_transport_4,"transport_4") D_FD(gsl_sf_transport_5,"transport_5") D_FD(gsl_sf_zeta,"zeta") D_FD(gsl_sf_zetam1,"zetam1") #define V SLANG_VOID_TYPE static SLang_Intrin_Fun_Type Module_Intrinsics [] = { MAKE_INTRINSIC_0("cos_complex", SLF(gsl_sf_complex_cos_e), V), MAKE_INTRINSIC_0("log_complex", SLF(gsl_sf_complex_log_e), V), MAKE_INTRINSIC_0("logsin_complex", SLF(gsl_sf_complex_logsin_e), V), MAKE_INTRINSIC_0("sin_complex", SLF(gsl_sf_complex_sin_e), V), MAKE_INTRINSIC_0("lngamma_complex", SLF(gsl_sf_lngamma_complex_e), V), MAKE_INTRINSIC_0("ellint_RJ", SLF(gsl_sf_ellint_RJ), V), MAKE_INTRINSIC_0("ellint_P", SLF(gsl_sf_ellint_P), V), MAKE_INTRINSIC_0("ellint_RD", SLF(gsl_sf_ellint_RD), V), MAKE_INTRINSIC_0("ellint_RF", SLF(gsl_sf_ellint_RF), V), MAKE_INTRINSIC_0("ellint_D", SLF(gsl_sf_ellint_D), V), MAKE_INTRINSIC_0("ellint_E", SLF(gsl_sf_ellint_E), V), MAKE_INTRINSIC_0("ellint_F", SLF(gsl_sf_ellint_F), V), MAKE_INTRINSIC_0("ellint_Pcomp", SLF(gsl_sf_ellint_Pcomp), V), MAKE_INTRINSIC_0("ellint_RC", SLF(gsl_sf_ellint_RC), V), MAKE_INTRINSIC_0("airy_Ai", SLF(gsl_sf_airy_Ai), V), MAKE_INTRINSIC_0("airy_Ai_deriv", SLF(gsl_sf_airy_Ai_deriv), V), MAKE_INTRINSIC_0("airy_Ai_deriv_scaled", SLF(gsl_sf_airy_Ai_deriv_scaled), V), MAKE_INTRINSIC_0("airy_Ai_scaled", SLF(gsl_sf_airy_Ai_scaled), V), MAKE_INTRINSIC_0("airy_Bi", SLF(gsl_sf_airy_Bi), V), MAKE_INTRINSIC_0("airy_Bi_deriv", SLF(gsl_sf_airy_Bi_deriv), V), MAKE_INTRINSIC_0("airy_Bi_deriv_scaled", SLF(gsl_sf_airy_Bi_deriv_scaled), V), MAKE_INTRINSIC_0("airy_Bi_scaled", SLF(gsl_sf_airy_Bi_scaled), V), MAKE_INTRINSIC_0("ellint_Dcomp", SLF(gsl_sf_ellint_Dcomp), V), MAKE_INTRINSIC_0("ellint_Ecomp", SLF(gsl_sf_ellint_Ecomp), V), MAKE_INTRINSIC_0("ellint_Kcomp", SLF(gsl_sf_ellint_Kcomp), V), MAKE_INTRINSIC_0("hydrogenicR", SLF(gsl_sf_hydrogenicR), V), MAKE_INTRINSIC_0("mathieu_Mc", SLF(gsl_sf_mathieu_Mc), V), MAKE_INTRINSIC_0("mathieu_Ms", SLF(gsl_sf_mathieu_Ms), V), MAKE_INTRINSIC_0("hermite_func_der", SLF(gsl_sf_hermite_func_der), V), MAKE_INTRINSIC_0("hermite_phys_der", SLF(gsl_sf_hermite_phys_der), V), MAKE_INTRINSIC_0("hermite_prob_der", SLF(gsl_sf_hermite_prob_der), V), MAKE_INTRINSIC_0("hyperg_1F1_int", SLF(gsl_sf_hyperg_1F1_int), V), MAKE_INTRINSIC_0("hyperg_U_int", SLF(gsl_sf_hyperg_U_int), V), MAKE_INTRINSIC_0("legendre_Plm", SLF(gsl_sf_legendre_Plm), V), MAKE_INTRINSIC_0("legendre_sphPlm", SLF(gsl_sf_legendre_sphPlm), V), MAKE_INTRINSIC_0("conicalP_cyl_reg", SLF(gsl_sf_conicalP_cyl_reg), V), MAKE_INTRINSIC_0("conicalP_sph_reg", SLF(gsl_sf_conicalP_sph_reg), V), MAKE_INTRINSIC_0("gegenpoly_n", SLF(gsl_sf_gegenpoly_n), V), MAKE_INTRINSIC_0("laguerre_n", SLF(gsl_sf_laguerre_n), V), MAKE_INTRINSIC_0("legendre_H3d", SLF(gsl_sf_legendre_H3d), V), MAKE_INTRINSIC_0("mathieu_ce", SLF(gsl_sf_mathieu_ce), V), MAKE_INTRINSIC_0("mathieu_se", SLF(gsl_sf_mathieu_se), V), MAKE_INTRINSIC_0("bessel_In", SLF(gsl_sf_bessel_In), V), MAKE_INTRINSIC_0("bessel_In_scaled", SLF(gsl_sf_bessel_In_scaled), V), MAKE_INTRINSIC_0("bessel_Jn", SLF(gsl_sf_bessel_Jn), V), MAKE_INTRINSIC_0("bessel_Kn", SLF(gsl_sf_bessel_Kn), V), MAKE_INTRINSIC_0("bessel_Kn_scaled", SLF(gsl_sf_bessel_Kn_scaled), V), MAKE_INTRINSIC_0("bessel_Yn", SLF(gsl_sf_bessel_Yn), V), MAKE_INTRINSIC_0("bessel_il_scaled", SLF(gsl_sf_bessel_il_scaled), V), MAKE_INTRINSIC_0("bessel_jl", SLF(gsl_sf_bessel_jl), V), MAKE_INTRINSIC_0("bessel_kl_scaled", SLF(gsl_sf_bessel_kl_scaled), V), MAKE_INTRINSIC_0("bessel_yl", SLF(gsl_sf_bessel_yl), V), MAKE_INTRINSIC_0("expint_En", SLF(gsl_sf_expint_En), V), MAKE_INTRINSIC_0("expint_En_scaled", SLF(gsl_sf_expint_En_scaled), V), MAKE_INTRINSIC_0("exprel_n", SLF(gsl_sf_exprel_n), V), MAKE_INTRINSIC_0("fermi_dirac_int", SLF(gsl_sf_fermi_dirac_int), V), MAKE_INTRINSIC_0("hermite_func", SLF(gsl_sf_hermite_func), V), MAKE_INTRINSIC_0("hermite_phys", SLF(gsl_sf_hermite_phys), V), MAKE_INTRINSIC_0("hermite_prob", SLF(gsl_sf_hermite_prob), V), MAKE_INTRINSIC_0("legendre_Pl", SLF(gsl_sf_legendre_Pl), V), MAKE_INTRINSIC_0("legendre_Ql", SLF(gsl_sf_legendre_Ql), V), MAKE_INTRINSIC_0("mathieu_a", SLF(gsl_sf_mathieu_a), V), MAKE_INTRINSIC_0("mathieu_b", SLF(gsl_sf_mathieu_b), V), MAKE_INTRINSIC_0("psi_n", SLF(gsl_sf_psi_n), V), MAKE_INTRINSIC_0("taylorcoeff", SLF(gsl_sf_taylorcoeff), V), MAKE_INTRINSIC_0("eta_int", SLF(gsl_sf_eta_int), V), MAKE_INTRINSIC_0("psi_1_int", SLF(gsl_sf_psi_1_int), V), MAKE_INTRINSIC_0("psi_int", SLF(gsl_sf_psi_int), V), MAKE_INTRINSIC_0("zeta_int", SLF(gsl_sf_zeta_int), V), MAKE_INTRINSIC_0("zetam1_int", SLF(gsl_sf_zetam1_int), V), MAKE_INTRINSIC_0("hyperg_2F1", SLF(gsl_sf_hyperg_2F1), V), MAKE_INTRINSIC_0("hyperg_2F1_conj", SLF(gsl_sf_hyperg_2F1_conj), V), MAKE_INTRINSIC_0("hyperg_2F1_conj_renorm", SLF(gsl_sf_hyperg_2F1_conj_renorm), V), MAKE_INTRINSIC_0("hyperg_2F1_renorm", SLF(gsl_sf_hyperg_2F1_renorm), V), MAKE_INTRINSIC_0("beta_inc", SLF(gsl_sf_beta_inc), V), MAKE_INTRINSIC_0("hyperg_1F1", SLF(gsl_sf_hyperg_1F1), V), MAKE_INTRINSIC_0("hyperg_2F0", SLF(gsl_sf_hyperg_2F0), V), MAKE_INTRINSIC_0("hyperg_U", SLF(gsl_sf_hyperg_U), V), MAKE_INTRINSIC_0("bessel_Inu", SLF(gsl_sf_bessel_Inu), V), MAKE_INTRINSIC_0("bessel_Inu_scaled", SLF(gsl_sf_bessel_Inu_scaled), V), MAKE_INTRINSIC_0("bessel_Jnu", SLF(gsl_sf_bessel_Jnu), V), MAKE_INTRINSIC_0("bessel_Knu", SLF(gsl_sf_bessel_Knu), V), MAKE_INTRINSIC_0("bessel_Knu_scaled", SLF(gsl_sf_bessel_Knu_scaled), V), MAKE_INTRINSIC_0("bessel_Ynu", SLF(gsl_sf_bessel_Ynu), V), MAKE_INTRINSIC_0("bessel_lnKnu", SLF(gsl_sf_bessel_lnKnu), V), MAKE_INTRINSIC_0("beta", SLF(gsl_sf_beta), V), MAKE_INTRINSIC_0("conicalP_0", SLF(gsl_sf_conicalP_0), V), MAKE_INTRINSIC_0("conicalP_1", SLF(gsl_sf_conicalP_1), V), MAKE_INTRINSIC_0("conicalP_half", SLF(gsl_sf_conicalP_half), V), MAKE_INTRINSIC_0("conicalP_mhalf", SLF(gsl_sf_conicalP_mhalf), V), MAKE_INTRINSIC_0("exp_mult", SLF(gsl_sf_exp_mult), V), MAKE_INTRINSIC_0("fermi_dirac_inc_0", SLF(gsl_sf_fermi_dirac_inc_0), V), MAKE_INTRINSIC_0("gamma_inc", SLF(gsl_sf_gamma_inc), V), MAKE_INTRINSIC_0("gamma_inc_P", SLF(gsl_sf_gamma_inc_P), V), MAKE_INTRINSIC_0("gamma_inc_Q", SLF(gsl_sf_gamma_inc_Q), V), MAKE_INTRINSIC_0("gegenpoly_1", SLF(gsl_sf_gegenpoly_1), V), MAKE_INTRINSIC_0("gegenpoly_2", SLF(gsl_sf_gegenpoly_2), V), MAKE_INTRINSIC_0("gegenpoly_3", SLF(gsl_sf_gegenpoly_3), V), MAKE_INTRINSIC_0("hydrogenicR_1", SLF(gsl_sf_hydrogenicR_1), V), MAKE_INTRINSIC_0("hyperg_0F1", SLF(gsl_sf_hyperg_0F1), V), MAKE_INTRINSIC_0("hzeta", SLF(gsl_sf_hzeta), V), MAKE_INTRINSIC_0("laguerre_1", SLF(gsl_sf_laguerre_1), V), MAKE_INTRINSIC_0("laguerre_2", SLF(gsl_sf_laguerre_2), V), MAKE_INTRINSIC_0("laguerre_3", SLF(gsl_sf_laguerre_3), V), MAKE_INTRINSIC_0("legendre_H3d_0", SLF(gsl_sf_legendre_H3d_0), V), MAKE_INTRINSIC_0("legendre_H3d_1", SLF(gsl_sf_legendre_H3d_1), V), MAKE_INTRINSIC_0("lnbeta", SLF(gsl_sf_lnbeta), V), MAKE_INTRINSIC_0("lnpoch", SLF(gsl_sf_lnpoch), V), MAKE_INTRINSIC_0("poch", SLF(gsl_sf_poch), V), MAKE_INTRINSIC_0("pochrel", SLF(gsl_sf_pochrel), V), MAKE_INTRINSIC_0("Chi", SLF(gsl_sf_Chi), V), MAKE_INTRINSIC_0("Ci", SLF(gsl_sf_Ci), V), MAKE_INTRINSIC_0("Shi", SLF(gsl_sf_Shi), V), MAKE_INTRINSIC_0("Si", SLF(gsl_sf_Si), V), MAKE_INTRINSIC_0("angle_restrict_pos", SLF(gsl_sf_angle_restrict_pos), V), MAKE_INTRINSIC_0("angle_restrict_symm", SLF(gsl_sf_angle_restrict_symm), V), MAKE_INTRINSIC_0("atanint", SLF(gsl_sf_atanint), V), MAKE_INTRINSIC_0("bessel_I0", SLF(gsl_sf_bessel_I0), V), MAKE_INTRINSIC_0("bessel_I0_scaled", SLF(gsl_sf_bessel_I0_scaled), V), MAKE_INTRINSIC_0("bessel_I1", SLF(gsl_sf_bessel_I1), V), MAKE_INTRINSIC_0("bessel_I1_scaled", SLF(gsl_sf_bessel_I1_scaled), V), MAKE_INTRINSIC_0("bessel_J0", SLF(gsl_sf_bessel_J0), V), MAKE_INTRINSIC_0("bessel_J1", SLF(gsl_sf_bessel_J1), V), MAKE_INTRINSIC_0("bessel_K0", SLF(gsl_sf_bessel_K0), V), MAKE_INTRINSIC_0("bessel_K0_scaled", SLF(gsl_sf_bessel_K0_scaled), V), MAKE_INTRINSIC_0("bessel_K1", SLF(gsl_sf_bessel_K1), V), MAKE_INTRINSIC_0("bessel_K1_scaled", SLF(gsl_sf_bessel_K1_scaled), V), MAKE_INTRINSIC_0("bessel_Y0", SLF(gsl_sf_bessel_Y0), V), MAKE_INTRINSIC_0("bessel_Y1", SLF(gsl_sf_bessel_Y1), V), MAKE_INTRINSIC_0("bessel_i0_scaled", SLF(gsl_sf_bessel_i0_scaled), V), MAKE_INTRINSIC_0("bessel_i1_scaled", SLF(gsl_sf_bessel_i1_scaled), V), MAKE_INTRINSIC_0("bessel_i2_scaled", SLF(gsl_sf_bessel_i2_scaled), V), MAKE_INTRINSIC_0("bessel_j0", SLF(gsl_sf_bessel_j0), V), MAKE_INTRINSIC_0("bessel_j1", SLF(gsl_sf_bessel_j1), V), MAKE_INTRINSIC_0("bessel_j2", SLF(gsl_sf_bessel_j2), V), MAKE_INTRINSIC_0("bessel_k0_scaled", SLF(gsl_sf_bessel_k0_scaled), V), MAKE_INTRINSIC_0("bessel_k1_scaled", SLF(gsl_sf_bessel_k1_scaled), V), MAKE_INTRINSIC_0("bessel_k2_scaled", SLF(gsl_sf_bessel_k2_scaled), V), MAKE_INTRINSIC_0("bessel_y0", SLF(gsl_sf_bessel_y0), V), MAKE_INTRINSIC_0("bessel_y1", SLF(gsl_sf_bessel_y1), V), MAKE_INTRINSIC_0("bessel_y2", SLF(gsl_sf_bessel_y2), V), MAKE_INTRINSIC_0("clausen", SLF(gsl_sf_clausen), V), MAKE_INTRINSIC_0("cos_pi", SLF(gsl_sf_cos_pi), V), MAKE_INTRINSIC_0("dawson", SLF(gsl_sf_dawson), V), MAKE_INTRINSIC_0("debye_1", SLF(gsl_sf_debye_1), V), MAKE_INTRINSIC_0("debye_2", SLF(gsl_sf_debye_2), V), MAKE_INTRINSIC_0("debye_3", SLF(gsl_sf_debye_3), V), MAKE_INTRINSIC_0("debye_4", SLF(gsl_sf_debye_4), V), MAKE_INTRINSIC_0("debye_5", SLF(gsl_sf_debye_5), V), MAKE_INTRINSIC_0("debye_6", SLF(gsl_sf_debye_6), V), MAKE_INTRINSIC_0("dilog", SLF(gsl_sf_dilog), V), MAKE_INTRINSIC_0("erf", SLF(gsl_sf_erf), V), MAKE_INTRINSIC_0("erf_Q", SLF(gsl_sf_erf_Q), V), MAKE_INTRINSIC_0("erf_Z", SLF(gsl_sf_erf_Z), V), MAKE_INTRINSIC_0("erfc", SLF(gsl_sf_erfc), V), MAKE_INTRINSIC_0("eta", SLF(gsl_sf_eta), V), MAKE_INTRINSIC_0("expint_3", SLF(gsl_sf_expint_3), V), MAKE_INTRINSIC_0("expint_E1", SLF(gsl_sf_expint_E1), V), MAKE_INTRINSIC_0("expint_E1_scaled", SLF(gsl_sf_expint_E1_scaled), V), MAKE_INTRINSIC_0("expint_E2", SLF(gsl_sf_expint_E2), V), MAKE_INTRINSIC_0("expint_E2_scaled", SLF(gsl_sf_expint_E2_scaled), V), MAKE_INTRINSIC_0("expint_Ei", SLF(gsl_sf_expint_Ei), V), MAKE_INTRINSIC_0("expint_Ei_scaled", SLF(gsl_sf_expint_Ei_scaled), V), MAKE_INTRINSIC_0("expm1", SLF(gsl_sf_expm1), V), MAKE_INTRINSIC_0("exprel", SLF(gsl_sf_exprel), V), MAKE_INTRINSIC_0("exprel_2", SLF(gsl_sf_exprel_2), V), MAKE_INTRINSIC_0("fermi_dirac_0", SLF(gsl_sf_fermi_dirac_0), V), MAKE_INTRINSIC_0("fermi_dirac_1", SLF(gsl_sf_fermi_dirac_1), V), MAKE_INTRINSIC_0("fermi_dirac_2", SLF(gsl_sf_fermi_dirac_2), V), MAKE_INTRINSIC_0("fermi_dirac_3half", SLF(gsl_sf_fermi_dirac_3half), V), MAKE_INTRINSIC_0("fermi_dirac_half", SLF(gsl_sf_fermi_dirac_half), V), MAKE_INTRINSIC_0("fermi_dirac_m1", SLF(gsl_sf_fermi_dirac_m1), V), MAKE_INTRINSIC_0("fermi_dirac_mhalf", SLF(gsl_sf_fermi_dirac_mhalf), V), MAKE_INTRINSIC_0("gamma", SLF(gsl_sf_gamma), V), MAKE_INTRINSIC_0("gammainv", SLF(gsl_sf_gammainv), V), MAKE_INTRINSIC_0("gammastar", SLF(gsl_sf_gammastar), V), MAKE_INTRINSIC_0("hazard", SLF(gsl_sf_hazard), V), MAKE_INTRINSIC_0("lambert_W0", SLF(gsl_sf_lambert_W0), V), MAKE_INTRINSIC_0("lambert_Wm1", SLF(gsl_sf_lambert_Wm1), V), MAKE_INTRINSIC_0("legendre_P1", SLF(gsl_sf_legendre_P1), V), MAKE_INTRINSIC_0("legendre_P2", SLF(gsl_sf_legendre_P2), V), MAKE_INTRINSIC_0("legendre_P3", SLF(gsl_sf_legendre_P3), V), MAKE_INTRINSIC_0("legendre_Q0", SLF(gsl_sf_legendre_Q0), V), MAKE_INTRINSIC_0("legendre_Q1", SLF(gsl_sf_legendre_Q1), V), MAKE_INTRINSIC_0("lncosh", SLF(gsl_sf_lncosh), V), MAKE_INTRINSIC_0("lngamma", SLF(gsl_sf_lngamma), V), MAKE_INTRINSIC_0("lnsinh", SLF(gsl_sf_lnsinh), V), MAKE_INTRINSIC_0("log_1plusx", SLF(gsl_sf_log_1plusx), V), MAKE_INTRINSIC_0("log_1plusx_mx", SLF(gsl_sf_log_1plusx_mx), V), MAKE_INTRINSIC_0("log_abs", SLF(gsl_sf_log_abs), V), MAKE_INTRINSIC_0("log_erfc", SLF(gsl_sf_log_erfc), V), MAKE_INTRINSIC_0("psi", SLF(gsl_sf_psi), V), MAKE_INTRINSIC_0("psi_1", SLF(gsl_sf_psi_1), V), MAKE_INTRINSIC_0("psi_1piy", SLF(gsl_sf_psi_1piy), V), MAKE_INTRINSIC_0("sin_pi", SLF(gsl_sf_sin_pi), V), MAKE_INTRINSIC_0("sinc", SLF(gsl_sf_sinc), V), MAKE_INTRINSIC_0("synchrotron_1", SLF(gsl_sf_synchrotron_1), V), MAKE_INTRINSIC_0("synchrotron_2", SLF(gsl_sf_synchrotron_2), V), MAKE_INTRINSIC_0("transport_2", SLF(gsl_sf_transport_2), V), MAKE_INTRINSIC_0("transport_3", SLF(gsl_sf_transport_3), V), MAKE_INTRINSIC_0("transport_4", SLF(gsl_sf_transport_4), V), MAKE_INTRINSIC_0("transport_5", SLF(gsl_sf_transport_5), V), MAKE_INTRINSIC_0("zeta", SLF(gsl_sf_zeta), V), MAKE_INTRINSIC_0("zetam1", SLF(gsl_sf_zetam1), V), #ifdef _GSLSF_MODULE_C_ MAKE_INTRINSIC_0("gslsf_get_precision", get_gsl_precision, SLANG_INT_TYPE), MAKE_INTRINSIC_I("gslsf_set_precision", set_gsl_precision, SLANG_VOID_TYPE), #endif SLANG_END_INTRIN_FUN_TABLE }; #undef V #endif /* MODULE_HAS_INTRINSICS */ static SLang_Intrin_Var_Type Module_Variables [] = { MAKE_VARIABLE("_gslsf_module_version_string", &Module_Version_String, SLANG_STRING_TYPE, 1), MAKE_VARIABLE("GSL_VERSION", &gsl_version, SLANG_STRING_TYPE, 1), SLANG_END_INTRIN_VAR_TABLE }; static SLang_IConstant_Type Module_IConstants [] = { MAKE_ICONSTANT("_gslsf_module_version", MODULE_VERSION_NUMBER), #ifdef _GSLSF_MODULE_C_ MAKE_ICONSTANT("GSL_PREC_SINGLE", GSL_PREC_SINGLE), MAKE_ICONSTANT("GSL_PREC_DOUBLE", GSL_PREC_DOUBLE), MAKE_ICONSTANT("GSL_PREC_APPROX", GSL_PREC_APPROX), #endif SLANG_END_ICONST_TABLE }; #ifdef MODULE_HAS_DCONSTANTS static SLang_DConstant_Type Module_DConstants [] = { SLANG_END_DCONST_TABLE }; #endif int init_gslsf_module_ns (char *ns_name) { SLang_NameSpace_Type *ns = SLns_create_namespace (ns_name); if (ns == NULL) return -1; if ( (-1 == SLns_add_intrin_var_table (ns, Module_Variables, NULL)) #ifdef MODULE_HAS_INTRINSICS || (-1 == SLns_add_intrin_fun_table (ns, Module_Intrinsics, NULL)) #endif || (-1 == SLns_add_iconstant_table (ns, Module_IConstants, NULL)) #ifdef MODULE_HAS_DCONSTANTS || (-1 == SLns_add_dconstant_table (ns, Module_DConstants, NULL)) #endif ) return -1; return 0; } /* This function is optional */ void deinit_gslsf_module (void) { } slgsl-pre0.10.0-7/src/gslfft.sl0000644000175000000620000002003512320462336015022 0ustar johnstaffrequire ("gslcore"); _gslcore_import_module ("gslfft", current_namespace()); define fft () { variable args = __pop_args (_NARGS); return _gsl_fft_complex (__push_args (__tmp(args))); } % This routine converts a 2-d kernel to an ny x nx version for convolution private define wrap_kernel_2d (kern, ny, nx, center) { variable my = array_shape(kern)[0], mx = array_shape(kern)[1], x0 = (center ? (mx-1)/2 : 0), y0 = (center ? (my-1)/2 : 0), new_kern = Complex_Type[ny,nx]; new_kern[[0:my-1]-y0,[0:mx-1]-x0] = kern; return new_kern; } private define wrap_kernel_1d (kern, nx, center) { variable mx = length (kern), new_kern = Complex_Type[nx], x0 = (center ? (mx-1)/2 : 0); new_kern[[0:mx-1]-x0] = kern; return new_kern; } private define find_nice_fft_grid_size (minsize) { % Make size a multiple of 2, 3, 5, or 7 variable max_2 = 0, max_3 = 0, max_5 = 0, max_7 = 0, size; size = 1; while (size < minsize) { max_2++; size *= 2; } size = 1; while (size < minsize) { max_3++; size *= 3; } size = 1; while (size < minsize) { max_5++; size *= 5; } size = 1; while (size < minsize) { max_7++; size *= 7; } variable e2 = 0, e3 = 0, e5 = 0, e7 = 0; variable expons; variable min_diff = _Inf; variable size2 = 1; _for e2 (0, max_2, 1) { variable size3 = 1; _for e3 (0, max_3, 1) { variable size5 = 1; _for e5 (0, max_5, 1) { variable size7 = 1; _for e7 (0, max_7, 1) { size = size2 * size3 * size5 * size7; if (size >= minsize) { variable diff = size - minsize; if (diff < min_diff) { expons = [e2, e3, e5, e7]; min_diff = diff; } break; } size7 *= 7; } size5 *= 5; } size3 *= 3; } size2 *= 2; } size = minsize + min_diff; #iffalse vmessage ("size=%d => %d = 2^%d * 3^%d * 5^%d * 7^%d", minsize, size, expons[0], expons[1], expons[2], expons[3]); #endif return size; } private define convolve2d (image, kernel, q) { variable ny = array_shape(image)[0], nx = array_shape(image)[1], my = array_shape(kernel)[0], mx = array_shape(kernel)[1], wrap = q.wrap, padx = nx+mx, pady = ny+my; if (wrap == NULL) { padx = nx + mx/2; pady = ny + my/2; } else if (wrap == "wrap") { padx = nx; pady = ny; } padx = find_nice_fft_grid_size (padx); pady = find_nice_fft_grid_size (pady); if (wrap == "wrap") { if (nx != padx) padx = find_nice_fft_grid_size (nx+mx); if (ny != pady) pady = find_nice_fft_grid_size (ny+my); } variable cimage = Complex_Type[pady,padx]; cimage[[:ny-1], [:nx-1]] = __tmp(image); if (q.pad != 0.0) { cimage[[ny:],*] = q.pad; cimage[*, [nx:]] = q.pad; } variable i, j, dx = mx/2, dy = my/2; if (wrap == "wrap") { if (nx != padx) { i = [0:dx-1]; cimage[*,nx+i] = cimage[*,i]; i = [dx:mx-1]; cimage[*,padx-mx+i] = cimage[*,nx-mx+i]; } if (ny != pady) { j = [0:dy-1]; cimage[ny+j,*] = cimage[j,*]; j = [dy:my-1]; cimage[pady-my+j,*] = cimage[ny-my+j,*]; if (nx != padx) { i = [0:dx-1]; j = [0:dy-1]; cimage[ny+j, nx+i] = cimage[j,i]; i = [dx:mx-1]; j = [dy:my-1]; cimage[pady-my+j, padx-mx+i] = cimage[ny-my+j,nx-mx+i]; } } } if (wrap == "reflect") { if (nx != padx) { i = [0:dx-1]; cimage[*,nx+i] = cimage[*,nx-i-2]; i = [dx:mx-1]; cimage[*,padx-mx+i] = cimage[*,mx-i]; } if (ny != pady) { j = [0:dy-1]; cimage[ny+j,*] = cimage[ny-j-2,*]; j = [dy:my-1]; cimage[pady-my+j,*] = cimage[my-j,*]; if (nx != padx) { i = [0:dx-1]; j = [0:dy-1]; cimage[ny+j, nx+i] = cimage[ny-j-2,nx-i-2]; i = [dx:mx-1]; j = [dy:my-1]; cimage[pady-my+j, padx-mx+i] = cimage[my-j,mx-i]; } } } if (wrap == "nearest") { variable slice; if (nx != padx) { j = pady-my+dy-1; slice = cimage[[:j], nx-1]; slice[[ny:j]] = cimage[ny-1,nx-1]; _for i (0, dx-1, 1) cimage[[:j],nx+i] = slice; slice = cimage[*,0]; slice[[ny:]] = cimage[ny-1,0]; _for i (dx, mx-1, 1) cimage[*,padx-mx+i] = slice; } if (ny != pady) { i = padx-mx+dx-1; slice = cimage[ny-1,[:i]]; slice[[nx:i]] = cimage[ny-1,nx-1]; _for j (0, dy-1, 1) cimage[ny+j,[:i]] = slice; slice = cimage[0,*]; slice[[nx:]] = cimage[0,nx-1]; _for j (dy, my-1, 1) cimage[pady-my+j,*] = slice; if (nx != padx) { i = [0:dx-1]; j = [0:dy-1]; cimage[ny+j, nx+i] = cimage[ny-1,nx-1]; i = [dx:mx-1]; j = [dy:my-1]; cimage[pady-my+j, padx-mx+i] = cimage[0,0]; } } } image = cimage; kernel = wrap_kernel_2d (kernel, pady, padx, q.center); image = Real(fft(fft(__tmp(kernel), 1) * fft(__tmp(image), 1), -1)); return __tmp(image)[[:ny-1],[:nx-1]]; } private define convolve1d (image, kernel, q) { variable nx = length (image), mx = length (kernel), wrap = q.wrap, padx; if (wrap == NULL) padx = nx + mx/2; else if (wrap == "wrap") padx = nx; % Periodic BC -- no need to add padding for the kernel else padx = nx + mx; padx = find_nice_fft_grid_size (padx); if ((wrap == "wrap") and (padx != nx)) padx = find_nice_fft_grid_size (nx + mx); variable cimage = Complex_Type[padx]; cimage[[:nx-1]] = __tmp(image); if (q.pad != 0.0) cimage[[nx:]] = q.pad; variable i, dx = mx/2; if ((wrap == "wrap") and (padx != nx)) { i = [0:dx-1]; cimage[nx+i] = cimage[i]; i = [dx:mx-1]; cimage[padx-mx+i] = cimage[nx-mx+i]; } if (wrap == "reflect") { i = [0:dx-1]; cimage[nx+i] = cimage[nx-i-2]; i = [dx:mx-1]; cimage[padx-mx+i] = cimage[mx-i]; } if (wrap == "nearest") { i = [0:dx-1]; cimage[nx+i] = cimage[nx-1]; i = [dx:mx-1]; cimage[padx-mx+i] = cimage[0]; } image = cimage; kernel = wrap_kernel_1d (kernel, padx, q.center); image = Real(fft(fft(__tmp(kernel), 1) * fft(__tmp(image), 1), -1)); if (padx == nx) return image; return __tmp(image)[[:nx-1]]; } private define process_qualifiers () { variable q = struct { pad = 0.0, wrap = NULL, center = 1, }; if (qualifier_exists ("pad")) q.pad = qualifier ("pad"); if (qualifier_exists ("reflect")) q.wrap = "reflect"; if (qualifier_exists ("wrap")) q.wrap = "wrap"; if (qualifier_exists ("nearest")) q.wrap = "nearest"; q.center = qualifier ("center"); if (q.center == NULL) q.center = 1; return q; } define convolve () { if (_NARGS != 2) { usage ("a = convolve (array, kernel);\n" + "Qualifiers:\n" + " pad=value (default=0.0)\n" + " wrap (periodic BC)\n" + " reflect (reflect at boundaries)\n" + " nearest (Use nearest boundary value)\n" + " center=0|1 (default=1)\n" ); } variable image, kernel; (image, kernel) = (); variable q = process_qualifiers (;;__qualifiers); variable ndims = length (array_shape (image)); if (ndims == 1) return convolve1d (image, kernel, q); if (ndims == 2) return convolve2d (image, kernel, q); throw NotImplementedError, "This interface is currently limited to the convolution 1 and 2-d arrays"; } define correlate () { if (_NARGS != 2) { usage ("a = correlate (array, kernel);\n" + "Qualifiers:\n" + " pad=value (default=0.0)\n" + " wrap (periodic BC)\n" + " reflect (reflect at boundaries)\n" + " nearest (Use nearest boundary value)\n" + " center=0|1 (default=1)\n" ); } variable image, kernel; (image, kernel) = (); variable q = process_qualifiers (;;__qualifiers); variable ndims = length (array_shape (image)); if (ndims == 1) return convolve1d (image, __tmp(kernel)[[::-1]], q); if (ndims == 2) return convolve2d (image, __tmp(kernel)[[::-1],[::-1]], q); throw NotImplementedError, "This interface is currently limited to the correlation 1 and 2-d arrays"; } provide ("gslfft"); slgsl-pre0.10.0-7/src/gslvers.c0000644000175000000620000000204413057673774015050 0ustar johnstaff#include #include #include int main (int argc, char **argv) { int major, minor, patch; int n; (void) argc; (void) argv; if (0 != strcmp (GSL_VERSION, gsl_version)) { fprintf (stderr, "\ ****************************************************************\n\ ERROR: Installation or Configuration problem:\n\ \n\ The GSL version defined by the library (%s) is not the same as\n\ the one in the gsl_version.h header file (%s). Please check the\n\ Makefile variables and your GSL installation.\n\ \n\ ****************************************************************\n", gsl_version, GSL_VERSION); return 1; } n = sscanf (gsl_version, "%d.%d.%d", &major, &minor, &patch); if (n < 3) { patch = 0; if (n < 2) { minor = 0; if (n < 1) { fprintf (stderr, "Unsupported version of GSL: %s\n", gsl_version); return 1; } } } fprintf (stdout, "\n#define GSL_VERSION_INT %d\n", major*10000 + minor * 100 + patch); return 0; } slgsl-pre0.10.0-7/src/gslmatrix-module.c0000644000175000000620000004457414074757130016663 0ustar johnstaff/* -*- mode: C; mode: fold; -*- */ /* Copyright (c) 2007 Massachusetts Institute of Technology This software was developed by the MIT Center for Space Research under contract SV1-61010 from the Smithsonian Institution. Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in the supporting documentation, and that the name of the Massachusetts Institute of Technology not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The Massachusetts Institute of Technology makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. THE MASSACHUSETTS INSTITUTE OF TECHNOLOGY DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE MASSACHUSETTS INSTITUTE OF TECHNOLOGY BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* Author: John E. Davis (jed@jedsoft.org) */ #include #include #include #include #include #include #include #include "config.h" #include "slgsl.h" #include "version.h" #ifdef __cplusplus extern "C" { #endif /* SLANG_MODULE(gslmatrix); */ #ifdef __cplusplus } #endif static int check_for_complex_args (int nargs, SLtype *tp) { unsigned int i, n; *tp = SLANG_DOUBLE_TYPE; if (nargs <= 0) return 0; n = (unsigned int) nargs; for (i = 0; i < n; i++) { int type = SLang_peek_at_stack1_n (i); if (type == -1) return -1; if (type == SLANG_COMPLEX_TYPE) { *tp = SLANG_COMPLEX_TYPE; return 0; } } return 0; } static int pop_permutation (gsl_permutation **pp) { gsl_permutation *p; SLang_Array_Type *at; unsigned int i, n; unsigned int *data; size_t *pdata; *pp = NULL; if (-1 == SLang_pop_array_of_type (&at, SLANG_UINT_TYPE)) return -1; data = (unsigned int *) at->data; n = at->num_elements; if (n == 0) { SLang_verror (SL_INVALID_PARM, "Empty permutation array"); SLang_free_array (at); return -1; } if (NULL == (p = gsl_permutation_alloc (n))) { SLang_free_array (at); return -1; } pdata = p->data; for (i = 0; i < n; i++) { if (data[i] >= n) { SLang_verror (SL_INVALID_PARM, "Invalid permutation array"); SLang_free_array (at); gsl_permutation_free (p); return -1; } pdata[i] = data[i]; } SLang_free_array (at); *pp = p; return 0; } static int push_permutation (gsl_permutation *p) { SLang_Array_Type *at; unsigned int *data; size_t *pdata; SLindex_Type i, n; n = p->size; if (NULL == (at = SLang_create_array (SLANG_UINT_TYPE, 0, NULL, &n, 1))) return -1; pdata = p->data; data = (unsigned int *) at->data; for (i = 0; i < n; i++) data[i] = pdata[i]; return SLang_push_array (at, 1); } static void linalg_LU_decomp (void) { SLang_Ref_Type *signum_ref = NULL; SLGSL_Matrix_Type *matrix; gsl_permutation *p; int signum; SLtype type; int nargs = SLang_Num_Function_Args; if (-1 == check_for_complex_args (nargs, &type)) return; switch (nargs) { case 2: if (-1 == SLang_pop_ref (&signum_ref)) return; /* fall through */ case 1: if (-1 == slgsl_pop_square_matrix (&matrix, type, 1)) { if (signum_ref != NULL) SLang_free_ref (signum_ref); return; } break; default: SLang_verror (SL_USAGE_ERROR, "Usage: (LU, p) = linalg_LU_decomp(A [,&signum])"); return; } if (NULL == (p = gsl_permutation_alloc (matrix->size1))) { slgsl_free_matrix (matrix); if (signum_ref != NULL) SLang_free_ref (signum_ref); return; } slgsl_reset_errors (); if (type == SLANG_COMPLEX_TYPE) gsl_linalg_complex_LU_decomp (&matrix->m.c, p, &signum); else gsl_linalg_LU_decomp (&matrix->m.d, p, &signum); slgsl_check_errors ("linalg_LU_decomp"); if ((0 == slgsl_push_matrix (matrix)) && (0 == push_permutation (p)) && (signum_ref != NULL)) (void) SLang_assign_to_ref (signum_ref, SLANG_INT_TYPE, (VOID_STAR)&signum); if (signum_ref != NULL) SLang_free_ref (signum_ref); gsl_permutation_free (p); slgsl_free_matrix (matrix); } static void linalg_LU_solve (void) { SLGSL_Matrix_Type *lu = NULL; SLGSL_Vector_Type *b = NULL; SLGSL_Vector_Type *x = NULL; gsl_permutation *p = NULL; SLtype type; int nargs = SLang_Num_Function_Args; if (-1 == check_for_complex_args (nargs, &type)) return; switch (nargs) { case 3: if ((-1 == slgsl_pop_vector (&b, type, 0)) || (-1 == pop_permutation (&p)) || (-1 == slgsl_pop_square_matrix (&lu, type, 0))) goto return_error; if ((lu->size2 != b->size) || (p->size != b->size)) { SLang_verror (SL_INVALID_PARM, "matrices have incompatible dimensions"); goto return_error; } break; default: SLang_verror (SL_USAGE_ERROR, "Usage: x = linalg_LU_solve(LU, p, b);"); return; } if (NULL == (x = slgsl_new_vector (type, b->size, 0, NULL))) goto return_error; slgsl_reset_errors (); if (type == SLANG_COMPLEX_TYPE) gsl_linalg_complex_LU_solve (&lu->m.c, p, &b->v.c, &x->v.c); else gsl_linalg_LU_solve (&lu->m.d, p, &b->v.d, &x->v.d); slgsl_check_errors ("linalg_LU_solve"); if (0 == SLang_get_error ()) (void) slgsl_push_vector (x); /* drop */ return_error: slgsl_free_vector (x); slgsl_free_matrix (lu); gsl_permutation_free (p); slgsl_free_vector (b); } static void do_linalg_LU_det (int nargs, int do_log) { SLGSL_Matrix_Type *matrix; SLtype type; int signum; const char *func; if (do_log) { func = "linalg_LU_lndet"; if (nargs != 1) { SLang_verror (SL_USAGE_ERROR, "Usage: det = linalg_LU_lndet (LU)"); return; } signum = 0; } else { func = "linalg_LU_det"; if (nargs != 2) { SLang_verror (SL_USAGE_ERROR, "Usage: det = linalg_LU_det (LU, signum)"); return; } if (-1 == SLang_pop_int (&signum)) return; } if (-1 == check_for_complex_args (1, &type)) return; if (-1 == slgsl_pop_square_matrix (&matrix, type, 0)) return; slgsl_reset_errors (); if (type == SLANG_COMPLEX_TYPE) { if (do_log) { double d = gsl_linalg_complex_LU_lndet (&matrix->m.c); (void) SLang_push_double (d); } else { gsl_complex c = gsl_linalg_complex_LU_det (&matrix->m.c, signum); (void) SLang_push_complex (c.dat[0], c.dat[1]); } } else { double d; if (do_log) d = gsl_linalg_LU_lndet (&matrix->m.d); else d = gsl_linalg_LU_det (&matrix->m.d, signum); (void) SLang_push_double (d); } slgsl_check_errors (func); slgsl_free_matrix (matrix); } static void linalg_LU_det (void) { do_linalg_LU_det (SLang_Num_Function_Args, 0); } static void linalg_LU_lndet (void) { do_linalg_LU_det (SLang_Num_Function_Args, 1); } static void linalg_LU_invert (void) { SLGSL_Matrix_Type *lu = NULL; SLGSL_Matrix_Type *inv = NULL; gsl_permutation *p = NULL; SLtype type; int nargs = SLang_Num_Function_Args; if (-1 == check_for_complex_args (nargs, &type)) return; if (nargs != 2) { SLang_verror (SL_USAGE_ERROR, "Usage: inv = linalg_LU_invert(LU, p);"); return; } if ((-1 == pop_permutation (&p)) || (-1 == slgsl_pop_square_matrix (&lu, type, 1))) goto return_error; if (NULL == (inv = slgsl_new_matrix (type, lu->size1, lu->size2, 0, NULL))) goto return_error; slgsl_reset_errors (); if (type == SLANG_COMPLEX_TYPE) gsl_linalg_complex_LU_invert (&lu->m.c, p, &inv->m.c); else gsl_linalg_LU_invert (&lu->m.d, p, &inv->m.d); slgsl_check_errors ("linalg_LU_solve"); if (0 == SLang_get_error ()) (void) slgsl_push_matrix (inv); /* drop */ return_error: slgsl_free_matrix (inv); slgsl_free_matrix (lu); gsl_permutation_free (p); } static void linalg_QR_decomp (void) { SLGSL_Matrix_Type *matrix; SLGSL_Vector_Type *tau; unsigned int n; SLtype type = SLANG_DOUBLE_TYPE; int nargs = SLang_Num_Function_Args; if (nargs != 1) { SLang_verror (SL_USAGE_ERROR, "Usage: (QR, tau) = linalg_QR_decomp(A)"); return; } if (-1 == slgsl_pop_matrix (&matrix, type, 1)) return; n = matrix->size1; if (matrix->size2 < n) n = matrix->size2; if (NULL == (tau = slgsl_new_vector (SLANG_DOUBLE_TYPE, n, 0, NULL))) { slgsl_free_matrix (matrix); return; } slgsl_reset_errors (); gsl_linalg_QR_decomp (&matrix->m.d, &tau->v.d); slgsl_check_errors ("linalg_LU_decomp"); (void) slgsl_push_matrix (matrix); (void) slgsl_push_vector (tau); slgsl_free_vector (tau); slgsl_free_matrix (matrix); } static void linalg_QR_solve (void) { SLGSL_Matrix_Type *qr = NULL; SLGSL_Vector_Type *b = NULL; SLGSL_Vector_Type *x = NULL; SLGSL_Vector_Type *tau = NULL; SLGSL_Vector_Type *residual = NULL; SLang_Ref_Type *ref = NULL; SLtype type; int nargs = SLang_Num_Function_Args; type = SLANG_DOUBLE_TYPE; switch (nargs) { case 4: if (-1 == SLang_pop_ref (&ref)) return; /* fall through */ case 3: if ((-1 == slgsl_pop_vector (&b, type, 0)) || (-1 == slgsl_pop_vector (&tau, type, 0)) || (-1 == slgsl_pop_matrix (&qr, type, 0))) goto return_error; break; default: SLang_verror (SL_USAGE_ERROR, "Usage: x = linalg_QR_solve(QR, tau, b [,&residual]);"); return; } if (qr->size2 != b->size) { SLang_verror (SL_INVALID_PARM, "matrices have incompatible dimensions"); goto return_error; } if (NULL == (x = slgsl_new_vector (type, b->size, 0, NULL))) goto return_error; if ((ref != NULL) || (qr->size1 != qr->size2)) { if (NULL == (residual = slgsl_new_vector (type, b->size, 0, NULL))) goto return_error; } slgsl_reset_errors (); if (residual == NULL) gsl_linalg_QR_solve (&qr->m.d, &tau->v.d, &b->v.d, &x->v.d); else gsl_linalg_QR_lssolve (&qr->m.d, &tau->v.d, &b->v.d, &x->v.d, &residual->v.d); slgsl_check_errors ("linalg_LU_solve"); if (0 == SLang_get_error ()) { (void) slgsl_push_vector (x); if (ref != NULL) (void) slgsl_assign_vector_to_ref (residual, ref); } /* drop */ return_error: slgsl_free_vector (x); slgsl_free_matrix (qr); slgsl_free_vector (tau); slgsl_free_vector (b); if (ref != NULL) SLang_free_ref (ref); if (residual != NULL) slgsl_free_vector (residual); } static void linalg_SV_decomp (void) { SLGSL_Matrix_Type *a = NULL, *v = NULL; SLGSL_Vector_Type *s = NULL; gsl_vector *work = NULL; size_t N,M; SLtype type; int nargs = SLang_Num_Function_Args; if (nargs != 1) { SLang_verror (SL_USAGE_ERROR, "Usage: (U,S,V) = linalg_SV_decomp(A); %% ==> A=U#S#transpose(V)"); return; } if (-1 == check_for_complex_args (nargs, &type)) return; if (type == SLANG_COMPLEX_TYPE) { SLang_verror (SL_NOT_IMPLEMENTED, "GSL does not support the SVD of complex arrays"); return; } if (-1 == slgsl_pop_matrix (&a, type, 1)) return; M = a->size1; N = a->size2; if (M < N) { SLang_verror (SL_INVALID_PARM, "Expecting a matrix with nrows>=ncols"); slgsl_free_matrix (a); return; } if ((NULL == (s = slgsl_new_vector (type, N, 0, NULL))) || (NULL == (v = slgsl_new_matrix (type, N, N, 0, NULL))) || (NULL == (work = gsl_vector_alloc (N)))) goto return_error; slgsl_reset_errors (); (void) gsl_linalg_SV_decomp (&a->m.d, &v->m.d, &s->v.d, work); slgsl_check_errors ("linalg_SV_decomp"); if (0 == SLang_get_error ()) { (void) slgsl_push_matrix (a); (void) slgsl_push_vector (s); (void) slgsl_push_matrix (v); } /* drop */ return_error: if (work != NULL) gsl_vector_free (work); slgsl_free_matrix (v); slgsl_free_vector (s); slgsl_free_matrix (a); } static void linalg_SV_solve (void) { SLGSL_Matrix_Type *u = NULL, *v = NULL; SLGSL_Vector_Type *b = NULL, *x = NULL, *s = NULL; size_t M, N; SLtype type; int nargs = SLang_Num_Function_Args; if (nargs != 4) { SLang_verror (SL_USAGE_ERROR, "Usage: x = linalg_SV_solve (U,V,S,b);"); return; } if (-1 == check_for_complex_args (nargs, &type)) return; if (type == SLANG_COMPLEX_TYPE) { SLang_verror (SL_NOT_IMPLEMENTED, "GSL does not support the SVD of complex arrays"); return; } if ((-1 == slgsl_pop_vector (&b, type, 0)) /* N */ || (-1 == slgsl_pop_vector (&s, type, 0)) /* N */ || (-1 == slgsl_pop_square_matrix (&v, type, 0)) /* N */ || (-1 == slgsl_pop_matrix (&u, type, 0))) /* MxN */ goto return_error; N = b->size; if ((s->size != N) || (v->size1 != N) || (u->size2 != N)) { SLang_verror (SL_INVALID_PARM, "matrices have incompatible dimensions"); goto return_error; } M = u->size1; if (M < N) { SLang_verror (SL_INVALID_PARM, "Context requires a matrix with nrows>=ncols"); goto return_error; } if (NULL == (x = slgsl_new_vector (type, N, 0, NULL))) goto return_error; slgsl_reset_errors (); gsl_linalg_SV_solve (&u->m.d, &v->m.d, &s->v.d, &b->v.d, &x->v.d); slgsl_check_errors ("linalg_SV_solve"); if (0 == SLang_get_error ()) (void) slgsl_push_vector (x); /* drop */ return_error: slgsl_free_vector (x); slgsl_free_vector (b); slgsl_free_vector (s); slgsl_free_matrix (v); slgsl_free_matrix (u); } /* Eigenvalue Routines */ static void eigen_symmv (void) { SLGSL_Matrix_Type *matrix; SLtype type = SLANG_DOUBLE_TYPE; SLGSL_Vector_Type *eigvals = NULL; SLGSL_Matrix_Type *eigvecs = NULL; unsigned int n; if (SLang_Num_Function_Args != 1) { SLang_verror (SL_USAGE_ERROR, "Usage: (eigvecs, eigvals)=eigen_symmv(A)"); return; } if (-1 == check_for_complex_args (1, &type)) return; if (-1 == slgsl_pop_square_matrix (&matrix, type, 1)) return; n = matrix->size1; if ((NULL == (eigvals = slgsl_new_vector (SLANG_DOUBLE_TYPE, n, 0, NULL))) || (NULL == (eigvecs = slgsl_new_matrix (type, n, n, 0, NULL)))) goto return_error; slgsl_reset_errors (); if (type == SLANG_COMPLEX_TYPE) { gsl_eigen_hermv_workspace *w = gsl_eigen_hermv_alloc (n); if (w == NULL) goto return_error; (void) gsl_eigen_hermv (&matrix->m.c, &eigvals->v.d, &eigvecs->m.c, w); gsl_eigen_hermv_free (w); } else { gsl_eigen_symmv_workspace *w = gsl_eigen_symmv_alloc (n); if (w == NULL) goto return_error; (void) gsl_eigen_symmv (&matrix->m.d, &eigvals->v.d, &eigvecs->m.d, w); gsl_eigen_symmv_free (w); } slgsl_check_errors ("eigen_symmv"); if (0 == SLang_get_error ()) { if (type == SLANG_COMPLEX_TYPE) gsl_eigen_hermv_sort (&eigvals->v.d, &eigvecs->m.c, GSL_EIGEN_SORT_ABS_DESC); else gsl_eigen_symmv_sort (&eigvals->v.d, &eigvecs->m.d, GSL_EIGEN_SORT_ABS_DESC); (void) slgsl_push_matrix (eigvecs); (void) slgsl_push_vector (eigvals); } /* drop */ return_error: slgsl_free_matrix (eigvecs); slgsl_free_vector (eigvals); slgsl_free_matrix (matrix); } #if GSL_VERSION_INT >= 10900 static void eigen_nonsymmv (void) { SLGSL_Matrix_Type *matrix; SLGSL_Vector_Type *eigvals = NULL; SLGSL_Matrix_Type *eigvecs = NULL; gsl_eigen_nonsymmv_workspace *w = NULL; unsigned int n; if (SLang_Num_Function_Args != 1) { SLang_verror (SL_USAGE_ERROR, "Usage: (eigvecs, eigvals)=eigen_nonsymmv(A)"); return; } if (-1 == slgsl_pop_square_matrix (&matrix, SLANG_DOUBLE_TYPE, 1)) return; n = matrix->size1; if ((NULL == (eigvals = slgsl_new_vector (SLANG_COMPLEX_TYPE, n, 0, NULL))) || (NULL == (eigvecs = slgsl_new_matrix (SLANG_COMPLEX_TYPE, n, n, 0, NULL))) || (NULL == (w = gsl_eigen_nonsymmv_alloc (n)))) goto return_error; slgsl_reset_errors (); (void) gsl_eigen_nonsymmv (&matrix->m.d, &eigvals->v.c, &eigvecs->m.c, w); slgsl_check_errors ("eigen_nonsymmv"); if (0 == SLang_get_error ()) { gsl_eigen_nonsymmv_sort (&eigvals->v.c, &eigvecs->m.c, GSL_EIGEN_SORT_ABS_DESC); (void) slgsl_push_matrix (eigvecs); (void) slgsl_push_vector (eigvals); } /* drop */ return_error: gsl_eigen_nonsymmv_free (w); slgsl_free_matrix (eigvecs); slgsl_free_vector (eigvals); slgsl_free_matrix (matrix); } #endif #define V SLANG_VOID_TYPE static SLang_Intrin_Fun_Type Module_Intrinsics [] = { MAKE_INTRINSIC_0("linalg_LU_decomp", linalg_LU_decomp, V), MAKE_INTRINSIC_0("linalg_LU_det", linalg_LU_det, V), MAKE_INTRINSIC_0("linalg_LU_lndet", linalg_LU_lndet, V), MAKE_INTRINSIC_0("linalg_LU_invert", linalg_LU_invert, V), MAKE_INTRINSIC_0("linalg_LU_solve", linalg_LU_solve, V), MAKE_INTRINSIC_0("linalg_QR_decomp", linalg_QR_decomp, V), MAKE_INTRINSIC_0("linalg_QR_solve", linalg_QR_solve, V), MAKE_INTRINSIC_0("linalg_SV_decomp", linalg_SV_decomp, V), MAKE_INTRINSIC_0("linalg_SV_solve", linalg_SV_solve, V), MAKE_INTRINSIC_0("eigen_symmv", eigen_symmv, V), #if GSL_VERSION_INT >= 10900 MAKE_INTRINSIC_0("eigen_nonsymmv", eigen_nonsymmv, V), #endif SLANG_END_INTRIN_FUN_TABLE }; #undef V static SLang_Intrin_Var_Type Module_Variables [] = { MAKE_VARIABLE("_gslmatrix_module_version_string", &Module_Version_String, SLANG_STRING_TYPE, 1), SLANG_END_INTRIN_VAR_TABLE }; static SLang_IConstant_Type Module_IConstants [] = { MAKE_ICONSTANT("_gslmatrix_module_version", MODULE_VERSION_NUMBER), SLANG_END_ICONST_TABLE }; int init_gslmatrix_module_ns (char *ns_name) { SLang_NameSpace_Type *ns = SLns_create_namespace (ns_name); if (ns == NULL) return -1; if ( (-1 == SLns_add_intrin_fun_table (ns, Module_Intrinsics, NULL)) || (-1 == SLns_add_intrin_var_table (ns, Module_Variables, NULL)) || (-1 == SLns_add_iconstant_table (ns, Module_IConstants, NULL)) ) return -1; return 0; } /* This function is optional */ void deinit_gslmatrix_module (void) { } slgsl-pre0.10.0-7/src/gslcdf-module.c0000644000175000000620000004742714713350753016113 0ustar johnstaff/* -*- mode: C; mode: fold; -*- */ /* This file was automatically generated. */ /* Copyright (c) 2003-2011 Massachusetts Institute of Technology This software was developed by the MIT Center for Space Research under contract SV1-61010 from the Smithsonian Institution. Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in the supporting documentation, and that the name of the Massachusetts Institute of Technology not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The Massachusetts Institute of Technology makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. THE MASSACHUSETTS INSTITUTE OF TECHNOLOGY DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE MASSACHUSETTS INSTITUTE OF TECHNOLOGY BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* Author: John E. Davis (jed@jedsoft.org) */ #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /* SLANG_MODULE(gslcdf); */ #ifdef __cplusplus } #endif #include "slgsl.h" #include "version.h" #define MODULE_HAS_INTRINSICS #define _GSLCDF_MODULE_C_ #ifdef MODULE_HAS_INTRINSICS /*{{{ Helper Functions */ #ifdef _GSLSF_MODULE_C_ static gsl_mode_t Default_GSL_Mode = GSL_PREC_SINGLE; static int get_gsl_precision (void) { return (int) Default_GSL_Mode; } static void set_gsl_precision (int *pp) { int p = *pp; if ((p == GSL_PREC_SINGLE) || (p == GSL_PREC_DOUBLE) || (p == GSL_PREC_APPROX)) Default_GSL_Mode = p; } static int get_gsl_mode (gsl_mode_t *mp, int from_stack) { if (from_stack) { int mode; if (-1 == SLang_pop_integer (&mode)) return -1; *mp = (gsl_mode_t) mode; } *mp = Default_GSL_Mode; return 0; } static void do_d_dm (double (*f)(double, gsl_mode_t), gsl_mode_t m) { SLGSL_Double_Array_Type a; SLang_Array_Type *in, *out; unsigned int i, n; double *xp, *yp; if (-1 == slgsl_pop_d_array (&a, 0)) return; if (NULL == (in = a.at)) { (void) SLang_push_double ((*f)(a.x, m)); return; } if (NULL == (out = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, in->dims, in->num_dims))) { SLang_free_array (in); return; } n = in->num_elements; xp = a.xp; yp = (double *) out->data; for (i = 0; i < n; i++) yp[i] = (*f)(xp[i], m); (void) SLang_push_array (out, 1); SLang_free_array (in); } static void do_d_ddm (double (*f)(double, double, gsl_mode_t), gsl_mode_t m) { SLGSL_Double_Array_Type a, b; SLang_Array_Type *atz; unsigned int i, n; double *xp, *yp, *zp; unsigned int xinc, yinc; if (-1 == slgsl_pop_dd_array (&a, &b, 0)) return; if ((NULL == (atz = a.at)) && (NULL == (atz = b.at))) { (void) SLang_push_double ((*f)(a.x, b.x, m)); return; } atz = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, atz->dims, atz->num_dims); if (atz == NULL) { SLang_free_array (a.at); SLang_free_array (b.at); return; } n = atz->num_elements; zp = (double *) atz->data; xp = a.xp; yp = b.xp; xinc = a.inc; yinc = b.inc; for (i = 0; i < n; i++) { zp[i] = (*f)(*xp, *yp, m); xp += xinc; yp += yinc; } (void) SLang_push_array (atz, 1); SLang_free_array (a.at); SLang_free_array (b.at); } static void do_d_dddm (double (*f)(double, double, double, gsl_mode_t), gsl_mode_t m) { SLGSL_Double_Array_Type a, b, c; SLang_Array_Type *atz; unsigned int i, n; double *ap, *bp, *cp, *zp; unsigned int ainc, binc, cinc; if (-1 == slgsl_pop_ddd_array (&a, &b, &c, 0)) return; if ((NULL == (atz = a.at)) && (NULL == (atz = b.at)) && (NULL == (atz = c.at))) { (void) SLang_push_double ((*f)(a.x, b.x, c.x, m)); return; } atz = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, atz->dims, atz->num_dims); if (atz == NULL) { SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); return; } n = atz->num_elements; zp = (double *) atz->data; ap = a.xp; bp = b.xp; cp = c.xp; ainc = a.inc; binc = b.inc; cinc = c.inc; for (i = 0; i < n; i++) { zp[i] = (*f)(*ap, *bp, *cp, m); ap += ainc; bp += binc; cp += cinc; } (void) SLang_push_array (atz, 1); SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); } static void do_d_ddddm (double (*f)(double, double, double, double, gsl_mode_t), gsl_mode_t m) { SLGSL_Double_Array_Type a, b, c, d; SLang_Array_Type *atz; unsigned int i, n; double *ap, *bp, *cp, *dp, *zp; unsigned int ainc, binc, cinc, dinc; if (-1 == slgsl_pop_dddd_array (&a, &b, &c, &d, 0)) return; if ((NULL == (atz = a.at)) && (NULL == (atz = b.at)) && (NULL == (atz = c.at)) && (NULL == (atz = d.at))) { (void) SLang_push_double ((*f)(a.x, b.x, c.x, d.x, m)); return; } atz = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, atz->dims, atz->num_dims); if (atz == NULL) { SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); SLang_free_array (d.at); return; } n = atz->num_elements; zp = (double *) atz->data; ap = a.xp; bp = b.xp; cp = c.xp; dp = d.xp; ainc = a.inc; binc = b.inc; cinc = c.inc; dinc = d.inc; for (i = 0; i < n; i++) { zp[i] = (*f)(*ap, *bp, *cp, *dp, m); ap += ainc; bp += binc; cp += cinc; dp += dinc; } (void) SLang_push_array (atz, 1); SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); SLang_free_array (d.at); } static void do_d_dm_fun (const char *fun, double (*f)(double, gsl_mode_t)) { gsl_mode_t m; if (SLang_Num_Function_Args < 1) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double[,mode])", fun); return; } if (-1 == get_gsl_mode (&m, SLang_Num_Function_Args-1)) return; slgsl_reset_errors (); do_d_dm (f,m); slgsl_check_errors (fun); } static void do_d_ddm_fun (const char *fun, double (*f)(double, double, gsl_mode_t)) { gsl_mode_t m; if (SLang_Num_Function_Args < 2) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double, double [,mode])", fun); return; } if (-1 == get_gsl_mode (&m, SLang_Num_Function_Args-2)) return; slgsl_reset_errors (); do_d_ddm (f,m); slgsl_check_errors (fun); } static void do_d_dddm_fun (const char *fun, double (*f)(double, double, double, gsl_mode_t)) { gsl_mode_t m; if (SLang_Num_Function_Args < 3) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double, double, double[,mode])", fun); return; } if (-1 == get_gsl_mode (&m, SLang_Num_Function_Args-3)) return; slgsl_reset_errors (); do_d_dddm (f,m); slgsl_check_errors (fun); } static void do_d_ddddm_fun (const char *fun, double (*f)(double,double,double,double,gsl_mode_t)) { gsl_mode_t m; if (SLang_Num_Function_Args < 4) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double, double, double, double [,mode])", fun); return; } if (-1 == get_gsl_mode (&m, SLang_Num_Function_Args-4)) return; slgsl_reset_errors (); do_d_ddddm (f,m); slgsl_check_errors (fun); } static void do_c_c_fun (const char *fun, int (*f)(double, double, gsl_sf_result*, gsl_sf_result*)) { SLGSL_Complex_Array_Type a; SLang_Array_Type *in, *out; unsigned int i, n; gsl_sf_result gsl_zr, gsl_zi; double *xp, *yp; if (SLang_Num_Function_Args < 1) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(complex)", fun); return; } if (-1 == slgsl_pop_c_array (&a, 0)) return; if (NULL == (in = a.at)) { (void) (*f)(a.x[0], a.x[1], &gsl_zr, &gsl_zi); (void) SLang_push_complex (gsl_zr.val, gsl_zi.val); return; } if (NULL == (out = SLang_create_array (SLANG_COMPLEX_TYPE, 0, NULL, in->dims, in->num_dims))) { SLang_free_array (in); return; } n = in->num_elements; xp = a.xp; yp = (double *) out->data; for (i = 0; i < 2*n; i+=2) { (void) (*f)(xp[i], xp[i+1], &gsl_zr, &gsl_zi); yp[i] = gsl_zr.val; yp[i+1] = gsl_zi.val; } (void) SLang_push_array (out, 1); SLang_free_array (in); } #endif /* _GSLSF_MODULE_C_ */ /* Macros to aid in wrapping the functions */ #define SLF(f) f##_intrin #define D_FD(f,n) \ static void SLF(f) (void) { slgsl_do_d_d_fun (n,f); } #define D_FDD(f,n) \ static void SLF(f) (void) { slgsl_do_d_dd_fun (n,f); } #define D_FDDD(f,n) \ static void SLF(f) (void) { slgsl_do_d_ddd_fun (n,f); } #define D_FDDDD(f,n) \ static void SLF(f) (void) { slgsl_do_d_dddd_fun (n,f); } #define D_FDM(f,n) \ static void SLF(f) (void) { do_d_dm_fun (n,f); } #define D_FDDM(f,n) \ static void SLF(f) (void) { do_d_ddm_fun (n,f); } #define D_FDDDM(f,n) \ static void SLF(f) (void) { do_d_dddm_fun (n,f); } #define D_FDDDDM(f,n) \ static void SLF(f) (void) { do_d_ddddm_fun (n,f); } #define D_FI(f,n) \ static void SLF(f) (void) { slgsl_do_d_i_fun (n,f); } #define D_FID(f,n) \ static void SLF(f) (void) { slgsl_do_d_id_fun (n,f); } #define D_FIDD(f,n) \ static void SLF(f) (void) { slgsl_do_d_idd_fun (n,f); } #define D_FIID(f,n) \ static void SLF(f) (void) { slgsl_do_d_iid_fun (n,f); } #define D_FIIDD(f,n) \ static void SLF(f) (void) { slgsl_do_d_iidd_fun (n,f); } #define I_FD(f,n) \ static void SLF(f) (void) { slgsl_do_i_d_fun (n,f); } /* Complex wrappers */ #define C_FC(f,n) \ static void SLF(f) (void) { do_c_c_fun (n,f); } /*}}}*/ D_FDDD(gsl_cdf_beta_P,"cdf_beta_P") D_FDDD(gsl_cdf_beta_Pinv,"cdf_beta_Pinv") D_FDDD(gsl_cdf_beta_Q,"cdf_beta_Q") D_FDDD(gsl_cdf_beta_Qinv,"cdf_beta_Qinv") D_FDDD(gsl_cdf_exppow_P,"cdf_exppow_P") D_FDDD(gsl_cdf_exppow_Q,"cdf_exppow_Q") D_FDDD(gsl_cdf_fdist_P,"cdf_fdist_P") D_FDDD(gsl_cdf_fdist_Pinv,"cdf_fdist_Pinv") D_FDDD(gsl_cdf_fdist_Q,"cdf_fdist_Q") D_FDDD(gsl_cdf_fdist_Qinv,"cdf_fdist_Qinv") D_FDDD(gsl_cdf_flat_P,"cdf_flat_P") D_FDDD(gsl_cdf_flat_Pinv,"cdf_flat_Pinv") D_FDDD(gsl_cdf_flat_Q,"cdf_flat_Q") D_FDDD(gsl_cdf_flat_Qinv,"cdf_flat_Qinv") D_FDDD(gsl_cdf_gamma_P,"cdf_gamma_P") D_FDDD(gsl_cdf_gamma_Pinv,"cdf_gamma_Pinv") D_FDDD(gsl_cdf_gamma_Q,"cdf_gamma_Q") D_FDDD(gsl_cdf_gamma_Qinv,"cdf_gamma_Qinv") D_FDDD(gsl_cdf_gumbel1_P,"cdf_gumbel1_P") D_FDDD(gsl_cdf_gumbel1_Pinv,"cdf_gumbel1_Pinv") D_FDDD(gsl_cdf_gumbel1_Q,"cdf_gumbel1_Q") D_FDDD(gsl_cdf_gumbel1_Qinv,"cdf_gumbel1_Qinv") D_FDDD(gsl_cdf_gumbel2_P,"cdf_gumbel2_P") D_FDDD(gsl_cdf_gumbel2_Pinv,"cdf_gumbel2_Pinv") D_FDDD(gsl_cdf_gumbel2_Q,"cdf_gumbel2_Q") D_FDDD(gsl_cdf_gumbel2_Qinv,"cdf_gumbel2_Qinv") D_FDDD(gsl_cdf_lognormal_P,"cdf_lognormal_P") D_FDDD(gsl_cdf_lognormal_Pinv,"cdf_lognormal_Pinv") D_FDDD(gsl_cdf_lognormal_Q,"cdf_lognormal_Q") D_FDDD(gsl_cdf_lognormal_Qinv,"cdf_lognormal_Qinv") D_FDDD(gsl_cdf_pareto_P,"cdf_pareto_P") D_FDDD(gsl_cdf_pareto_Pinv,"cdf_pareto_Pinv") D_FDDD(gsl_cdf_pareto_Q,"cdf_pareto_Q") D_FDDD(gsl_cdf_pareto_Qinv,"cdf_pareto_Qinv") D_FDDD(gsl_cdf_weibull_P,"cdf_weibull_P") D_FDDD(gsl_cdf_weibull_Pinv,"cdf_weibull_Pinv") D_FDDD(gsl_cdf_weibull_Q,"cdf_weibull_Q") D_FDDD(gsl_cdf_weibull_Qinv,"cdf_weibull_Qinv") D_FDD(gsl_cdf_cauchy_P,"cdf_cauchy_P") D_FDD(gsl_cdf_cauchy_Pinv,"cdf_cauchy_Pinv") D_FDD(gsl_cdf_cauchy_Q,"cdf_cauchy_Q") D_FDD(gsl_cdf_cauchy_Qinv,"cdf_cauchy_Qinv") D_FDD(gsl_cdf_chisq_P,"cdf_chisq_P") D_FDD(gsl_cdf_chisq_Pinv,"cdf_chisq_Pinv") D_FDD(gsl_cdf_chisq_Q,"cdf_chisq_Q") D_FDD(gsl_cdf_chisq_Qinv,"cdf_chisq_Qinv") D_FDD(gsl_cdf_exponential_P,"cdf_exponential_P") D_FDD(gsl_cdf_exponential_Pinv,"cdf_exponential_Pinv") D_FDD(gsl_cdf_exponential_Q,"cdf_exponential_Q") D_FDD(gsl_cdf_exponential_Qinv,"cdf_exponential_Qinv") D_FDD(gsl_cdf_gaussian_P,"cdf_gaussian_P") D_FDD(gsl_cdf_gaussian_Pinv,"cdf_gaussian_Pinv") D_FDD(gsl_cdf_gaussian_Q,"cdf_gaussian_Q") D_FDD(gsl_cdf_gaussian_Qinv,"cdf_gaussian_Qinv") D_FDD(gsl_cdf_laplace_P,"cdf_laplace_P") D_FDD(gsl_cdf_laplace_Pinv,"cdf_laplace_Pinv") D_FDD(gsl_cdf_laplace_Q,"cdf_laplace_Q") D_FDD(gsl_cdf_laplace_Qinv,"cdf_laplace_Qinv") D_FDD(gsl_cdf_logistic_P,"cdf_logistic_P") D_FDD(gsl_cdf_logistic_Pinv,"cdf_logistic_Pinv") D_FDD(gsl_cdf_logistic_Q,"cdf_logistic_Q") D_FDD(gsl_cdf_logistic_Qinv,"cdf_logistic_Qinv") D_FDD(gsl_cdf_rayleigh_P,"cdf_rayleigh_P") D_FDD(gsl_cdf_rayleigh_Pinv,"cdf_rayleigh_Pinv") D_FDD(gsl_cdf_rayleigh_Q,"cdf_rayleigh_Q") D_FDD(gsl_cdf_rayleigh_Qinv,"cdf_rayleigh_Qinv") D_FDD(gsl_cdf_tdist_P,"cdf_tdist_P") D_FDD(gsl_cdf_tdist_Pinv,"cdf_tdist_Pinv") D_FDD(gsl_cdf_tdist_Q,"cdf_tdist_Q") D_FDD(gsl_cdf_tdist_Qinv,"cdf_tdist_Qinv") D_FD(gsl_cdf_ugaussian_P,"cdf_ugaussian_P") D_FD(gsl_cdf_ugaussian_Pinv,"cdf_ugaussian_Pinv") D_FD(gsl_cdf_ugaussian_Q,"cdf_ugaussian_Q") D_FD(gsl_cdf_ugaussian_Qinv,"cdf_ugaussian_Qinv") #define V SLANG_VOID_TYPE static SLang_Intrin_Fun_Type Module_Intrinsics [] = { MAKE_INTRINSIC_0("cdf_beta_P", SLF(gsl_cdf_beta_P), V), MAKE_INTRINSIC_0("cdf_beta_Pinv", SLF(gsl_cdf_beta_Pinv), V), MAKE_INTRINSIC_0("cdf_beta_Q", SLF(gsl_cdf_beta_Q), V), MAKE_INTRINSIC_0("cdf_beta_Qinv", SLF(gsl_cdf_beta_Qinv), V), MAKE_INTRINSIC_0("cdf_exppow_P", SLF(gsl_cdf_exppow_P), V), MAKE_INTRINSIC_0("cdf_exppow_Q", SLF(gsl_cdf_exppow_Q), V), MAKE_INTRINSIC_0("cdf_fdist_P", SLF(gsl_cdf_fdist_P), V), MAKE_INTRINSIC_0("cdf_fdist_Pinv", SLF(gsl_cdf_fdist_Pinv), V), MAKE_INTRINSIC_0("cdf_fdist_Q", SLF(gsl_cdf_fdist_Q), V), MAKE_INTRINSIC_0("cdf_fdist_Qinv", SLF(gsl_cdf_fdist_Qinv), V), MAKE_INTRINSIC_0("cdf_flat_P", SLF(gsl_cdf_flat_P), V), MAKE_INTRINSIC_0("cdf_flat_Pinv", SLF(gsl_cdf_flat_Pinv), V), MAKE_INTRINSIC_0("cdf_flat_Q", SLF(gsl_cdf_flat_Q), V), MAKE_INTRINSIC_0("cdf_flat_Qinv", SLF(gsl_cdf_flat_Qinv), V), MAKE_INTRINSIC_0("cdf_gamma_P", SLF(gsl_cdf_gamma_P), V), MAKE_INTRINSIC_0("cdf_gamma_Pinv", SLF(gsl_cdf_gamma_Pinv), V), MAKE_INTRINSIC_0("cdf_gamma_Q", SLF(gsl_cdf_gamma_Q), V), MAKE_INTRINSIC_0("cdf_gamma_Qinv", SLF(gsl_cdf_gamma_Qinv), V), MAKE_INTRINSIC_0("cdf_gumbel1_P", SLF(gsl_cdf_gumbel1_P), V), MAKE_INTRINSIC_0("cdf_gumbel1_Pinv", SLF(gsl_cdf_gumbel1_Pinv), V), MAKE_INTRINSIC_0("cdf_gumbel1_Q", SLF(gsl_cdf_gumbel1_Q), V), MAKE_INTRINSIC_0("cdf_gumbel1_Qinv", SLF(gsl_cdf_gumbel1_Qinv), V), MAKE_INTRINSIC_0("cdf_gumbel2_P", SLF(gsl_cdf_gumbel2_P), V), MAKE_INTRINSIC_0("cdf_gumbel2_Pinv", SLF(gsl_cdf_gumbel2_Pinv), V), MAKE_INTRINSIC_0("cdf_gumbel2_Q", SLF(gsl_cdf_gumbel2_Q), V), MAKE_INTRINSIC_0("cdf_gumbel2_Qinv", SLF(gsl_cdf_gumbel2_Qinv), V), MAKE_INTRINSIC_0("cdf_lognormal_P", SLF(gsl_cdf_lognormal_P), V), MAKE_INTRINSIC_0("cdf_lognormal_Pinv", SLF(gsl_cdf_lognormal_Pinv), V), MAKE_INTRINSIC_0("cdf_lognormal_Q", SLF(gsl_cdf_lognormal_Q), V), MAKE_INTRINSIC_0("cdf_lognormal_Qinv", SLF(gsl_cdf_lognormal_Qinv), V), MAKE_INTRINSIC_0("cdf_pareto_P", SLF(gsl_cdf_pareto_P), V), MAKE_INTRINSIC_0("cdf_pareto_Pinv", SLF(gsl_cdf_pareto_Pinv), V), MAKE_INTRINSIC_0("cdf_pareto_Q", SLF(gsl_cdf_pareto_Q), V), MAKE_INTRINSIC_0("cdf_pareto_Qinv", SLF(gsl_cdf_pareto_Qinv), V), MAKE_INTRINSIC_0("cdf_weibull_P", SLF(gsl_cdf_weibull_P), V), MAKE_INTRINSIC_0("cdf_weibull_Pinv", SLF(gsl_cdf_weibull_Pinv), V), MAKE_INTRINSIC_0("cdf_weibull_Q", SLF(gsl_cdf_weibull_Q), V), MAKE_INTRINSIC_0("cdf_weibull_Qinv", SLF(gsl_cdf_weibull_Qinv), V), MAKE_INTRINSIC_0("cdf_cauchy_P", SLF(gsl_cdf_cauchy_P), V), MAKE_INTRINSIC_0("cdf_cauchy_Pinv", SLF(gsl_cdf_cauchy_Pinv), V), MAKE_INTRINSIC_0("cdf_cauchy_Q", SLF(gsl_cdf_cauchy_Q), V), MAKE_INTRINSIC_0("cdf_cauchy_Qinv", SLF(gsl_cdf_cauchy_Qinv), V), MAKE_INTRINSIC_0("cdf_chisq_P", SLF(gsl_cdf_chisq_P), V), MAKE_INTRINSIC_0("cdf_chisq_Pinv", SLF(gsl_cdf_chisq_Pinv), V), MAKE_INTRINSIC_0("cdf_chisq_Q", SLF(gsl_cdf_chisq_Q), V), MAKE_INTRINSIC_0("cdf_chisq_Qinv", SLF(gsl_cdf_chisq_Qinv), V), MAKE_INTRINSIC_0("cdf_exponential_P", SLF(gsl_cdf_exponential_P), V), MAKE_INTRINSIC_0("cdf_exponential_Pinv", SLF(gsl_cdf_exponential_Pinv), V), MAKE_INTRINSIC_0("cdf_exponential_Q", SLF(gsl_cdf_exponential_Q), V), MAKE_INTRINSIC_0("cdf_exponential_Qinv", SLF(gsl_cdf_exponential_Qinv), V), MAKE_INTRINSIC_0("cdf_gaussian_P", SLF(gsl_cdf_gaussian_P), V), MAKE_INTRINSIC_0("cdf_gaussian_Pinv", SLF(gsl_cdf_gaussian_Pinv), V), MAKE_INTRINSIC_0("cdf_gaussian_Q", SLF(gsl_cdf_gaussian_Q), V), MAKE_INTRINSIC_0("cdf_gaussian_Qinv", SLF(gsl_cdf_gaussian_Qinv), V), MAKE_INTRINSIC_0("cdf_laplace_P", SLF(gsl_cdf_laplace_P), V), MAKE_INTRINSIC_0("cdf_laplace_Pinv", SLF(gsl_cdf_laplace_Pinv), V), MAKE_INTRINSIC_0("cdf_laplace_Q", SLF(gsl_cdf_laplace_Q), V), MAKE_INTRINSIC_0("cdf_laplace_Qinv", SLF(gsl_cdf_laplace_Qinv), V), MAKE_INTRINSIC_0("cdf_logistic_P", SLF(gsl_cdf_logistic_P), V), MAKE_INTRINSIC_0("cdf_logistic_Pinv", SLF(gsl_cdf_logistic_Pinv), V), MAKE_INTRINSIC_0("cdf_logistic_Q", SLF(gsl_cdf_logistic_Q), V), MAKE_INTRINSIC_0("cdf_logistic_Qinv", SLF(gsl_cdf_logistic_Qinv), V), MAKE_INTRINSIC_0("cdf_rayleigh_P", SLF(gsl_cdf_rayleigh_P), V), MAKE_INTRINSIC_0("cdf_rayleigh_Pinv", SLF(gsl_cdf_rayleigh_Pinv), V), MAKE_INTRINSIC_0("cdf_rayleigh_Q", SLF(gsl_cdf_rayleigh_Q), V), MAKE_INTRINSIC_0("cdf_rayleigh_Qinv", SLF(gsl_cdf_rayleigh_Qinv), V), MAKE_INTRINSIC_0("cdf_tdist_P", SLF(gsl_cdf_tdist_P), V), MAKE_INTRINSIC_0("cdf_tdist_Pinv", SLF(gsl_cdf_tdist_Pinv), V), MAKE_INTRINSIC_0("cdf_tdist_Q", SLF(gsl_cdf_tdist_Q), V), MAKE_INTRINSIC_0("cdf_tdist_Qinv", SLF(gsl_cdf_tdist_Qinv), V), MAKE_INTRINSIC_0("cdf_ugaussian_P", SLF(gsl_cdf_ugaussian_P), V), MAKE_INTRINSIC_0("cdf_ugaussian_Pinv", SLF(gsl_cdf_ugaussian_Pinv), V), MAKE_INTRINSIC_0("cdf_ugaussian_Q", SLF(gsl_cdf_ugaussian_Q), V), MAKE_INTRINSIC_0("cdf_ugaussian_Qinv", SLF(gsl_cdf_ugaussian_Qinv), V), #ifdef _GSLSF_MODULE_C_ MAKE_INTRINSIC_0("gslsf_get_precision", get_gsl_precision, SLANG_INT_TYPE), MAKE_INTRINSIC_I("gslsf_set_precision", set_gsl_precision, SLANG_VOID_TYPE), #endif SLANG_END_INTRIN_FUN_TABLE }; #undef V #endif /* MODULE_HAS_INTRINSICS */ static SLang_Intrin_Var_Type Module_Variables [] = { MAKE_VARIABLE("_gslcdf_module_version_string", &Module_Version_String, SLANG_STRING_TYPE, 1), MAKE_VARIABLE("GSL_VERSION", &gsl_version, SLANG_STRING_TYPE, 1), SLANG_END_INTRIN_VAR_TABLE }; static SLang_IConstant_Type Module_IConstants [] = { MAKE_ICONSTANT("_gslcdf_module_version", MODULE_VERSION_NUMBER), #ifdef _GSLSF_MODULE_C_ MAKE_ICONSTANT("GSL_PREC_SINGLE", GSL_PREC_SINGLE), MAKE_ICONSTANT("GSL_PREC_DOUBLE", GSL_PREC_DOUBLE), MAKE_ICONSTANT("GSL_PREC_APPROX", GSL_PREC_APPROX), #endif SLANG_END_ICONST_TABLE }; #ifdef MODULE_HAS_DCONSTANTS static SLang_DConstant_Type Module_DConstants [] = { SLANG_END_DCONST_TABLE }; #endif int init_gslcdf_module_ns (char *ns_name) { SLang_NameSpace_Type *ns = SLns_create_namespace (ns_name); if (ns == NULL) return -1; if ( (-1 == SLns_add_intrin_var_table (ns, Module_Variables, NULL)) #ifdef MODULE_HAS_INTRINSICS || (-1 == SLns_add_intrin_fun_table (ns, Module_Intrinsics, NULL)) #endif || (-1 == SLns_add_iconstant_table (ns, Module_IConstants, NULL)) #ifdef MODULE_HAS_DCONSTANTS || (-1 == SLns_add_dconstant_table (ns, Module_DConstants, NULL)) #endif ) return -1; return 0; } /* This function is optional */ void deinit_gslcdf_module (void) { } slgsl-pre0.10.0-7/src/slgsl.h0000644000175000000620000001220314713350753014477 0ustar johnstaff#ifndef _SLGSL_MODULE_H_ #define _SLGSL_MODULE_H_ #include #include extern void slgsl_reset_errors (void); extern void slgsl_check_errors (const char *module_name); typedef struct { double x; double *xp; SLang_Array_Type *at; unsigned int num_elements; unsigned int inc; } SLGSL_Double_Array_Type; typedef struct { int x; int *xp; SLang_Array_Type *at; unsigned int num_elements; unsigned int inc; } SLGSL_Int_Array_Type; typedef struct { double x[2]; double *xp; SLang_Array_Type *at; unsigned int num_elements; unsigned int inc; } SLGSL_Complex_Array_Type; extern int slgsl_create_d_array (SLGSL_Double_Array_Type *a, SLGSL_Double_Array_Type *b); extern int slgsl_create_c_array (SLGSL_Complex_Array_Type *a, SLGSL_Complex_Array_Type *b); extern void slgsl_free_i_array (SLGSL_Int_Array_Type *a); extern void slgsl_free_d_array (SLGSL_Double_Array_Type *a); extern void slgsl_free_c_array (SLGSL_Complex_Array_Type *a); extern int slgsl_push_i_array (SLGSL_Int_Array_Type *a, int do_free); extern int slgsl_push_d_array (SLGSL_Double_Array_Type *a, int do_free); extern int slgsl_push_c_array (SLGSL_Complex_Array_Type *a, int do_free); extern int slgsl_pop_d_array (SLGSL_Double_Array_Type *a, int); extern int slgsl_pop_i_array (SLGSL_Int_Array_Type *a, int); extern int slgsl_pop_c_array (SLGSL_Complex_Array_Type *a, int); extern int slgsl_pop_dd_array (SLGSL_Double_Array_Type *a, SLGSL_Double_Array_Type *b, int); extern int slgsl_pop_id_array (SLGSL_Int_Array_Type *a, SLGSL_Double_Array_Type *b, int); extern int slgsl_pop_idd_array (SLGSL_Int_Array_Type *a, SLGSL_Double_Array_Type *b, SLGSL_Double_Array_Type *c, int); extern int slgsl_pop_iid_array (SLGSL_Int_Array_Type *a, SLGSL_Int_Array_Type *b, SLGSL_Double_Array_Type *c, int); extern int slgsl_pop_iidd_array (SLGSL_Int_Array_Type *a, SLGSL_Int_Array_Type *b, SLGSL_Double_Array_Type *c, SLGSL_Double_Array_Type *d, int); extern int slgsl_pop_ddd_array (SLGSL_Double_Array_Type *a, SLGSL_Double_Array_Type *b, SLGSL_Double_Array_Type *c, int); extern int slgsl_pop_dddd_array (SLGSL_Double_Array_Type *a, SLGSL_Double_Array_Type *b, SLGSL_Double_Array_Type *c, SLGSL_Double_Array_Type *d, int); extern void slgsl_do_d_d_fun (const char *fun, double (*f)(double)); extern void slgsl_do_d_i_fun (const char *fun, double (*f)(int)); extern void slgsl_do_d_dd_fun (const char *fun, double (*f)(double, double)); extern void slgsl_do_d_ddd_fun (const char *fun, double (*f)(double, double, double)); extern void slgsl_do_d_dddd_fun (const char *fun, double (*f)(double, double, double,double)); extern void slgsl_do_d_id_fun (const char *fun, double (*f)(int, double)); extern void slgsl_do_d_idd_fun (const char *fun, double (*f)(int, double, double)); extern void slgsl_do_d_iid_fun (const char *fun, double (*f)(int, int, double)); extern void slgsl_do_d_iidd_fun (const char *fun, double (*f)(int, int, double, double)); extern void slgsl_do_i_d_fun (const char *fun, int (*f)(double)); typedef struct SLGSL_Matrix_Type { unsigned int size1, size2; union { gsl_matrix d; gsl_matrix_complex c; } m; int is_complex; void (*free_method)(struct SLGSL_Matrix_Type *); int (*push_method)(struct SLGSL_Matrix_Type *); SLang_Array_Type *at; } SLGSL_Matrix_Type; typedef struct SLGSL_Vector_Type { unsigned int size; union { gsl_vector d; gsl_vector_complex c; } v; int is_complex; void (*free_method)(struct SLGSL_Vector_Type *); int (*push_method)(struct SLGSL_Vector_Type *); SLang_Array_Type *at; } SLGSL_Vector_Type; extern void slgsl_free_matrix (SLGSL_Matrix_Type *matrix); extern int slgsl_push_matrix (SLGSL_Matrix_Type *matrix); extern int slgsl_pop_matrix (SLGSL_Matrix_Type **matrixp, SLtype type, int copy); extern int slgsl_pop_square_matrix (SLGSL_Matrix_Type **matrixp, SLtype type, int copy); extern SLGSL_Matrix_Type *slgsl_new_matrix (SLtype type, unsigned int n0, unsigned int n1, int copy, SLang_Array_Type *at); extern void slgsl_free_vector (SLGSL_Vector_Type *vector); extern int slgsl_push_vector (SLGSL_Vector_Type *vector); extern int slgsl_assign_vector_to_ref (SLGSL_Vector_Type *vector, SLang_Ref_Type *ref); extern int slgsl_pop_vector (SLGSL_Vector_Type **vectorp, SLtype type, int copy); extern SLGSL_Vector_Type *slgsl_new_vector (SLtype type, unsigned int n, int copy, SLang_Array_Type *at); extern int init_gslcdf_module_ns (char *); extern void deinit_gslcdf_module (void); extern int init_gslconst_module_ns (char *); extern void deinit_gslconst_module (void); extern int init_gslfft_module_ns (char *); extern void deinit_gslfft_module (void); extern int init_gslinterp_module_ns (char *); extern void deinit_gslinterp_module (void); extern int init_gslmatrix_module_ns (char *); extern void deinit_gslmatrix_module (void); extern int init_gslrand_module_ns (char *); extern void deinit_gslrand_module (void); extern int init_gslsf_module_ns (char *); extern void deinit_gslsf_module (void); extern int init_gsldwt_module_ns (char *); extern void deinit_gsldwt_module (void); extern int init_gslinteg_module_ns (char *); extern void deinit_gslinteg_module (void); #endif slgsl-pre0.10.0-7/gen/0002755000175000000620000000000014713350753013170 5ustar johnstaffslgsl-pre0.10.0-7/gen/Makefile0000644000175000000620000000133512105106006014607 0ustar johnstaffSRCDIR = ../src AUTOGEN_SOURCES = gslsf-module.c gslconst-module.c gslcdf-module.c AUTOGEN_DOCS = gslsf-module.tm gslconst-module.tm gslcdf-module.tm DOCDIR = ../doc/tm/rtl/ #PREFIX = $(HOME)/sys/i686/test #PREFIX = /usr INCLUDE=$(PREFIX)/include/gsl usage: @echo Usage: make PREFIX=/path/to/gsl/prefix all all: $(AUTOGEN_SOURCES) gslsf-module.c: template.c codegen ./codegen gslsf $(INCLUDE)/gsl_sf*.h gslconst-module.c: template.c codegen ./codegen gslconst $(INCLUDE)/gsl_const*.h gslcdf-module.c: template.c codegen ./codegen gslcdf $(INCLUDE)/gsl_cdf*.h # $(INCLUDE)/gsl_randist.h install: $(AUTOGEN_SOURCES) mv $(AUTOGEN_SOURCES) $(SRCDIR) mv $(AUTOGEN_DOCS) $(DOCDIR) clean: /bin/rm -f *~ \#* $(AUTOGEN_SOURCES) slgsl-pre0.10.0-7/gen/codegen0000755000175000000620000006043214713350753014525 0ustar johnstaff#!/usr/bin/env jed-script implements ("codegen"); if (__argc < 3) { () = fprintf (stderr, "Usage: %s module-name files....\n", __argv[0]); exit (1); } private variable Module_Name = __argv[1]; % Customize Here private variable Func_RE = "gsl_[a-zA-Z_0-9]+"; private variable DConst_REs = ["GSL_CONST_[A-Z_0-9]+"]; private variable Type_Map = Assoc_Type[String_Type]; Type_Map["double"] = "D"; Type_Map["int"] = "I"; Type_Map["float"] = "F"; Type_Map["gsl_mode_t"] = "M"; Type_Map["complex"] = "C"; private variable Excluded_Functions = ["min", "max", "exp", "cos", "sin", "tan", "atanh", "asinh", "acosh", "log", "multiply"]; private variable Excluded_Functions_SLang2 = ["hypot"]; private variable Document_Sections = NULL; private define add_function_doc_section (title, regexp) { variable d = struct { regexp, section_title, function_docs, next }; d.regexp = regexp; d.section_title = title; d.function_docs = Assoc_Type[]; d.next = NULL; variable d0 = Document_Sections; if (d0 == NULL) { Document_Sections = d; return; } while (d0.next != NULL) d0 = d0.next; d0.next = d; } switch (Module_Name) { case "gslsf": add_function_doc_section ("Airy Functions", "airy"); add_function_doc_section ("Bessel Functions", "bessel"); add_function_doc_section ("Beta Functions", "beta"); add_function_doc_section ("Clausen Functions", "clausen"); add_function_doc_section ("Conical Functions", "conical"); add_function_doc_section ("Coulomb Functions", "hydrogenic"); add_function_doc_section ("Coulomb Wave Functions", "coulomb"); add_function_doc_section ("Debye Functions", "debye"); add_function_doc_section ("Di/Tri and Polygamma Functions", "^psi"); add_function_doc_section ("Elliptic Integrals", "ellint"); add_function_doc_section ("Error Functions", "erf"); add_function_doc_section ("Eta/Zeta Functions", "^[zh]?[z]?eta"); add_function_doc_section ("Exponential Functions and Integrals", "exp"); add_function_doc_section ("Factorial Functions", "fact"); add_function_doc_section ("Fermi-Dirac Functions", "fermi_dirac"); add_function_doc_section ("Gamma Functions", "gamma"); add_function_doc_section ("Gegenbauer Functions", "gegen"); add_function_doc_section ("Hypergeometric Functions", "^hyperg"); add_function_doc_section ("Laguerre Functions", "^laguerre"); add_function_doc_section ("Lambert Functions", "lambert"); add_function_doc_section ("Legendre Functions and Spherical Harmonics", "legendre"); add_function_doc_section ("Logarithm and Related Functions", "^log"); add_function_doc_section ("Transport Functions", "^transport"); %add_function_doc_section ("Jacobi Elliptic Functions", "elljac"); add_function_doc_section ("Miscellaneous Functions", "."); } { case "gslcdf": add_function_doc_section ("PDF Functions", "_pdf$"); add_function_doc_section ("CDF Functions", "."); } { add_function_doc_section (sprintf("%s Module Functions", Module_Name), "."); } private define make_intrinsic_name (name) { variable re; foreach re ([`gsl_sf_\([a-zA-Z_0-9]+\)_complex_e`, `gsl_sf_complex_\([a-zA-Z_0-9]+\)_e`]) { variable matches = string_matches (name, re); if (matches != NULL) return matches[1] + "_complex"; } if (0 == strncmp (name, "gsl_sf_", 7)) return substr (name, 8, -1); if (0 == strncmp (name, "gsl_", 4)) return substr (name, 5, -1); return name; } private define make_const_name (name) { if (0 == strncmp (name, "GSL_CONST_", 10)) { name = substr (name, 5, -1); #iffalse if (0 == strncmp (name, "CONST_CGSM_", 11)) name = "CONST_CGS" + substr (name, 11, -1); else if (0 == strncmp (name, "CONST_MKSA_", 11)) name = "CONST_MKS" + substr (name, 11, -1); #endif } return name; } % End of Customizations % Documentation Functions private define parse_prototype (prototype) { % Assume form: "type fname (type parm, type parm, ...)" % Here, type is assumed to not contain spaces (by construction). variable type_names = strtok (prototype, ",()"); variable argv = String_Type[length (type_names)]; variable i = 0; foreach (type_names) { variable type_name = (); argv[i] = strtok (type_name, " \t")[1]; i++; } return argv; } private define insert_function_doc_template (iname, fname, usage) { vinsert ("\\function{%s}\n", iname); vinsert ("\\synopsis{S-Lang version of %s}\n", fname); if (strlen (usage) > 75) { vinsert ("\\usage{%s}", usage); () = bfind ("("); go_right(1); push_spot (); push_mark (); () = ffind (")"); % Expect something like % (Int_Type[] foo, Double_Type bar[]) % or % (Int_Type[] foo [,Int_Type mode]) variable args = bufsubstr (); pop_spot (); push_mark (); while (ffind (" ")) { del_region (); del (); skip_chars ("^[,)"); skip_chars ("[, "); push_mark (); } pop_mark (0); eol (); newline (); insert ("#v+\n"); insert (args); bol (); insert (" "); while (ffind (",")) { if (blooking_at ("[")) { go_left (1); del (); push_spot (); () = ffind (" "); () = ffind ("]"); del (); pop_spot (); } del (); newline (); trim (); insert (" "); } eol (); newline (); insert ("#v-\n"); } else vinsert ("\\usage{%s}\n", usage); %insert ("\\description\n"); %vinsert (" See \\url{%s} for more information.\n", % "http://sources.redhat.com/gsl/ref/gsl-ref_toc.html"); insert ("\\done\n\n"); } private define write_function_documentation () { variable d = Document_Sections; while (d != NULL) { variable keys = assoc_get_keys (d.function_docs); if (length (keys) == 0) { () = fprintf (stderr, "Section %s has no documented functions\n", d.section_title); d = d.next; continue; } vinsert ("\\function_sect{%s}\n", d.section_title); variable i = array_sort (array_map (String_Type, &strlow, keys)); foreach (i) { i = (); variable k = keys[i]; variable v = d.function_docs[k]; insert_function_doc_template (k, v.fname, v.usage); } d = d.next; } } private define store_function_documentation (iname, fname, u) { variable d; variable doc_struct = struct { fname, usage }; doc_struct.fname = fname; doc_struct.usage = u; d = Document_Sections; while (d != NULL) { if (string_match (iname, d.regexp, 1)) { d.function_docs[iname] = doc_struct; return; } d = d.next; } d = Document_Sections; d.function_docs[iname] = doc_struct; } private variable Documented_Constants = Assoc_Type[String_Type]; private define write_constants_documentation () { variable constants = assoc_get_keys (Documented_Constants); constants = constants[array_sort (constants)]; variable i = where (0 == array_map (Int_Type, &strncmp, (constants, "CONST_MKSA_", 10))); insert ("\\begin_constant_sect{MKSA Constants}\n"); foreach (constants[i]) { variable c = (); vinsert ("\\constant{%s}\n", c); } insert ("\\end_constant_sect\n"); constants = constants[array_sort (constants)]; i = where (0 == array_map (Int_Type, &strncmp, (constants, "CONST_CGSM_", 11))); insert ("\\begin_constant_sect{CGSM Constants}\n"); foreach (constants[i]) { c = (); vinsert ("\\constant{%s}\n", c); } insert ("\\end_constant_sect\n"); } private define doc_fun_i_fd (iname, prototype) { variable a = parse_prototype (prototype); variable fname = a[0]; variable u; u = sprintf ("Int_Type[] %s (Double_Type[] %s)", iname, a[1]); store_function_documentation (iname, fname, u); } private define doc_fun_i_fdd (iname, prototype) { variable a = parse_prototype (prototype); variable fname = a[0]; variable u; u = sprintf ("Int_Type[] %s (Double_Type[] %s, Double_Type[] %s)", iname, a[1], a[2]); store_function_documentation (iname, fname, u); } private define doc_fun_d_fd (iname, prototype) { variable a = parse_prototype (prototype); variable fname = a[0]; variable u; u = sprintf ("Double_Type[] %s (Double_Type[] %s)", iname, a[1]); store_function_documentation (iname, fname, u); } private define doc_fun_d_fdd (iname, prototype) { variable a = parse_prototype (prototype); variable fname = a[0]; variable u; u = sprintf ("Double_Type[] %s (Double_Type[] %s, Double_Type[] %s)", iname, a[1], a[2]); store_function_documentation (iname, fname, u); } private define doc_fun_d_fddd (iname, prototype) { variable a = parse_prototype (prototype); variable fname = a[0]; variable u; u = sprintf ("Double_Type[] %s (Double_Type[] %s, Double_Type[] %s, Double_Type[] %s)", iname, a[1], a[2], a[3]); store_function_documentation (iname, fname, u); } private define doc_fun_d_fdddd (iname, prototype) { variable a = parse_prototype (prototype); variable fname = a[0]; variable u; u = sprintf ("Double_Type[] %s (Double_Type[] %s, Double_Type[] %s, Double_Type[] %s, Double_Type[] %s)", iname, a[1], a[2], a[3], a[4]); store_function_documentation (iname, fname, u); } private define doc_fun_d_fi (iname, prototype) { variable a = parse_prototype (prototype); variable fname = a[0]; variable u; u = sprintf ("Double_Type[] %s (Int_Type[] %s)", iname, a[1]); store_function_documentation (iname, fname, u); } private define doc_fun_d_fid (iname, prototype) { variable a = parse_prototype (prototype); variable fname = a[0]; variable u; u = sprintf ("Double_Type[] %s (Int_Type[] %s, Double_Type[] %s)", iname, a[1], a[2]); store_function_documentation (iname, fname, u); } private define doc_fun_d_fidd (iname, prototype) { variable a = parse_prototype (prototype); variable fname = a[0]; variable u; u = sprintf ("Double_Type[] %s (Int_Type[] %s, Double_Type[] %s, Double_Type[] %s)", iname, a[1], a[2], a[3]); store_function_documentation (iname, fname, u); } private define doc_fun_d_fiid (iname, prototype) { variable a = parse_prototype (prototype); variable fname = a[0]; variable u; u = sprintf ("Double_Type[] %s (Int_Type[] %s, Int_Type[] %s, Double_Type[] %s)", iname, a[1], a[2], a[3]); store_function_documentation (iname, fname, u); } private define doc_fun_d_fiidd (iname, prototype) { variable a = parse_prototype (prototype); variable fname = a[0]; variable u; u = sprintf ("Double_Type[] %s (Int_Type[] %s, Int_Type[] %s, Double_Type[] %s, Double_Type[] %s)", iname, a[1], a[2], a[3], a[4]); store_function_documentation (iname, fname, u); } private define doc_fun_d_fiii (iname, prototype) { variable a = parse_prototype (prototype); variable fname = a[0]; variable u; u = sprintf ("Double_Type[] %s (Int_Type[] %s, Int_Type[] %s, Int_Type[] %s)", iname, a[1], a[2], a[3]); store_function_documentation (iname, fname, u); } private define doc_fun_i_fdm (iname, prototype) { variable a = parse_prototype (prototype); variable fname = a[0]; variable u; u = sprintf ("Int_Type[] %s (Double_Type[] %s [,Int_Type %s])", iname, a[1], a[2]); store_function_documentation (iname, fname, u); } private define doc_fun_i_fddm (iname, prototype) { variable a = parse_prototype (prototype); variable fname = a[0]; variable u; u = sprintf ("Int_Type[] %s (Double_Type[] %s, Double_Type %s [,Int_Type %s])", iname, a[1], a[2], a[3]); store_function_documentation (iname, fname, u); } private define doc_fun_d_fdm (iname, prototype) { variable a = parse_prototype (prototype); variable fname = a[0]; variable u; u = sprintf ("Double_Type[] %s (Double_Type[] %s [,Int_Type %s])", iname, a[1], a[2]); store_function_documentation (iname, fname, u); } private define doc_fun_d_fddm (iname, prototype) { variable a = parse_prototype (prototype); variable fname = a[0]; variable u; u = sprintf ("Double_Type[] %s (Double_Type[] %s, Double_Type[] %s [,Int_Type %s])", iname, a[1], a[2], a[3]); store_function_documentation (iname, fname, u); } private define doc_fun_d_fdddm (iname, prototype) { variable a = parse_prototype (prototype); variable fname = a[0]; variable u; u = sprintf ("Double_Type[] %s (Double_Type[] %s, Double_Type[] %s, Double_Type[] %s [,Int_Type %s])", iname, a[1], a[2], a[3], a[4]); store_function_documentation (iname, fname, u); } private define doc_fun_d_fddddm (iname, prototype) { variable a = parse_prototype (prototype); variable fname = a[0]; variable u; u = sprintf ("Double_Type[] %s (Double_Type[] %s, Double_Type[] %s, Double_Type[] %s, Double_Type[] %s [,Int_Type %s])", iname, a[1], a[2], a[3], a[4], a[5]); store_function_documentation (iname, fname, u); } private define doc_fun_d_fim (iname, prototype) { variable a = parse_prototype (prototype); variable fname = a[0]; variable u; u = sprintf ("Double_Type[] %s (Int_Type[] %s [,Int_Type %s])", iname, a[1], a[2]); store_function_documentation (iname, fname, u); } private define doc_fun_d_fidm (iname, prototype) { variable a = parse_prototype (prototype); variable fname = a[0]; variable u; u = sprintf ("Double_Type[] %s (Int_Type[] %s, Double_Type[] %s [,Int_Type %s])", iname, a[1], a[2], a[3]); store_function_documentation (iname, fname, u); } private define doc_fun_d_fiddm (iname, prototype) { variable a = parse_prototype (prototype); variable fname = a[0]; variable u; u = sprintf ("Double_Type[] %s (Int_Type[] %s, Double_Type[] %s, Double_Type[] %s [,Int_Type %s])", iname, a[1], a[2], a[3], a[4]); store_function_documentation (iname, fname, u); } private define doc_fun_d_fiidm (iname, prototype) { variable a = parse_prototype (prototype); variable fname = a[0]; variable u; u = sprintf ("Double_Type[] %s (Int_Type[] %s, Int_Type[] %s, Double_Type[] %s [,Int_Type %s])", iname, a[1], a[2], a[3], a[4]); store_function_documentation (iname, fname, u); } private define doc_fun_d_fiiim (iname, prototype) { variable a = parse_prototype (prototype); variable fname = a[0]; variable u; u = sprintf ("Double_Type[] %s (Int_Type[] %s, Int_Type[] %s, Int_Type[] %s [,Int_Type %s])", iname, a[1], a[2], a[3], a[4]); store_function_documentation (iname, fname, u); } % Complex special functions private define doc_fun_c_fc (iname, prototype) { variable a = parse_prototype(prototype); variable fname = a[0]; variable u; u = sprintf("Complex_Type[] %s (Complex_Type[])", iname, a[1]); store_function_documentation (iname, fname, u); } % End Documentation Functions private variable Exclude_List = Assoc_Type[Int_Type,0]; foreach (Excluded_Functions) { $1 = (); Exclude_List[$1] = 1; } private variable Exclude_List_SLang2 = Assoc_Type[Int_Type,0]; foreach (Excluded_Functions_SLang2) { $1 = (); Exclude_List_SLang2[$1] = 1; } private variable Include_Files = Assoc_Type[Int_Type]; private define store_function (r, fname, file, prototype) { if (fname == strup (fname)) { vmessage ("Excluding possible macro %s in %s", fname, file); return; % could be a macro } variable iname = make_intrinsic_name (fname); if (Exclude_List[iname]) return; Include_Files[path_basename(file)] = 1; if (Exclude_List_SLang2[iname]) r.slang1_matches[iname] = fname; else r.matches [iname] = fname; r.prototypes [iname] = prototype; } private define store_constant (a, cname, file) { variable iname = make_const_name (cname); Include_Files[path_basename(file)] = 1; a [iname] = cname; Documented_Constants[iname] = cname; } private variable Func_Regexps = NULL; private variable DConst_Regexps = NULL; private define special_ret_arg_translate (ret, arg) { variable new_ret = NULL, new_arg = NULL; if (ret != NULL) { switch (ret) { case "complex": new_ret = ["int"]; new_arg = ["gsl_sf_result *\\*", "gsl_sf_result *\\*"]; } } else if (arg != NULL) { switch (arg) { case "complex": new_arg = ["double", "double"]; } } return new_ret, new_arg; } private define add_func_regexp (p) { p = strchop (p, ',', 0); variable ret_type = p[0]; variable args = p[[1:]]; variable args_regexp = ""; variable macro = sprintf ("%s_F", Type_Map[ret_type]); variable new_ret, new_arg, arg, narg; foreach arg (args) { (new_ret, new_arg) = special_ret_arg_translate(NULL, arg); if (NULL != new_arg) { foreach narg (new_arg) args_regexp += sprintf (", *\\<%s\\>[^,\\[\\]\\*)]*", narg); } else { args_regexp += sprintf (", *\\<%s\\>[^,\\[\\]\\*)]*", arg); } macro += Type_Map[arg]; } macro = strup (macro); (new_ret, new_arg) = special_ret_arg_translate(ret_type, NULL); if (NULL != new_ret) { ret_type = new_ret[0]; } if (NULL != new_arg) { foreach narg (new_arg) args_regexp += sprintf (", *\\<%s\\>[^,\\[\\]\\*)]*", narg); } args_regexp = args_regexp[[1:]]; variable re = sprintf ("%s +\\(\\<%s\\>\\) *(%s)", ret_type, qualifier("func_re", Func_RE), args_regexp); variable s = struct { re = re, macro = macro, matches = Assoc_Type[String_Type], slang1_matches = Assoc_Type[String_Type], prototypes = Assoc_Type[String_Type], document_func = __get_reference ("doc_fun_" + strlow(macro)), next = Func_Regexps, }; if (s.document_func == NULL) vmessage ("Unable to find %s", "doc_fun_" + strlow(macro)); Func_Regexps = s; } add_func_regexp ("int,double"); add_func_regexp ("int,double,double"); add_func_regexp ("double,double"); add_func_regexp ("double,double,double"); add_func_regexp ("double,double,double,double"); add_func_regexp ("double,double,double,double,double"); add_func_regexp ("double,int"); add_func_regexp ("double,int,double"); add_func_regexp ("double,int,double,double"); add_func_regexp ("double,int,int,double"); add_func_regexp ("double,int,int,double,double"); add_func_regexp ("double,int,int,int"); add_func_regexp ("int,double,gsl_mode_t"); add_func_regexp ("int,double,double,gsl_mode_t"); add_func_regexp ("double,double,gsl_mode_t"); add_func_regexp ("double,double,double,gsl_mode_t"); add_func_regexp ("double,double,double,double,gsl_mode_t"); add_func_regexp ("double,double,double,double,double,gsl_mode_t"); add_func_regexp ("double,int,gsl_mode_t"); add_func_regexp ("double,int,double,gsl_mode_t"); add_func_regexp ("double,int,double,double,gsl_mode_t"); add_func_regexp ("double,int,int,double,gsl_mode_t"); add_func_regexp ("double,int,int,int,gsl_mode_t"); %add_func_regexp ("int,int"); %add_func_regexp ("int,int,int"); %% complex special functions add_func_regexp ("complex,complex"; func_re="gsl_[a-zA-Z_0-9]+_complex_e"); add_func_regexp ("complex,complex"; func_re="gsl_sf_complex_[a-zA-Z_0-9]+_e"); private define add_dconstant_regexp (pat) { variable s = struct { re, matches, next }; variable re = sprintf ("^ *# *define *\\(%s\\)\\>", pat); s.re = re; s.matches = Assoc_Type[String_Type]; s.next = DConst_Regexps; DConst_Regexps = s; } foreach (DConst_REs) { $1 = (); add_dconstant_regexp($1); } private define process_file (file) { setbuf ("*scratch*"); erase_buffer (); if (-1 == insert_file (file)) { () = fprintf (stderr, "%s: Unable to insert %s--- skipping\n", __argv[0], file); return; } c_mode (); % Get rid of tabs to make REs simpler bob (); replace ("\t", " "); % Get rid of the const qualifier bob (); while (re_fsearch ("\\")) { push_mark (); skip_white (); go_right (5); skip_white (); del_region (); } variable r = Func_Regexps; while (r != NULL) { variable re = r.re; bob (); while (re_fsearch (re)) { variable prototype = regexp_nth_match (0); variable name = regexp_nth_match (1); store_function (r, name, file, prototype); eol (); } r = r.next; } r = DConst_Regexps; while (r != NULL) { re = r.re; bob (); while (re_fsearch (re)) { name = regexp_nth_match (1); store_constant (r.matches, name, file); eol (); } r = r.next; } } private define find_tag (tag) { bob (); !if (fsearch (tag)) verror ("Unable to find %s tag", tag); delete_line (); } private define insert_copyright () { variable copyright; bob (); !if (fsearch ("")) return; delete_line (); copyright = NULL; foreach (["COPYRIGHT", "../COPYRIGHT"]) { variable c = (); if (0 == file_status (c)) continue; copyright = c; break; } if (copyright == NULL) { vmessage ("Warning: COPYRIGHT file not found.\n"); insert ("/* Copyright file goes here */\n"); return; } insert ("/*\n"); () = insert_file (copyright); insert ("*/\n"); } private define sort_assoc (a) { variable keys = assoc_get_keys (a); variable values = assoc_get_values (a); variable i = array_sort (keys); return keys[i], values[i]; } private define dump_results (module_name) { () = read_file (sprintf ("%s-module.c", module_name)); erase_buffer (); () = insert_file ("template.c"); bob (); replace ("", module_name); insert_copyright (); find_tag (""); foreach (Include_Files) using ("keys") { variable inc_file = (); vinsert ("#include \n", inc_file); } find_tag (""); variable has_intrinsics = 0, has_dconstants = 0; variable fname, iname, i, keys, values; variable r = Func_Regexps; while (r != NULL) { variable macro = r.macro; (keys, values) = sort_assoc (r.matches); _for i (0, length(keys)-1, 1) { iname = keys[i]; fname = values[i]; vinsert ("%s(%s,\"%s\")\n", macro, fname, iname); has_intrinsics++; } r = r.next; } #iffalse insert ("#if SLANG_VERSION < 20000\n"); r = Func_Regexps; while (r != NULL) { macro = r.macro; foreach (r.slang1_matches) using ("keys", "values") { (iname, fname) = (); vinsert ("%s(%s,\"%s\")\n", macro, fname, iname); has_intrinsics++; } r = r.next; } insert ("#endif /* SLANG_VERSION < 20000 */\n"); #endif find_tag (""); r = Func_Regexps; while (r != NULL) { (keys, values) = sort_assoc (r.matches); _for i (0, length(keys)-1, 1) { iname = keys[i]; fname = values[i]; vinsert (" MAKE_INTRINSIC_0(\"%s\", SLF(%s), V),\n", iname, fname); } r = r.next; } #iffalse insert ("#if SLANG_VERSION < 20000\n"); r = Func_Regexps; while (r != NULL) { foreach (r.slang1_matches) using ("keys", "values") { (iname, fname) = (); vinsert (" MAKE_INTRINSIC_0(\"%s\", SLF(%s), V),\n", iname, fname); } r = r.next; } insert ("#endif /* SLANG_VERSION < 20000 */\n"); #endif find_tag (""); % add code find_tag (""); % add code find_tag (""); r = DConst_Regexps; while (r != NULL) { (keys, values) = sort_assoc (r.matches); _for i (0, length(keys)-1, 1) { iname = keys[i]; fname = values[i]; vinsert ("#ifdef %s\n", fname); vinsert (" MAKE_DCONSTANT(\"%s\", %s),\n", iname, fname); vinsert ("#endif\n"); has_dconstants++; } r = r.next; } find_tag ("MODULE_DEFINES"); if (has_intrinsics) insert ("#define MODULE_HAS_INTRINSICS\n"); if (has_dconstants) insert ("#define MODULE_HAS_DCONSTANTS\n"); vinsert ("#define _%s_MODULE_C_", strup (module_name)); save_buffer (); % Documentation () = read_file (sprintf ("%s-module.tm", module_name)); erase_buffer (); r = Func_Regexps; while (r != NULL) { (keys, values) = sort_assoc (r.prototypes); _for i (0, length(keys)-1, 1) { %vinsert ("%s: %s: %s\n", macro, iname, prototype); (@r.document_func)(keys[i], values[i]); } r = r.next; } if (has_intrinsics) write_function_documentation (); if (has_dconstants) write_constants_documentation (); save_buffer (); } private define main () { variable module_name = Module_Name; foreach (__argv[[2:]]) { variable file = (); process_file (file); } dump_results (module_name); exit (0); } main (); slgsl-pre0.10.0-7/gen/template.c0000644000175000000620000002472414713350753015156 0ustar johnstaff/* -*- mode: C; mode: fold; -*- */ /* This file was automatically generated. */ /* Author: John E. Davis (jed@jedsoft.org) */ #include #include #include #include #ifdef __cplusplus extern "C" { #endif /* SLANG_MODULE(); */ #ifdef __cplusplus } #endif #include "slgsl.h" #include "version.h" #ifdef MODULE_HAS_INTRINSICS /*{{{ Helper Functions */ #ifdef _GSLSF_MODULE_C_ static gsl_mode_t Default_GSL_Mode = GSL_PREC_SINGLE; static int get_gsl_precision (void) { return (int) Default_GSL_Mode; } static void set_gsl_precision (int *pp) { int p = *pp; if ((p == GSL_PREC_SINGLE) || (p == GSL_PREC_DOUBLE) || (p == GSL_PREC_APPROX)) Default_GSL_Mode = p; } static int get_gsl_mode (gsl_mode_t *mp, int from_stack) { if (from_stack) { int mode; if (-1 == SLang_pop_integer (&mode)) return -1; *mp = (gsl_mode_t) mode; } *mp = Default_GSL_Mode; return 0; } static void do_d_dm (double (*f)(double, gsl_mode_t), gsl_mode_t m) { SLGSL_Double_Array_Type a; SLang_Array_Type *in, *out; unsigned int i, n; double *xp, *yp; if (-1 == slgsl_pop_d_array (&a, 0)) return; if (NULL == (in = a.at)) { (void) SLang_push_double ((*f)(a.x, m)); return; } if (NULL == (out = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, in->dims, in->num_dims))) { SLang_free_array (in); return; } n = in->num_elements; xp = a.xp; yp = (double *) out->data; for (i = 0; i < n; i++) yp[i] = (*f)(xp[i], m); (void) SLang_push_array (out, 1); SLang_free_array (in); } static void do_d_ddm (double (*f)(double, double, gsl_mode_t), gsl_mode_t m) { SLGSL_Double_Array_Type a, b; SLang_Array_Type *atz; unsigned int i, n; double *xp, *yp, *zp; unsigned int xinc, yinc; if (-1 == slgsl_pop_dd_array (&a, &b, 0)) return; if ((NULL == (atz = a.at)) && (NULL == (atz = b.at))) { (void) SLang_push_double ((*f)(a.x, b.x, m)); return; } atz = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, atz->dims, atz->num_dims); if (atz == NULL) { SLang_free_array (a.at); SLang_free_array (b.at); return; } n = atz->num_elements; zp = (double *) atz->data; xp = a.xp; yp = b.xp; xinc = a.inc; yinc = b.inc; for (i = 0; i < n; i++) { zp[i] = (*f)(*xp, *yp, m); xp += xinc; yp += yinc; } (void) SLang_push_array (atz, 1); SLang_free_array (a.at); SLang_free_array (b.at); } static void do_d_dddm (double (*f)(double, double, double, gsl_mode_t), gsl_mode_t m) { SLGSL_Double_Array_Type a, b, c; SLang_Array_Type *atz; unsigned int i, n; double *ap, *bp, *cp, *zp; unsigned int ainc, binc, cinc; if (-1 == slgsl_pop_ddd_array (&a, &b, &c, 0)) return; if ((NULL == (atz = a.at)) && (NULL == (atz = b.at)) && (NULL == (atz = c.at))) { (void) SLang_push_double ((*f)(a.x, b.x, c.x, m)); return; } atz = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, atz->dims, atz->num_dims); if (atz == NULL) { SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); return; } n = atz->num_elements; zp = (double *) atz->data; ap = a.xp; bp = b.xp; cp = c.xp; ainc = a.inc; binc = b.inc; cinc = c.inc; for (i = 0; i < n; i++) { zp[i] = (*f)(*ap, *bp, *cp, m); ap += ainc; bp += binc; cp += cinc; } (void) SLang_push_array (atz, 1); SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); } static void do_d_ddddm (double (*f)(double, double, double, double, gsl_mode_t), gsl_mode_t m) { SLGSL_Double_Array_Type a, b, c, d; SLang_Array_Type *atz; unsigned int i, n; double *ap, *bp, *cp, *dp, *zp; unsigned int ainc, binc, cinc, dinc; if (-1 == slgsl_pop_dddd_array (&a, &b, &c, &d, 0)) return; if ((NULL == (atz = a.at)) && (NULL == (atz = b.at)) && (NULL == (atz = c.at)) && (NULL == (atz = d.at))) { (void) SLang_push_double ((*f)(a.x, b.x, c.x, d.x, m)); return; } atz = SLang_create_array (SLANG_DOUBLE_TYPE, 0, NULL, atz->dims, atz->num_dims); if (atz == NULL) { SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); SLang_free_array (d.at); return; } n = atz->num_elements; zp = (double *) atz->data; ap = a.xp; bp = b.xp; cp = c.xp; dp = d.xp; ainc = a.inc; binc = b.inc; cinc = c.inc; dinc = d.inc; for (i = 0; i < n; i++) { zp[i] = (*f)(*ap, *bp, *cp, *dp, m); ap += ainc; bp += binc; cp += cinc; dp += dinc; } (void) SLang_push_array (atz, 1); SLang_free_array (a.at); SLang_free_array (b.at); SLang_free_array (c.at); SLang_free_array (d.at); } static void do_d_dm_fun (const char *fun, double (*f)(double, gsl_mode_t)) { gsl_mode_t m; if (SLang_Num_Function_Args < 1) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double[,mode])", fun); return; } if (-1 == get_gsl_mode (&m, SLang_Num_Function_Args-1)) return; slgsl_reset_errors (); do_d_dm (f,m); slgsl_check_errors (fun); } static void do_d_ddm_fun (const char *fun, double (*f)(double, double, gsl_mode_t)) { gsl_mode_t m; if (SLang_Num_Function_Args < 2) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double, double [,mode])", fun); return; } if (-1 == get_gsl_mode (&m, SLang_Num_Function_Args-2)) return; slgsl_reset_errors (); do_d_ddm (f,m); slgsl_check_errors (fun); } static void do_d_dddm_fun (const char *fun, double (*f)(double, double, double, gsl_mode_t)) { gsl_mode_t m; if (SLang_Num_Function_Args < 3) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double, double, double[,mode])", fun); return; } if (-1 == get_gsl_mode (&m, SLang_Num_Function_Args-3)) return; slgsl_reset_errors (); do_d_dddm (f,m); slgsl_check_errors (fun); } static void do_d_ddddm_fun (const char *fun, double (*f)(double,double,double,double,gsl_mode_t)) { gsl_mode_t m; if (SLang_Num_Function_Args < 4) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(double, double, double, double [,mode])", fun); return; } if (-1 == get_gsl_mode (&m, SLang_Num_Function_Args-4)) return; slgsl_reset_errors (); do_d_ddddm (f,m); slgsl_check_errors (fun); } static void do_c_c_fun (const char *fun, int (*f)(double, double, gsl_sf_result*, gsl_sf_result*)) { SLGSL_Complex_Array_Type a; SLang_Array_Type *in, *out; unsigned int i, n; gsl_sf_result gsl_zr, gsl_zi; double *xp, *yp; if (SLang_Num_Function_Args < 1) { SLang_verror (SL_USAGE_ERROR, "Usage: y=%s(complex)", fun); return; } if (-1 == slgsl_pop_c_array (&a, 0)) return; if (NULL == (in = a.at)) { (void) (*f)(a.x[0], a.x[1], &gsl_zr, &gsl_zi); (void) SLang_push_complex (gsl_zr.val, gsl_zi.val); return; } if (NULL == (out = SLang_create_array (SLANG_COMPLEX_TYPE, 0, NULL, in->dims, in->num_dims))) { SLang_free_array (in); return; } n = in->num_elements; xp = a.xp; yp = (double *) out->data; for (i = 0; i < 2*n; i+=2) { (void) (*f)(xp[i], xp[i+1], &gsl_zr, &gsl_zi); yp[i] = gsl_zr.val; yp[i+1] = gsl_zi.val; } (void) SLang_push_array (out, 1); SLang_free_array (in); } #endif /* _GSLSF_MODULE_C_ */ /* Macros to aid in wrapping the functions */ #define SLF(f) f##_intrin #define D_FD(f,n) \ static void SLF(f) (void) { slgsl_do_d_d_fun (n,f); } #define D_FDD(f,n) \ static void SLF(f) (void) { slgsl_do_d_dd_fun (n,f); } #define D_FDDD(f,n) \ static void SLF(f) (void) { slgsl_do_d_ddd_fun (n,f); } #define D_FDDDD(f,n) \ static void SLF(f) (void) { slgsl_do_d_dddd_fun (n,f); } #define D_FDM(f,n) \ static void SLF(f) (void) { do_d_dm_fun (n,f); } #define D_FDDM(f,n) \ static void SLF(f) (void) { do_d_ddm_fun (n,f); } #define D_FDDDM(f,n) \ static void SLF(f) (void) { do_d_dddm_fun (n,f); } #define D_FDDDDM(f,n) \ static void SLF(f) (void) { do_d_ddddm_fun (n,f); } #define D_FI(f,n) \ static void SLF(f) (void) { slgsl_do_d_i_fun (n,f); } #define D_FID(f,n) \ static void SLF(f) (void) { slgsl_do_d_id_fun (n,f); } #define D_FIDD(f,n) \ static void SLF(f) (void) { slgsl_do_d_idd_fun (n,f); } #define D_FIID(f,n) \ static void SLF(f) (void) { slgsl_do_d_iid_fun (n,f); } #define D_FIIDD(f,n) \ static void SLF(f) (void) { slgsl_do_d_iidd_fun (n,f); } #define I_FD(f,n) \ static void SLF(f) (void) { slgsl_do_i_d_fun (n,f); } /* Complex wrappers */ #define C_FC(f,n) \ static void SLF(f) (void) { do_c_c_fun (n,f); } /*}}}*/ #define V SLANG_VOID_TYPE static SLang_Intrin_Fun_Type Module_Intrinsics [] = { #ifdef _GSLSF_MODULE_C_ MAKE_INTRINSIC_0("gslsf_get_precision", get_gsl_precision, SLANG_INT_TYPE), MAKE_INTRINSIC_I("gslsf_set_precision", set_gsl_precision, SLANG_VOID_TYPE), #endif SLANG_END_INTRIN_FUN_TABLE }; #undef V #endif /* MODULE_HAS_INTRINSICS */ static SLang_Intrin_Var_Type Module_Variables [] = { MAKE_VARIABLE("__module_version_string", &Module_Version_String, SLANG_STRING_TYPE, 1), MAKE_VARIABLE("GSL_VERSION", &gsl_version, SLANG_STRING_TYPE, 1), SLANG_END_INTRIN_VAR_TABLE }; static SLang_IConstant_Type Module_IConstants [] = { MAKE_ICONSTANT("__module_version", MODULE_VERSION_NUMBER), #ifdef _GSLSF_MODULE_C_ MAKE_ICONSTANT("GSL_PREC_SINGLE", GSL_PREC_SINGLE), MAKE_ICONSTANT("GSL_PREC_DOUBLE", GSL_PREC_DOUBLE), MAKE_ICONSTANT("GSL_PREC_APPROX", GSL_PREC_APPROX), #endif SLANG_END_ICONST_TABLE }; #ifdef MODULE_HAS_DCONSTANTS static SLang_DConstant_Type Module_DConstants [] = { SLANG_END_DCONST_TABLE }; #endif int init__module_ns (char *ns_name) { SLang_NameSpace_Type *ns = SLns_create_namespace (ns_name); if (ns == NULL) return -1; if ( (-1 == SLns_add_intrin_var_table (ns, Module_Variables, NULL)) #ifdef MODULE_HAS_INTRINSICS || (-1 == SLns_add_intrin_fun_table (ns, Module_Intrinsics, NULL)) #endif || (-1 == SLns_add_iconstant_table (ns, Module_IConstants, NULL)) #ifdef MODULE_HAS_DCONSTANTS || (-1 == SLns_add_dconstant_table (ns, Module_DConstants, NULL)) #endif ) return -1; return 0; } /* This function is optional */ void deinit__module (void) { } slgsl-pre0.10.0-7/gen/README0000644000175000000620000000026512105106006014030 0ustar johnstaffThis directory contains scripts that facilitate wrapping of many of the gsl library functions. codegen is a jed script. See http://www.jedsoft.org/jed/ for information about jed. slgsl-pre0.10.0-7/changes.txt0000644000175000000620000000447115012561735014571 0ustar johnstaff-*- mode: text; mode: fold -*- Changes since 0.9.0 1. Updated to support GSL v2. However, v2 broke backward API compatibility with respect to the elliptic integral functions. As such, this module now requires version 2. 2. Added wrappers for the GSL integration routines; Updated configure scripts 3. A return statement was missing from an error handler causing the linalg_SV_decomp to fail when supplied with an invalid matrix. 4. The symbolic constants GSL_INTEG_GAUSS* for the gaussian quadrature routines were added. 5. Updated aclocal.m4; added support for CPPFLAGS (based upon patch from Rafael Laboissière) 6. Added support for a number of GSL complex valued functions (Jakob Stierhof) 7. src/Makefile.in: Added a patch from Rafael Laboissière to resolve an issue with building using `make --shuffle=reverse` {{{ Previous Versions Changes since 0.8.0 1. src/*.c: Added const qualifiers to a number of strings. 2. Updated aclocal.m4, and tweaked codegen to sort the functions. 3. configure: parse /etc/ld.so.conf for system lib paths. 4. updated autoconf files and regenerated the configure script. 5. src/gslfft.sl: Added center qualifier to convolve routines to add addition control on how the kernel is to be shifted. 6. src/test/test_fft.sl: Updated to test the center qualifier in #5. 7. src/gslmatrix-module.c: Moved matrix/vector routines to gsl-module.c for use by other submodules. 8. src/Makefile.in: add slgsl.h to the DEPS variable. 9. src/gsl-module.c: The (unused) deinit routines were incorrectly set (Laurent Perez). 10. src/gsldwt-module.c: Wrapped 1 and 2d wavelet functions (Laurent Perez). 11. src/Makefile.in: gsldwt.sl was not getting installed (Reported by Dave Huenemoerder). Changes since 0.7.0 1. doc/tm/rtl/gslinterp.tm: Some typos corrected. 2. src/Makefile.in: $(CC) was being used instead of $(CC_SHARED) to compile the .o files. 3. src/gslfft.sl (convolve2d): New function. 4. src/gslfft.sl: Added convolve and correlate public functions with support for various qualifiers that specify what to do at boundaries. 5. src/gslrand-module.c (do_ran_dist_dd_fun): Corrected the usage message for distributions that require 2 parameters. 6. src/*.c: regenerated the wrappers-- the base version is now gsl-1.14. This appears to be backward compatible with 1.10. }}} slgsl-pre0.10.0-7/README0000644000175000000620000000466414001614376013301 0ustar johnstaffThe code here provides several slang modules for the GNU Scientific library. See the documentation in the doc/ directory for information about using the modules, or, for the most up to date version, see . To build the code, you will need the following additional libraries: 1. The slang library (http://www.jedsoft.org/slang/) 2. The GNU Scientific library (http://www.gnu.org/software/gsl/) *** NOTE: The module now requires at least version 2.5 of the GSL library. You must run the configure script before you can compile the GSL modules. If either the slang or gsl libraries are installed in non-standard locations, then you will need to specify the locations of these libraries as arguments to the configure script. For example, suppose libslang.so is located in /home/bill/lib and its include file slang.h is located in /home/bill/include. Similarly, assume the gsl libraries and include files are located in /home/bill/opt/lib and /home/bill/opt/include, respectively. Then one would run the configure script using: ./configure --with-slanglib=/home/bill/lib \ --with-slanginc=/home/bill/include \ --with-gsllib=/home/bill/opt/lib \ --with-gslinc=/home/bill/opt/include or, the shorter form which assumes a common pathname prefix for the lib include directories: ./configure --with-slang=/home/bill --with-gsl=/home/bill/opt You should also specify a location for the modules (*.so) and any associated script (*.sl) files created by this package. The default location for the modules is in $prefix/lib/slang/v2/modules/ Any .sl files will be installed in $exec_prefix/share/slsh/local-packages/ where the values of the variable $prefix defaults to /usr/local, and that of $exec_prefix to the value of $prefix. These values may be changed using the --prefix and --exec-prefix configure script parameters. For example, to set the value of $prefix to /home/bill, use ./configure --prefix=/home/bill ... For more help using the configure script, run it using ./configure --help It is also a good idea to read the INSTALL.txt file located in this directory. Once the configure script has been run, it is a good idea to inspect the Makefile that it generated in the src directory. Then building and installing the library should involve nothing more than: make make install You may have to have root privileges to perform the last step. slgsl-pre0.10.0-7/gsl.lis0000644000175000000620000000233612105106006013676 0ustar johnstaff@gsl.lis @configure 0755 @COPYRIGHT @README @INSTALL.txt @autoconf/Makefile.in @autoconf/Makefile @autoconf/aclocal.m4 @autoconf/config.guess 0755 @autoconf/config.sub 0755 @autoconf/configure.ac @autoconf/install-sh 0755 @autoconf/mkinsdir.sh 0755 @gen/Makefile @gen/README @gen/codegen 0755 @gen/template.c @src/Makefile.in @src/config.hin @src/mkversion.sh 0755 @src/slgsl.h @src/gsl-module.c @src/gslconst-module.c @src/gslsf-module.c @src/gslinterp-module.c @src/gslrand-module.c @src/gslcdf-module.c @src/gslmatrix-module.c @src/gsl.sl @src/gslsf.sl @src/gslconst.sl @src/gslinterp.sl @src/gslrand.sl @src/gslcdf.sl @src/gslmatrix.sl @src/version.h @src/tests/test_interp.sl @src/tests/test_err.sl @src/tests/test_rand.sl @src/tests/test_fft.sl @src/tests/test_import.sl @doc/tm/Makefile @doc/tm/fixtex.sl @doc/tm/slgsl.tm @doc/tm/rtl/gslsf-module.tm @doc/tm/rtl/gslmatrix.tm @doc/tm/rtl/gslfft.tm @doc/tm/rtl/gslinterp.tm @doc/tm/rtl/gslconst-module.tm @doc/tm/rtl/gslcdf-module.tm @doc/tm/rtl/gslrand.tm @doc/html/slgsl.html @doc/html/slgsl-1.html @doc/html/slgsl-2.html @doc/html/slgsl-3.html @doc/html/slgsl-4.html @doc/html/slgsl-5.html @doc/html/slgsl-6.html @doc/html/slgsl-7.html @doc/html/slgsl-8.html @doc/html/slgsl-9.html slgsl-pre0.10.0-7/autoconf/0002755000175000000620000000000014146404552014232 5ustar johnstaffslgsl-pre0.10.0-7/autoconf/config.sub0000755000175000000620000010645014001614376016216 0ustar johnstaff#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-02-22' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo "$1" exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo "$1" | sed 's/-[^-]*$//'` if [ "$basic_machine" != "$1" ] then os=`echo "$1" | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia16 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pru \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | wasm32 \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pru-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-pc os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; asmjs) basic_machine=asmjs-unknown ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2*) basic_machine=m68k-bull os=-sysv3 ;; e500v[12]) basic_machine=powerpc-unknown os=$os"spe" ;; e500v[12]-*) basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=$os"spe" ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; nsv-tandem) basic_machine=nsv-tandem ;; nsx-tandem) basic_machine=nsx-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh5el) basic_machine=sh5le-unknown ;; simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; x64) basic_machine=x86_64-pc ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases that might get confused # with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # es1800 is here to avoid being matched by es* (a different OS) -es1800*) os=-ose ;; # Now accept the basic system types. # The portable systems comes first. # Each alternative MUST end in a * to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ | -midnightbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -xray | -os68k* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo "$os" | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4*) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -pikeos*) # Until real need of OS specific support for # particular features comes up, bare metal # configurations are quite functional. case $basic_machine in arm*) os=-eabi ;; *) os=-elf ;; esac ;; -nacl*) ;; -ios) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; pru-*) os=-elf ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` ;; esac echo "$basic_machine$os" exit # Local variables: # eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: slgsl-pre0.10.0-7/autoconf/Makefile0000644000175000000620000000047312105106006015656 0ustar johnstaff../configure: aclocal.m4 configure.ac /bin/rm -rf autom4te.cache autoconf && mv ./configure .. update: config.sub config.guess config.guess: /usr/share/misc/config.guess /bin/cp -f /usr/share/misc/config.guess config.guess config.sub: /usr/share/misc/config.sub /bin/cp -f /usr/share/misc/config.sub config.sub slgsl-pre0.10.0-7/autoconf/scripts/0002755000175000000620000000000013057673774015737 5ustar johnstaffslgsl-pre0.10.0-7/autoconf/scripts/getsyslibs.sh0000755000175000000620000000236613057673774020473 0ustar johnstaff#!/bin/sh # This script parses /etc/ld.so.conf and returns lib and include directories # in a form that JD_CHECK_FOR_LIBRARY can grok. SH_TRUE=0 SH_FALSE=1 # Usage: sh_substr string a b ==> string[a:b] (1s-based) sh_substr() { echo "$1" | cut "-c" "$2-$3" } # if sh_is_comment line; then ... sh_is_comment() { ch=`sh_substr "$1" 1 1` if test "X$ch" = "X#" -o "X$ch" = "X" then return $SH_TRUE; fi return $SH_FALSE; } sh_read_ldsoconf () { file="$1" dirlist="" if test ! -f "$file" then return $SH_FALSE; fi while read line do if sh_is_comment "$line"; then continue; fi read p1 p2 pn << EOF ${line} EOF if test "$p1" = "include" then for file in $p2 do dirs=`sh_read_ldsoconf "$file"` dirlist="$dirlist $dirs" done else dirlist="$dirlist $p1" fi done < "$file" echo "$dirlist" } dirs=`sh_read_ldsoconf "/etc/ld.so.conf"` XY="" for Y in $dirs do if test "/usr/lib" = `sh_substr $Y 1 8` then X="/usr/include" else if test "/lib" = `sh_substr $Y 1 4` then X="/usr/include" else X=`dirname $Y`"/include" fi fi if test -d "$Y" then XY="$XY $X,$Y" fi done echo $XY slgsl-pre0.10.0-7/autoconf/install-sh0000755000175000000620000001273612105106006016227 0ustar johnstaff#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 slgsl-pre0.10.0-7/autoconf/configure.ac0000644000175000000620000000226612105106006016506 0ustar johnstaffdnl -*- sh -*- AC_INIT(src/gslsf-module.c) AC_PREFIX_DEFAULT(/usr/local) AC_CONFIG_AUX_DIR(autoconf) AC_CANONICAL_HOST AC_PROG_RANLIB AC_PROG_INSTALL AC_PROG_MAKE_SET JD_INIT JD_ANSI_CC JD_ELF_COMPILER JD_IEEE_CFLAGS AC_PATH_XTRA JD_WITH_LIBRARY(slang) JD_WITH_LIBRARY(gsl,gsl/gsl_const_cgsm.h) JD_SLANG_MODULE_INSTALL_DIR dnl Check these header since they cause trouble AC_CHECK_HEADERS( \ stdlib.h \ unistd.h \ ) AC_CHECK_SIZEOF(short, 2) AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(long, 4) AC_CHECK_SIZEOF(float, 4) AC_CHECK_SIZEOF(double, 8) dnl #JD_SET_RPATH($libdir) ELF_CFLAGS="$ELF_CFLAGS $IEEE_CFLAGS" CFLAGS="$CFLAGS $IEEE_CFLAGS" AC_CONFIG_HEADER(src/sysconf.h:src/config.hin) AC_OUTPUT(Makefile:autoconf/Makefile.in src/Makefile) echo "" echo "You are compiling with the following compiler configuration:" echo " CC =" "$CC" echo " CC_SHARED =" "$CC_SHARED" echo " CFLAGS =" "$CFLAGS" echo " LDFLAGS =" "$LDFLAGS" "$DYNAMIC_LINK_FLAGS" echo "" echo "The modules will be installed in $MODULE_INSTALL_DIR." echo "Any associated .sl files will be installed in $SL_FILES_INSTALL_DIR" echo "" echo "If any of these quantities are incorrect, edit src/Makefile accordingly." echo "" slgsl-pre0.10.0-7/autoconf/Makefile.in0000644000175000000620000000046113057673774016314 0ustar johnstaff# -*- sh -*- @SET_MAKE@ SHELL = /bin/sh all: cd src; $(MAKE) all clean: cd src; $(MAKE) clean /bin/rm -f *~ \#* distclean: clean cd src; $(MAKE) distclean /bin/rm -f config.log config.cache config.status Makefile check: cd src && $(MAKE) check && echo "Check ok" install: cd src; $(MAKE) install slgsl-pre0.10.0-7/autoconf/mkinsdir.sh0000755000175000000620000000113612105106006016372 0ustar johnstaff#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d in ${1+"$@"} ; do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" 1>&2 mkdir "$pathcomp" || errstatus=$? fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here slgsl-pre0.10.0-7/autoconf/config.guess0000755000175000000620000012637314001614376016561 0ustar johnstaff#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-02-24' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > "$dummy.c" ; for c in cc gcc c89 c99 ; do if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval "$set_cc_for_build" cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" # If ldd exists, use it to detect musl libc. if command -v ldd >/dev/null && \ ldd --version 2>&1 | grep -q ^musl then LIBC=musl fi ;; esac # Note: order is significant - the case branches are not exclusive. case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ "/sbin/$sysctl" 2>/dev/null || \ "/usr/sbin/$sysctl" 2>/dev/null || \ echo unknown)` case "$UNAME_MACHINE_ARCH" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine="${arch}${endian}"-unknown ;; *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case "$UNAME_MACHINE_ARCH" in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval "$set_cc_for_build" if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "$machine-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" exit ;; *:MidnightBSD:*:*) echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:Sortix:*:*) echo "$UNAME_MACHINE"-unknown-sortix exit ;; *:Redox:*:*) echo "$UNAME_MACHINE"-unknown-redox exit ;; mips:OSF1:*.*) echo mips-dec-osf1 exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval "$set_cc_for_build" SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos"$UNAME_RELEASE" exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] then if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ [ "$TARGET_BINARY_INTERFACE"x = x ] then echo m88k-dg-dgux"$UNAME_RELEASE" else echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` case "$UNAME_MACHINE" in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "$sc_cpu_version" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "$sc_kernel_bits" in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if [ "$HP_ARCH" = "" ]; then eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ "$HP_ARCH" = hppa2.0w ] then eval "$set_cc_for_build" # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo "$UNAME_MACHINE"-unknown-osf1mk else echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case "$UNAME_PROCESSOR" in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) case "$UNAME_MACHINE" in x86) echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; i*:UWIN*:*) echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; *:GNU:*:*) # the GNU system echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; i*86:Minix:*:*) echo "$UNAME_MACHINE"-pc-minix exit ;; aarch64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) eval "$set_cc_for_build" if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; e2k:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; k1om:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } ;; mips64el:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-"$LIBC" exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-"$LIBC" exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-"$LIBC" exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-"$LIBC" exit ;; riscv32:Linux:*:* | riscv64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) if objdump -f /bin/sh | grep -q elf32-x86-64; then echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32 else echo "$UNAME_MACHINE"-pc-linux-"$LIBC" fi exit ;; xtensa*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) echo "$UNAME_MACHINE"-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos"$UNAME_RELEASE" exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo "$UNAME_MACHINE"-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux"$UNAME_RELEASE" exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv"$UNAME_RELEASE" else echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux"$UNAME_RELEASE" exit ;; SX-ACE:SUPER-UX:*:*) echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval "$set_cc_for_build" if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-*:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk"$UNAME_RELEASE" exit ;; NSR-*:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk"$UNAME_RELEASE" exit ;; NSV-*:NONSTOP_KERNEL:*:*) echo nsv-tandem-nsk"$UNAME_RELEASE" exit ;; NSX-*:NONSTOP_KERNEL:*:*) echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" exit ;; i*86:rdos:*:*) echo "$UNAME_MACHINE"-pc-rdos exit ;; i*86:AROS:*:*) echo "$UNAME_MACHINE"-pc-aros exit ;; x86_64:VMkernel:*:*) echo "$UNAME_MACHINE"-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; esac echo "$0: unable to guess system type" >&2 case "$UNAME_MACHINE:$UNAME_SYSTEM" in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 </dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF exit 1 # Local variables: # eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: slgsl-pre0.10.0-7/autoconf/aclocal.m40000644000175000000620000007212414146404552016076 0ustar johnstaffdnl# -*- mode: sh; mode: fold -*- dnl# 0.3.4.0: Added $(CPPFLAGS) dnl# 0.3.3-1: Use INSTALL instead of INSTALL_DATA to install modules to get executable permissions dnl# 0.3.3-0: Added $(OBJ_O_DEPS) and $(ELF_O_DEPS) to PROGRAM_OBJECT_RULES dnl# 0.3.2-0: Add rpath support for freebsd dnl# 0.3.1-0: New output variable: CC_SHARED_FLAGS; CC_SHARED is deprecated dnl# 0.3.0-0: Added support for parsing /etc/ld.so.conf dnl# 0.2.7-3: Change ncurses5w-config to ncursesw5-config (Gilles Espinasse) dnl# 0.2.7-2: For the Makefile rules, use cd foo && bar instead of cd foo; bar dnl# 0.2.7-1: Use "$ARCH"elfobjs instead of elf"$ARCH"objs for better flexibility dnl# 0.2.7-0: Instead of expanding $ARCH at configure time, use \$ARCH for compile-time expansion dnl# 0.2.6-2: Missing hyphen for cygwin ELFLIB_MAJOR (Marco Atzeri) dnl# 0.2.6-1: Added optional second and third arguments to AC_DEFINE (Marco Atzeri) dnl# 0.2.6-0: On cygwin, change libfooX_Y_Z.dll to cygfoo-X_Y_Z.dll (Marco Atzeri) dnl# 0.2.5-3: Changed AC_DEFUN(foo...) to AC_DEFUN([foo]...) dnl# 0.2.5-2: JD_CHECK_FOR_LIBRARY will alse output *_INC_DIR and *_LIB_DIR dnl# 0.2.5-1: Updated using autoupdate dnl# 0.2.5-0: M_LIB output variable created for haiku support (Scott McCreary) dnl# 0.2.4-0: Added optional 3rd argument to JD_WITH_LIBRARY for a default path dnl# 0.2.3-2: X was missing in a "test" statement (Joerg Sommer) dnl# 0.2.3-1: AC_AIX needs to be called before running the compiler (Miroslav Lichvar) dnl# 0.2.3: rewrote JD_CHECK_FOR_LIBRARY to loop over include/lib pairs dnl# 0.2.2-1: JD_WITH_LIBRARY bug-fix dnl# 0.2.2: Use ncurses5-config to search for terminfo dirs. dnl# 0.2.1: Add .dll.a to list of extensions to when searching for libs (cygwin) dnl# 0.2.0: Added install target name and more fixes for cygwin dnl# 0.1.12: Improved support for cygwin dnl# 0.1.11: Fixed elf linking on freebsd (Renato Botelho (garga at freebsd, org) dnl# Version 0.1.10: rpath support for netbsd dnl# Version 0.1.9: When searching for libs, use dylib on darwin dnl# Version 0.1.8: Add rpath support for OpenBSD dnl# Version 0.1.7: removed "-K pic" from IRIX compiler lines dnl# Version 0.1.6: Added cygwin module support dnl# Version 0.1.5: Added gcc version-script support. AC_DEFUN([JD_INIT], dnl#{{{ [ #These variable are initialized by JD init function CONFIG_DIR=`pwd` cd $srcdir if test "`pwd`" != "$CONFIG_DIR" then AC_MSG_ERROR("This software does not support configuring from another directory. See the INSTALL file") fi dnl# if test "X$PWD" != "X" dnl# then dnl# CONFIG_DIR="$PWD" dnl# fi AC_SUBST(CONFIG_DIR)dnl # Note: these will differ if one is a symbolic link if test -f /usr/bin/dirname; then JD_Above_Dir=`dirname $CONFIG_DIR` else # system is a loser JD_Above_Dir=`cd ..;pwd` fi JD_Above_Dir2=`cd ..;pwd` ]) dnl#}}} dnl# This function expand the "prefix variables. For example, it will expand dnl# values such as ${exec_prefix}/foo when ${exec_prefix} itself has a dnl# of ${prefix}. This function produces the shell variables: dnl# jd_prefix_libdir, jd_prefix_incdir AC_DEFUN([JD_EXPAND_PREFIX], dnl#{{{ [ if test "X$jd_prefix" = "X" then jd_prefix=$ac_default_prefix if test "X$prefix" != "XNONE" then jd_prefix="$prefix" fi jd_exec_prefix="$jd_prefix" if test "X$exec_prefix" != "XNONE" then jd_exec_prefix="$exec_prefix" fi dnl#Unfortunately, exec_prefix may have a value like ${prefix}, etc. dnl#Let the shell expand those. Yuk. eval `sh <>)dnl define(<<$2>>, translit($1, [a-z], [A-Z]))dnl changequote([, ])dnl ]) #}}} AC_DEFUN([JD_SIMPLE_LIB_DIR], dnl#{{{ [ JD_UPPERCASE($1,JD_UP_NAME) JD_UP_NAME[]_LIB_DIR=$JD_Above_Dir/$1/libsrc/"$ARCH"objs JD_UP_NAME[]_INCLUDE=$JD_Above_Dir/$1/libsrc if test ! -d "[$]JD_UP_NAME[]_INCLUDE" then JD_UP_NAME[]_LIB_DIR=$JD_Above_Dir/$1/src/"$ARCH"objs JD_UP_NAME[]_INCLUDE=$JD_Above_Dir/$1/src if test ! -d "[$]JD_UP_NAME[]_INCLUDE" then echo "" echo WARNING------Unable to find the JD_UP_NAME directory echo You may have to edit $CONFIG_DIR/src/Makefile. echo "" fi fi AC_SUBST(JD_UP_NAME[]_LIB_DIR)dnl AC_SUBST(JD_UP_NAME[]_INCLUDE)dnl undefine([JD_UP_NAME])dnl ]) dnl#}}} AC_DEFUN([JD_FIND_GENERIC], dnl#{{{ [ AC_REQUIRE([JD_EXPAND_PREFIX])dnl changequote(<<, >>)dnl define(<>, translit($1, [a-z], [A-Z]))dnl changequote([, ])dnl # Look for the JD_UP_NAME package #JD_UP_NAME[]_INCLUDE="" #JD_UP_NAME[]_LIB_DIR="" # This list consists of "include,lib include,lib ..." JD_Search_Dirs="$JD_Above_Dir2/$1/libsrc,$JD_Above_Dir2/$1/libsrc/"$ARCH"objs \ $JD_Above_Dir/$1/libsrc,$JD_Above_Dir/$1/libsrc/"$ARCH"objs \ $JD_Above_Dir2/$1/src,$JD_Above_Dir2/$1/src/"$ARCH"objs \ $JD_Above_Dir/$1/src,$JD_Above_Dir/$1/src/"$ARCH"objs" JD_Search_Dirs="$JD_Search_Dirs \ $jd_prefix_incdir,$jd_prefix_libdir \ $HOME/include,$HOME/lib" if test -n "$ARCH" then JD_Search_Dirs="$JD_Search_Dirs $HOME/include,$HOME/$ARCH/lib" JD_Search_Dirs="$JD_Search_Dirs $HOME/include,$HOME/sys/$ARCH/lib" fi # Now add the standard system includes. The reason for doing this is that # the other directories may have a better chance of containing a more recent # version. JD_Search_Dirs="$JD_Search_Dirs \ /usr/local/include,/usr/local/lib \ /usr/include,/usr/lib \ /usr/include/$1,/usr/lib \ /usr/include/$1,/usr/lib/$1" echo looking for the JD_UP_NAME library for include_and_lib in $JD_Search_Dirs do # Yuk. Is there a better way to set these variables?? generic_include=`echo $include_and_lib | tr ',' ' ' | awk '{print [$]1}'` generic_lib=`echo $include_and_lib | tr ',' ' ' | awk '{print [$]2}'` echo Looking for $1.h in $generic_include echo and lib$1.a in $generic_lib if test -r $generic_include/$1.h && test -r $generic_lib/lib$1.a then echo Found it. JD_UP_NAME[]_LIB_DIR="$generic_lib" JD_UP_NAME[]_INCLUDE="$generic_include" break else if test -r $generic_include/$1.h && test -r $generic_lib/lib$1.so then echo Found it. JD_UP_NAME[]_LIB_DIR="$generic_lib" JD_UP_NAME[]_INCLUDE="$generic_include" break fi fi done if test -n "[$]JD_UP_NAME[]_LIB_DIR" then jd_have_$1="yes" else echo Unable to find the $JD_UP_NAME library. echo You may have to edit $CONFIG_DIR/src/Makefile. JD_UP_NAME[]_INCLUDE=$JD_Above_Dir/$1/src JD_UP_NAME[]_LIB_DIR=$JD_Above_Dir/$1/src/"$ARCH"objs jd_have_$1="no" fi JD_UP_NAME[]_INC="-I[$]JD_UP_NAME[]_INCLUDE" JD_UP_NAME[]_LIB="-L[$]JD_UP_NAME[]_LIB_DIR" JD_SET_RPATH([$]JD_UP_NAME[]_LIB_DIR) dnl# if test "X$GCC" = Xyes dnl# then dnl# RPATH_[]JD_UP_NAME="-Wl,-R[$]JD_UP_NAME[]_LIB_DIR" dnl# else dnl# RPATH_[]JD_UP_NAME="-R[$]JD_UP_NAME[]_LIB_DIR" dnl# fi # gcc under solaris is often not installed correctly. Avoid specifying # -I/usr/include. if test "[$]JD_UP_NAME[]_INC" = "-I/usr/include" then JD_UP_NAME[]_INC="" fi if test "[$]JD_UP_NAME[]_LIB" = "-L/usr/lib" then JD_UP_NAME[]_LIB="" RPATH_[]JD_UP_NAME="" fi AC_SUBST(JD_UP_NAME[]_LIB)dnl AC_SUBST(JD_UP_NAME[]_INC)dnl AC_SUBST(JD_UP_NAME[]_LIB_DIR)dnl AC_SUBST(JD_UP_NAME[]_INCLUDE)dnl dnl# AC_SUBST(RPATH_[]JD_UP_NAME)dnl undefine([JD_UP_NAME])dnl ]) dnl#}}} AC_DEFUN([JD_FIND_SLANG], dnl#{{{ [ JD_FIND_GENERIC(slang) ]) dnl#}}} AC_DEFUN([JD_GCC_WARNINGS], dnl#{{{ [ AC_ARG_ENABLE(warnings, AC_HELP_STRING([--enable-warnings],[turn on GCC compiler warnings]), [gcc_warnings=$enableval]) if test -n "$GCC" then #CFLAGS="$CFLAGS -fno-strength-reduce" if test -n "$gcc_warnings" then CFLAGS="$CFLAGS -Wall -W -pedantic -Winline -Wmissing-prototypes \ -Wnested-externs -Wpointer-arith -Wcast-align -Wshadow -Wstrict-prototypes \ -Wformat=2" # Now trim excess whitespace CFLAGS=`echo $CFLAGS` fi fi ]) dnl#}}} IEEE_CFLAGS="" AC_DEFUN([JD_IEEE_CFLAGS], dnl#{{{ [ case "$host_cpu" in *alpha* ) if test "$GCC" = yes then IEEE_CFLAGS="-mieee" else IEEE_CFLAGS="-ieee_with_no_inexact" fi ;; * ) IEEE_CFLAGS="" esac ]) dnl#}}} AC_DEFUN([JD_CREATE_ORULE], dnl#{{{ [ PROGRAM_OBJECT_RULES="$PROGRAM_OBJECT_RULES \$(OBJDIR)/$1.o : \$(SRCDIR)/$1.c \$(DOT_O_DEPS) \$(OBJ_O_DEPS) \$("$1"_O_DEP) cd \$(OBJDIR) && \$(COMPILE_CMD) \$("$1"_C_FLAGS) \$(SRCDIR)/$1.c " ]) dnl#}}} AC_DEFUN([JD_CREATE_ELFORULE], dnl#{{{ [ PROGRAM_ELF_ORULES="$PROGRAM_ELF_ORULES \$(ELFDIR)/$1.o : \$(SRCDIR)/$1.c \$(DOT_O_DEPS) \$(ELF_O_DEPS) \$("$1"_O_DEP) cd \$(ELFDIR) && \$(ELFCOMPILE_CMD) \$("$1"_C_FLAGS) \$(SRCDIR)/$1.c " ]) dnl#}}} AC_DEFUN([JD_CREATE_EXEC_RULE], dnl#{{{ [ PROGRAM_OBJECT_RULES="$PROGRAM_OBJECT_RULES $1 : \$(OBJDIR)/$1 @echo $1 created in \$(OBJDIR) \$(OBJDIR)/$1 : \$(OBJDIR)/$1.o \$("$1"_DEPS) \$(EXECDEPS) \$(CC) -o \$(OBJDIR)/$1 \$(LDFLAGS) \$(OBJDIR)/$1.o \$("$1"_LIBS) \$(EXECLIBS) \$(OBJDIR)/$1.o : \$(SRCDIR)/$1.c \$(DOT_O_DEPS) \$("$1"_O_DEP) cd \$(OBJDIR) && \$(COMPILE_CMD) \$("$1"_INC) \$(EXECINC) \$(SRCDIR)/$1.c " ]) dnl#}}} AC_DEFUN([JD_CREATE_MODULE_ORULES], dnl#{{{ [ for program_module in $Program_Modules; do JD_CREATE_ORULE($program_module) JD_CREATE_ELFORULE($program_module) done ]) dnl#}}} AC_DEFUN([JD_GET_MODULES], dnl#{{{ [ PROGRAM_HFILES="" PROGRAM_OFILES="" PROGRAM_CFILES="" PROGRAM_OBJECTS="" PROGRAM_ELFOBJECTS="" PROGRAM_OBJECT_RULES="" PROGRAM_ELF_ORULES="" if test -z "$1" then Program_Modules="" else comment_re="^#" Program_Modules=`grep -v '$comment_re' $1 | awk '{print [$]1}'` Program_H_Modules=`grep -v '$comment_re' $1 | awk '{print [$]2}'` for program_module in $Program_H_Modules; do PROGRAM_HFILES="$PROGRAM_HFILES $program_module" done fi for program_module in $Program_Modules; do PROGRAM_OFILES="$PROGRAM_OFILES $program_module.o" PROGRAM_CFILES="$PROGRAM_CFILES $program_module.c" PROGRAM_OBJECTS="$PROGRAM_OBJECTS \$(OBJDIR)/$program_module.o" PROGRAM_ELFOBJECTS="$PROGRAM_ELFOBJECTS \$(ELFDIR)/$program_module.o" done dnl echo $PROGRAM_OFILES dnl echo $PROGRAM_HFILES AC_SUBST(PROGRAM_OFILES)dnl AC_SUBST(PROGRAM_CFILES)dnl AC_SUBST(PROGRAM_HFILES)dnl AC_SUBST(PROGRAM_OBJECTS)dnl AC_SUBST(PROGRAM_ELFOBJECTS)dnl ]) dnl#}}} AC_DEFUN([JD_APPEND_RULES], dnl#{{{ [ echo "$PROGRAM_OBJECT_RULES" >> $1 ]) dnl#}}} AC_DEFUN([JD_APPEND_ELFRULES], dnl#{{{ [ echo "$PROGRAM_ELF_ORULES" >> $1 ]) dnl#}}} AC_DEFUN([JD_CREATE_MODULE_EXEC_RULES], dnl#{{{ [ for program_module in $Program_Modules; do JD_CREATE_EXEC_RULE($program_module) done ]) dnl#}}} AC_DEFUN([JD_TERMCAP], dnl#{{{ [ AC_PATH_PROG(nc5config, ncurses5-config, no) if test "$nc5config" = "no" then AC_PATH_PROG(nc5config, ncursesw5-config, no) fi AC_MSG_CHECKING(for terminfo) if test "$nc5config" != "no" then MISC_TERMINFO_DIRS=`$nc5config --terminfo` else MISC_TERMINFO_DIRS="" fi JD_Terminfo_Dirs="$MISC_TERMINFO_DIRS \ /usr/lib/terminfo \ /usr/share/terminfo \ /usr/share/lib/terminfo \ /usr/local/lib/terminfo" TERMCAP=-ltermcap for terminfo_dir in $JD_Terminfo_Dirs do if test -d $terminfo_dir then AC_MSG_RESULT(yes) TERMCAP="" break fi done if test "$TERMCAP"; then AC_MSG_RESULT(no) AC_DEFINE(USE_TERMCAP,1,[Define to use termcap]) fi AC_SUBST(TERMCAP)dnl AC_SUBST(MISC_TERMINFO_DIRS)dnl ]) dnl#}}} AC_DEFUN([JD_ANSI_CC], dnl#{{{ [ AC_AIX AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_CPP]) AC_REQUIRE([AC_PROG_GCC_TRADITIONAL]) AC_ISC_POSIX dnl #This stuff came from Yorick config script dnl dnl # HPUX needs special stuff dnl AC_EGREP_CPP(yes, [#ifdef hpux yes #endif ], [ AC_DEFINE(_HPUX_SOURCE,1,[Special define needed for HPUX]) if test "$CC" = cc; then CC="cc -Ae"; fi ])dnl dnl dnl #Be sure we've found compiler that understands prototypes dnl AC_MSG_CHECKING(C compiler that understands ANSI prototypes) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ extern int silly (int);]])],[ AC_MSG_RESULT($CC looks ok. Good.)],[ AC_MSG_RESULT($CC is not a good enough compiler) AC_MSG_ERROR(Set env variable CC to your ANSI compiler and rerun configure.) ])dnl ])dnl dnl#}}} AC_DEFUN([JD_ELF_COMPILER], dnl#{{{ [ dnl #------------------------------------------------------------------------- dnl # Check for dynamic linker dnl #------------------------------------------------------------------------- DYNAMIC_LINK_LIB="" dnl# AH_TEMPLATE([HAVE_DLOPEN],1,[Define if you have dlopen]) AC_CHECK_HEADER(dlfcn.h,[ AC_DEFINE(HAVE_DLFCN_H,1,[Define if you have the dlfcn.h header]) AC_CHECK_LIB(dl,dlopen,[ DYNAMIC_LINK_LIB="-ldl" AC_DEFINE(HAVE_DLOPEN,1,[Define if you have dlopen]) ],[ AC_CHECK_FUNC(dlopen,AC_DEFINE(HAVE_DLOPEN,[Define if you have dlopen])) if test "$ac_cv_func_dlopen" != yes then AC_MSG_WARN(cannot perform dynamic linking) fi ])]) AC_SUBST(DYNAMIC_LINK_LIB) if test "$GCC" = yes then if test X"$CFLAGS" = X then CFLAGS="-O2" fi fi dnl #Some defaults ELFLIB="lib\$(THIS_LIB).so" ELFLIB_MAJOR="\$(ELFLIB).\$(ELF_MAJOR_VERSION)" ELFLIB_MAJOR_MINOR="\$(ELFLIB_MAJOR).\$(ELF_MINOR_VERSION)" ELFLIB_MAJOR_MINOR_MICRO="\$(ELFLIB_MAJOR_MINOR).\$(ELF_MICRO_VERSION)" dnl# This specifies the target to use in the makefile to install the shared library INSTALL_ELFLIB_TARGET="install-elf-and-links" ELFLIB_BUILD_NAME="\$(ELFLIB_MAJOR_MINOR_MICRO)" INSTALL_MODULE="\$(INSTALL)" SLANG_DLL_CFLAGS="" M_LIB="-lm" case "$host_os" in *linux*|*gnu*|k*bsd*-gnu ) DYNAMIC_LINK_FLAGS="-Wl,-export-dynamic" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) \$(CPPFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED_FLAGS="-shared -fPIC" CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS) \$(CPPFLAGS)" ;; *solaris* ) if test "$GCC" = yes then DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) \$(CPPFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-ztext -Wl,-h,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED_FLAGS="-G -fPIC" CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS) \$(CPPFLAGS)" else DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) \$(CPPFLAGS) -K PIC" ELF_LINK="\$(CC) \$(LDFLAGS) -G -h\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED_FLAGS="-G -K PIC" CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS) \$(CPPFLAGS)" fi ;; # osr5 or unixware7 with current or late autoconf *sco3.2v5* | *unixware-5* | *sco-sysv5uw7*) if test "$GCC" = yes then DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) \$(CPPFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-h,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED_FLAGS="-G -fPIC" CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS) \$(CPPFLAGS)" else DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) \$(CPPFLAGS) -K pic" # ELF_LINK="ld -G -z text -h#" ELF_LINK="\$(CC) \$(LDFLAGS) -G -z text -h\$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED_FLAGS="-G -K pic" CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS) \$(CPPFLAGS)" fi ;; *irix6.5* ) echo "Note: ELF compiler for host_os=$host_os may not be correct" echo "double-check: 'mode_t', 'pid_t' may be wrong!" if test "$GCC" = yes then # not tested DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) \$(CPPFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-h,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED_FLAGS="-shared -fPIC" CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS) \$(CPPFLAGS)" else DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) \$(CPPFLAGS)" # default anyhow ELF_LINK="\$(CC) \$(LDFLAGS) -shared -o \$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED_FLAGS="-shared" CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS) \$(CPPFLAGS)" fi ;; *darwin* ) DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) \$(CPPFLAGS) -fno-common" ELF_LINK="\$(CC) \$(LDFLAGS) -dynamiclib -install_name \$(install_lib_dir)/\$(ELFLIB_MAJOR) -compatibility_version \$(ELF_MAJOR_VERSION) -current_version \$(ELF_MAJOR_VERSION).\$(ELF_MINOR_VERSION)" ELF_DEP_LIBS="\$(LDFLAGS) \$(DL_LIB)" CC_SHARED_FLAGS="-bundle -flat_namespace -undefined suppress -fno-common" CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS) \$(CPPFLAGS)" ELFLIB="lib\$(THIS_LIB).dylib" ELFLIB_MAJOR="lib\$(THIS_LIB).\$(ELF_MAJOR_VERSION).dylib" ELFLIB_MAJOR_MINOR="lib\$(THIS_LIB).\$(ELF_MAJOR_VERSION).\$(ELF_MINOR_VERSION).dylib" ELFLIB_MAJOR_MINOR_MICRO="lib\$(THIS_LIB).\$(ELF_MAJOR_VERSION).\$(ELF_MINOR_VERSION).\$(ELF_MICRO_VERSION).dylib" ;; *freebsd* ) ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) \$(CPPFLAGS) -fPIC" #if test "X$PORTOBJFORMAT" = "Xelf" ; then # ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-soname,\$(ELFLIB_MAJOR)" #else # ELF_LINK="ld -Bshareable -x" #fi ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-soname,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB) -lm" CC_SHARED_FLAGS="-shared -fPIC" CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS) \$(CPPFLAGS)" ;; *cygwin* ) DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" SLANG_DLL_CFLAGS="-DSLANG_DLL=1" ELF_CFLAGS="\$(CFLAGS) \$(CPPFLAGS) -DBUILD_DLL=1" DLL_IMPLIB_NAME="lib\$(THIS_LIB)\$(ELFLIB_MAJOR_VERSION).dll.a" #ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR) -Wl,--out-implib=\$(DLL_IMPLIB_NAME) -Wl,-export-all-symbols -Wl,-enable-auto-import" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR) -Wl,--out-implib=\$(DLL_IMPLIB_NAME)" ELF_DEP_LIBS="\$(DL_LIB) -lm" CC_SHARED_FLAGS="-shared -DSLANG_DLL=1" CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS) \$(CPPFLAGS)" dnl# CYGWIN prohibits undefined symbols when linking shared libs SLANG_LIB_FOR_MODULES="-L\$(ELFDIR) -lslang" INSTALL_MODULE="\$(INSTALL)" INSTALL_ELFLIB_TARGET="install-elf-cygwin" ELFLIB="lib\$(THIS_LIB).dll" ELFLIB_MAJOR="cyg\$(THIS_LIB)-\$(ELF_MAJOR_VERSION).dll" ELFLIB_MAJOR_MINOR="cyg\$(THIS_LIB)-\$(ELF_MAJOR_VERSION)_\$(ELF_MINOR_VERSION).dll" ELFLIB_MAJOR_MINOR_MICRO="cyg\$(THIS_LIB)-\$(ELF_MAJOR_VERSION)_\$(ELF_MINOR_VERSION)_\$(ELF_MICRO_VERSION).dll" ELFLIB_BUILD_NAME="\$(ELFLIB_MAJOR)" ;; *haiku* ) M_LIB="" DYNAMIC_LINK_FLAGS="-Wl,-export-dynamic" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) \$(CPPFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB)" CC_SHARED_FLAGS="-shared -fPIC" CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS) \$(CPPFLAGS)" ;; * ) echo "Note: ELF compiler for host_os=$host_os may be wrong" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) \$(CPPFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED_FLAGS="-shared -fPIC" CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS) \$(CPPFLAGS)" esac AC_SUBST(ELF_CC) AC_SUBST(ELF_CFLAGS) AC_SUBST(ELF_LINK) AC_SUBST(ELF_LINK_CMD) AC_SUBST(ELF_DEP_LIBS) AC_SUBST(DYNAMIC_LINK_FLAGS) AC_SUBST(CC_SHARED_FLAGS) AC_SUBST(CC_SHARED) AC_SUBST(ELFLIB) AC_SUBST(ELFLIB_MAJOR) AC_SUBST(ELFLIB_MAJOR_MINOR) AC_SUBST(ELFLIB_MAJOR_MINOR_MICRO) AC_SUBST(SLANG_LIB_FOR_MODULES) AC_SUBST(DLL_IMPLIB_NAME) AC_SUBST(INSTALL_MODULE) AC_SUBST(INSTALL_ELFLIB_TARGET) AC_SUBST(ELFLIB_BUILD_NAME) AC_SUBST(SLANG_DLL_CFLAGS) AC_SUBST(M_LIB) ]) dnl#}}} AC_DEFUN([JD_F77_COMPILER], dnl#{{{ [ case "$host_os" in *linux* ) F77="g77" F77_LIBS="-lg2c" ;; *solaris*) F77=f77 #F77_LIBS="-lF77 -lM77 -L/opt/SUNWspro/SC4.0/lib -lsunmath" F77_LIBS="-lF77 -lM77 -lsunmath" ;; *) echo "" echo "WARNING: Assuming f77 as your FORTRAN compiler" echo "" F77=f77 F77_LIBS="" esac AC_SUBST(F77) AC_SUBST(F77_LIBS) ]) dnl#}}} dnl# This macro process the --with-xxx, --with-xxxinc, and --with-xxxlib dnl# command line arguments and returns the values as shell variables dnl# jd_xxx_include_dir and jd_xxx_library_dir. It does not perform any dnl# substitutions, nor check for the existence of the supplied values. AC_DEFUN([JD_WITH_LIBRARY_PATHS], dnl#{{{ [ JD_UPPERCASE($1,JD_ARG1) jd_$1_include_dir="" jd_$1_library_dir="" if test X"$jd_with_$1_library" = X then jd_with_$1_library="" fi AC_ARG_WITH($1, [ --with-$1=DIR Use DIR/lib and DIR/include for $1], [jd_with_$1_arg=$withval], [jd_with_$1_arg=unspecified]) case "x$jd_with_$1_arg" in xno) jd_with_$1_library="no" ;; x) dnl# AC_MSG_ERROR(--with-$1 requires a value-- try yes or no) jd_with_$1_library="yes" ;; xunspecified) ;; xyes) jd_with_$1_library="yes" ;; *) jd_with_$1_library="yes" jd_$1_include_dir="$jd_with_$1_arg"/include jd_$1_library_dir="$jd_with_$1_arg"/lib ;; esac AC_ARG_WITH($1lib, [ --with-$1lib=DIR $1 library in DIR], [jd_with_$1lib_arg=$withval], [jd_with_$1lib_arg=unspecified]) case "x$jd_with_$1lib_arg" in xunspecified) ;; xno) ;; x) AC_MSG_ERROR(--with-$1lib requres a value) ;; *) jd_with_$1_library="yes" jd_$1_library_dir="$jd_with_$1lib_arg" ;; esac AC_ARG_WITH($1inc, [ --with-$1inc=DIR $1 include files in DIR], [jd_with_$1inc_arg=$withval], [jd_with_$1inc_arg=unspecified]) case "x$jd_with_$1inc_arg" in x) AC_MSG_ERROR(--with-$1inc requres a value) ;; xunspecified) ;; xno) ;; *) jd_with_$1_library="yes" jd_$1_include_dir="$jd_with_$1inc_arg" ;; esac ]) dnl#}}} dnl# This function checks for the existence of the specified library $1 with dnl# header file $2. If the library exists, then the shell variables will dnl# be created: dnl# jd_with_$1_library=yes/no, dnl# jd_$1_inc_file dnl# jd_$1_include_dir dnl# jd_$1_library_dir dnl# If $3 is present, then also look in $3/include+$3/lib AC_DEFUN([JD_CHECK_FOR_LIBRARY], dnl#{{{ [ AC_REQUIRE([JD_EXPAND_PREFIX])dnl AC_REQUIRE([JD_GET_SYS_INCLIBS])dnl dnl JD_UPPERCASE($1,JD_ARG1) JD_WITH_LIBRARY_PATHS($1) AC_MSG_CHECKING(for the $1 library and header files $2) if test X"$jd_with_$1_library" != Xno then jd_$1_inc_file=$2 dnl# jd_with_$1_library="yes" if test "X$jd_$1_inc_file" = "X" then jd_$1_inc_file=$1.h fi if test X"$jd_$1_include_dir" = X then inc_and_lib_dirs="\ $jd_prefix_incdir,$jd_prefix_libdir \ /usr/local/$1/include,/usr/local/$1/lib \ /usr/local/include/$1,/usr/local/lib \ /usr/local/include,/usr/local/lib \ $JD_SYS_INCLIBS \ /usr/include/$1,/usr/lib \ /usr/$1/include,/usr/$1/lib \ /usr/include,/usr/lib \ /opt/include/$1,/opt/lib \ /opt/$1/include,/opt/$1/lib \ /opt/include,/opt/lib" if test X$3 != X then inc_and_lib_dirs="$3/include,$3/lib $inc_and_lib_dirs" fi case "$host_os" in *darwin* ) exts="dylib so a" ;; *cygwin* ) exts="dll.a so a" ;; * ) exts="so a" esac xincfile="$jd_$1_inc_file" xlibfile="lib$1" jd_with_$1_library="no" for include_and_lib in $inc_and_lib_dirs do # Yuk. Is there a better way to set these variables?? xincdir=`echo $include_and_lib | tr ',' ' ' | awk '{print [$]1}'` xlibdir=`echo $include_and_lib | tr ',' ' ' | awk '{print [$]2}'` found=0 if test -r $xincdir/$xincfile then for E in $exts do if test -r "$xlibdir/$xlibfile.$E" then jd_$1_include_dir="$xincdir" jd_$1_library_dir="$xlibdir" jd_with_$1_library="yes" found=1 break fi done fi if test $found -eq 1 then break fi done fi fi if test X"$jd_$1_include_dir" != X -a X"$jd_$1_library_dir" != X then AC_MSG_RESULT(yes: $jd_$1_library_dir and $jd_$1_include_dir) jd_with_$1_library="yes" dnl# Avoid using /usr/lib and /usr/include because of problems with dnl# gcc on some solaris systems. JD_ARG1[]_LIB=-L$jd_$1_library_dir JD_ARG1[]_LIB_DIR=$jd_$1_library_dir if test "X$jd_$1_library_dir" = "X/usr/lib" -o "X$jd_$1_include_dir" = "X/usr/include" then JD_ARG1[]_LIB="" else JD_SET_RPATH($jd_$1_library_dir) fi JD_ARG1[]_INC=-I$jd_$1_include_dir JD_ARG1[]_INC_DIR=$jd_$1_include_dir if test "X$jd_$1_include_dir" = "X/usr/include" then JD_ARG1[]_INC="" fi else AC_MSG_RESULT(no) jd_with_$1_library="no" JD_ARG1[]_INC="" JD_ARG1[]_LIB="" JD_ARG1[]_INC_DIR="" JD_ARG1[]_LIB_DIR="" fi AC_SUBST(JD_ARG1[]_LIB) AC_SUBST(JD_ARG1[]_INC) AC_SUBST(JD_ARG1[]_LIB_DIR) AC_SUBST(JD_ARG1[]_INC_DIR) ]) dnl#}}} AC_DEFUN([JD_WITH_LIBRARY], dnl#{{{ [ JD_CHECK_FOR_LIBRARY($1, $2, $3) if test "$jd_with_$1_library" = "no" then AC_MSG_ERROR(unable to find the $1 library and header file $jd_$1_inc_file) fi ]) dnl#}}} AC_DEFUN([JD_SLANG_VERSION], dnl#{{{ [ slang_h=$jd_slang_include_dir/slang.h AC_MSG_CHECKING(SLANG_VERSION in $slang_h) slang_version=`grep "^#define *SLANG_VERSION " $slang_h | awk '{ print [$]3 }'` slang_major_version=`echo $slang_version | awk '{ print int([$]1/10000) }'` slang_minor_version=`echo $slang_version $slang_major_version | awk '{ print int(([$]1 - [$]2*10000)/100) }'` slang_patchlevel_version=`echo $slang_version $slang_major_version $slang_minor_version | awk '{ print ([$]1 - [$]2*10000 - [$]3*100) }'` AC_MSG_RESULT($slang_major_version.$slang_minor_version.$slang_patchlevel_version) AC_SUBST(slang_version) AC_SUBST(slang_major_version) AC_SUBST(slang_minor_version) AC_SUBST(slang_patchlevel_version) ]) #}}} AC_DEFUN([JD_SLANG_MODULE_INSTALL_DIR], dnl#{{{ [ AC_REQUIRE([JD_SLANG_VERSION]) if test "X$slang_major_version" = "X1" then MODULE_INSTALL_DIR="$libdir/slang/modules" else MODULE_INSTALL_DIR="$libdir/slang/v$slang_major_version/modules" fi SL_FILES_INSTALL_DIR=$datadir/slsh/local-packages AC_SUBST(MODULE_INSTALL_DIR) AC_SUBST(SL_FILES_INSTALL_DIR) ]) #}}} AC_DEFUN([JD_CHECK_LONG_LONG], dnl#{{{ [ AC_CHECK_TYPES(long long) AC_CHECK_SIZEOF(long long) ]) dnl#}}} AC_DEFUN([JD_LARGE_FILE_SUPPORTXXX], dnl#{{{ [ AC_REQUIRE([JD_CHECK_LONG_LONG]) AC_MSG_CHECKING(whether to explicitly activate long file support) AC_DEFINE(_LARGEFILE_SOURCE, 1) AC_DEFINE(_FILE_OFFSET_BITS, 64) jd_large_file_support=no if test X$ac_cv_type_long_long = Xyes then if test $ac_cv_sizeof_long_long -ge 8 then jd_large_file_support=yes fi fi if test $jd_large_file_support = yes then AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi ]) dnl#}}} AC_DEFUN([JD_LARGE_FILE_SUPPORT], dnl#{{{ [ AC_SYS_LARGEFILE AC_FUNC_FSEEKO AC_TYPE_OFF_T AC_CHECK_SIZEOF(off_t) ]) #}}} AC_DEFUN([JD_HAVE_ISINF], dnl#{{{ [ AC_MSG_CHECKING([for isinf]) AC_LINK_IFELSE([AC_LANG_PROGRAM( [[#include ]], [[isinf (0.0);]])], [AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_ISINF, 1)]) ]) #}}} slgsl-pre0.10.0-7/examples/0002755000175000000620000000000012320462336014226 5ustar johnstaffslgsl-pre0.10.0-7/examples/wavelet.sl0000644000175000000620000000131412320462336016232 0ustar johnstaff% This example computes an approximation of a sin curve, % setting all but the 10 largest largest components % of the wavelet transform to 0 require ("gsl"); require ("csv"); define slsh_main () { variable x, y, w, a, t, fp, N = 1024; t = [0:1:#N]; x = sin (2 * PI * t); w = wavelet_transform (x ; type = DWT_DAUBECHIES, k = 4); a = array_sort (abs (w)); w [a [[:N - 10]]] = 0; y = wavelet_transform (w, -1 ; type = DWT_DAUBECHIES, k = 4); csv_writecol ("dwt.tsv", t, x, y; delim='\t'); fp = fopen ("dwt.gp", "w"); () = fprintf (fp, "p 'dwt.tsv' using 1:2 w l, '' using 1:3 w l\n"); () = fprintf (fp, "pause -1\n"); () = fclose (fp); message ("Now run : gnuplot dwt.gp"); } slgsl-pre0.10.0-7/examples/wavelet2d.sl0000644000175000000620000000141612320462336016463 0ustar johnstaff#!/usr/bin/env slsh % Usage: wavelet2d.sl image.png image-low.png % image.png being a 8-bit gray PNG image require ("gsl"); require ("png"); define slsh_main () { if (__argc != 2) { () = fprintf (stderr, "\ Usage: wavelet2d.sl image.png image-low.png\n\ where image.png is an 8-but grayscale PNG image\n"); exit (1); } variable x, w, k = 8; x = png_read (__argv [1]); variable dims = array_shape (x), nx = dims[1], ny=dims[0]; w = wavelet_transform (x [[0:ny-1], [0:nx-1]] ; type = DWT_DAUBECHIES, k = k); % all but the upper-left n/k of dwt is set to 0 w [[ny / k:], [0:nx / k]] = 0; w [*, [nx / k:]] = 0; x = wavelet_transform (w, -1 ; type = DWT_DAUBECHIES, k = k); png_write (__argv [2], typecast (x, UChar_Type)); } slgsl-pre0.10.0-7/ChangeLog0000644000175000000620000000560014001614376014162 0ustar johnstaffThis file is obsolete. See changes.txt for this list of changes. 2008-4-7 John E. Davis * src/version.h (MODULE_PATCH_LEVEL): bumped to 0.7.1 * src/gslrand-module.c (do_ran_dist_dd_fun): Corrected the usage message for distributions that require 2 parameters. * src/gslfft.sl: Added convolve and correlate public functions with support for various qualifiers that specify what to do at boundaries. 2008-2-22 John E. Davis * src/gslfft.sl (convolve2d): New function. 2007-11-6 John E. Davis * autoconf/aclocal.m4: Updated. 2007-10-16 John E. Davis * src/Makefile.in: $(CC) was being used instead of $(CC_SHARED) to compile the .o files. 2007-9-21 John E. Davis * doc/tm/rtl/gslinterp.tm: Some typos corrected. 2007-8-30 John E. Davis * src/version.h (Module_Version_String): Bumped to 0.7.0 * src/gsl-module.c (init_gsl_module_ns): Modified the way the modules get imported. Instead of having N modules, now there is just 1: gsl. I added a function call gsl_import_module that may be used to instantiate "submodules". This change was necessary for CYGWIN. 2007-8-28 John E. Davis * src/Makefile.in: Compile gslcore-module first because it appears that this module may have to be linked into the others under CYGWIN. 2007-7-8 John E. Davis * src/gslrand-module.c (ran_bivariate_gaussian): New function (pop_rand_nds_and_int): incorrect handling of the multi-parameter case. 2007-3-22 John E. Davis * src/gslmatrix-module.c: New module. * src/Makefile.in: Append the output of gslvers to config.h. * src/gslvers.c (main): New file that uses the string-valued GSL version number to derive an integer version number that can be used in preprocessor macros. 2006-10-19 John E. Davis * src/version.h (MODULE_PATCH_LEVEL): bumped to 0.5.3 * src/gslinterp-module.c (do_interp_integ): Error handling code was missing a return statement, causing a SEGV upon error. 2006-2-1 John E. Davis * src/version.h (MODULE_PATCH_LEVEL): bumped to 0.5.3 * src/gslinterp-module.c (alloc_interp_type): 2nd and 3rd args of memset were reversed, triggering a segv in some cases. 2005-10-27 John E. Davis * src/gslfft-module.c: added string.h to the list of includes * autoconf/configure.ac: removed call to JD_SET_RPATH 2005-6-9 John E. Davis * src/gslinterp-module.c (do_interp): return statement missing from one of the error handlers. 2005-6-7 John E. Davis * src/version.h (MODULE_PATCH_LEVEL): bumped to 0.5.2 * src/gslrand-module.c (rng_set): the default generator was being using instead of the user-supplied one. slgsl-pre0.10.0-7/INSTALL.txt0000644000175000000620000001705112105106006014247 0ustar johnstaffBasic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. slgsl-pre0.10.0-7/configure0000755000175000000620000061114214146404552014326 0ustar johnstaff#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="src/gslsf-module.c" ac_default_prefix=/usr/local # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='LTLIBOBJS LIBOBJS SL_FILES_INSTALL_DIR MODULE_INSTALL_DIR slang_patchlevel_version slang_minor_version slang_major_version slang_version GSL_INC_DIR GSL_LIB_DIR GSL_INC GSL_LIB SLANG_INC_DIR SLANG_LIB_DIR SLANG_INC SLANG_LIB X_EXTRA_LIBS X_LIBS X_PRE_LIBS X_CFLAGS XMKMF M_LIB SLANG_DLL_CFLAGS ELFLIB_BUILD_NAME INSTALL_ELFLIB_TARGET INSTALL_MODULE DLL_IMPLIB_NAME SLANG_LIB_FOR_MODULES ELFLIB_MAJOR_MINOR_MICRO ELFLIB_MAJOR_MINOR ELFLIB_MAJOR ELFLIB CC_SHARED CC_SHARED_FLAGS DYNAMIC_LINK_FLAGS ELF_DEP_LIBS ELF_LINK_CMD ELF_LINK ELF_CFLAGS ELF_CC DYNAMIC_LINK_LIB EGREP GREP CPP OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC CONFIG_DIR SET_MAKE INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM RANLIB host_os host_vendor host_cpu host build_os build_vendor build_cpu build target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL RPATH' ac_subst_files='' ac_user_opts=' enable_option_checking with_x with_slang with_slanglib with_slanginc with_gsl with_gsllib with_gslinc ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP XMKMF' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-x use the X Window System --with-slang=DIR Use DIR/lib and DIR/include for slang --with-slanglib=DIR slang library in DIR --with-slanginc=DIR slang include files in DIR --with-gsl=DIR Use DIR/lib and DIR/include for gsl --with-gsllib=DIR gsl library in DIR --with-gslinc=DIR gsl include files in DIR Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor XMKMF Path to xmkmf, Makefile generator for X Window System Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in autoconf "$srcdir"/autoconf; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in autoconf \"$srcdir\"/autoconf" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi #These variable are initialized by JD init function CONFIG_DIR=`pwd` cd $srcdir if test "`pwd`" != "$CONFIG_DIR" then as_fn_error $? "\"This software does not support configuring from another directory. See the INSTALL file\"" "$LINENO" 5 fi # Note: these will differ if one is a symbolic link if test -f /usr/bin/dirname; then JD_Above_Dir=`dirname $CONFIG_DIR` else # system is a loser JD_Above_Dir=`cd ..;pwd` fi JD_Above_Dir2=`cd ..;pwd` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" if test "x$ac_cv_header_minix_config_h" = xyes; then : MINIX=yes else MINIX= fi if test "$MINIX" = yes; then $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h $as_echo "#define _MINIX 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } if ${ac_cv_safe_to_define___extensions__+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_safe_to_define___extensions__=yes else ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h $as_echo "#define _ALL_SOURCE 1" >>confdefs.h $as_echo "#define _GNU_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h if test $ac_cv_c_compiler_gnu = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 $as_echo_n "checking whether $CC needs -traditional... " >&6; } if ${ac_cv_prog_gcc_traditional+:} false; then : $as_echo_n "(cached) " >&6 else ac_pattern="Autoconf.*'x'" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 $as_echo "$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 $as_echo_n "checking for library containing strerror... " >&6; } if ${ac_cv_search_strerror+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char strerror (); int main () { return strerror (); ; return 0; } _ACEOF for ac_lib in '' cposix; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_strerror=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_strerror+:} false; then : break fi done if ${ac_cv_search_strerror+:} false; then : else ac_cv_search_strerror=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5 $as_echo "$ac_cv_search_strerror" >&6; } ac_res=$ac_cv_search_strerror if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef hpux yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then : $as_echo "#define _HPUX_SOURCE 1" >>confdefs.h if test "$CC" = cc; then CC="cc -Ae"; fi fi rm -f conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: checking C compiler that understands ANSI prototypes" >&5 $as_echo_n "checking C compiler that understands ANSI prototypes... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { extern int silly (int); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC looks ok. Good." >&5 $as_echo "$CC looks ok. Good." >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC is not a good enough compiler" >&5 $as_echo "$CC is not a good enough compiler" >&6; } as_fn_error $? "Set env variable CC to your ANSI compiler and rerun configure." "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext DYNAMIC_LINK_LIB="" ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" if test "x$ac_cv_header_dlfcn_h" = xyes; then : $as_echo "#define HAVE_DLFCN_H 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : DYNAMIC_LINK_LIB="-ldl" $as_echo "#define HAVE_DLOPEN 1" >>confdefs.h else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : $as_echo "#define HAVE_DLOPEN Define if you have dlopen" >>confdefs.h fi if test "$ac_cv_func_dlopen" != yes then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot perform dynamic linking" >&5 $as_echo "$as_me: WARNING: cannot perform dynamic linking" >&2;} fi fi fi if test "$GCC" = yes then if test X"$CFLAGS" = X then CFLAGS="-O2" fi fi ELFLIB="lib\$(THIS_LIB).so" ELFLIB_MAJOR="\$(ELFLIB).\$(ELF_MAJOR_VERSION)" ELFLIB_MAJOR_MINOR="\$(ELFLIB_MAJOR).\$(ELF_MINOR_VERSION)" ELFLIB_MAJOR_MINOR_MICRO="\$(ELFLIB_MAJOR_MINOR).\$(ELF_MICRO_VERSION)" INSTALL_ELFLIB_TARGET="install-elf-and-links" ELFLIB_BUILD_NAME="\$(ELFLIB_MAJOR_MINOR_MICRO)" INSTALL_MODULE="\$(INSTALL)" SLANG_DLL_CFLAGS="" M_LIB="-lm" case "$host_os" in *linux*|*gnu*|k*bsd*-gnu ) DYNAMIC_LINK_FLAGS="-Wl,-export-dynamic" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) \$(CPPFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED_FLAGS="-shared -fPIC" CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS) \$(CPPFLAGS)" ;; *solaris* ) if test "$GCC" = yes then DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) \$(CPPFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-ztext -Wl,-h,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED_FLAGS="-G -fPIC" CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS) \$(CPPFLAGS)" else DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) \$(CPPFLAGS) -K PIC" ELF_LINK="\$(CC) \$(LDFLAGS) -G -h\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED_FLAGS="-G -K PIC" CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS) \$(CPPFLAGS)" fi ;; # osr5 or unixware7 with current or late autoconf *sco3.2v5* | *unixware-5* | *sco-sysv5uw7*) if test "$GCC" = yes then DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) \$(CPPFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-h,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED_FLAGS="-G -fPIC" CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS) \$(CPPFLAGS)" else DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) \$(CPPFLAGS) -K pic" # ELF_LINK="ld -G -z text -h#" ELF_LINK="\$(CC) \$(LDFLAGS) -G -z text -h\$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED_FLAGS="-G -K pic" CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS) \$(CPPFLAGS)" fi ;; *irix6.5* ) echo "Note: ELF compiler for host_os=$host_os may not be correct" echo "double-check: 'mode_t', 'pid_t' may be wrong!" if test "$GCC" = yes then # not tested DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) \$(CPPFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-h,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED_FLAGS="-shared -fPIC" CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS) \$(CPPFLAGS)" else DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) \$(CPPFLAGS)" # default anyhow ELF_LINK="\$(CC) \$(LDFLAGS) -shared -o \$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED_FLAGS="-shared" CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS) \$(CPPFLAGS)" fi ;; *darwin* ) DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) \$(CPPFLAGS) -fno-common" ELF_LINK="\$(CC) \$(LDFLAGS) -dynamiclib -install_name \$(install_lib_dir)/\$(ELFLIB_MAJOR) -compatibility_version \$(ELF_MAJOR_VERSION) -current_version \$(ELF_MAJOR_VERSION).\$(ELF_MINOR_VERSION)" ELF_DEP_LIBS="\$(LDFLAGS) \$(DL_LIB)" CC_SHARED_FLAGS="-bundle -flat_namespace -undefined suppress -fno-common" CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS) \$(CPPFLAGS)" ELFLIB="lib\$(THIS_LIB).dylib" ELFLIB_MAJOR="lib\$(THIS_LIB).\$(ELF_MAJOR_VERSION).dylib" ELFLIB_MAJOR_MINOR="lib\$(THIS_LIB).\$(ELF_MAJOR_VERSION).\$(ELF_MINOR_VERSION).dylib" ELFLIB_MAJOR_MINOR_MICRO="lib\$(THIS_LIB).\$(ELF_MAJOR_VERSION).\$(ELF_MINOR_VERSION).\$(ELF_MICRO_VERSION).dylib" ;; *freebsd* ) ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) \$(CPPFLAGS) -fPIC" #if test "X$PORTOBJFORMAT" = "Xelf" ; then # ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-soname,\$(ELFLIB_MAJOR)" #else # ELF_LINK="ld -Bshareable -x" #fi ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-soname,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB) -lm" CC_SHARED_FLAGS="-shared -fPIC" CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS) \$(CPPFLAGS)" ;; *cygwin* ) DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" SLANG_DLL_CFLAGS="-DSLANG_DLL=1" ELF_CFLAGS="\$(CFLAGS) \$(CPPFLAGS) -DBUILD_DLL=1" DLL_IMPLIB_NAME="lib\$(THIS_LIB)\$(ELFLIB_MAJOR_VERSION).dll.a" #ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR) -Wl,--out-implib=\$(DLL_IMPLIB_NAME) -Wl,-export-all-symbols -Wl,-enable-auto-import" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR) -Wl,--out-implib=\$(DLL_IMPLIB_NAME)" ELF_DEP_LIBS="\$(DL_LIB) -lm" CC_SHARED_FLAGS="-shared -DSLANG_DLL=1" CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS) \$(CPPFLAGS)" SLANG_LIB_FOR_MODULES="-L\$(ELFDIR) -lslang" INSTALL_MODULE="\$(INSTALL)" INSTALL_ELFLIB_TARGET="install-elf-cygwin" ELFLIB="lib\$(THIS_LIB).dll" ELFLIB_MAJOR="cyg\$(THIS_LIB)-\$(ELF_MAJOR_VERSION).dll" ELFLIB_MAJOR_MINOR="cyg\$(THIS_LIB)-\$(ELF_MAJOR_VERSION)_\$(ELF_MINOR_VERSION).dll" ELFLIB_MAJOR_MINOR_MICRO="cyg\$(THIS_LIB)-\$(ELF_MAJOR_VERSION)_\$(ELF_MINOR_VERSION)_\$(ELF_MICRO_VERSION).dll" ELFLIB_BUILD_NAME="\$(ELFLIB_MAJOR)" ;; *haiku* ) M_LIB="" DYNAMIC_LINK_FLAGS="-Wl,-export-dynamic" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) \$(CPPFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB)" CC_SHARED_FLAGS="-shared -fPIC" CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS) \$(CPPFLAGS)" ;; * ) echo "Note: ELF compiler for host_os=$host_os may be wrong" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) \$(CPPFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED_FLAGS="-shared -fPIC" CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS) \$(CPPFLAGS)" esac case "$host_cpu" in *alpha* ) if test "$GCC" = yes then IEEE_CFLAGS="-mieee" else IEEE_CFLAGS="-ieee_with_no_inexact" fi ;; * ) IEEE_CFLAGS="" esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 $as_echo_n "checking for X... " >&6; } # Check whether --with-x was given. if test "${with_x+set}" = set; then : withval=$with_x; fi # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else case $x_includes,$x_libraries in #( *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then : $as_echo_n "(cached) " >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir cat >Imakefile <<'_ACEOF' incroot: @echo incroot='${INCROOT}' usrlibdir: @echo usrlibdir='${USRLIBDIR}' libdir: @echo libdir='${LIBDIR}' _ACEOF if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. for ac_var in incroot usrlibdir libdir; do eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl dylib la dll; do if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && test -f "$ac_im_libdir/libX11.$ac_extension"; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ac_x_includes= ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /usr/lib64 | /lib | /lib64) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -f -r conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R7/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R7 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R7/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R7 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # We can compile using X headers with no special include directory. ac_x_includes= else for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.i conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { XrmInitialize () ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else LIBS=$ac_save_LIBS for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl dylib la dll; do if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no case $ac_x_includes,$ac_x_libraries in #( no,* | *,no | *\'*) # Didn't find X, or a directory has "'" in its name. ac_cv_have_x="have_x=no";; #( *) # Record where we found X for the cache. ac_cv_have_x="have_x=yes\ ac_x_includes='$ac_x_includes'\ ac_x_libraries='$ac_x_libraries'" esac fi ;; #( *) have_x=yes;; esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 $as_echo "$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes\ ac_x_includes='$x_includes'\ ac_x_libraries='$x_libraries'" { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 $as_echo "libraries $x_libraries, headers $x_includes" >&6; } fi if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. $as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else if test -n "$x_includes"; then X_CFLAGS="$X_CFLAGS -I$x_includes" fi # It would also be nice to do this for all -L options, not just this one. if test -n "$x_libraries"; then X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5 $as_echo_n "checking whether -R must be followed by a space... " >&6; } ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" ac_xsave_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" else LIBS="$ac_xsave_LIBS -R $x_libraries" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 $as_echo "neither works" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_c_werror_flag=$ac_xsave_c_werror_flag LIBS=$ac_xsave_LIBS fi # Check for system-dependent libraries X programs must link with. # Do this before checking for the system-independent R6 libraries # (-lICE), since we may need -lsocket or whatever for X linking. if test "$ISC" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" else # Martyn Johnson says this is needed for Ultrix, if the X # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XOpenDisplay (); int main () { return XOpenDisplay (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dnet_dnet_ntoa=yes else ac_cv_lib_dnet_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dnet_stub_dnet_ntoa=yes else ac_cv_lib_dnet_stub_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, # to get the SysV transport functions. # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) # needs -lnsl. # The nsl library prevents programs from opening the X display # on Irix 5.2, according to T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" if test "x$ac_cv_func_gethostbyname" = xyes; then : fi if test $ac_cv_func_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } if ${ac_cv_lib_nsl_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostbyname=yes else ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 $as_echo_n "checking for gethostbyname in -lbsd... " >&6; } if ${ac_cv_lib_bsd_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bsd_gethostbyname=yes else ac_cv_lib_bsd_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 $as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; } if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi fi fi # lieder@skyler.mavd.honeywell.com says without -lsocket, # socket/setsockopt and other routines are undefined under SCO ODT # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary # on later versions), says Simon Leinen: it contains gethostby* # variants that don't use the name server (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" if test "x$ac_cv_func_connect" = xyes; then : fi if test $ac_cv_func_connect = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 $as_echo_n "checking for connect in -lsocket... " >&6; } if ${ac_cv_lib_socket_connect+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); int main () { return connect (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_connect=yes else ac_cv_lib_socket_connect=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 $as_echo "$ac_cv_lib_socket_connect" >&6; } if test "x$ac_cv_lib_socket_connect" = xyes; then : X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove" if test "x$ac_cv_func_remove" = xyes; then : fi if test $ac_cv_func_remove = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 $as_echo_n "checking for remove in -lposix... " >&6; } if ${ac_cv_lib_posix_remove+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char remove (); int main () { return remove (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_posix_remove=yes else ac_cv_lib_posix_remove=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 $as_echo "$ac_cv_lib_posix_remove" >&6; } if test "x$ac_cv_lib_posix_remove" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat" if test "x$ac_cv_func_shmat" = xyes; then : fi if test $ac_cv_func_shmat = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 $as_echo_n "checking for shmat in -lipc... " >&6; } if ${ac_cv_lib_ipc_shmat+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shmat (); int main () { return shmat (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ipc_shmat=yes else ac_cv_lib_ipc_shmat=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 $as_echo "$ac_cv_lib_ipc_shmat" >&6; } if test "x$ac_cv_lib_ipc_shmat" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi fi fi # Check for libraries that X11R6 Xt/Xaw programs need. ac_save_LDFLAGS=$LDFLAGS test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to # check for ICE first), but we must link in the order -lSM -lICE or # we get undefined symbols. So assume we have SM if we have ICE. # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 $as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char IceConnectionNumber (); int main () { return IceConnectionNumber (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ICE_IceConnectionNumber=yes else ac_cv_lib_ICE_IceConnectionNumber=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 $as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then : X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi LDFLAGS=$ac_save_LDFLAGS fi if test "X$jd_prefix" = "X" then jd_prefix=$ac_default_prefix if test "X$prefix" != "XNONE" then jd_prefix="$prefix" fi jd_exec_prefix="$jd_prefix" if test "X$exec_prefix" != "XNONE" then jd_exec_prefix="$exec_prefix" fi eval `sh <&5 $as_echo_n "checking for the slang library and header files ... " >&6; } if test X"$jd_with_slang_library" != Xno then jd_slang_inc_file= if test "X$jd_slang_inc_file" = "X" then jd_slang_inc_file=slang.h fi if test X"$jd_slang_include_dir" = X then inc_and_lib_dirs="\ $jd_prefix_incdir,$jd_prefix_libdir \ /usr/local/slang/include,/usr/local/slang/lib \ /usr/local/include/slang,/usr/local/lib \ /usr/local/include,/usr/local/lib \ $JD_SYS_INCLIBS \ /usr/include/slang,/usr/lib \ /usr/slang/include,/usr/slang/lib \ /usr/include,/usr/lib \ /opt/include/slang,/opt/lib \ /opt/slang/include,/opt/slang/lib \ /opt/include,/opt/lib" if test X != X then inc_and_lib_dirs="/include,/lib $inc_and_lib_dirs" fi case "$host_os" in *darwin* ) exts="dylib so a" ;; *cygwin* ) exts="dll.a so a" ;; * ) exts="so a" esac xincfile="$jd_slang_inc_file" xlibfile="libslang" jd_with_slang_library="no" for include_and_lib in $inc_and_lib_dirs do # Yuk. Is there a better way to set these variables?? xincdir=`echo $include_and_lib | tr ',' ' ' | awk '{print $1}'` xlibdir=`echo $include_and_lib | tr ',' ' ' | awk '{print $2}'` found=0 if test -r $xincdir/$xincfile then for E in $exts do if test -r "$xlibdir/$xlibfile.$E" then jd_slang_include_dir="$xincdir" jd_slang_library_dir="$xlibdir" jd_with_slang_library="yes" found=1 break fi done fi if test $found -eq 1 then break fi done fi fi if test X"$jd_slang_include_dir" != X -a X"$jd_slang_library_dir" != X then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes: $jd_slang_library_dir and $jd_slang_include_dir" >&5 $as_echo "yes: $jd_slang_library_dir and $jd_slang_include_dir" >&6; } jd_with_slang_library="yes" SLANG_LIB=-L$jd_slang_library_dir SLANG_LIB_DIR=$jd_slang_library_dir if test "X$jd_slang_library_dir" = "X/usr/lib" -o "X$jd_slang_include_dir" = "X/usr/include" then SLANG_LIB="" else if test "X$jd_slang_library_dir" != "X" then if test "X$RPATH" = "X" then case "$host_os" in *linux*|*solaris* ) if test "X$GCC" = Xyes then if test "X$ac_R_nospace" = "Xno" then RPATH="-Wl,-R," else RPATH="-Wl,-R" fi else if test "X$ac_R_nospace" = "Xno" then RPATH="-R " else RPATH="-R" fi fi ;; *osf*|*openbsd*|*freebsd*) if test "X$GCC" = Xyes then RPATH="-Wl,-rpath," else RPATH="-rpath " fi ;; *netbsd*) if test "X$GCC" = Xyes then RPATH="-Wl,-R" fi ;; esac if test "X$RPATH" != "X" then RPATH="$RPATH$jd_slang_library_dir" fi else _already_there=0 for X in `echo $RPATH | sed 's/:/ /g'` do if test "$X" = "$jd_slang_library_dir" then _already_there=1 break fi done if test $_already_there = 0 then RPATH="$RPATH:$jd_slang_library_dir" fi fi fi fi SLANG_INC=-I$jd_slang_include_dir SLANG_INC_DIR=$jd_slang_include_dir if test "X$jd_slang_include_dir" = "X/usr/include" then SLANG_INC="" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } jd_with_slang_library="no" SLANG_INC="" SLANG_LIB="" SLANG_INC_DIR="" SLANG_LIB_DIR="" fi if test "$jd_with_slang_library" = "no" then as_fn_error $? "unable to find the slang library and header file $jd_slang_inc_file" "$LINENO" 5 fi jd_gsl_include_dir="" jd_gsl_library_dir="" if test X"$jd_with_gsl_library" = X then jd_with_gsl_library="" fi # Check whether --with-gsl was given. if test "${with_gsl+set}" = set; then : withval=$with_gsl; jd_with_gsl_arg=$withval else jd_with_gsl_arg=unspecified fi case "x$jd_with_gsl_arg" in xno) jd_with_gsl_library="no" ;; x) jd_with_gsl_library="yes" ;; xunspecified) ;; xyes) jd_with_gsl_library="yes" ;; *) jd_with_gsl_library="yes" jd_gsl_include_dir="$jd_with_gsl_arg"/include jd_gsl_library_dir="$jd_with_gsl_arg"/lib ;; esac # Check whether --with-gsllib was given. if test "${with_gsllib+set}" = set; then : withval=$with_gsllib; jd_with_gsllib_arg=$withval else jd_with_gsllib_arg=unspecified fi case "x$jd_with_gsllib_arg" in xunspecified) ;; xno) ;; x) as_fn_error $? "--with-gsllib requres a value" "$LINENO" 5 ;; *) jd_with_gsl_library="yes" jd_gsl_library_dir="$jd_with_gsllib_arg" ;; esac # Check whether --with-gslinc was given. if test "${with_gslinc+set}" = set; then : withval=$with_gslinc; jd_with_gslinc_arg=$withval else jd_with_gslinc_arg=unspecified fi case "x$jd_with_gslinc_arg" in x) as_fn_error $? "--with-gslinc requres a value" "$LINENO" 5 ;; xunspecified) ;; xno) ;; *) jd_with_gsl_library="yes" jd_gsl_include_dir="$jd_with_gslinc_arg" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the gsl library and header files gsl/gsl_const_cgsm.h" >&5 $as_echo_n "checking for the gsl library and header files gsl/gsl_const_cgsm.h... " >&6; } if test X"$jd_with_gsl_library" != Xno then jd_gsl_inc_file=gsl/gsl_const_cgsm.h if test "X$jd_gsl_inc_file" = "X" then jd_gsl_inc_file=gsl.h fi if test X"$jd_gsl_include_dir" = X then inc_and_lib_dirs="\ $jd_prefix_incdir,$jd_prefix_libdir \ /usr/local/gsl/include,/usr/local/gsl/lib \ /usr/local/include/gsl,/usr/local/lib \ /usr/local/include,/usr/local/lib \ $JD_SYS_INCLIBS \ /usr/include/gsl,/usr/lib \ /usr/gsl/include,/usr/gsl/lib \ /usr/include,/usr/lib \ /opt/include/gsl,/opt/lib \ /opt/gsl/include,/opt/gsl/lib \ /opt/include,/opt/lib" if test X != X then inc_and_lib_dirs="/include,/lib $inc_and_lib_dirs" fi case "$host_os" in *darwin* ) exts="dylib so a" ;; *cygwin* ) exts="dll.a so a" ;; * ) exts="so a" esac xincfile="$jd_gsl_inc_file" xlibfile="libgsl" jd_with_gsl_library="no" for include_and_lib in $inc_and_lib_dirs do # Yuk. Is there a better way to set these variables?? xincdir=`echo $include_and_lib | tr ',' ' ' | awk '{print $1}'` xlibdir=`echo $include_and_lib | tr ',' ' ' | awk '{print $2}'` found=0 if test -r $xincdir/$xincfile then for E in $exts do if test -r "$xlibdir/$xlibfile.$E" then jd_gsl_include_dir="$xincdir" jd_gsl_library_dir="$xlibdir" jd_with_gsl_library="yes" found=1 break fi done fi if test $found -eq 1 then break fi done fi fi if test X"$jd_gsl_include_dir" != X -a X"$jd_gsl_library_dir" != X then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes: $jd_gsl_library_dir and $jd_gsl_include_dir" >&5 $as_echo "yes: $jd_gsl_library_dir and $jd_gsl_include_dir" >&6; } jd_with_gsl_library="yes" GSL_LIB=-L$jd_gsl_library_dir GSL_LIB_DIR=$jd_gsl_library_dir if test "X$jd_gsl_library_dir" = "X/usr/lib" -o "X$jd_gsl_include_dir" = "X/usr/include" then GSL_LIB="" else if test "X$jd_gsl_library_dir" != "X" then if test "X$RPATH" = "X" then case "$host_os" in *linux*|*solaris* ) if test "X$GCC" = Xyes then if test "X$ac_R_nospace" = "Xno" then RPATH="-Wl,-R," else RPATH="-Wl,-R" fi else if test "X$ac_R_nospace" = "Xno" then RPATH="-R " else RPATH="-R" fi fi ;; *osf*|*openbsd*|*freebsd*) if test "X$GCC" = Xyes then RPATH="-Wl,-rpath," else RPATH="-rpath " fi ;; *netbsd*) if test "X$GCC" = Xyes then RPATH="-Wl,-R" fi ;; esac if test "X$RPATH" != "X" then RPATH="$RPATH$jd_gsl_library_dir" fi else _already_there=0 for X in `echo $RPATH | sed 's/:/ /g'` do if test "$X" = "$jd_gsl_library_dir" then _already_there=1 break fi done if test $_already_there = 0 then RPATH="$RPATH:$jd_gsl_library_dir" fi fi fi fi GSL_INC=-I$jd_gsl_include_dir GSL_INC_DIR=$jd_gsl_include_dir if test "X$jd_gsl_include_dir" = "X/usr/include" then GSL_INC="" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } jd_with_gsl_library="no" GSL_INC="" GSL_LIB="" GSL_INC_DIR="" GSL_LIB_DIR="" fi if test "$jd_with_gsl_library" = "no" then as_fn_error $? "unable to find the gsl library and header file $jd_gsl_inc_file" "$LINENO" 5 fi slang_h=$jd_slang_include_dir/slang.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking SLANG_VERSION in $slang_h" >&5 $as_echo_n "checking SLANG_VERSION in $slang_h... " >&6; } slang_version=`grep "^#define *SLANG_VERSION " $slang_h | awk '{ print $3 }'` slang_major_version=`echo $slang_version | awk '{ print int($1/10000) }'` slang_minor_version=`echo $slang_version $slang_major_version | awk '{ print int(($1 - $2*10000)/100) }'` slang_patchlevel_version=`echo $slang_version $slang_major_version $slang_minor_version | awk '{ print ($1 - $2*10000 - $3*100) }'` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $slang_major_version.$slang_minor_version.$slang_patchlevel_version" >&5 $as_echo "$slang_major_version.$slang_minor_version.$slang_patchlevel_version" >&6; } if test "X$slang_major_version" = "X1" then MODULE_INSTALL_DIR="$libdir/slang/modules" else MODULE_INSTALL_DIR="$libdir/slang/v$slang_major_version/modules" fi SL_FILES_INSTALL_DIR=$datadir/slsh/local-packages for ac_header in \ stdlib.h \ unistd.h \ do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 $as_echo_n "checking size of short... " >&6; } if ${ac_cv_sizeof_short+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : else if test "$ac_cv_type_short" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (short) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_short=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 $as_echo "$ac_cv_sizeof_short" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SHORT $ac_cv_sizeof_short _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 $as_echo_n "checking size of int... " >&6; } if ${ac_cv_sizeof_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : else if test "$ac_cv_type_int" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 $as_echo "$ac_cv_sizeof_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 $as_echo_n "checking size of long... " >&6; } if ${ac_cv_sizeof_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : else if test "$ac_cv_type_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 $as_echo "$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of float" >&5 $as_echo_n "checking size of float... " >&6; } if ${ac_cv_sizeof_float+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (float))" "ac_cv_sizeof_float" "$ac_includes_default"; then : else if test "$ac_cv_type_float" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (float) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_float=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_float" >&5 $as_echo "$ac_cv_sizeof_float" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_FLOAT $ac_cv_sizeof_float _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of double" >&5 $as_echo_n "checking size of double... " >&6; } if ${ac_cv_sizeof_double+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))" "ac_cv_sizeof_double" "$ac_includes_default"; then : else if test "$ac_cv_type_double" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (double) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_double=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_double" >&5 $as_echo "$ac_cv_sizeof_double" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_DOUBLE $ac_cv_sizeof_double _ACEOF ELF_CFLAGS="$ELF_CFLAGS $IEEE_CFLAGS" CFLAGS="$CFLAGS $IEEE_CFLAGS" ac_config_headers="$ac_config_headers src/sysconf.h:src/config.hin" ac_config_files="$ac_config_files Makefile:autoconf/Makefile.in src/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "src/sysconf.h") CONFIG_HEADERS="$CONFIG_HEADERS src/sysconf.h:src/config.hin" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile:autoconf/Makefile.in" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi echo "" echo "You are compiling with the following compiler configuration:" echo " CC =" "$CC" echo " CC_SHARED =" "$CC_SHARED" echo " CFLAGS =" "$CFLAGS" echo " LDFLAGS =" "$LDFLAGS" "$DYNAMIC_LINK_FLAGS" echo "" echo "The modules will be installed in $MODULE_INSTALL_DIR." echo "Any associated .sl files will be installed in $SL_FILES_INSTALL_DIR" echo "" echo "If any of these quantities are incorrect, edit src/Makefile accordingly." echo "" slgsl-pre0.10.0-7/NEWS0000644000175000000620000000201514001614376013104 0ustar johnstaff-*-text-*- ----------------------------- Release Notes for version 0.10 ----------------------------- * GSL version 2.5 or later is required. * New modules: gslinteg: Wrappers for the GSL integration routines ----------------------------- Release Notes for version 0.9 ----------------------------- * New modules: gsldwt: Wrappers for the GSL 1 and 2d wavelet functions ----------------------------- Release Notes for version 0.8 ----------------------------- * New functions added to the fft module: correlate and convolve. These functions act on 1 or 2-d arrays. * GSL version 1.10 or later is required. ----------------------------- Release Notes for version 0.7 ----------------------------- * New modules: gslmatrix: Wraps a number of the linear-algebra and eigenvalue/vector routines. * Strictly speaking, only a single module is created: gsl-module.so. Entities such a gslmatrix and gslsf are implemented as submodules. This was necessary to work-around the dynamic-linking limitations of CYGWIN. slgsl-pre0.10.0-7/doc/0002755000175000000620000000000012105106006013143 5ustar johnstaffslgsl-pre0.10.0-7/doc/help/0002755000175000000620000000000014540776552014123 5ustar johnstaffslgsl-pre0.10.0-7/doc/help/slgsl.hlp0000644000175000000620000032407114540776552015761 0ustar johnstaffcdf_beta_P SYNOPSIS S-Lang version of gsl_cdf_beta_P USAGE Double_Type[] cdf_beta_P (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_beta_Pinv SYNOPSIS S-Lang version of gsl_cdf_beta_Pinv USAGE Double_Type[] cdf_beta_Pinv (P, a, b) Double_Type[] P Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_beta_Q SYNOPSIS S-Lang version of gsl_cdf_beta_Q USAGE Double_Type[] cdf_beta_Q (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_beta_Qinv SYNOPSIS S-Lang version of gsl_cdf_beta_Qinv USAGE Double_Type[] cdf_beta_Qinv (Q, a, b) Double_Type[] Q Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_cauchy_P SYNOPSIS S-Lang version of gsl_cdf_cauchy_P USAGE Double_Type[] cdf_cauchy_P (Double_Type[] x, Double_Type[] a) -------------------------------------------------------------- cdf_cauchy_Pinv SYNOPSIS S-Lang version of gsl_cdf_cauchy_Pinv USAGE Double_Type[] cdf_cauchy_Pinv (Double_Type[] P, Double_Type[] a) -------------------------------------------------------------- cdf_cauchy_Q SYNOPSIS S-Lang version of gsl_cdf_cauchy_Q USAGE Double_Type[] cdf_cauchy_Q (Double_Type[] x, Double_Type[] a) -------------------------------------------------------------- cdf_cauchy_Qinv SYNOPSIS S-Lang version of gsl_cdf_cauchy_Qinv USAGE Double_Type[] cdf_cauchy_Qinv (Double_Type[] Q, Double_Type[] a) -------------------------------------------------------------- cdf_chisq_P SYNOPSIS S-Lang version of gsl_cdf_chisq_P USAGE Double_Type[] cdf_chisq_P (Double_Type[] x, Double_Type[] nu) -------------------------------------------------------------- cdf_chisq_Pinv SYNOPSIS S-Lang version of gsl_cdf_chisq_Pinv USAGE Double_Type[] cdf_chisq_Pinv (Double_Type[] P, Double_Type[] nu) -------------------------------------------------------------- cdf_chisq_Q SYNOPSIS S-Lang version of gsl_cdf_chisq_Q USAGE Double_Type[] cdf_chisq_Q (Double_Type[] x, Double_Type[] nu) -------------------------------------------------------------- cdf_chisq_Qinv SYNOPSIS S-Lang version of gsl_cdf_chisq_Qinv USAGE Double_Type[] cdf_chisq_Qinv (Double_Type[] Q, Double_Type[] nu) -------------------------------------------------------------- cdf_exponential_P SYNOPSIS S-Lang version of gsl_cdf_exponential_P USAGE Double_Type[] cdf_exponential_P (Double_Type[] x, Double_Type[] mu) -------------------------------------------------------------- cdf_exponential_Pinv SYNOPSIS S-Lang version of gsl_cdf_exponential_Pinv USAGE Double_Type[] cdf_exponential_Pinv (Double_Type[] P, Double_Type[] mu) -------------------------------------------------------------- cdf_exponential_Q SYNOPSIS S-Lang version of gsl_cdf_exponential_Q USAGE Double_Type[] cdf_exponential_Q (Double_Type[] x, Double_Type[] mu) -------------------------------------------------------------- cdf_exponential_Qinv SYNOPSIS S-Lang version of gsl_cdf_exponential_Qinv USAGE Double_Type[] cdf_exponential_Qinv (Double_Type[] Q, Double_Type[] mu) -------------------------------------------------------------- cdf_exppow_P SYNOPSIS S-Lang version of gsl_cdf_exppow_P USAGE Double_Type[] cdf_exppow_P (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_exppow_Q SYNOPSIS S-Lang version of gsl_cdf_exppow_Q USAGE Double_Type[] cdf_exppow_Q (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_fdist_P SYNOPSIS S-Lang version of gsl_cdf_fdist_P USAGE Double_Type[] cdf_fdist_P (x, nu1, nu2) Double_Type[] x Double_Type[] nu1 Double_Type[] nu2 -------------------------------------------------------------- cdf_fdist_Pinv SYNOPSIS S-Lang version of gsl_cdf_fdist_Pinv USAGE Double_Type[] cdf_fdist_Pinv (P, nu1, nu2) Double_Type[] P Double_Type[] nu1 Double_Type[] nu2 -------------------------------------------------------------- cdf_fdist_Q SYNOPSIS S-Lang version of gsl_cdf_fdist_Q USAGE Double_Type[] cdf_fdist_Q (x, nu1, nu2) Double_Type[] x Double_Type[] nu1 Double_Type[] nu2 -------------------------------------------------------------- cdf_fdist_Qinv SYNOPSIS S-Lang version of gsl_cdf_fdist_Qinv USAGE Double_Type[] cdf_fdist_Qinv (Q, nu1, nu2) Double_Type[] Q Double_Type[] nu1 Double_Type[] nu2 -------------------------------------------------------------- cdf_flat_P SYNOPSIS S-Lang version of gsl_cdf_flat_P USAGE Double_Type[] cdf_flat_P (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_flat_Pinv SYNOPSIS S-Lang version of gsl_cdf_flat_Pinv USAGE Double_Type[] cdf_flat_Pinv (P, a, b) Double_Type[] P Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_flat_Q SYNOPSIS S-Lang version of gsl_cdf_flat_Q USAGE Double_Type[] cdf_flat_Q (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_flat_Qinv SYNOPSIS S-Lang version of gsl_cdf_flat_Qinv USAGE Double_Type[] cdf_flat_Qinv (Q, a, b) Double_Type[] Q Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_gamma_P SYNOPSIS S-Lang version of gsl_cdf_gamma_P USAGE Double_Type[] cdf_gamma_P (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_gamma_Pinv SYNOPSIS S-Lang version of gsl_cdf_gamma_Pinv USAGE Double_Type[] cdf_gamma_Pinv (P, a, b) Double_Type[] P Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_gamma_Q SYNOPSIS S-Lang version of gsl_cdf_gamma_Q USAGE Double_Type[] cdf_gamma_Q (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_gamma_Qinv SYNOPSIS S-Lang version of gsl_cdf_gamma_Qinv USAGE Double_Type[] cdf_gamma_Qinv (Q, a, b) Double_Type[] Q Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_gaussian_P SYNOPSIS S-Lang version of gsl_cdf_gaussian_P USAGE Double_Type[] cdf_gaussian_P (Double_Type[] x, Double_Type[] sigma) -------------------------------------------------------------- cdf_gaussian_Pinv SYNOPSIS S-Lang version of gsl_cdf_gaussian_Pinv USAGE Double_Type[] cdf_gaussian_Pinv (Double_Type[] P, Double_Type[] sigma) -------------------------------------------------------------- cdf_gaussian_Q SYNOPSIS S-Lang version of gsl_cdf_gaussian_Q USAGE Double_Type[] cdf_gaussian_Q (Double_Type[] x, Double_Type[] sigma) -------------------------------------------------------------- cdf_gaussian_Qinv SYNOPSIS S-Lang version of gsl_cdf_gaussian_Qinv USAGE Double_Type[] cdf_gaussian_Qinv (Double_Type[] Q, Double_Type[] sigma) -------------------------------------------------------------- cdf_gumbel1_P SYNOPSIS S-Lang version of gsl_cdf_gumbel1_P USAGE Double_Type[] cdf_gumbel1_P (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_gumbel1_Pinv SYNOPSIS S-Lang version of gsl_cdf_gumbel1_Pinv USAGE Double_Type[] cdf_gumbel1_Pinv (P, a, b) Double_Type[] P Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_gumbel1_Q SYNOPSIS S-Lang version of gsl_cdf_gumbel1_Q USAGE Double_Type[] cdf_gumbel1_Q (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_gumbel1_Qinv SYNOPSIS S-Lang version of gsl_cdf_gumbel1_Qinv USAGE Double_Type[] cdf_gumbel1_Qinv (Q, a, b) Double_Type[] Q Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_gumbel2_P SYNOPSIS S-Lang version of gsl_cdf_gumbel2_P USAGE Double_Type[] cdf_gumbel2_P (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_gumbel2_Pinv SYNOPSIS S-Lang version of gsl_cdf_gumbel2_Pinv USAGE Double_Type[] cdf_gumbel2_Pinv (P, a, b) Double_Type[] P Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_gumbel2_Q SYNOPSIS S-Lang version of gsl_cdf_gumbel2_Q USAGE Double_Type[] cdf_gumbel2_Q (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_gumbel2_Qinv SYNOPSIS S-Lang version of gsl_cdf_gumbel2_Qinv USAGE Double_Type[] cdf_gumbel2_Qinv (Q, a, b) Double_Type[] Q Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_laplace_P SYNOPSIS S-Lang version of gsl_cdf_laplace_P USAGE Double_Type[] cdf_laplace_P (Double_Type[] x, Double_Type[] a) -------------------------------------------------------------- cdf_laplace_Pinv SYNOPSIS S-Lang version of gsl_cdf_laplace_Pinv USAGE Double_Type[] cdf_laplace_Pinv (Double_Type[] P, Double_Type[] a) -------------------------------------------------------------- cdf_laplace_Q SYNOPSIS S-Lang version of gsl_cdf_laplace_Q USAGE Double_Type[] cdf_laplace_Q (Double_Type[] x, Double_Type[] a) -------------------------------------------------------------- cdf_laplace_Qinv SYNOPSIS S-Lang version of gsl_cdf_laplace_Qinv USAGE Double_Type[] cdf_laplace_Qinv (Double_Type[] Q, Double_Type[] a) -------------------------------------------------------------- cdf_logistic_P SYNOPSIS S-Lang version of gsl_cdf_logistic_P USAGE Double_Type[] cdf_logistic_P (Double_Type[] x, Double_Type[] a) -------------------------------------------------------------- cdf_logistic_Pinv SYNOPSIS S-Lang version of gsl_cdf_logistic_Pinv USAGE Double_Type[] cdf_logistic_Pinv (Double_Type[] P, Double_Type[] a) -------------------------------------------------------------- cdf_logistic_Q SYNOPSIS S-Lang version of gsl_cdf_logistic_Q USAGE Double_Type[] cdf_logistic_Q (Double_Type[] x, Double_Type[] a) -------------------------------------------------------------- cdf_logistic_Qinv SYNOPSIS S-Lang version of gsl_cdf_logistic_Qinv USAGE Double_Type[] cdf_logistic_Qinv (Double_Type[] Q, Double_Type[] a) -------------------------------------------------------------- cdf_lognormal_P SYNOPSIS S-Lang version of gsl_cdf_lognormal_P USAGE Double_Type[] cdf_lognormal_P (x, zeta, sigma) Double_Type[] x Double_Type[] zeta Double_Type[] sigma -------------------------------------------------------------- cdf_lognormal_Pinv SYNOPSIS S-Lang version of gsl_cdf_lognormal_Pinv USAGE Double_Type[] cdf_lognormal_Pinv (P, zeta, sigma) Double_Type[] P Double_Type[] zeta Double_Type[] sigma -------------------------------------------------------------- cdf_lognormal_Q SYNOPSIS S-Lang version of gsl_cdf_lognormal_Q USAGE Double_Type[] cdf_lognormal_Q (x, zeta, sigma) Double_Type[] x Double_Type[] zeta Double_Type[] sigma -------------------------------------------------------------- cdf_lognormal_Qinv SYNOPSIS S-Lang version of gsl_cdf_lognormal_Qinv USAGE Double_Type[] cdf_lognormal_Qinv (Q, zeta, sigma) Double_Type[] Q Double_Type[] zeta Double_Type[] sigma -------------------------------------------------------------- cdf_pareto_P SYNOPSIS S-Lang version of gsl_cdf_pareto_P USAGE Double_Type[] cdf_pareto_P (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_pareto_Pinv SYNOPSIS S-Lang version of gsl_cdf_pareto_Pinv USAGE Double_Type[] cdf_pareto_Pinv (P, a, b) Double_Type[] P Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_pareto_Q SYNOPSIS S-Lang version of gsl_cdf_pareto_Q USAGE Double_Type[] cdf_pareto_Q (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_pareto_Qinv SYNOPSIS S-Lang version of gsl_cdf_pareto_Qinv USAGE Double_Type[] cdf_pareto_Qinv (Q, a, b) Double_Type[] Q Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_rayleigh_P SYNOPSIS S-Lang version of gsl_cdf_rayleigh_P USAGE Double_Type[] cdf_rayleigh_P (Double_Type[] x, Double_Type[] sigma) -------------------------------------------------------------- cdf_rayleigh_Pinv SYNOPSIS S-Lang version of gsl_cdf_rayleigh_Pinv USAGE Double_Type[] cdf_rayleigh_Pinv (Double_Type[] P, Double_Type[] sigma) -------------------------------------------------------------- cdf_rayleigh_Q SYNOPSIS S-Lang version of gsl_cdf_rayleigh_Q USAGE Double_Type[] cdf_rayleigh_Q (Double_Type[] x, Double_Type[] sigma) -------------------------------------------------------------- cdf_rayleigh_Qinv SYNOPSIS S-Lang version of gsl_cdf_rayleigh_Qinv USAGE Double_Type[] cdf_rayleigh_Qinv (Double_Type[] Q, Double_Type[] sigma) -------------------------------------------------------------- cdf_tdist_P SYNOPSIS S-Lang version of gsl_cdf_tdist_P USAGE Double_Type[] cdf_tdist_P (Double_Type[] x, Double_Type[] nu) -------------------------------------------------------------- cdf_tdist_Pinv SYNOPSIS S-Lang version of gsl_cdf_tdist_Pinv USAGE Double_Type[] cdf_tdist_Pinv (Double_Type[] P, Double_Type[] nu) -------------------------------------------------------------- cdf_tdist_Q SYNOPSIS S-Lang version of gsl_cdf_tdist_Q USAGE Double_Type[] cdf_tdist_Q (Double_Type[] x, Double_Type[] nu) -------------------------------------------------------------- cdf_tdist_Qinv SYNOPSIS S-Lang version of gsl_cdf_tdist_Qinv USAGE Double_Type[] cdf_tdist_Qinv (Double_Type[] Q, Double_Type[] nu) -------------------------------------------------------------- cdf_ugaussian_P SYNOPSIS S-Lang version of gsl_cdf_ugaussian_P USAGE Double_Type[] cdf_ugaussian_P (Double_Type[] x) -------------------------------------------------------------- cdf_ugaussian_Pinv SYNOPSIS S-Lang version of gsl_cdf_ugaussian_Pinv USAGE Double_Type[] cdf_ugaussian_Pinv (Double_Type[] P) -------------------------------------------------------------- cdf_ugaussian_Q SYNOPSIS S-Lang version of gsl_cdf_ugaussian_Q USAGE Double_Type[] cdf_ugaussian_Q (Double_Type[] x) -------------------------------------------------------------- cdf_ugaussian_Qinv SYNOPSIS S-Lang version of gsl_cdf_ugaussian_Qinv USAGE Double_Type[] cdf_ugaussian_Qinv (Double_Type[] Q) -------------------------------------------------------------- cdf_weibull_P SYNOPSIS S-Lang version of gsl_cdf_weibull_P USAGE Double_Type[] cdf_weibull_P (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_weibull_Pinv SYNOPSIS S-Lang version of gsl_cdf_weibull_Pinv USAGE Double_Type[] cdf_weibull_Pinv (P, a, b) Double_Type[] P Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_weibull_Q SYNOPSIS S-Lang version of gsl_cdf_weibull_Q USAGE Double_Type[] cdf_weibull_Q (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b -------------------------------------------------------------- cdf_weibull_Qinv SYNOPSIS S-Lang version of gsl_cdf_weibull_Qinv USAGE Double_Type[] cdf_weibull_Qinv (Q, a, b) Double_Type[] Q Double_Type[] a Double_Type[] b -------------------------------------------------------------- _gsl_fft_complex SYNOPSIS Perform an N-d FFT USAGE y = _gsl_fft_complex (x, dir) DESCRIPTION This routine computes the FFT of an array `x' and returns the result. The integer-valued parameter `dir' parameter specifies the direction of the transform. A forward transform will be produced for positive values of `dir' and a reverse transform will be computed for negative values. The result will be a complex array of the same size and dimensionality as the the input array. NOTES It is better to call this routine indirectly using the `fft' function. SEE ALSO fft -------------------------------------------------------------- fft SYNOPSIS Perform an N-d FFT USAGE y = fft (x, dir) DESCRIPTION This routine computes the FFT of an array `x' and returns the result. The integer-valued parameter `dir' parameter specifies the direction of the transform. A forward transform will be produced for positive values of `dir' and a reverse transform will be computed for negative values. The result will be a complex array of the same size and dimensionality as the the input array. EXAMPLE Assume that the array `x' represents the values of a signal that is sampled at 10 Hz, i.e., with a period `T' of 0.1 secs. Then T = 0.1; N = length(x); y = fft (x, 1); will result in the `y' being set to the FFT of the samples `x'. The frequencies represented by `y' contains both positive and negative frequencies from from `-1/2T' to `+1/2T'. The frequency `f' represented by `y[i]' is given by `i/(NT)' for `i<=N/2', and `(i-N))/NT' for `i>N/2'. If `N' is even, then the frequency appearing at `i=N/2' represents both positive and negatives values of `1/2T'. Programatically, this corresponds to f = [[0:N/2], [N/2+1-N:-1]]/double(N*T); NOTES This routine is currently a wrapper for the `_gsl_fft_complex' function. SEE ALSO _gsl_fft_complex -------------------------------------------------------------- convolve SYNOPSIS Perform a convolution USAGE b = convolve (array, kernel) DESCRIPTION This function performs a convolution of the specified array and kernel using FFTs. One of the following qualifiers may be used to indicate how the overlap of the kernel with the edges of the array are to be handled: pad=value Pad the array with the specified value wrap Use periodic boundary-conditions reflect Reflect the pixels at the boundary nearest Use the value of the nearest edge pixel The default behavior is to use pad=0.0. NOTES The current implementation utilizes ffts and will expand the array to the nearest multiple of small primes for run-time efficiency. A future version may allow different methods to be used. SEE ALSO fft, correlate -------------------------------------------------------------- correlate SYNOPSIS Perform a correlation USAGE b = correlate (array, kernel) DESCRIPTION This function performs a correlation of the specified array and kernel using FFTs. One of the following qualifiers may be used to indicate how the overlap of the kernel with the edges of the array are to be handled: pad=value Pad the array with the specified value wrap Use periodic boundary-conditions reflect Reflect the pixels at the boundary nearest Use the value of the nearest edge pixel The default behavior is to use pad=0.0. NOTES The current implementation utilizes ffts and will expand the array to the nearest multiple of small primes for run-time efficiency. A future version may allow different methods to be used. SEE ALSO fft, convolve -------------------------------------------------------------- rng_alloc SYNOPSIS Allocate an instance of a random number generator USAGE Rand_Type rng_alloc ([generator]) -------------------------------------------------------------- rng_set SYNOPSIS Seed a random number generator USAGE rng_set ([Rand_Type gen,] ULong_Type seed) -------------------------------------------------------------- rng_get SYNOPSIS rng_get USAGE x = rng_get ([Rand_Type gen] [, Int_Type num]) -------------------------------------------------------------- rng_get_rng_types SYNOPSIS Get a list of all supported generators USAGE String_Type[] = rng_get_rng_types () -------------------------------------------------------------- rng_uniform SYNOPSIS Get a uniformly distributed random number USAGE x = rng_uniform ([Rand_Type gen] [, Int_Type num]) -------------------------------------------------------------- rng_uniform_pos SYNOPSIS Generate a uniformly distributed non-zero random number USAGE x = rng_uniform_pos ([Rand_Type gen] [, Int_Type num]) -------------------------------------------------------------- rng_max SYNOPSIS Obtain the maximum value produced by a random number generator USAGE ULong_Type rng_max (Rand_Type gen) -------------------------------------------------------------- rng_min SYNOPSIS Obtain the minimum value produced by a random number generator USAGE ULong_Type rng_min (Rand_Type gen) -------------------------------------------------------------- ran_bernoulli SYNOPSIS Produce Bernoulli distributed random numbers USAGE x = ran_bernoulli ([Rand_Type gen,] Double_Type p [,Int_Type num] -------------------------------------------------------------- ran_beta SYNOPSIS Produce distributed random numbers USAGE x = ran_beta ([Rand_Type gen,] Double_Type a, Double_Type b [,Int_Type num]) -------------------------------------------------------------- ran_binomial SYNOPSIS Produce random numbers from the binomial distribution USAGE x = ran_binomial ([Rand_Type gen,] Double_Type p, Int_Type n [,Int_Type num]) -------------------------------------------------------------- ran_cauchy SYNOPSIS Produce random numbers from the Cauchy distribution USAGE x = ran_cauchy ([Rand_Type gen,] Double_Type mu [,Int_Type num]) -------------------------------------------------------------- ran_chisq SYNOPSIS Produce chi-squared distributed random numbers USAGE x = ran_chisq ([Rand_Type gen,] Double_Type nu [,Int_Type num]) -------------------------------------------------------------- ran_exponential SYNOPSIS Produce exponentially distributed random numbers USAGE x = ran_exponential ([Rand_Type gen,] Double_Type mu [,Int_Type num]) -------------------------------------------------------------- ran_exppow SYNOPSIS Produce random numbers from the exponential power distribution USAGE x = ran_exppow ([Rand_Type gen,] Double_Type mu, Double_Type a [,Int_Type num]) -------------------------------------------------------------- ran_fdist SYNOPSIS Produce F-distributed random numbers USAGE x = ran_fdist ([Rand_Type gen,] Double_Type nu1, Double_Type nu2 [,Int_Type num]) -------------------------------------------------------------- ran_flat SYNOPSIS Produce uniformly distributed random numbers USAGE x = ran_flat ([Rand_Type gen,] Double_Type a, Double_Type b [,Int_Type num]) -------------------------------------------------------------- ran_gamma SYNOPSIS Produce a random number from the gamma distribution USAGE x = ran_gamma ([Rand_Type gen,] Double_Type a, Double_Type b [,Int_Type num]) -------------------------------------------------------------- ran_gaussian SYNOPSIS Produce gaussian distributed random numbers USAGE x = ran_gaussian ([Rand_Type gen,] Double_Type sigma [,Int_Type num]) -------------------------------------------------------------- ran_gaussian_ratio_method SYNOPSIS Produce gaussian distributed random numbers USAGE x = ran_gaussian_ratio_method ([Rand_Type gen,] Double_Type sigma [,Int_Type num]) -------------------------------------------------------------- ran_gaussian_tail SYNOPSIS Produce gaussian distributed random numbers from the tail USAGE x = ran_gaussian_tail ([Rand_Type gen,] Double_Type a, Double_Type sigma [,Int_Type num]) -------------------------------------------------------------- ran_geometric SYNOPSIS Produce random integers from the geometric distribution USAGE x = ran_geometric ([Rand_Type gen,] Double_Type p [,Int_Type num]) -------------------------------------------------------------- ran_gumbel1 SYNOPSIS Produce random numbers from the type-1 Gumbel distribution USAGE x = ran_gumbel1 ([Rand_Type gen,] Double_Type a, Double_Type b [,Int_Type num]) -------------------------------------------------------------- ran_gumbel2 SYNOPSIS Produce random numbers from the type-2 Gumbel distribution USAGE x = ran_gumbel2 ([Rand_Type gen,] Double_Type a, Double_Type b [,Int_Type num]) -------------------------------------------------------------- ran_laplace SYNOPSIS Produce random numbers from the Laplace distribution USAGE x = ran_laplace ([Rand_Type gen,] Double_Type mu [,Int_Type num]) -------------------------------------------------------------- ran_levy SYNOPSIS Produce random numbers from the Levy distribution USAGE x = ran_levy ([Rand_Type gen,] Double_Type mu, Double_Type a [,Int_Type num]) -------------------------------------------------------------- ran_logarithmic SYNOPSIS Produce random numbers from the logarithmic distribution USAGE x = ran_logarithmic ([Rand_Type gen,] Double_Type p [,Int_Type num]) -------------------------------------------------------------- ran_logistic SYNOPSIS Produce random numbers from the logistic distribution USAGE x = ran_logistic ([Rand_Type gen,] Double_Type mu [,Int_Type num]) -------------------------------------------------------------- ran_lognormal SYNOPSIS Produce random numbers from the lognormal distribution USAGE x = ran_lognormal ([Rand_Type gen,] Double_Type zeta, Double_Type sigma [,Int_Type num]) -------------------------------------------------------------- ran_negative_binomial SYNOPSIS Produce random numbers from the negative binomial distribution USAGE x = ran_negative_binomial ([Rand_Type gen,] Double_Type p, Double_Type n [,Int_Type num]) -------------------------------------------------------------- ran_pareto SYNOPSIS Produce random numbers from the Pareto distribution USAGE x = ran_pareto ([Rand_Type gen,] Double_Type a, Double_Type b [,Int_Type num]) -------------------------------------------------------------- ran_pascal SYNOPSIS Produce random numbers from the Pascal distribution USAGE x = ran_pascal ([Rand_Type gen,] Double_Type p, Int_Type k [,Int_Type num]) -------------------------------------------------------------- ran_poisson SYNOPSIS Produce random numbers from the Poisson distribution USAGE x = ran_poisson ([Rand_Type gen,] Double_Type mu [,Int_Type num]) -------------------------------------------------------------- ran_rayleigh SYNOPSIS Produce random numbers from the Rayleigh distribution USAGE x = ran_rayleigh ([Rand_Type gen,] Double_Type sigma [,Int_Type num]) -------------------------------------------------------------- ran_rayleigh_tail SYNOPSIS Produce random numbers from the tail of the Rayleigh distribution USAGE x = ran_rayleigh_tail ([Rand_Type gen,] Double_Type a, Double_Type sigma [,Int_Type num]) -------------------------------------------------------------- ran_tdist SYNOPSIS Produce random numbers from the t-distribution USAGE x = ran_tdist ([Rand_Type gen,] Double_Type nu [,Int_Type num]) -------------------------------------------------------------- ran_ugaussian SYNOPSIS Produce random numbers from the gaussian distribution USAGE x = ran_ugaussian ([Rand_Type gen] [,Int_Type num]) -------------------------------------------------------------- ran_ugaussian_ratio_method SYNOPSIS Produce random numbers from the gaussian distribution USAGE x = ran_ugaussian_ratio_method ([Rand_Type gen] [,Int_Type num]) -------------------------------------------------------------- ran_ugaussian_tail SYNOPSIS Produce random numbers from the tail of the gaussian distribution USAGE x = ran_ugaussian_tail ([Rand_Type gen,] Double_Type a [,Int_Type num]) -------------------------------------------------------------- ran_weibull SYNOPSIS Produce random numbers from the Weibull distribution USAGE x = ran_weibull ([Rand_Type gen,] Double_Type mu, Double_Type a [,Int_Type num]) -------------------------------------------------------------- ran_beta_pdf SYNOPSIS S-Lang version of gsl_ran_beta_pdf USAGE Double_Type[] ran_beta_pdf (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b -------------------------------------------------------------- ran_cauchy_pdf SYNOPSIS S-Lang version of gsl_ran_cauchy_pdf USAGE Double_Type[] ran_cauchy_pdf (Double_Type[] x, Double_Type[] a) -------------------------------------------------------------- ran_chisq_pdf SYNOPSIS S-Lang version of gsl_ran_chisq_pdf USAGE Double_Type[] ran_chisq_pdf (Double_Type[] x, Double_Type[] nu) -------------------------------------------------------------- ran_erlang_pdf SYNOPSIS S-Lang version of gsl_ran_erlang_pdf USAGE Double_Type[] ran_erlang_pdf (x, a, n) Double_Type[] x Double_Type[] a Double_Type[] n -------------------------------------------------------------- ran_exponential_pdf SYNOPSIS S-Lang version of gsl_ran_exponential_pdf USAGE Double_Type[] ran_exponential_pdf (Double_Type[] x, Double_Type[] mu) -------------------------------------------------------------- ran_exppow_pdf SYNOPSIS S-Lang version of gsl_ran_exppow_pdf USAGE Double_Type[] ran_exppow_pdf (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b -------------------------------------------------------------- ran_fdist_pdf SYNOPSIS S-Lang version of gsl_ran_fdist_pdf USAGE Double_Type[] ran_fdist_pdf (x, nu1, nu2) Double_Type[] x Double_Type[] nu1 Double_Type[] nu2 -------------------------------------------------------------- ran_flat_pdf SYNOPSIS S-Lang version of gsl_ran_flat_pdf USAGE Double_Type[] ran_flat_pdf (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b -------------------------------------------------------------- ran_gamma_pdf SYNOPSIS S-Lang version of gsl_ran_gamma_pdf USAGE Double_Type[] ran_gamma_pdf (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b -------------------------------------------------------------- ran_gaussian_pdf SYNOPSIS S-Lang version of gsl_ran_gaussian_pdf USAGE Double_Type[] ran_gaussian_pdf (Double_Type[] x, Double_Type[] sigma) -------------------------------------------------------------- ran_gaussian_tail_pdf SYNOPSIS S-Lang version of gsl_ran_gaussian_tail_pdf USAGE Double_Type[] ran_gaussian_tail_pdf (x, a, sigma) Double_Type[] x Double_Type[] a Double_Type[] sigma -------------------------------------------------------------- ran_gumbel1_pdf SYNOPSIS S-Lang version of gsl_ran_gumbel1_pdf USAGE Double_Type[] ran_gumbel1_pdf (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b -------------------------------------------------------------- ran_gumbel2_pdf SYNOPSIS S-Lang version of gsl_ran_gumbel2_pdf USAGE Double_Type[] ran_gumbel2_pdf (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b -------------------------------------------------------------- ran_landau_pdf SYNOPSIS S-Lang version of gsl_ran_landau_pdf USAGE Double_Type[] ran_landau_pdf (Double_Type[] x) -------------------------------------------------------------- ran_laplace_pdf SYNOPSIS S-Lang version of gsl_ran_laplace_pdf USAGE Double_Type[] ran_laplace_pdf (Double_Type[] x, Double_Type[] a) -------------------------------------------------------------- ran_logistic_pdf SYNOPSIS S-Lang version of gsl_ran_logistic_pdf USAGE Double_Type[] ran_logistic_pdf (Double_Type[] x, Double_Type[] a) -------------------------------------------------------------- ran_lognormal_pdf SYNOPSIS S-Lang version of gsl_ran_lognormal_pdf USAGE Double_Type[] ran_lognormal_pdf (x, zeta, sigma) Double_Type[] x Double_Type[] zeta Double_Type[] sigma -------------------------------------------------------------- ran_pareto_pdf SYNOPSIS S-Lang version of gsl_ran_pareto_pdf USAGE Double_Type[] ran_pareto_pdf (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b -------------------------------------------------------------- ran_rayleigh_pdf SYNOPSIS S-Lang version of gsl_ran_rayleigh_pdf USAGE Double_Type[] ran_rayleigh_pdf (Double_Type[] x, Double_Type[] sigma) -------------------------------------------------------------- ran_rayleigh_tail_pdf SYNOPSIS S-Lang version of gsl_ran_rayleigh_tail_pdf USAGE Double_Type[] ran_rayleigh_tail_pdf (x, a, sigma) Double_Type[] x Double_Type[] a Double_Type[] sigma -------------------------------------------------------------- ran_tdist_pdf SYNOPSIS S-Lang version of gsl_ran_tdist_pdf USAGE Double_Type[] ran_tdist_pdf (Double_Type[] x, Double_Type[] nu) -------------------------------------------------------------- ran_ugaussian_pdf SYNOPSIS S-Lang version of gsl_ran_ugaussian_pdf USAGE Double_Type[] ran_ugaussian_pdf (Double_Type[] x) -------------------------------------------------------------- ran_ugaussian_tail_pdf SYNOPSIS S-Lang version of gsl_ran_ugaussian_tail_pdf USAGE Double_Type[] ran_ugaussian_tail_pdf (Double_Type[] x, Double_Type[] a) -------------------------------------------------------------- ran_weibull_pdf SYNOPSIS S-Lang version of gsl_ran_weibull_pdf USAGE Double_Type[] ran_weibull_pdf (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b -------------------------------------------------------------- airy_Ai SYNOPSIS S-Lang version of gsl_sf_airy_Ai USAGE Double_Type[] airy_Ai (Double_Type[] x [,Int_Type mode]) -------------------------------------------------------------- airy_Ai_deriv SYNOPSIS S-Lang version of gsl_sf_airy_Ai_deriv USAGE Double_Type[] airy_Ai_deriv (Double_Type[] x [,Int_Type mode]) -------------------------------------------------------------- airy_Ai_deriv_scaled SYNOPSIS S-Lang version of gsl_sf_airy_Ai_deriv_scaled USAGE Double_Type[] airy_Ai_deriv_scaled (Double_Type[] x [,Int_Type mode]) -------------------------------------------------------------- airy_Ai_scaled SYNOPSIS S-Lang version of gsl_sf_airy_Ai_scaled USAGE Double_Type[] airy_Ai_scaled (Double_Type[] x [,Int_Type mode]) -------------------------------------------------------------- airy_Bi SYNOPSIS S-Lang version of gsl_sf_airy_Bi USAGE Double_Type[] airy_Bi (Double_Type[] x [,Int_Type mode]) -------------------------------------------------------------- airy_Bi_deriv SYNOPSIS S-Lang version of gsl_sf_airy_Bi_deriv USAGE Double_Type[] airy_Bi_deriv (Double_Type[] x [,Int_Type mode]) -------------------------------------------------------------- airy_Bi_deriv_scaled SYNOPSIS S-Lang version of gsl_sf_airy_Bi_deriv_scaled USAGE Double_Type[] airy_Bi_deriv_scaled (Double_Type[] x [,Int_Type mode]) -------------------------------------------------------------- airy_Bi_scaled SYNOPSIS S-Lang version of gsl_sf_airy_Bi_scaled USAGE Double_Type[] airy_Bi_scaled (Double_Type[] x [,Int_Type mode]) -------------------------------------------------------------- bessel_I0 SYNOPSIS S-Lang version of gsl_sf_bessel_I0 USAGE Double_Type[] bessel_I0 (Double_Type[] x) -------------------------------------------------------------- bessel_i0_scaled SYNOPSIS S-Lang version of gsl_sf_bessel_i0_scaled USAGE Double_Type[] bessel_i0_scaled (Double_Type[] x) -------------------------------------------------------------- bessel_I0_scaled SYNOPSIS S-Lang version of gsl_sf_bessel_I0_scaled USAGE Double_Type[] bessel_I0_scaled (Double_Type[] x) -------------------------------------------------------------- bessel_I1 SYNOPSIS S-Lang version of gsl_sf_bessel_I1 USAGE Double_Type[] bessel_I1 (Double_Type[] x) -------------------------------------------------------------- bessel_i1_scaled SYNOPSIS S-Lang version of gsl_sf_bessel_i1_scaled USAGE Double_Type[] bessel_i1_scaled (Double_Type[] x) -------------------------------------------------------------- bessel_I1_scaled SYNOPSIS S-Lang version of gsl_sf_bessel_I1_scaled USAGE Double_Type[] bessel_I1_scaled (Double_Type[] x) -------------------------------------------------------------- bessel_i2_scaled SYNOPSIS S-Lang version of gsl_sf_bessel_i2_scaled USAGE Double_Type[] bessel_i2_scaled (Double_Type[] x) -------------------------------------------------------------- bessel_il_scaled SYNOPSIS S-Lang version of gsl_sf_bessel_il_scaled USAGE Double_Type[] bessel_il_scaled (Int_Type[] l, Double_Type[] x) -------------------------------------------------------------- bessel_In SYNOPSIS S-Lang version of gsl_sf_bessel_In USAGE Double_Type[] bessel_In (Int_Type[] n, Double_Type[] x) -------------------------------------------------------------- bessel_In_scaled SYNOPSIS S-Lang version of gsl_sf_bessel_In_scaled USAGE Double_Type[] bessel_In_scaled (Int_Type[] n, Double_Type[] x) -------------------------------------------------------------- bessel_Inu SYNOPSIS S-Lang version of gsl_sf_bessel_Inu USAGE Double_Type[] bessel_Inu (Double_Type[] nu, Double_Type[] x) -------------------------------------------------------------- bessel_Inu_scaled SYNOPSIS S-Lang version of gsl_sf_bessel_Inu_scaled USAGE Double_Type[] bessel_Inu_scaled (Double_Type[] nu, Double_Type[] x) -------------------------------------------------------------- bessel_J0 SYNOPSIS S-Lang version of gsl_sf_bessel_J0 USAGE Double_Type[] bessel_J0 (Double_Type[] x) -------------------------------------------------------------- bessel_j0 SYNOPSIS S-Lang version of gsl_sf_bessel_j0 USAGE Double_Type[] bessel_j0 (Double_Type[] x) -------------------------------------------------------------- bessel_j1 SYNOPSIS S-Lang version of gsl_sf_bessel_j1 USAGE Double_Type[] bessel_j1 (Double_Type[] x) -------------------------------------------------------------- bessel_J1 SYNOPSIS S-Lang version of gsl_sf_bessel_J1 USAGE Double_Type[] bessel_J1 (Double_Type[] x) -------------------------------------------------------------- bessel_j2 SYNOPSIS S-Lang version of gsl_sf_bessel_j2 USAGE Double_Type[] bessel_j2 (Double_Type[] x) -------------------------------------------------------------- bessel_jl SYNOPSIS S-Lang version of gsl_sf_bessel_jl USAGE Double_Type[] bessel_jl (Int_Type[] l, Double_Type[] x) -------------------------------------------------------------- bessel_Jn SYNOPSIS S-Lang version of gsl_sf_bessel_Jn USAGE Double_Type[] bessel_Jn (Int_Type[] n, Double_Type[] x) -------------------------------------------------------------- bessel_Jnu SYNOPSIS S-Lang version of gsl_sf_bessel_Jnu USAGE Double_Type[] bessel_Jnu (Double_Type[] nu, Double_Type[] x) -------------------------------------------------------------- bessel_K0 SYNOPSIS S-Lang version of gsl_sf_bessel_K0 USAGE Double_Type[] bessel_K0 (Double_Type[] x) -------------------------------------------------------------- bessel_K0_scaled SYNOPSIS S-Lang version of gsl_sf_bessel_K0_scaled USAGE Double_Type[] bessel_K0_scaled (Double_Type[] x) -------------------------------------------------------------- bessel_k0_scaled SYNOPSIS S-Lang version of gsl_sf_bessel_k0_scaled USAGE Double_Type[] bessel_k0_scaled (Double_Type[] x) -------------------------------------------------------------- bessel_K1 SYNOPSIS S-Lang version of gsl_sf_bessel_K1 USAGE Double_Type[] bessel_K1 (Double_Type[] x) -------------------------------------------------------------- bessel_K1_scaled SYNOPSIS S-Lang version of gsl_sf_bessel_K1_scaled USAGE Double_Type[] bessel_K1_scaled (Double_Type[] x) -------------------------------------------------------------- bessel_k1_scaled SYNOPSIS S-Lang version of gsl_sf_bessel_k1_scaled USAGE Double_Type[] bessel_k1_scaled (Double_Type[] x) -------------------------------------------------------------- bessel_k2_scaled SYNOPSIS S-Lang version of gsl_sf_bessel_k2_scaled USAGE Double_Type[] bessel_k2_scaled (Double_Type[] x) -------------------------------------------------------------- bessel_kl_scaled SYNOPSIS S-Lang version of gsl_sf_bessel_kl_scaled USAGE Double_Type[] bessel_kl_scaled (Int_Type[] l, Double_Type[] x) -------------------------------------------------------------- bessel_Kn SYNOPSIS S-Lang version of gsl_sf_bessel_Kn USAGE Double_Type[] bessel_Kn (Int_Type[] n, Double_Type[] x) -------------------------------------------------------------- bessel_Kn_scaled SYNOPSIS S-Lang version of gsl_sf_bessel_Kn_scaled USAGE Double_Type[] bessel_Kn_scaled (Int_Type[] n, Double_Type[] x) -------------------------------------------------------------- bessel_Knu SYNOPSIS S-Lang version of gsl_sf_bessel_Knu USAGE Double_Type[] bessel_Knu (Double_Type[] nu, Double_Type[] x) -------------------------------------------------------------- bessel_Knu_scaled SYNOPSIS S-Lang version of gsl_sf_bessel_Knu_scaled USAGE Double_Type[] bessel_Knu_scaled (Double_Type[] nu, Double_Type[] x) -------------------------------------------------------------- bessel_lnKnu SYNOPSIS S-Lang version of gsl_sf_bessel_lnKnu USAGE Double_Type[] bessel_lnKnu (Double_Type[] nu, Double_Type[] x) -------------------------------------------------------------- bessel_y0 SYNOPSIS S-Lang version of gsl_sf_bessel_y0 USAGE Double_Type[] bessel_y0 (Double_Type[] x) -------------------------------------------------------------- bessel_Y0 SYNOPSIS S-Lang version of gsl_sf_bessel_Y0 USAGE Double_Type[] bessel_Y0 (Double_Type[] x) -------------------------------------------------------------- bessel_y1 SYNOPSIS S-Lang version of gsl_sf_bessel_y1 USAGE Double_Type[] bessel_y1 (Double_Type[] x) -------------------------------------------------------------- bessel_Y1 SYNOPSIS S-Lang version of gsl_sf_bessel_Y1 USAGE Double_Type[] bessel_Y1 (Double_Type[] x) -------------------------------------------------------------- bessel_y2 SYNOPSIS S-Lang version of gsl_sf_bessel_y2 USAGE Double_Type[] bessel_y2 (Double_Type[] x) -------------------------------------------------------------- bessel_yl SYNOPSIS S-Lang version of gsl_sf_bessel_yl USAGE Double_Type[] bessel_yl (Int_Type[] l, Double_Type[] x) -------------------------------------------------------------- bessel_Yn SYNOPSIS S-Lang version of gsl_sf_bessel_Yn USAGE Double_Type[] bessel_Yn (Int_Type[] n, Double_Type[] x) -------------------------------------------------------------- bessel_Ynu SYNOPSIS S-Lang version of gsl_sf_bessel_Ynu USAGE Double_Type[] bessel_Ynu (Double_Type[] nu, Double_Type[] x) -------------------------------------------------------------- beta SYNOPSIS S-Lang version of gsl_sf_beta USAGE Double_Type[] beta (Double_Type[] a, Double_Type[] b) -------------------------------------------------------------- beta_inc SYNOPSIS S-Lang version of gsl_sf_beta_inc USAGE Double_Type[] beta_inc (Double_Type[] a, Double_Type[] b, Double_Type[] x) -------------------------------------------------------------- lnbeta SYNOPSIS S-Lang version of gsl_sf_lnbeta USAGE Double_Type[] lnbeta (Double_Type[] a, Double_Type[] b) -------------------------------------------------------------- clausen SYNOPSIS S-Lang version of gsl_sf_clausen USAGE Double_Type[] clausen (Double_Type[] x) -------------------------------------------------------------- conicalP_0 SYNOPSIS S-Lang version of gsl_sf_conicalP_0 USAGE Double_Type[] conicalP_0 (Double_Type[] lambda, Double_Type[] x) -------------------------------------------------------------- conicalP_1 SYNOPSIS S-Lang version of gsl_sf_conicalP_1 USAGE Double_Type[] conicalP_1 (Double_Type[] lambda, Double_Type[] x) -------------------------------------------------------------- conicalP_cyl_reg SYNOPSIS S-Lang version of gsl_sf_conicalP_cyl_reg USAGE Double_Type[] conicalP_cyl_reg (m, lambda, x) Int_Type[] m Double_Type[] lambda Double_Type[] x -------------------------------------------------------------- conicalP_half SYNOPSIS S-Lang version of gsl_sf_conicalP_half USAGE Double_Type[] conicalP_half (Double_Type[] lambda, Double_Type[] x) -------------------------------------------------------------- conicalP_mhalf SYNOPSIS S-Lang version of gsl_sf_conicalP_mhalf USAGE Double_Type[] conicalP_mhalf (Double_Type[] lambda, Double_Type[] x) -------------------------------------------------------------- conicalP_sph_reg SYNOPSIS S-Lang version of gsl_sf_conicalP_sph_reg USAGE Double_Type[] conicalP_sph_reg (l, lambda, x) Int_Type[] l Double_Type[] lambda Double_Type[] x -------------------------------------------------------------- hydrogenicR SYNOPSIS S-Lang version of gsl_sf_hydrogenicR USAGE Double_Type[] hydrogenicR (n, l, Z, r) Int_Type[] n Int_Type[] l Double_Type[] Z Double_Type[] r -------------------------------------------------------------- hydrogenicR_1 SYNOPSIS S-Lang version of gsl_sf_hydrogenicR_1 USAGE Double_Type[] hydrogenicR_1 (Double_Type[] Z, Double_Type[] r) -------------------------------------------------------------- debye_1 SYNOPSIS S-Lang version of gsl_sf_debye_1 USAGE Double_Type[] debye_1 (Double_Type[] x) -------------------------------------------------------------- debye_2 SYNOPSIS S-Lang version of gsl_sf_debye_2 USAGE Double_Type[] debye_2 (Double_Type[] x) -------------------------------------------------------------- debye_3 SYNOPSIS S-Lang version of gsl_sf_debye_3 USAGE Double_Type[] debye_3 (Double_Type[] x) -------------------------------------------------------------- debye_4 SYNOPSIS S-Lang version of gsl_sf_debye_4 USAGE Double_Type[] debye_4 (Double_Type[] x) -------------------------------------------------------------- debye_5 SYNOPSIS S-Lang version of gsl_sf_debye_5 USAGE Double_Type[] debye_5 (Double_Type[] x) -------------------------------------------------------------- debye_6 SYNOPSIS S-Lang version of gsl_sf_debye_6 USAGE Double_Type[] debye_6 (Double_Type[] x) -------------------------------------------------------------- psi SYNOPSIS S-Lang version of gsl_sf_psi USAGE Double_Type[] psi (Double_Type[] x) -------------------------------------------------------------- psi_1 SYNOPSIS S-Lang version of gsl_sf_psi_1 USAGE Double_Type[] psi_1 (Double_Type[] x) -------------------------------------------------------------- psi_1_int SYNOPSIS S-Lang version of gsl_sf_psi_1_int USAGE Double_Type[] psi_1_int (Int_Type[] n) -------------------------------------------------------------- psi_1piy SYNOPSIS S-Lang version of gsl_sf_psi_1piy USAGE Double_Type[] psi_1piy (Double_Type[] y) -------------------------------------------------------------- psi_int SYNOPSIS S-Lang version of gsl_sf_psi_int USAGE Double_Type[] psi_int (Int_Type[] n) -------------------------------------------------------------- psi_n SYNOPSIS S-Lang version of gsl_sf_psi_n USAGE Double_Type[] psi_n (Int_Type[] n, Double_Type[] x) -------------------------------------------------------------- ellint_D SYNOPSIS S-Lang version of gsl_sf_ellint_D USAGE Double_Type[] ellint_D (phi, k [,mode]) Double_Type[] phi Double_Type[] k Int_Type mode -------------------------------------------------------------- ellint_Dcomp SYNOPSIS S-Lang version of gsl_sf_ellint_Dcomp USAGE Double_Type[] ellint_Dcomp (Double_Type[] k [,Int_Type mode]) -------------------------------------------------------------- ellint_E SYNOPSIS S-Lang version of gsl_sf_ellint_E USAGE Double_Type[] ellint_E (phi, k [,mode]) Double_Type[] phi Double_Type[] k Int_Type mode -------------------------------------------------------------- ellint_Ecomp SYNOPSIS S-Lang version of gsl_sf_ellint_Ecomp USAGE Double_Type[] ellint_Ecomp (Double_Type[] k [,Int_Type mode]) -------------------------------------------------------------- ellint_F SYNOPSIS S-Lang version of gsl_sf_ellint_F USAGE Double_Type[] ellint_F (phi, k [,mode]) Double_Type[] phi Double_Type[] k Int_Type mode -------------------------------------------------------------- ellint_Kcomp SYNOPSIS S-Lang version of gsl_sf_ellint_Kcomp USAGE Double_Type[] ellint_Kcomp (Double_Type[] k [,Int_Type mode]) -------------------------------------------------------------- ellint_P SYNOPSIS S-Lang version of gsl_sf_ellint_P USAGE Double_Type[] ellint_P (phi, k, n [,mode]) Double_Type[] phi Double_Type[] k Double_Type[] n Int_Type mode -------------------------------------------------------------- ellint_Pcomp SYNOPSIS S-Lang version of gsl_sf_ellint_Pcomp USAGE Double_Type[] ellint_Pcomp (k, n [,mode]) Double_Type[] k Double_Type[] n Int_Type mode -------------------------------------------------------------- ellint_RC SYNOPSIS S-Lang version of gsl_sf_ellint_RC USAGE Double_Type[] ellint_RC (Double_Type[] x, Double_Type[] y [,Int_Type mode]) -------------------------------------------------------------- ellint_RD SYNOPSIS S-Lang version of gsl_sf_ellint_RD USAGE Double_Type[] ellint_RD (x, y, z [,mode]) Double_Type[] x Double_Type[] y Double_Type[] z Int_Type mode -------------------------------------------------------------- ellint_RF SYNOPSIS S-Lang version of gsl_sf_ellint_RF USAGE Double_Type[] ellint_RF (x, y, z [,mode]) Double_Type[] x Double_Type[] y Double_Type[] z Int_Type mode -------------------------------------------------------------- ellint_RJ SYNOPSIS S-Lang version of gsl_sf_ellint_RJ USAGE Double_Type[] ellint_RJ (x, y, z, p [,mode]) Double_Type[] x Double_Type[] y Double_Type[] z Double_Type[] p Int_Type mode -------------------------------------------------------------- erf SYNOPSIS S-Lang version of gsl_sf_erf USAGE Double_Type[] erf (Double_Type[] x) -------------------------------------------------------------- erf_Q SYNOPSIS S-Lang version of gsl_sf_erf_Q USAGE Double_Type[] erf_Q (Double_Type[] x) -------------------------------------------------------------- erf_Z SYNOPSIS S-Lang version of gsl_sf_erf_Z USAGE Double_Type[] erf_Z (Double_Type[] x) -------------------------------------------------------------- erfc SYNOPSIS S-Lang version of gsl_sf_erfc USAGE Double_Type[] erfc (Double_Type[] x) -------------------------------------------------------------- log_erfc SYNOPSIS S-Lang version of gsl_sf_log_erfc USAGE Double_Type[] log_erfc (Double_Type[] x) -------------------------------------------------------------- eta SYNOPSIS S-Lang version of gsl_sf_eta USAGE Double_Type[] eta (Double_Type[] s) -------------------------------------------------------------- eta_int SYNOPSIS S-Lang version of gsl_sf_eta_int USAGE Double_Type[] eta_int (Int_Type[] n) -------------------------------------------------------------- hzeta SYNOPSIS S-Lang version of gsl_sf_hzeta USAGE Double_Type[] hzeta (Double_Type[] s, Double_Type[] q) -------------------------------------------------------------- zeta SYNOPSIS S-Lang version of gsl_sf_zeta USAGE Double_Type[] zeta (Double_Type[] s) -------------------------------------------------------------- zeta_int SYNOPSIS S-Lang version of gsl_sf_zeta_int USAGE Double_Type[] zeta_int (Int_Type[] n) -------------------------------------------------------------- zetam1 SYNOPSIS S-Lang version of gsl_sf_zetam1 USAGE Double_Type[] zetam1 (Double_Type[] s) -------------------------------------------------------------- zetam1_int SYNOPSIS S-Lang version of gsl_sf_zetam1_int USAGE Double_Type[] zetam1_int (Int_Type[] s) -------------------------------------------------------------- exp_mult SYNOPSIS S-Lang version of gsl_sf_exp_mult USAGE Double_Type[] exp_mult (Double_Type[] x, Double_Type[] y) -------------------------------------------------------------- expint_3 SYNOPSIS S-Lang version of gsl_sf_expint_3 USAGE Double_Type[] expint_3 (Double_Type[] x) -------------------------------------------------------------- expint_E1 SYNOPSIS S-Lang version of gsl_sf_expint_E1 USAGE Double_Type[] expint_E1 (Double_Type[] x) -------------------------------------------------------------- expint_E1_scaled SYNOPSIS S-Lang version of gsl_sf_expint_E1_scaled USAGE Double_Type[] expint_E1_scaled (Double_Type[] x) -------------------------------------------------------------- expint_E2 SYNOPSIS S-Lang version of gsl_sf_expint_E2 USAGE Double_Type[] expint_E2 (Double_Type[] x) -------------------------------------------------------------- expint_E2_scaled SYNOPSIS S-Lang version of gsl_sf_expint_E2_scaled USAGE Double_Type[] expint_E2_scaled (Double_Type[] x) -------------------------------------------------------------- expint_Ei SYNOPSIS S-Lang version of gsl_sf_expint_Ei USAGE Double_Type[] expint_Ei (Double_Type[] x) -------------------------------------------------------------- expint_Ei_scaled SYNOPSIS S-Lang version of gsl_sf_expint_Ei_scaled USAGE Double_Type[] expint_Ei_scaled (Double_Type[] x) -------------------------------------------------------------- expint_En SYNOPSIS S-Lang version of gsl_sf_expint_En USAGE Double_Type[] expint_En (Int_Type[] n, Double_Type[] x) -------------------------------------------------------------- expint_En_scaled SYNOPSIS S-Lang version of gsl_sf_expint_En_scaled USAGE Double_Type[] expint_En_scaled (Int_Type[] n, Double_Type[] x) -------------------------------------------------------------- expm1 SYNOPSIS S-Lang version of gsl_sf_expm1 USAGE Double_Type[] expm1 (Double_Type[] x) -------------------------------------------------------------- exprel SYNOPSIS S-Lang version of gsl_sf_exprel USAGE Double_Type[] exprel (Double_Type[] x) -------------------------------------------------------------- exprel_2 SYNOPSIS S-Lang version of gsl_sf_exprel_2 USAGE Double_Type[] exprel_2 (Double_Type[] x) -------------------------------------------------------------- exprel_n SYNOPSIS S-Lang version of gsl_sf_exprel_n USAGE Double_Type[] exprel_n (Int_Type[] n, Double_Type[] x) -------------------------------------------------------------- fermi_dirac_0 SYNOPSIS S-Lang version of gsl_sf_fermi_dirac_0 USAGE Double_Type[] fermi_dirac_0 (Double_Type[] x) -------------------------------------------------------------- fermi_dirac_1 SYNOPSIS S-Lang version of gsl_sf_fermi_dirac_1 USAGE Double_Type[] fermi_dirac_1 (Double_Type[] x) -------------------------------------------------------------- fermi_dirac_2 SYNOPSIS S-Lang version of gsl_sf_fermi_dirac_2 USAGE Double_Type[] fermi_dirac_2 (Double_Type[] x) -------------------------------------------------------------- fermi_dirac_3half SYNOPSIS S-Lang version of gsl_sf_fermi_dirac_3half USAGE Double_Type[] fermi_dirac_3half (Double_Type[] x) -------------------------------------------------------------- fermi_dirac_half SYNOPSIS S-Lang version of gsl_sf_fermi_dirac_half USAGE Double_Type[] fermi_dirac_half (Double_Type[] x) -------------------------------------------------------------- fermi_dirac_inc_0 SYNOPSIS S-Lang version of gsl_sf_fermi_dirac_inc_0 USAGE Double_Type[] fermi_dirac_inc_0 (Double_Type[] x, Double_Type[] b) -------------------------------------------------------------- fermi_dirac_int SYNOPSIS S-Lang version of gsl_sf_fermi_dirac_int USAGE Double_Type[] fermi_dirac_int (Int_Type[] j, Double_Type[] x) -------------------------------------------------------------- fermi_dirac_m1 SYNOPSIS S-Lang version of gsl_sf_fermi_dirac_m1 USAGE Double_Type[] fermi_dirac_m1 (Double_Type[] x) -------------------------------------------------------------- fermi_dirac_mhalf SYNOPSIS S-Lang version of gsl_sf_fermi_dirac_mhalf USAGE Double_Type[] fermi_dirac_mhalf (Double_Type[] x) -------------------------------------------------------------- gamma SYNOPSIS S-Lang version of gsl_sf_gamma USAGE Double_Type[] gamma (Double_Type[] x) -------------------------------------------------------------- gamma_inc SYNOPSIS S-Lang version of gsl_sf_gamma_inc USAGE Double_Type[] gamma_inc (Double_Type[] a, Double_Type[] x) -------------------------------------------------------------- gamma_inc_P SYNOPSIS S-Lang version of gsl_sf_gamma_inc_P USAGE Double_Type[] gamma_inc_P (Double_Type[] a, Double_Type[] x) -------------------------------------------------------------- gamma_inc_Q SYNOPSIS S-Lang version of gsl_sf_gamma_inc_Q USAGE Double_Type[] gamma_inc_Q (Double_Type[] a, Double_Type[] x) -------------------------------------------------------------- gammainv SYNOPSIS S-Lang version of gsl_sf_gammainv USAGE Double_Type[] gammainv (Double_Type[] x) -------------------------------------------------------------- gammastar SYNOPSIS S-Lang version of gsl_sf_gammastar USAGE Double_Type[] gammastar (Double_Type[] x) -------------------------------------------------------------- lngamma SYNOPSIS S-Lang version of gsl_sf_lngamma USAGE Double_Type[] lngamma (Double_Type[] x) -------------------------------------------------------------- gegenpoly_1 SYNOPSIS S-Lang version of gsl_sf_gegenpoly_1 USAGE Double_Type[] gegenpoly_1 (Double_Type[] lambda, Double_Type[] x) -------------------------------------------------------------- gegenpoly_2 SYNOPSIS S-Lang version of gsl_sf_gegenpoly_2 USAGE Double_Type[] gegenpoly_2 (Double_Type[] lambda, Double_Type[] x) -------------------------------------------------------------- gegenpoly_3 SYNOPSIS S-Lang version of gsl_sf_gegenpoly_3 USAGE Double_Type[] gegenpoly_3 (Double_Type[] lambda, Double_Type[] x) -------------------------------------------------------------- gegenpoly_n SYNOPSIS S-Lang version of gsl_sf_gegenpoly_n USAGE Double_Type[] gegenpoly_n (n, lambda, x) Int_Type[] n Double_Type[] lambda Double_Type[] x -------------------------------------------------------------- hyperg_0F1 SYNOPSIS S-Lang version of gsl_sf_hyperg_0F1 USAGE Double_Type[] hyperg_0F1 (Double_Type[] c, Double_Type[] x) -------------------------------------------------------------- hyperg_1F1 SYNOPSIS S-Lang version of gsl_sf_hyperg_1F1 USAGE Double_Type[] hyperg_1F1 (a, b, x) Double_Type[] a Double_Type[] b Double_Type[] x -------------------------------------------------------------- hyperg_1F1_int SYNOPSIS S-Lang version of gsl_sf_hyperg_1F1_int USAGE Double_Type[] hyperg_1F1_int (Int_Type[] m, Int_Type[] n, Double_Type[] x) -------------------------------------------------------------- hyperg_2F0 SYNOPSIS S-Lang version of gsl_sf_hyperg_2F0 USAGE Double_Type[] hyperg_2F0 (a, b, x) Double_Type[] a Double_Type[] b Double_Type[] x -------------------------------------------------------------- hyperg_2F1 SYNOPSIS S-Lang version of gsl_sf_hyperg_2F1 USAGE Double_Type[] hyperg_2F1 (a, b, c, x) Double_Type[] a Double_Type[] b Double_Type[] c Double_Type[] x -------------------------------------------------------------- hyperg_2F1_conj SYNOPSIS S-Lang version of gsl_sf_hyperg_2F1_conj USAGE Double_Type[] hyperg_2F1_conj (aR, aI, c, x) Double_Type[] aR Double_Type[] aI Double_Type[] c Double_Type[] x -------------------------------------------------------------- hyperg_2F1_conj_renorm SYNOPSIS S-Lang version of gsl_sf_hyperg_2F1_conj_renorm USAGE Double_Type[] hyperg_2F1_conj_renorm (aR, aI, c, x) Double_Type[] aR Double_Type[] aI Double_Type[] c Double_Type[] x -------------------------------------------------------------- hyperg_2F1_renorm SYNOPSIS S-Lang version of gsl_sf_hyperg_2F1_renorm USAGE Double_Type[] hyperg_2F1_renorm (a, b, c, x) Double_Type[] a Double_Type[] b Double_Type[] c Double_Type[] x -------------------------------------------------------------- hyperg_U SYNOPSIS S-Lang version of gsl_sf_hyperg_U USAGE Double_Type[] hyperg_U (Double_Type[] a, Double_Type[] b, Double_Type[] x) -------------------------------------------------------------- hyperg_U_int SYNOPSIS S-Lang version of gsl_sf_hyperg_U_int USAGE Double_Type[] hyperg_U_int (Int_Type[] m, Int_Type[] n, Double_Type[] x) -------------------------------------------------------------- laguerre_1 SYNOPSIS S-Lang version of gsl_sf_laguerre_1 USAGE Double_Type[] laguerre_1 (Double_Type[] a, Double_Type[] x) -------------------------------------------------------------- laguerre_2 SYNOPSIS S-Lang version of gsl_sf_laguerre_2 USAGE Double_Type[] laguerre_2 (Double_Type[] a, Double_Type[] x) -------------------------------------------------------------- laguerre_3 SYNOPSIS S-Lang version of gsl_sf_laguerre_3 USAGE Double_Type[] laguerre_3 (Double_Type[] a, Double_Type[] x) -------------------------------------------------------------- laguerre_n SYNOPSIS S-Lang version of gsl_sf_laguerre_n USAGE Double_Type[] laguerre_n (Int_Type[] n, Double_Type[] a, Double_Type[] x) -------------------------------------------------------------- lambert_W0 SYNOPSIS S-Lang version of gsl_sf_lambert_W0 USAGE Double_Type[] lambert_W0 (Double_Type[] x) -------------------------------------------------------------- lambert_Wm1 SYNOPSIS S-Lang version of gsl_sf_lambert_Wm1 USAGE Double_Type[] lambert_Wm1 (Double_Type[] x) -------------------------------------------------------------- legendre_H3d SYNOPSIS S-Lang version of gsl_sf_legendre_H3d USAGE Double_Type[] legendre_H3d (l, lambda, eta) Int_Type[] l Double_Type[] lambda Double_Type[] eta -------------------------------------------------------------- legendre_H3d_0 SYNOPSIS S-Lang version of gsl_sf_legendre_H3d_0 USAGE Double_Type[] legendre_H3d_0 (Double_Type[] lambda, Double_Type[] eta) -------------------------------------------------------------- legendre_H3d_1 SYNOPSIS S-Lang version of gsl_sf_legendre_H3d_1 USAGE Double_Type[] legendre_H3d_1 (Double_Type[] lambda, Double_Type[] eta) -------------------------------------------------------------- legendre_P1 SYNOPSIS S-Lang version of gsl_sf_legendre_P1 USAGE Double_Type[] legendre_P1 (Double_Type[] x) -------------------------------------------------------------- legendre_P2 SYNOPSIS S-Lang version of gsl_sf_legendre_P2 USAGE Double_Type[] legendre_P2 (Double_Type[] x) -------------------------------------------------------------- legendre_P3 SYNOPSIS S-Lang version of gsl_sf_legendre_P3 USAGE Double_Type[] legendre_P3 (Double_Type[] x) -------------------------------------------------------------- legendre_Pl SYNOPSIS S-Lang version of gsl_sf_legendre_Pl USAGE Double_Type[] legendre_Pl (Int_Type[] l, Double_Type[] x) -------------------------------------------------------------- legendre_Plm SYNOPSIS S-Lang version of gsl_sf_legendre_Plm USAGE Double_Type[] legendre_Plm (Int_Type[] l, Int_Type[] m, Double_Type[] x) -------------------------------------------------------------- legendre_Q0 SYNOPSIS S-Lang version of gsl_sf_legendre_Q0 USAGE Double_Type[] legendre_Q0 (Double_Type[] x) -------------------------------------------------------------- legendre_Q1 SYNOPSIS S-Lang version of gsl_sf_legendre_Q1 USAGE Double_Type[] legendre_Q1 (Double_Type[] x) -------------------------------------------------------------- legendre_Ql SYNOPSIS S-Lang version of gsl_sf_legendre_Ql USAGE Double_Type[] legendre_Ql (Int_Type[] l, Double_Type[] x) -------------------------------------------------------------- legendre_sphPlm SYNOPSIS S-Lang version of gsl_sf_legendre_sphPlm USAGE Double_Type[] legendre_sphPlm (Int_Type[] l, Int_Type[] m, Double_Type[] x) -------------------------------------------------------------- log_1plusx SYNOPSIS S-Lang version of gsl_sf_log_1plusx USAGE Double_Type[] log_1plusx (Double_Type[] x) -------------------------------------------------------------- log_1plusx_mx SYNOPSIS S-Lang version of gsl_sf_log_1plusx_mx USAGE Double_Type[] log_1plusx_mx (Double_Type[] x) -------------------------------------------------------------- log_abs SYNOPSIS S-Lang version of gsl_sf_log_abs USAGE Double_Type[] log_abs (Double_Type[] x) -------------------------------------------------------------- transport_2 SYNOPSIS S-Lang version of gsl_sf_transport_2 USAGE Double_Type[] transport_2 (Double_Type[] x) -------------------------------------------------------------- transport_3 SYNOPSIS S-Lang version of gsl_sf_transport_3 USAGE Double_Type[] transport_3 (Double_Type[] x) -------------------------------------------------------------- transport_4 SYNOPSIS S-Lang version of gsl_sf_transport_4 USAGE Double_Type[] transport_4 (Double_Type[] x) -------------------------------------------------------------- transport_5 SYNOPSIS S-Lang version of gsl_sf_transport_5 USAGE Double_Type[] transport_5 (Double_Type[] x) -------------------------------------------------------------- angle_restrict_pos SYNOPSIS S-Lang version of gsl_sf_angle_restrict_pos USAGE Double_Type[] angle_restrict_pos (Double_Type[] theta) -------------------------------------------------------------- angle_restrict_symm SYNOPSIS S-Lang version of gsl_sf_angle_restrict_symm USAGE Double_Type[] angle_restrict_symm (Double_Type[] theta) -------------------------------------------------------------- atanint SYNOPSIS S-Lang version of gsl_sf_atanint USAGE Double_Type[] atanint (Double_Type[] x) -------------------------------------------------------------- Chi SYNOPSIS S-Lang version of gsl_sf_Chi USAGE Double_Type[] Chi (Double_Type[] x) -------------------------------------------------------------- Ci SYNOPSIS S-Lang version of gsl_sf_Ci USAGE Double_Type[] Ci (Double_Type[] x) -------------------------------------------------------------- dawson SYNOPSIS S-Lang version of gsl_sf_dawson USAGE Double_Type[] dawson (Double_Type[] x) -------------------------------------------------------------- dilog SYNOPSIS S-Lang version of gsl_sf_dilog USAGE Double_Type[] dilog (Double_Type[] x) -------------------------------------------------------------- hazard SYNOPSIS S-Lang version of gsl_sf_hazard USAGE Double_Type[] hazard (Double_Type[] x) -------------------------------------------------------------- hypot SYNOPSIS S-Lang version of gsl_sf_hypot USAGE Double_Type[] hypot (Double_Type[] x, Double_Type[] y) -------------------------------------------------------------- lncosh SYNOPSIS S-Lang version of gsl_sf_lncosh USAGE Double_Type[] lncosh (Double_Type[] x) -------------------------------------------------------------- lnpoch SYNOPSIS S-Lang version of gsl_sf_lnpoch USAGE Double_Type[] lnpoch (Double_Type[] a, Double_Type[] x) -------------------------------------------------------------- lnsinh SYNOPSIS S-Lang version of gsl_sf_lnsinh USAGE Double_Type[] lnsinh (Double_Type[] x) -------------------------------------------------------------- mathieu_a SYNOPSIS S-Lang version of gsl_sf_mathieu_a USAGE Double_Type[] mathieu_a (Int_Type[] order, Double_Type[] qq) -------------------------------------------------------------- mathieu_b SYNOPSIS S-Lang version of gsl_sf_mathieu_b USAGE Double_Type[] mathieu_b (Int_Type[] order, Double_Type[] qq) -------------------------------------------------------------- mathieu_ce SYNOPSIS S-Lang version of gsl_sf_mathieu_ce USAGE Double_Type[] mathieu_ce (order, qq, zz) Int_Type[] order Double_Type[] qq Double_Type[] zz -------------------------------------------------------------- mathieu_Mc SYNOPSIS S-Lang version of gsl_sf_mathieu_Mc USAGE Double_Type[] mathieu_Mc (kind, order, qq, zz) Int_Type[] kind Int_Type[] order Double_Type[] qq Double_Type[] zz -------------------------------------------------------------- mathieu_Ms SYNOPSIS S-Lang version of gsl_sf_mathieu_Ms USAGE Double_Type[] mathieu_Ms (kind, order, qq, zz) Int_Type[] kind Int_Type[] order Double_Type[] qq Double_Type[] zz -------------------------------------------------------------- mathieu_se SYNOPSIS S-Lang version of gsl_sf_mathieu_se USAGE Double_Type[] mathieu_se (order, qq, zz) Int_Type[] order Double_Type[] qq Double_Type[] zz -------------------------------------------------------------- poch SYNOPSIS S-Lang version of gsl_sf_poch USAGE Double_Type[] poch (Double_Type[] a, Double_Type[] x) -------------------------------------------------------------- pochrel SYNOPSIS S-Lang version of gsl_sf_pochrel USAGE Double_Type[] pochrel (Double_Type[] a, Double_Type[] x) -------------------------------------------------------------- Shi SYNOPSIS S-Lang version of gsl_sf_Shi USAGE Double_Type[] Shi (Double_Type[] x) -------------------------------------------------------------- Si SYNOPSIS S-Lang version of gsl_sf_Si USAGE Double_Type[] Si (Double_Type[] x) -------------------------------------------------------------- sinc SYNOPSIS S-Lang version of gsl_sf_sinc USAGE Double_Type[] sinc (Double_Type[] x) -------------------------------------------------------------- synchrotron_1 SYNOPSIS S-Lang version of gsl_sf_synchrotron_1 USAGE Double_Type[] synchrotron_1 (Double_Type[] x) -------------------------------------------------------------- synchrotron_2 SYNOPSIS S-Lang version of gsl_sf_synchrotron_2 USAGE Double_Type[] synchrotron_2 (Double_Type[] x) -------------------------------------------------------------- taylorcoeff SYNOPSIS S-Lang version of gsl_sf_taylorcoeff USAGE Double_Type[] taylorcoeff (Int_Type[] n, Double_Type[] x) -------------------------------------------------------------- interp_linear SYNOPSIS Linear Interpolation USAGE y = interp_linear (x, Double_Type xa[], Double_Type ya[]) DESCRIPTION Use linear interpolation to determine the value at `x' given the points (`xa', `ya'). The first argument, `x', may be either a scalar or an array, and a result of the corresponding type will be returned. SEE ALSO interp_polynomial, interp_cspline, interp_cspline_periodic, interp_akima, interp_akima_periodic -------------------------------------------------------------- interp_polynomial SYNOPSIS Polynomial Interpolation USAGE y = interp_polynomial (x, Double_Type xa[], Double_Type ya[]) DESCRIPTION Use polynomial interpolation to determine the value at `x' given the points (`xa', `ya'). The first argument, `x', may be either a scalar or an array, and a result of the corresponding type will be returned. The degree of the interpolating polynomial is given by one less than the number of points in the `xa' array. For example, if `length(xa)' is 3, then a quadratic polynomial will be used. SEE ALSO interp_linear, interp_cspline, interp_cspline_periodic, interp_akima, interp_akima_periodic -------------------------------------------------------------- interp_cspline SYNOPSIS Cubic Spline Interpolation USAGE y = interp_cspline (x, Double_Type xa[], Double_Type ya[]) DESCRIPTION Use cubic spline interpolation with natural boundary conditions to determine the value at `x' given the points (`xa', `ya'). The first argument, `x', may be either a scalar or an array, and a result of the corresponding type will be returned. SEE ALSO interp_linear, interp_polynomial, interp_cspline_periodic, interp_akima, interp_akima_periodic -------------------------------------------------------------- interp_cspline_periodic SYNOPSIS Cubic spline interpolation with periodic boundary conditions USAGE y = interp_cspline_periodic (x, Double_Type xa[], Double_Type ya[]) DESCRIPTION Use cubic spline interpolation with periodic boundary conditions to determine the value at `x' given the points (`xa', `ya'). The first argument, `x', may be either a scalar or an array, and a result of the corresponding type will be returned. SEE ALSO interp_linear, interp_polynomial, interp_cspline, interp_akima, interp_akima_periodic -------------------------------------------------------------- interp_akima SYNOPSIS Akima spline interpolation USAGE y = interp_akima (x, Double_Type xa[], Double_Type ya[]) DESCRIPTION Use an Akima spline with natural boundary conditions to determine the value at `x' given the points (`xa', `ya'). The first argument, `x', may be either a scalar or an array, and a result of the corresponding type will be returned. SEE ALSO interp_linear, interp_polynomial, interp_cspline, interp_cspline_periodic, interp_akima_periodic -------------------------------------------------------------- interp_akima_periodic SYNOPSIS Akima spline interpolation with periodic boundary conditions USAGE y = interp_akima_periodic (x, Double_Type xa[], Double_Type ya[]) DESCRIPTION Use an Akima spline with periodic boundary conditions to determine the value at `x' given the points (`xa', `ya'). The first argument, `x', may be either a scalar or an array, and a result of the corresponding type will be returned. SEE ALSO interp_linear, interp_polynomial, interp_cspline, interp_cspline_periodic, interp_akima -------------------------------------------------------------- interp_linear_deriv SYNOPSIS Compute derivative using linear interpolation USAGE y = interp_linear_deriv (x, Double_Type xa[], Double_Type ya[]) DESCRIPTION Use linear interpolation to determine the value of the first derivative at `x' given the points (`xa', `ya'). The first argument, `x', may be either a scalar or an array, and a result of the corresponding type will be returned. SEE ALSO interp_polynomial_deriv, interp_cspline_deriv, interp_cspline_periodic_deriv, interp_akima_deriv, interp_akima_periodic_deriv -------------------------------------------------------------- interp_polynomial_deriv SYNOPSIS Compute derivative using polynomial interpolation USAGE y = interp_polynomial_deriv (x, Double_Type xa[], Double_Type ya[]) DESCRIPTION Use polynomial interpolation to determine the value of the first derivative at `x' given the points (`xa', `ya'). The first argument, `x', may be either a scalar or an array, and a result of the corresponding type will be returned. The degree of the interpolating polynomial is given by one less than the number of points in the `xa' array. For example, if `length(xa)' is 3, then a quadratic polynomial will be used. SEE ALSO interp_linear_deriv, interp_cspline_deriv, interp_cspline_periodic_deriv, interp_akima_deriv, interp_akima_periodic_deriv -------------------------------------------------------------- interp_cspline_deriv SYNOPSIS Compute derivative using a cubic spline USAGE y = interp_cspline_deriv (x, Double_Type xa[], Double_Type ya[]) DESCRIPTION Use cubic spline interpolation with natural boundary conditions to determine the value of the first derivative at `x' given the points (`xa', `ya'). The first argument, `x', may be either a scalar or an array, and a result of the corresponding type will be returned. SEE ALSO interp_linear_deriv, interp_polynomial_deriv, interp_cspline_periodic_deriv, interp_akima_deriv, interp_akima_periodic_deriv -------------------------------------------------------------- interp_cspline_periodic_deriv SYNOPSIS Compute derivative using a cubic spline USAGE y = interp_cspline_periodic_deriv (x, Double_Type xa[], Double_Type ya[]) DESCRIPTION Use cubic spline interpolation with periodic boundary conditions to determine the value of the first derivative at `x' given the points (`xa', `ya'). The first argument, `x', may be either a scalar or an array, and a result of the corresponding type will be returned. SEE ALSO interp_linear_deriv, interp_polynomial_deriv, interp_cspline_deriv, interp_akima_deriv, interp_akima_periodic_deriv -------------------------------------------------------------- interp_akima_deriv SYNOPSIS Compute derivative using an Akima spline USAGE y = interp_akima_deriv (x, Double_Type xa[], Double_Type ya[]) DESCRIPTION Use Akima spline interpolation with natural boundary conditions to determine the value of the first derivative at `x' given the points (`xa', `ya'). The first argument, `x', may be either a scalar or an array, and a result of the corresponding type will be returned. SEE ALSO interp_linear_deriv, interp_polynomial_deriv, interp_cspline_deriv, interp_cspline_periodic_deriv, interp_akima_periodic_deriv -------------------------------------------------------------- interp_akima_periodic_deriv SYNOPSIS Compute derivative using an Akima spline USAGE y = interp_cspline_deriv (x, Double_Type xa[], Double_Type ya[]) DESCRIPTION Use Akima spline interpolation with periodic boundary conditions to determine the value of the first derivative at `x' given the points (`xa', `ya'). The first argument, `x', may be either a scalar or an array, and a result of the corresponding type will be returned. SEE ALSO interp_linear_deriv, interp_polynomial_deriv, interp_cspline_deriv, interp_cspline_periodic_deriv, interp_akima_deriv -------------------------------------------------------------- interp_linear_deriv2 SYNOPSIS Compute second derivative using linear interpolation USAGE y = interp_linear_deriv2 (x, Double_Type xa[], Double_Type ya[]) DESCRIPTION Use linear interpolation to determine the value of the second derivative at `x' given the points (`xa', `ya'). The first argument, `x', may be either a scalar or an array, and a result of the corresponding type will be returned. SEE ALSO interp_polynomial_deriv2, interp_cspline_deriv2, interp_cspline_periodic_deriv2, interp_akima_deriv2, interp_akima_periodic_deriv2 -------------------------------------------------------------- interp_polynomial_deriv2 SYNOPSIS Compute second derivative using polynomial interpolation USAGE y = interp_polynomial_deriv2 (x, Double_Type xa[], Double_Type ya[]) DESCRIPTION Use polynomial interpolation to determine the value of the second derivative at `x' given the points (`xa', `ya'). The first argument, `x', may be either a scalar or an array, and a result of the corresponding type will be returned. The degree of the interpolating polynomial is given by one less than the number of points in the `xa' array. For example, if `length(xa)' is 3, then a quadratic polynomial will be used. SEE ALSO interp_linear_deriv2, interp_cspline_deriv2, interp_cspline_periodic_deriv2, interp_akima_deriv2, interp_akima_periodic_deriv2 -------------------------------------------------------------- interp_cspline_deriv2 SYNOPSIS Compute second derivative using a cubic spline USAGE y = interp_cspline_deriv2 (x, Double_Type xa[], Double_Type ya[]) DESCRIPTION Use cubic spline interpolation with natural boundary conditions to determine the value of the second derivative at `x' given the points (`xa', `ya'). The first argument, `x', may be either a scalar or an array, and a result of the corresponding type will be returned. SEE ALSO interp_linear_deriv2, interp_polynomial_deriv2, interp_cspline_periodic_deriv2, interp_akima_deriv2, interp_akima_periodic_deriv2 -------------------------------------------------------------- interp_cspline_periodic_deriv2 SYNOPSIS Compute second derivative using a cubic spline USAGE y = interp_cspline_periodic_deriv2 (x, Double_Type xa[], Double_Type ya[]) DESCRIPTION Use cubic spline interpolation with periodic boundary conditions to determine the value of the second derivative at `x' given the points (`xa', `ya'). The first argument, `x', may be either a scalar or an array, and a result of the corresponding type will be returned. SEE ALSO interp_linear_deriv2, interp_polynomial_deriv2, interp_cspline_deriv2, interp_akima_deriv2, interp_akima_periodic_deriv2 -------------------------------------------------------------- interp_akima_deriv2 SYNOPSIS Compute second derivative using an Akima spline USAGE y = interp_akima_deriv2 (x, Double_Type xa[], Double_Type ya[]) DESCRIPTION Use Akima spline interpolation with natural boundary conditions to determine the value of the second derivative at `x' given the points (`xa', `ya'). The first argument, `x', may be either a scalar or an array, and a result of the corresponding type will be returned. SEE ALSO interp_linear_deriv2, interp_polynomial_deriv2, interp_cspline_deriv2, interp_cspline_periodic_deriv2, interp_akima_periodic_deriv2 -------------------------------------------------------------- interp_akima_periodic_deriv2 SYNOPSIS Compute second derivative using an Akima spline USAGE y = interp_cspline_deriv2 (x, Double_Type xa[], Double_Type ya[]) DESCRIPTION Use Akima spline interpolation with periodic boundary conditions to determine the value of the second derivative at `x' given the points (`xa', `ya'). The first argument, `x', may be either a scalar or an array, and a result of the corresponding type will be returned. SEE ALSO interp_linear_deriv2, interp_polynomial_deriv2, interp_cspline_deriv2, interp_cspline_periodic_deriv2, interp_akima_deriv2, interp_akima_periodic_deriv2 -------------------------------------------------------------- interp_linear_integ SYNOPSIS Compute an integral using linear interpolation USAGE y = interp_linear_integ (Double_Type xa[], Double_Type ya[], a, b) DESCRIPTION This function computes the integral from `a' to `b' of the linear interpolating function associated with the set of points (`xa', `ya'). See `interp_linear' for more information about the interpolating function. SEE ALSO interp_polynomial_integ, interp_cspline_integ, interp_cspline_periodic_integ, interp_akima_integ, interp_akima_periodic_integ -------------------------------------------------------------- interp_polynomial_integ SYNOPSIS Compute an integral using polynomial interpolation USAGE y = interp_polynomial_integ (Double_Type xa[], Double_Type ya[], a, b) DESCRIPTION This function computes the integral from `a' to `b' of the polynomial interpolating function associated with the set of points (`xa', `ya'). See `interp_polynomial' for more information about the interpolating function. SEE ALSO interp_linear_integ, interp_cspline_integ, interp_cspline_periodic_integ, interp_akima_integ, interp_akima_periodic_integ -------------------------------------------------------------- interp_cspline_integ SYNOPSIS Compute an integral using a cubic spline USAGE y = interp_cspline_integ (Double_Type xa[], Double_Type ya[], a, b) DESCRIPTION This function computes the integral from `a' to `b' of the cubic spline interpolating function associated with the set of points (`xa', `ya'). See `interp_cspline' for more information about the interpolating function. SEE ALSO interp_linear_integ, interp_polynomial_integ, interp_cspline_periodic_integ, interp_akima_integ, interp_akima_periodic_integ -------------------------------------------------------------- interp_cspline_periodic_integ SYNOPSIS Compute an integral using a cubic spline USAGE y = interp_cspline_periodic_integ (Double_Type xa[], Double_Type ya[], a, b) DESCRIPTION This function computes the integral from `a' to `b' of the cubic spline interpolating function associated with the set of points (`xa', `ya'). See `interp_cspline_periodic' for more information about the interpolating function. SEE ALSO interp_linear_integ, interp_polynomial_integ, interp_cspline_integ, interp_akima_integ, interp_akima_periodic_integ -------------------------------------------------------------- interp_akima_integ SYNOPSIS Compute an integral using an Akima spline USAGE y = interp_akima_integ (Double_Type xa[], Double_Type ya[], a, b) DESCRIPTION This function computes the integral from `a' to `b' of the Akima spline interpolating function associated with the set of points (`xa', `ya'). See `interp_akima' for more information about the interpolating function. SEE ALSO interp_linear_integ, interp_polynomial_integ, interp_cspline_integ, interp_cspline_periodic_integ, interp_akima_periodic_integ -------------------------------------------------------------- interp_akima_periodic_integ SYNOPSIS Compute an integral using an Akima spline USAGE y = interp_akima_periodic_integ (Double_Type xa[], Double_Type ya[], a, b) DESCRIPTION This function computes the integral from `a' to `b' of the Akima spline interpolating function associated with the set of points (`xa', `ya'). See `interp_akima_periodic' for more information about the interpolating function. SEE ALSO interp_linear_integ, interp_polynomial_integ, interp_cspline_integ, interp_cspline_periodic_integ, interp_akima_integ -------------------------------------------------------------- interp_linear_init SYNOPSIS Compute a linear interpolation object USAGE GSL_Interp_Type interp_linear_init (Double_Type_Type xa[], Double_Type_Type ya[]) DESCRIPTION This function computes an interpolation object appropriate for linear interpolation on the specified `xa' and `ya' arrays. SEE ALSO interp_eval, interp_polynomial_init, interp_cspline_init, interp_cspline_periodic_init, interp_akima_init, interp_akima_periodic_init -------------------------------------------------------------- interp_polynomial_init SYNOPSIS Compute a polynomial interpolation object USAGE GSL_Interp_Type interp_polynomial_init (Double_Type xa[], Double_Type ya[]) DESCRIPTION This function computes an interpolation object appropriate for polynomial interpolation on the specified `xa' and `ya' arrays. SEE ALSO interp_eval, interp_linear_init, interp_cspline_init, interp_cspline_periodic_init, interp_akima_init, interp_akima_periodic_init -------------------------------------------------------------- interp_cspline_init SYNOPSIS Compute a cubic spline Interpolation object USAGE GSL_Interp_Type interp_cspline_init (Double_Type xa[], Double_Type ya[]) DESCRIPTION This function computes an interpolation object appropriate for cubic spline interpolation with natural boundary conditions on the specified `xa' and `ya' arrays. SEE ALSO interp_eval, interp_linear_init, interp_polynomial_init, interp_cspline_periodic_init, interp_akima_init, interp_akima_periodic_init -------------------------------------------------------------- interp_cspline_periodic_init SYNOPSIS Compute a cubic spline interpolation object USAGE GSL_Interp_Type interp_cspline_periodic_init (Double_Type xa[], Double_Type ya[]) DESCRIPTION This function computes an interpolation object appropriate for cubic spline interpolation with periodic boundary conditions on the specified `xa' and `ya' arrays. SEE ALSO interp_eval, interp_linear_init, interp_polynomial_init, interp_cspline_init, interp_akima_init, interp_akima_periodic_init -------------------------------------------------------------- interp_akima_init SYNOPSIS Compute an Akima spline interpolation object USAGE GSL_Interp_Type interp_akima_init (Double_Type xa[], Double_Type ya[]) DESCRIPTION This function computes an interpolation object appropriate for Akima spline interpolation with natural boundary conditions on the specified `xa' and `ya' arrays. SEE ALSO interp_eval, interp_linear_init, interp_polynomial_init, interp_cspline_init, interp_cspline_periodic_init, interp_akima_periodic_init -------------------------------------------------------------- interp_akima_periodic_init SYNOPSIS Compute an Akima spline interpolation object USAGE GSL_Interp_Type interp_akima_periodic_init (Double_Type xa[], Double_Type ya[]) DESCRIPTION This function computes an interpolation object appropriate for Akima spline interpolation with periodic boundary conditions on the specified `xa' and `ya' arrays. SEE ALSO interp_eval, interp_linear_init, interp_polynomial_init, interp_cspline_init, interp_cspline_periodic_init, interp_akima_periodic -------------------------------------------------------------- interp_eval SYNOPSIS Evaluate an interpolation object USAGE y = interp_eval (GSL_Interp_Type c, x) DESCRIPTION Use the precomputed interpolation object `c' to interpolate its value at `x', which may be either a scalar or an array. An interpolated value of the corresponding shape will be returned. SEE ALSO interp_linear_init, interp_eval_deriv, interp_eval_deriv2, interp_eval_integ -------------------------------------------------------------- interp_eval_deriv SYNOPSIS Evaluate the derivative of an interpolation object USAGE dydx = interp_eval_deriv (GSL_Interp_Type c, x) DESCRIPTION Use the precomputed interpolation object `c' to interpolate its first derivative at `x', which may be either a scalar or an array. An interpolated value of the corresponding shape will be returned. SEE ALSO interp_linear_init, interp_eval, interp_eval_deriv2, interp_eval_integ -------------------------------------------------------------- interp_eval_deriv2 SYNOPSIS Evaluate the derivative of an interpolation object USAGE d2ydx2 = interp_eval_deriv2 (GSL_Interp_Type c, x) DESCRIPTION Use the precomputed interpolation object `c' to interpolate its second derivative at `x', which may be either a scalar or an array. An interpolated value of the corresponding shape will be returned. SEE ALSO interp_linear_init, interp_eval, interp_eval_deriv, interp_eval_integ -------------------------------------------------------------- interp_eval_integ SYNOPSIS Compute the integral of an interpolation object USAGE integral = interp_eval_integ (GSL_Interp_Type c, a, b) DESCRIPTION Use the precomputed interpolation object `c' to interpolate its integral from `a' to `b'. SEE ALSO interp_linear_init, interp_eval, interp_eval_deriv, interp_eval_deriv2 -------------------------------------------------------------- linalg_LU_decomp SYNOPSIS Factorize a square matrix into its LU decomposition USAGE (LU,p) = linalg_LU_decomp (A [,&signum]) DESCRIPTION This routines returns the LU decomposition of the square matrix `A' such that `P#A == LU'. See the corresponding GSL documentation for how `L' and `U' are stored in `LU', and how the permutation matrix `P' is defined. For many applications, it is unnecessary to unpack the matrix `LU' into its separate components. If the optional argument `&signum' is given, upon return `signum' will be set to the sign of the permutation that relates `P' to the identity matrix. SEE ALSO linalg_LU_det, linalg_LU_invert, linalg_LU_solve -------------------------------------------------------------- linalg_LU_det SYNOPSIS Compute the determinant of a matrix from its LU decomposition USAGE det = linalg_LU_det (LU, signum) DESCRIPTION This function computes the determinant of a matrix from its LU decomposition. In the LU form, determinant is given by the product of the diagonal elements with the sign of the permutation. require ("gslmatrix"); define determinant (A) { variable LU, sig; (LU,) = linalg_LU_decomp (A, &sig); return linalg_LU_det (LU,sig); } SEE ALSO linalg_LU_lndet, linalg_LU_decomp, linalg_LU_invert, linalg_LU_solve -------------------------------------------------------------- linalg_LU_lndet SYNOPSIS Compute the log of a determinant using LU decomposition USAGE det = linalg_LU_lndet (LU) DESCRIPTION This function computes the natural logarithm of the determinant of a matrix from its LU decomposition. In the LU form, determinant is given by the product of the diagonal elements with the sign of the permutation. This function is useful for cases where the product of the diagonal elements would overflow. SEE ALSO linalg_LU_det, linalg_LU_decomp, linalg_LU_solve, linalg_LU_invert -------------------------------------------------------------- linalg_LU_invert SYNOPSIS Compute the inverse of a matrix via its LU decomposition USAGE inv = linalg_LU_invert (LU, p) DESCRIPTION This function may be used to compute the inverse of a matrix from its LU decomposition. For the purposes of inverting a set of linear equations, it is preferable to use the `linalg_LU_solve' function rather than inverting the equations via the inverse. define matrix_inverse (A) { return linalg_LU_invert (linalg_LU_decomp (A)); } SEE ALSO linalg_LU_decomp, linalg_LU_solve, linalg_LU_det -------------------------------------------------------------- linalg_LU_solve SYNOPSIS Solve a set of linear equations using LU decomposition USAGE x = linalg_LU_solve (LU, p, b) DESCRIPTION This function solves the square linear system of equations `A#x=b' for the vector `x' via the LU decomposition of `A'. define solve_equations (A, b) { return linalg_LU_solve (linalg_LU_decomp (A), b); } SEE ALSO linalg_LU_decomp, linalg_LU_det, linalg_LU_invert -------------------------------------------------------------- linalg_QR_decomp SYNOPSIS Factor a matrix into its QR form USAGE (QR, tau) = linalg_QR_decomp(A) DESCRIPTION This function may be used to decompose a rectangular matrix into its so-called QR such that `A=Q#R' where `Q' is a square orthogonal matrix and `R' is a rectangular right-triangular matrix. The factor `R' encoded in the diagonal and upper-triangular elements of the first return value `QR'. The matrix `Q' is encoded in the lower triangular part of `QR' and the vector `tau' via Householder vectors and coefficients. See the corresponding GNU Scientific Library documentation for the details of the encoding. For most uses encoding details are not required. SEE ALSO linalg_QR_solve, -------------------------------------------------------------- linalg_QR_solve SYNOPSIS Solve a system of linear equations using QR decomposition USAGE x = linalg_QR_solve(QR, tau, b [,&residual]) DESCRIPTION This function may be used to solve the linear system `A#x=b' using the `QR' decomposition of `A'. If the optional fourth argument is present (`&residual'), or if `QR' is not a square matrix, then the linear system will be solved in the least-squares sense by minimizing the (Euclidean) norm of `A#x-b'. Upon return, the value of the variable `residual' is set to the the norm of `A#x-b'. NOTES GNU Scientific Library has a separate function called `gsl_linalg_QR_lssolve' for computing this least-squares solution. The `linalg_QR_solve' combines both `gsl_linalg_QR_lssolve' and `gsl_linalg_QR_solve' into a single routine. SEE ALSO linalg_QR_decomp -------------------------------------------------------------- linalg_SV_decomp SYNOPSIS Perform a singular-value decomposition on a matrix USAGE (U,S,V) = linalg_SV_decomp(A) DESCRIPTION This function factors a MxN (M>=N) rectangular matrix `A' into three factors such that `A = U#S#transpose(V)', where `S' is diagonal matrix containing the singular values of `A' and `V' is a square orthogonal matrix. Since `S' is diagonal, it is returned as a 1-d array. SEE ALSO linalg_SV_solve -------------------------------------------------------------- linalg_SV_solve SYNOPSIS Solve a linear system using Singular-Value Decomposition USAGE x = linalg_SV_solve (U,V,S,b) DESCRIPTION This function ``solves'' the linear system `A#x=b' using the SVD form of `A'. EXAMPLE define svd_solve (A, b) { variable U, V, S; (U,V,S) = linalg_SV_decomp (A); return linalg_SV_solve (U,V,S,b); } SEE ALSO linalg_SV_decomp, linalg_QR_solve, linalg_LU_solve -------------------------------------------------------------- eigen_symmv SYNOPSIS Compute the eigenvalues and eigenvectors of a Hermitian matrix USAGE (eigvecs, eigvals)=eigen_symmv(A) DESCRIPTION This function computes the eigenvalues and eigenvectors of a Hermitian (or real-symmetric) square matrix `A'. The eigenvalues are returned sorted on their absolute value (or norm) in descending order. SEE ALSO eigen_nonsymmv -------------------------------------------------------------- eigen_nonsymmv SYNOPSIS Compute the eigenvalues and eigenvectors of a matrix USAGE (eigvecs, eigvals)=eigen_nonsymmv(A) DESCRIPTION This function returns the eigenvalues and eigenvectors of a real non-symmetric matrix `A'. As such quantities are in general complex, complex-valued arrays will be returned. The eigenvalues are returned in descending order sorted upon norm. SEE ALSO eigen_symmv -------------------------------------------------------------- wavelet_transform SYNOPSIS Perform an N-d Discrete Wavelet Transform USAGE w = wavelet_transform (x, dir) DESCRIPTION This routine computes the DWT of an array `x' and returns the result. The optional `dir' parameter specifies the direction of the transform. A forward transform will be produced for positive values of `dir' (default value) and a reverse transform will be computed for negative values. Array dimension(s) must be an integer power of two. The result will be an array of the same size and dimensionality as the the input array. The following qualifiers may be used : type = DWT_HAAR|DWT_DAUBECHIES|DWT_BSPLINE k = value Selects the specific member of the wavelet family. centered The centered forms of the wavelets align the coefficients of the various sub-bands on edges. nsf Choose the "non-standard" forms ordering of the rows and columns in the two-dimensional wavelet transform. The following wavelet types are implemented : Daubechies (k = 4, 6, ..., 20, with k even), Haar (k = 2), bsplines (k = 100*i + j are 103, 105, 202, 204, 206, 208, 301, 303, 305 307, 309). -------------------------------------------------------------- integration_qng SYNOPSIS non-adaptive Gauss-Kronrod integration USAGE res = integration_qng (&func, [optargs-list,] a, b, epsabs, relabs DESCRIPTION This function wraps the `gsl_integration_qng' function. See the GSL documentation for more information. -------------------------------------------------------------- integration_qag SYNOPSIS Adaptive integration USAGE res = integration_qag (&func, [optargs_list,] a, b, epsabs, relabs, limit, key) DESCRIPTION This function wraps the `gsl_integration_qag' function. The paramter `key' must be set to one of the following symbolic constants: GSL_INTEG_GAUSS15 GSL_INTEG_GAUSS21 GSL_INTEG_GAUSS31 GSL_INTEG_GAUSS41 GSL_INTEG_GAUSS51 GSL_INTEG_GAUSS61 See the GSL documentation for more information. -------------------------------------------------------------- integration_qags SYNOPSIS Adaptive integration with singularities USAGE res = integration_qags (&func, [optargs_list,] a, b, epsabs, relabs, limit) DESCRIPTION This function wraps the `gsl_integration_qags' function. See the GSL documentation for more information. -------------------------------------------------------------- integration_qagp SYNOPSIS Adaptive integration with known singular points USAGE res = integration_qagp (&func, [optargs_list,] pts, epsabs, epsrel, limit) DESCRIPTION This function wraps the `gsl_integration_qagp' function. Here, `pts' is an array of ordered values `[a, x1, x2, ..., xn, b]' that contain the end-points and the locations `x1, ..., xn' of singularities. See the GSL documentation for more information. -------------------------------------------------------------- integration_qagi SYNOPSIS Adaptive integration on infinite intervals USAGE res = integration_qagi (&func, [optargs_list,] epsabs, epsrel, limit) DESCRIPTION This function wraps the `gsl_integration_qagi' function. See the GSL documentation for more information. -------------------------------------------------------------- integration_qagiu SYNOPSIS Adaptive integration on semi-infinite intervals USAGE res = integration_qagiu (&func, [optargs_list,] a, epsabs, epsrel, limit) DESCRIPTION This function wraps the `gsl_integration_qagiu' function. See the GSL documentation for more information. -------------------------------------------------------------- integration_qagil SYNOPSIS Adaptive integration on semi-infinite intervals USAGE res = integration_qagil (&func, [optargs_list,] b, epsabs, epsrel, limit) DESCRIPTION This function wraps the `gsl_integration_qagil' function. See the GSL documentation for more information. -------------------------------------------------------------- integration_qawc SYNOPSIS Adaptive integration for Cauchy principal values USAGE res = integration_qawc (&func, [optargs_list,] a, b, c, epsabs, epsrel, limit) DESCRIPTION This function wraps the `gsl_integration_qawc' function. See the GSL documentation for more information. #% SEE ALSO -------------------------------------------------------------- integration_cquad SYNOPSIS Doubly-adaptive integration USAGE res = integration_cquad (&func, [optargs_list,] a, b, epsabs, epsrel, limit) DESCRIPTION This function wraps the `gsl_integration_cquad' function. See the GSL documentation for more information. #% SEE ALSO -------------------------------------------------------------- integration_romberg SYNOPSIS Romberg integration USAGE res = integration_romberg (&func, [optargs_list,] a, b, epsabs, epsrel, limit) DESCRIPTION This function wraps the `gsl_integration_romberg' function. See the GSL documentation for more information. #% SEE ALSO -------------------------------------------------------------- integration_fixed_alloc SYNOPSIS Create a workspace for the integration_fixed function USAGE fixedobj = integration_fixed_alloc (typestr, n, a, b, alpha, beta) DESCRIPTION This function wraps the `gsl_integration_fixed_alloc' function. It return a workspace that is to be passed to the `integration_fixed' function. The `typestr' parameter is used to specify the weighting functions using by the integrator. It must be one of the following: #v+ "legendre", "chebyshev", "gegenbauer", "jacobi", "laguerre", "hermite", "exponential", "rational", "chebyshev2" #v- See the GSL documentation for more information. #% SEE ALSO -------------------------------------------------------------- integration_fixed SYNOPSIS Fixed point quadrature integration USAGE res = integration_fixed (&func, [optargs_list,] fixedobj) DESCRIPTION This function wraps the `gsl_integration_fixed' function. Here, `fixedobj' is the workspace returned by the `integration_fixed_alloc' function. See the GSL documentation for more information. #% SEE ALSO -------------------------------------------------------------- integration_glfixed_alloc SYNOPSIS Create a table of precomputed values for the integration_fixed function USAGE glfixed_table = integration_glfixed_alloc (n) DESCRIPTION This function wraps the `gsl_integration_glfixed_table_alloc' function. It returns a table of values that is to be passed to the `integration_glfixed' function to perform an n-point fixed order integration. See the GSL documentation for more information. #% SEE ALSO -------------------------------------------------------------- integration_glfixed SYNOPSIS Gauss-Legendre integration USAGE res = integration_glfixed (&func, [optargs_list,] a, b, glfixed_table) DESCRIPTION This function wraps the `gsl_integration_glfixed' function. The `glfixed_table' represents the precomputed values returned by the `integration_glfixed_alloc' function. See the GSL documentation for more information. #% SEE ALSO -------------------------------------------------------------- integration_qaws_alloc SYNOPSIS Create a table of precomputed values for the integration_qaws function USAGE qaws_table = integration_qaws_alloc (alpha, beta, mu, nu) DESCRIPTION This function wraps the `gsl_integration_qaws_table_alloc' function. It returns a precomputed table of values that is to be passed to the `integration_qaws' function. See the GSL documentation for more information. #% SEE ALSO -------------------------------------------------------------- integration_qaws SYNOPSIS Adaptive integration for singular functions USAGE res = integration_qaws (&func, [optargs_list,] a, b, epsabs, epsrel, limit, qaws_table) DESCRIPTION This function wraps the `gsl_integration_qaws' function. Here, `qaws_table' represents the pre-computed values returned by the `integration_qaws_alloc' function. See the GSL documentation for more information. #% SEE ALSO -------------------------------------------------------------- integration_qawo_alloc SYNOPSIS Create a table of precomputed values for the integration_qawo function USAGE res = integration_qawo_alloc (omega, L, type, n) DESCRIPTION This function wraps the `gsl_integration_qawo_table_alloc' function. It returns a precomputed table of Chebyshev moments that is to be passed to the `integration_qawo' function. Here, `type' must be one of the symbolic constants `GSL_INTEG_COSINE' or `GSL_INTEG_SINE'. See the GSL documentation for more information. #% SEE ALSO -------------------------------------------------------------- integration_qawo SYNOPSIS Adaptive integration for oscillatory functions USAGE res = integration_qawo (&func, [optargs_list,] a, epsabs, epsrel, limit, qawo_table) DESCRIPTION This function wraps the `gsl_integration_qawo' function. Here, `qawo_table' is to be precomputed using the `integration_qawo_alloc' function. See the GSL documentation for more information. #% SEE ALSO -------------------------------------------------------------- integration_qawf SYNOPSIS Adaptive integration for Fourier integrals USAGE res = integration_qawf (&func, [optargs_list, a, epsabs, limit, qawo_table] ) DESCRIPTION This function wraps the `gsl_integration_qawf' function. Here, `qawo_table' is to be precomputed using the `integration_qawo_alloc' function. See the GSL documentation for more information. #% SEE ALSO -------------------------------------------------------------- slgsl-pre0.10.0-7/doc/text/0002755000175000000620000000000014540776552014157 5ustar johnstaffslgsl-pre0.10.0-7/doc/text/slgsl.txt0000644000175000000620000042743314540776552016057 0ustar johnstaff S-Lang GSL Module Reference John E. Davis, jed@jedsoft.org Jan 19, 2021 ____________________________________________________________ 1. Introduction to GSL The GNU Scientific Library (GSL ) is a vast collection of robust and well documented numerical functions. It includes support for many special functions, random numbers, interpolation and integration routines, and much more. For more information about GSL, visit . Many of the routines in the GSL may be made available to the S-lang interpreter via the GSL modules described by this document, whose most recent version may be found at . At the moment, the following GSL modules are available: o gslsf: The GSL special function module. Currently, this module provides an interface to nearly 200 GSL special functions. o gslconst: The GSL constants module. This module defines many constants such as CONST_MKSA_SPEED_OF_LIGHT, CONST_CGSM_BOLTZMANN, etc. o gslinterp: The GSL interpolation module, which includes routines for linear interpolation, cubic splines, etc. o gslrand: The GSL random number module. This module supports most of GSL's random number generators and distributions. o gslcdf The GSL cumulative distribution function module. o gslfft The GSL fast-fourier transform module. o gslmatrix A set of GSL routines that deal with matrices. These include eigenvalue, eigenvector, and a number of other linear algebra functions. o gsldwt The GSL Discrete Wavelet Transform module o gslinteg The GSL numerical integration module There are many functions that are not yet wrapped. For example, none of GSL's ODE functions have been wrapped. Future releases of the GSL module will include more functionality. Nevertheless, what has been implemented should prove useful. 2. Using the GSL Modules To use one of the GSL modules in a S-lang script, the module must first be loaded using the require function. For example, to load the GSL special function module, use require ("gslsf"); The gsl.sl file exists as a convenient way to load all GSL modules (gslsf, gslrand, etc.), e.g., require ("gsl"); Finally, it may be desirable to import the GSL module into a separate namespace. For example, to load the GSL special function module gslsf into a namespace called GSL, use require ("gsl", "G") Then to access, e.g., the hypot function, use the GSL->hypot. See the S-Lang documentation for more information about name- spaces. Once the desired module has been loaded, intrinsics functions and variables defined by the module may be used in the usual way, e.g., require ("gslsf"); . . % Use the GSL hypot function to filter a list of (x,y) pairs % to those values that fall in a circle of radius R centered % on (0,0) define filter_region_in_circle (x, y, R) { variable i = where (hypot (x,y) < R); return (x[i], y[i]); } 3. Error Handling This section describes how the GSL modules handle errors reported by the GSL library. The following GSL error codes are defined by the gsl module: GSL_EDOM input domain error, e.g sqrt(-1) GSL_ERANGE output range error, e.g. exp(1e100) GSL_EFAULT invalid pointer GSL_EINVAL invalid argument supplied by user GSL_EFAILED generic failure GSL_EFACTOR factorization failed GSL_ESANITY sanity check failed - shouldn't happen GSL_ENOMEM malloc failed GSL_EBADFUNC problem with user-supplied function GSL_ERUNAWAY iterative process is out of control GSL_EMAXITER exceeded max number of iterations GSL_EZERODIV tried to divide by zero GSL_EBADTOL user specified an invalid tolerance GSL_ETOL failed to reach the specified tolerance GSL_EUNDRFLW underflow GSL_EOVRFLW overflow GSL_ELOSS loss of accuracy GSL_EROUND failed because of roundoff error GSL_EBADLEN matrix, vector lengths are not conformant GSL_ENOTSQR matrix not square GSL_ESING apparent singularity detected GSL_EDIVERGE integral or series is divergent GSL_EUNSUP requested feature is not supported by the hardware GSL_EUNIMPL requested feature not (yet) implemented GSL_ECACHE cache limit exceeded GSL_ETABLE table limit exceeded GSL_ENOPROG iteration is not making progress towards solution GSL_ENOPROGJ jacobian evaluations are not improving the solution GSL_ETOLF cannot reach the specified tolerance in F GSL_ETOLX cannot reach the specified tolerance in X GSL_ETOLG cannot reach the specified tolerance in gradient GSL_EOF end of file The gsl_set_error_disposition function may be used to indicate how the module is to handle a specified error. It takes two arguments: an error code and a value controlling how the error is to be handled: gsl_set_error_disposition (error_code, control_value) If the control value is 0, the error will be ignored by the module. If the control value is 1, the module will print a warning message when the specified error is encountered. If the control value is -1, the module will generate an exception when the error is encountered. For example, gsl_set_error_disposition (GSL_EDOM, -1); will cause domain errors to generate an exception, whereas gsl_set_error_disposition (GSL_EUNDRFLW, 0); will cause the GSL modules to ignore underflow errors. Alternatively, the control value may be the reference to a function to be called when the specified error occurs. The function will be passed two arguments: a string whose value is the function name generating the error and the error code itself, e.g., static define edom_callback (fname, err_code) { vmessage ("%s: domain error.", fname); } gsl_set_error_disposition (GSL_EDOM, &edom_callback); y = log_1plusx (-10); will result in the message "log_1plusx: domain error.". By default, all errors will generate exceptions except for the following, which will generate warnings: GSL_EDOM GSL_ERANGE GSL_EUNDRFLW GSL_EOVRFLW 4. gslinterp: The GSL Interpolation Module The gslinterp module provides S-Lang interpreter access to GSL's interpolations routines. The interpolation methods include linear, polynomial, and spline interpolation. Both Cubic and Akima splines are supported with normal or periodic boundary conditions. In addition, routines for computing first and second order derivatives, as well as integrals based upon these interpolation methods are included. The wrapping of these functions differs somewhat from the interface provided by the GSL API in the interest of ease of use. The gslinterp modules actual defines two interfaces to the underlying GSL routines. The higher-level interface is the simplest to use and should suffice for most applications. As an example of its use, suppose one has a set of (x,y) pairs represented by the arrays xa and ya that one wants to use for interpolation. Then y = interp_cspline (x, xa, ya); will fit a cubic spline to the points and return the of the spline at the point x. If x is an array, then the spline will be evaluated at each of the points in the array returning an array of the same shape. The low-level interface consists of several method-specific initialization functions and functions that carry out the actual interpolation. The above example may be written in terms of this interface as c = interp_cspline_init (xa, ya); y = interp_eval (c, x); Here interp_cspline_init returns an object of type GSL_Interp_Type that represents the spline function. It is then passed to the in- terp_eval function to evaluate the spline at x. The advantage of the lower level interface is that it moves the overhead associated with the computation of the interpolating function (the spline in the above example) out of the function that performs the interpolation. This means that code such as c = interp_cspline_init (xa, ya); y0 = interp_eval (c, x0); y1 = interp_eval (c, x1); will execute in less time than y0 = interp_cspline (x0, xa, ya); y1 = interp_cspline (x1, xa, ya); 4.1. Interpolation Routines 4.1.1. interp_linear Synopsis Linear Interpolation Usage y = interp_linear (x, Double_Type xa[], Double_Type ya[]) Description Use linear interpolation to determine the value at x given the points (xa, ya). The first argument, x, may be either a scalar or an array, and a result of the corresponding type will be returned. See Also ``interp_polynomial'', ``interp_cspline'', ``interp_cspline_periodic'', ``interp_akima'', ``interp_akima_periodic'' 4.1.2. interp_polynomial Synopsis Polynomial Interpolation Usage y = interp_polynomial (x, Double_Type xa[], Double_Type ya[]) Description Use polynomial interpolation to determine the value at x given the points (xa, ya). The first argument, x, may be either a scalar or an array, and a result of the corresponding type will be returned. The degree of the interpolating polynomial is given by one less than the number of points in the xa array. For example, if length(xa) is 3, then a quadratic polynomial will be used. See Also ``interp_linear'', ``interp_cspline'', ``interp_cspline_periodic'', ``interp_akima'', ``interp_akima_periodic'' 4.1.3. interp_cspline Synopsis Cubic Spline Interpolation Usage y = interp_cspline (x, Double_Type xa[], Double_Type ya[]) Description Use cubic spline interpolation with natural boundary conditions to determine the value at x given the points (xa, ya). The first argument, x, may be either a scalar or an array, and a result of the corresponding type will be returned. See Also ``interp_linear'', ``interp_polynomial'', ``interp_cspline_periodic'', ``interp_akima'', ``interp_akima_periodic'' 4.1.4. interp_cspline_periodic Synopsis Cubic spline interpolation with periodic boundary conditions Usage y = interp_cspline_periodic (x, Double_Type xa[], Double_Type ya[]) Description Use cubic spline interpolation with periodic boundary conditions to determine the value at x given the points (xa, ya). The first argument, x, may be either a scalar or an array, and a result of the corresponding type will be returned. See Also ``interp_linear'', ``interp_polynomial'', ``interp_cspline'', ``interp_akima'', ``interp_akima_periodic'' 4.1.5. interp_akima Synopsis Akima spline interpolation Usage y = interp_akima (x, Double_Type xa[], Double_Type ya[]) Description Use an Akima spline with natural boundary conditions to determine the value at x given the points (xa, ya). The first argument, x, may be either a scalar or an array, and a result of the corresponding type will be returned. See Also ``interp_linear'', ``interp_polynomial'', ``interp_cspline'', ``interp_cspline_periodic'', ``interp_akima_periodic'' 4.1.6. interp_akima_periodic Synopsis Akima spline interpolation with periodic boundary conditions Usage y = interp_akima_periodic (x, Double_Type xa[], Double_Type ya[]) Description Use an Akima spline with periodic boundary conditions to determine the value at x given the points (xa, ya). The first argument, x, may be either a scalar or an array, and a result of the corresponding type will be returned. See Also ``interp_linear'', ``interp_polynomial'', ``interp_cspline'', ``interp_cspline_periodic'', ``interp_akima'' 4.2. First Derivative via Interpolation 4.2.1. interp_linear_deriv Synopsis Compute derivative using linear interpolation Usage y = interp_linear_deriv (x, Double_Type xa[], Double_Type ya[]) Description Use linear interpolation to determine the value of the first derivative at x given the points (xa, ya). The first argument, x, may be either a scalar or an array, and a result of the corresponding type will be returned. See Also ``interp_polynomial_deriv'', ``interp_cspline_deriv'', ``interp_cspline_periodic_deriv'', ``interp_akima_deriv'', ``interp_akima_periodic_deriv'' 4.2.2. interp_polynomial_deriv Synopsis Compute derivative using polynomial interpolation Usage y = interp_polynomial_deriv (x, Double_Type xa[], Double_Type ya[]) Description Use polynomial interpolation to determine the value of the first derivative at x given the points (xa, ya). The first argument, x, may be either a scalar or an array, and a result of the corresponding type will be returned. The degree of the interpolating polynomial is given by one less than the number of points in the xa array. For example, if length(xa) is 3, then a quadratic polynomial will be used. See Also ``interp_linear_deriv'', ``interp_cspline_deriv'', ``interp_cspline_periodic_deriv'', ``interp_akima_deriv'', ``interp_akima_periodic_deriv'' 4.2.3. interp_cspline_deriv Synopsis Compute derivative using a cubic spline Usage y = interp_cspline_deriv (x, Double_Type xa[], Double_Type ya[]) Description Use cubic spline interpolation with natural boundary conditions to determine the value of the first derivative at x given the points (xa, ya). The first argument, x, may be either a scalar or an array, and a result of the corresponding type will be returned. See Also ``interp_linear_deriv'', ``interp_polynomial_deriv'', ``interp_cspline_periodic_deriv'', ``interp_akima_deriv'', ``interp_akima_periodic_deriv'' 4.2.4. interp_cspline_periodic_deriv Synopsis Compute derivative using a cubic spline Usage y = interp_cspline_periodic_deriv (x, Double_Type xa[], Double_Type ya[]) Description Use cubic spline interpolation with periodic boundary conditions to determine the value of the first derivative at x given the points (xa, ya). The first argument, x, may be either a scalar or an array, and a result of the corresponding type will be returned. See Also ``interp_linear_deriv'', ``interp_polynomial_deriv'', ``interp_cspline_deriv'', ``interp_akima_deriv'', ``interp_akima_periodic_deriv'' 4.2.5. interp_akima_deriv Synopsis Compute derivative using an Akima spline Usage y = interp_akima_deriv (x, Double_Type xa[], Double_Type ya[]) Description Use Akima spline interpolation with natural boundary conditions to determine the value of the first derivative at x given the points (xa, ya). The first argument, x, may be either a scalar or an array, and a result of the corresponding type will be returned. See Also ``interp_linear_deriv'', ``interp_polynomial_deriv'', ``interp_cspline_deriv'', ``interp_cspline_periodic_deriv'', ``interp_akima_periodic_deriv'' 4.2.6. interp_akima_periodic_deriv Synopsis Compute derivative using an Akima spline Usage y = interp_cspline_deriv (x, Double_Type xa[], Double_Type ya[]) Description Use Akima spline interpolation with periodic boundary conditions to determine the value of the first derivative at x given the points (xa, ya). The first argument, x, may be either a scalar or an array, and a result of the corresponding type will be returned. See Also ``interp_linear_deriv'', ``interp_polynomial_deriv'', ``interp_cspline_deriv'', ``interp_cspline_periodic_deriv'', ``interp_akima_deriv'' 4.3. Second Derivative via Interpolation 4.3.1. interp_linear_deriv2 Synopsis Compute second derivative using linear interpolation Usage y = interp_linear_deriv2 (x, Double_Type xa[], Double_Type ya[]) Description Use linear interpolation to determine the value of the second derivative at x given the points (xa, ya). The first argument, x, may be either a scalar or an array, and a result of the corresponding type will be returned. See Also ``interp_polynomial_deriv2'', ``interp_cspline_deriv2'', ``interp_cspline_periodic_deriv2'', ``interp_akima_deriv2'', ``interp_akima_periodic_deriv2'' 4.3.2. interp_polynomial_deriv2 Synopsis Compute second derivative using polynomial interpolation Usage y = interp_polynomial_deriv2 (x, Double_Type xa[], Double_Type ya[]) Description Use polynomial interpolation to determine the value of the second derivative at x given the points (xa, ya). The first argument, x, may be either a scalar or an array, and a result of the corresponding type will be returned. The degree of the interpolating polynomial is given by one less than the number of points in the xa array. For example, if length(xa) is 3, then a quadratic polynomial will be used. See Also ``interp_linear_deriv2'', ``interp_cspline_deriv2'', ``interp_cspline_periodic_deriv2'', ``interp_akima_deriv2'', ``interp_akima_periodic_deriv2'' 4.3.3. interp_cspline_deriv2 Synopsis Compute second derivative using a cubic spline Usage y = interp_cspline_deriv2 (x, Double_Type xa[], Double_Type ya[]) Description Use cubic spline interpolation with natural boundary conditions to determine the value of the second derivative at x given the points (xa, ya). The first argument, x, may be either a scalar or an array, and a result of the corresponding type will be returned. See Also ``interp_linear_deriv2'', ``interp_polynomial_deriv2'', ``interp_cspline_periodic_deriv2'', ``interp_akima_deriv2'', ``interp_akima_periodic_deriv2'' 4.3.4. interp_cspline_periodic_deriv2 Synopsis Compute second derivative using a cubic spline Usage y = interp_cspline_periodic_deriv2 (x, Double_Type xa[], Double_Type ya[]) Description Use cubic spline interpolation with periodic boundary conditions to determine the value of the second derivative at x given the points (xa, ya). The first argument, x, may be either a scalar or an array, and a result of the corresponding type will be returned. See Also ``interp_linear_deriv2'', ``interp_polynomial_deriv2'', ``interp_cspline_deriv2'', ``interp_akima_deriv2'', ``interp_akima_periodic_deriv2'' 4.3.5. interp_akima_deriv2 Synopsis Compute second derivative using an Akima spline Usage y = interp_akima_deriv2 (x, Double_Type xa[], Double_Type ya[]) Description Use Akima spline interpolation with natural boundary conditions to determine the value of the second derivative at x given the points (xa, ya). The first argument, x, may be either a scalar or an array, and a result of the corresponding type will be returned. See Also ``interp_linear_deriv2'', ``interp_polynomial_deriv2'', ``interp_cspline_deriv2'', ``interp_cspline_periodic_deriv2'', ``interp_akima_periodic_deriv2'' 4.3.6. interp_akima_periodic_deriv2 Synopsis Compute second derivative using an Akima spline Usage y = interp_cspline_deriv2 (x, Double_Type xa[], Double_Type ya[]) Description Use Akima spline interpolation with periodic boundary conditions to determine the value of the second derivative at x given the points (xa, ya). The first argument, x, may be either a scalar or an array, and a result of the corresponding type will be returned. See Also ``interp_linear_deriv2'', ``interp_polynomial_deriv2'', ``interp_cspline_deriv2'', ``interp_cspline_periodic_deriv2'', ``interp_akima_deriv2'', ``interp_akima_periodic_deriv2'' 4.4. Integration via Interpolation 4.4.1. interp_linear_integ Synopsis Compute an integral using linear interpolation Usage y = interp_linear_integ (Double_Type xa[], Double_Type ya[], a, b) Description This function computes the integral from a to b of the linear interpolating function associated with the set of points (xa, ya). See interp_linear for more information about the interpolating function. See Also ``interp_polynomial_integ'', ``interp_cspline_integ'', ``interp_cspline_periodic_integ'', ``interp_akima_integ'', ``interp_akima_periodic_integ'' 4.4.2. interp_polynomial_integ Synopsis Compute an integral using polynomial interpolation Usage y = interp_polynomial_integ (Double_Type xa[], Double_Type ya[], a, b) Description This function computes the integral from a to b of the polynomial interpolating function associated with the set of points (xa, ya). See interp_polynomial for more information about the interpolating function. See Also ``interp_linear_integ'', ``interp_cspline_integ'', ``interp_cspline_periodic_integ'', ``interp_akima_integ'', ``interp_akima_periodic_integ'' 4.4.3. interp_cspline_integ Synopsis Compute an integral using a cubic spline Usage y = interp_cspline_integ (Double_Type xa[], Double_Type ya[], a, b) Description This function computes the integral from a to b of the cubic spline interpolating function associated with the set of points (xa, ya). See interp_cspline for more information about the interpolating function. See Also ``interp_linear_integ'', ``interp_polynomial_integ'', ``interp_cspline_periodic_integ'', ``interp_akima_integ'', ``interp_akima_periodic_integ'' 4.4.4. interp_cspline_periodic_integ Synopsis Compute an integral using a cubic spline Usage y = interp_cspline_periodic_integ (Double_Type xa[], Double_Type ya[], a, b) Description This function computes the integral from a to b of the cubic spline interpolating function associated with the set of points (xa, ya). See interp_cspline_periodic for more information about the interpolating function. See Also ``interp_linear_integ'', ``interp_polynomial_integ'', ``interp_cspline_integ'', ``interp_akima_integ'', ``interp_akima_periodic_integ'' 4.4.5. interp_akima_integ Synopsis Compute an integral using an Akima spline Usage y = interp_akima_integ (Double_Type xa[], Double_Type ya[], a, b) Description This function computes the integral from a to b of the Akima spline interpolating function associated with the set of points (xa, ya). See interp_akima for more information about the interpolating function. See Also ``interp_linear_integ'', ``interp_polynomial_integ'', ``interp_cspline_integ'', ``interp_cspline_periodic_integ'', ``interp_akima_periodic_integ'' 4.4.6. interp_akima_periodic_integ Synopsis Compute an integral using an Akima spline Usage y = interp_akima_periodic_integ (Double_Type xa[], Double_Type ya[], a, b) Description This function computes the integral from a to b of the Akima spline interpolating function associated with the set of points (xa, ya). See interp_akima_periodic for more information about the interpolating function. See Also ``interp_linear_integ'', ``interp_polynomial_integ'', ``interp_cspline_integ'', ``interp_cspline_periodic_integ'', ``interp_akima_integ'' 4.5. Low-level Interpolation Routines 4.5.1. interp_linear_init Synopsis Compute a linear interpolation object Usage GSL_Interp_Type interp_linear_init (Double_Type_Type xa[], Double_Type_Type ya[]) Description This function computes an interpolation object appropriate for linear interpolation on the specified xa and ya arrays. See Also ``interp_eval'', ``interp_polynomial_init'', ``interp_cspline_init'', ``interp_cspline_periodic_init'', ``interp_akima_init'', ``interp_akima_periodic_init'' 4.5.2. interp_polynomial_init Synopsis Compute a polynomial interpolation object Usage GSL_Interp_Type interp_polynomial_init (Double_Type xa[], Double_Type ya[]) Description This function computes an interpolation object appropriate for polynomial interpolation on the specified xa and ya arrays. See Also ``interp_eval'', ``interp_linear_init'', ``interp_cspline_init'', ``interp_cspline_periodic_init'', ``interp_akima_init'', ``interp_akima_periodic_init'' 4.5.3. interp_cspline_init Synopsis Compute a cubic spline Interpolation object Usage GSL_Interp_Type interp_cspline_init (Double_Type xa[], Double_Type ya[]) Description This function computes an interpolation object appropriate for cubic spline interpolation with natural boundary conditions on the specified xa and ya arrays. See Also ``interp_eval'', ``interp_linear_init'', ``interp_polynomial_init'', ``interp_cspline_periodic_init'', ``interp_akima_init'', ``interp_akima_periodic_init'' 4.5.4. interp_cspline_periodic_init Synopsis Compute a cubic spline interpolation object Usage GSL_Interp_Type interp_cspline_periodic_init (Double_Type xa[], Double_Type ya[]) Description This function computes an interpolation object appropriate for cubic spline interpolation with periodic boundary conditions on the specified xa and ya arrays. See Also ``interp_eval'', ``interp_linear_init'', ``interp_polynomial_init'', ``interp_cspline_init'', ``interp_akima_init'', ``interp_akima_periodic_init'' 4.5.5. interp_akima_init Synopsis Compute an Akima spline interpolation object Usage GSL_Interp_Type interp_akima_init (Double_Type xa[], Double_Type ya[]) Description This function computes an interpolation object appropriate for Akima spline interpolation with natural boundary conditions on the specified xa and ya arrays. See Also ``interp_eval'', ``interp_linear_init'', ``interp_polynomial_init'', ``interp_cspline_init'', ``interp_cspline_periodic_init'', ``interp_akima_periodic_init'' 4.5.6. interp_akima_periodic_init Synopsis Compute an Akima spline interpolation object Usage GSL_Interp_Type interp_akima_periodic_init (Double_Type xa[], Double_Type ya[]) Description This function computes an interpolation object appropriate for Akima spline interpolation with periodic boundary conditions on the specified xa and ya arrays. See Also ``interp_eval'', ``interp_linear_init'', ``interp_polynomial_init'', ``interp_cspline_init'', ``interp_cspline_periodic_init'', ``interp_akima_periodic'' 4.5.7. interp_eval Synopsis Evaluate an interpolation object Usage y = interp_eval (GSL_Interp_Type c, x) Description Use the precomputed interpolation object c to interpolate its value at x, which may be either a scalar or an array. An interpolated value of the corresponding shape will be returned. See Also ``interp_linear_init'', ``interp_eval_deriv'', ``interp_eval_deriv2'', ``interp_eval_integ'' 4.5.8. interp_eval_deriv Synopsis Evaluate the derivative of an interpolation object Usage dydx = interp_eval_deriv (GSL_Interp_Type c, x) Description Use the precomputed interpolation object c to interpolate its first derivative at x, which may be either a scalar or an array. An interpolated value of the corresponding shape will be returned. See Also ``interp_linear_init'', ``interp_eval'', ``interp_eval_deriv2'', ``interp_eval_integ'' 4.5.9. interp_eval_deriv2 Synopsis Evaluate the derivative of an interpolation object Usage d2ydx2 = interp_eval_deriv2 (GSL_Interp_Type c, x) Description Use the precomputed interpolation object c to interpolate its second derivative at x, which may be either a scalar or an array. An interpolated value of the corresponding shape will be returned. See Also ``interp_linear_init'', ``interp_eval'', ``interp_eval_deriv'', ``interp_eval_integ'' 4.5.10. interp_eval_integ Synopsis Compute the integral of an interpolation object Usage integral = interp_eval_integ (GSL_Interp_Type c, a, b) Description Use the precomputed interpolation object c to interpolate its integral from a to b. See Also ``interp_linear_init'', ``interp_eval'', ``interp_eval_deriv'', ``interp_eval_deriv2'' 5. gslsf: The GSL Special Functions Module The special function module, gslsf, wraps nearly 200 GSL special functions. Since the special functions are described in detail in the documentation for the GSL library , no attempt will be made here to duplicate the main documentation. Rather, a description of how the special functions have been wrapped by the module is given. GSL prefixes the special functions with the string gsl_sf_. This prefix is omitted from the corresponding intrinsic functions of the gslsf module. For example, the GSL function that computes spherical harmonics is called gsl_sf_legendre_sphPlm. However, it is represented in the module by simply legendre_sphPlm. Most of GSL's special functions take scalar arguments and returns a scalar. For example, gsl_sf_legendre_sphPlm takes three arguments (int, int, and a double) and returns a double, e.g., int l = 5, m = 0; double x = 0.5; double y = gsl_sf_legendre_sphPlm (l, m, x); While the module supports the scalar usage, e.g, variable l = 5, m = 0, x = 0.5; variable y = legendre_sphPlm (l, m, x); it also supports vector arguments, e.g., variable l = 5, m = 0, x = [-1:1:0.1]; variable y = legendre_sphPlm (l, m, x); and variable l = 5, m = [0:l], x = 0.5; variable y = legendre_sphPlm (l, m, x); Some of the functions are expensive to compute to full double precision accuracy. In the interest of speed, it may want to perform perform the computation with less precision. Hence, several of the special functions take an optional mode argument that specifies the desired precision: GSL_PREC_DOUBLE for double precision accuracy, GSL_PREC_SINGLE for single precision accuracy, and GSL_PREC_APPROX for a relative accuracy of 5e-4. For example, to compute the Airy function to double precision accuracy use: y = airy_Ai (x, GSL_PREC_DOUBLE); If called without the mode argument, i.e., y = airy_Ai (x); the function will be computed to a default precision of GSL_PREC_SIN- GLE. The default precision can be set and queried by the gslsf_set_precision and gslsf_get_precision functions, resp. Functions that do not take the optional mode argument will always be computed at full precision. 5.1. Airy Functions 5.1.1. airy_Ai Synopsis S-Lang version of gsl_sf_airy_Ai Usage Double_Type[] airy_Ai (Double_Type[] x [,Int_Type mode]) 5.1.2. airy_Ai_deriv Synopsis S-Lang version of gsl_sf_airy_Ai_deriv Usage Double_Type[] airy_Ai_deriv (Double_Type[] x [,Int_Type mode]) 5.1.3. airy_Ai_deriv_scaled Synopsis S-Lang version of gsl_sf_airy_Ai_deriv_scaled Usage Double_Type[] airy_Ai_deriv_scaled (Double_Type[] x [,Int_Type mode]) 5.1.4. airy_Ai_scaled Synopsis S-Lang version of gsl_sf_airy_Ai_scaled Usage Double_Type[] airy_Ai_scaled (Double_Type[] x [,Int_Type mode]) 5.1.5. airy_Bi Synopsis S-Lang version of gsl_sf_airy_Bi Usage Double_Type[] airy_Bi (Double_Type[] x [,Int_Type mode]) 5.1.6. airy_Bi_deriv Synopsis S-Lang version of gsl_sf_airy_Bi_deriv Usage Double_Type[] airy_Bi_deriv (Double_Type[] x [,Int_Type mode]) 5.1.7. airy_Bi_deriv_scaled Synopsis S-Lang version of gsl_sf_airy_Bi_deriv_scaled Usage Double_Type[] airy_Bi_deriv_scaled (Double_Type[] x [,Int_Type mode]) 5.1.8. airy_Bi_scaled Synopsis S-Lang version of gsl_sf_airy_Bi_scaled Usage Double_Type[] airy_Bi_scaled (Double_Type[] x [,Int_Type mode]) 5.2. Bessel Functions 5.2.1. bessel_I0 Synopsis S-Lang version of gsl_sf_bessel_I0 Usage Double_Type[] bessel_I0 (Double_Type[] x) 5.2.2. bessel_i0_scaled Synopsis S-Lang version of gsl_sf_bessel_i0_scaled Usage Double_Type[] bessel_i0_scaled (Double_Type[] x) 5.2.3. bessel_I0_scaled Synopsis S-Lang version of gsl_sf_bessel_I0_scaled Usage Double_Type[] bessel_I0_scaled (Double_Type[] x) 5.2.4. bessel_I1 Synopsis S-Lang version of gsl_sf_bessel_I1 Usage Double_Type[] bessel_I1 (Double_Type[] x) 5.2.5. bessel_i1_scaled Synopsis S-Lang version of gsl_sf_bessel_i1_scaled Usage Double_Type[] bessel_i1_scaled (Double_Type[] x) 5.2.6. bessel_I1_scaled Synopsis S-Lang version of gsl_sf_bessel_I1_scaled Usage Double_Type[] bessel_I1_scaled (Double_Type[] x) 5.2.7. bessel_i2_scaled Synopsis S-Lang version of gsl_sf_bessel_i2_scaled Usage Double_Type[] bessel_i2_scaled (Double_Type[] x) 5.2.8. bessel_il_scaled Synopsis S-Lang version of gsl_sf_bessel_il_scaled Usage Double_Type[] bessel_il_scaled (Int_Type[] l, Double_Type[] x) 5.2.9. bessel_In Synopsis S-Lang version of gsl_sf_bessel_In Usage Double_Type[] bessel_In (Int_Type[] n, Double_Type[] x) 5.2.10. bessel_In_scaled Synopsis S-Lang version of gsl_sf_bessel_In_scaled Usage Double_Type[] bessel_In_scaled (Int_Type[] n, Double_Type[] x) 5.2.11. bessel_Inu Synopsis S-Lang version of gsl_sf_bessel_Inu Usage Double_Type[] bessel_Inu (Double_Type[] nu, Double_Type[] x) 5.2.12. bessel_Inu_scaled Synopsis S-Lang version of gsl_sf_bessel_Inu_scaled Usage Double_Type[] bessel_Inu_scaled (Double_Type[] nu, Double_Type[] x) 5.2.13. bessel_J0 Synopsis S-Lang version of gsl_sf_bessel_J0 Usage Double_Type[] bessel_J0 (Double_Type[] x) 5.2.14. bessel_j0 Synopsis S-Lang version of gsl_sf_bessel_j0 Usage Double_Type[] bessel_j0 (Double_Type[] x) 5.2.15. bessel_j1 Synopsis S-Lang version of gsl_sf_bessel_j1 Usage Double_Type[] bessel_j1 (Double_Type[] x) 5.2.16. bessel_J1 Synopsis S-Lang version of gsl_sf_bessel_J1 Usage Double_Type[] bessel_J1 (Double_Type[] x) 5.2.17. bessel_j2 Synopsis S-Lang version of gsl_sf_bessel_j2 Usage Double_Type[] bessel_j2 (Double_Type[] x) 5.2.18. bessel_jl Synopsis S-Lang version of gsl_sf_bessel_jl Usage Double_Type[] bessel_jl (Int_Type[] l, Double_Type[] x) 5.2.19. bessel_Jn Synopsis S-Lang version of gsl_sf_bessel_Jn Usage Double_Type[] bessel_Jn (Int_Type[] n, Double_Type[] x) 5.2.20. bessel_Jnu Synopsis S-Lang version of gsl_sf_bessel_Jnu Usage Double_Type[] bessel_Jnu (Double_Type[] nu, Double_Type[] x) 5.2.21. bessel_K0 Synopsis S-Lang version of gsl_sf_bessel_K0 Usage Double_Type[] bessel_K0 (Double_Type[] x) 5.2.22. bessel_K0_scaled Synopsis S-Lang version of gsl_sf_bessel_K0_scaled Usage Double_Type[] bessel_K0_scaled (Double_Type[] x) 5.2.23. bessel_k0_scaled Synopsis S-Lang version of gsl_sf_bessel_k0_scaled Usage Double_Type[] bessel_k0_scaled (Double_Type[] x) 5.2.24. bessel_K1 Synopsis S-Lang version of gsl_sf_bessel_K1 Usage Double_Type[] bessel_K1 (Double_Type[] x) 5.2.25. bessel_K1_scaled Synopsis S-Lang version of gsl_sf_bessel_K1_scaled Usage Double_Type[] bessel_K1_scaled (Double_Type[] x) 5.2.26. bessel_k1_scaled Synopsis S-Lang version of gsl_sf_bessel_k1_scaled Usage Double_Type[] bessel_k1_scaled (Double_Type[] x) 5.2.27. bessel_k2_scaled Synopsis S-Lang version of gsl_sf_bessel_k2_scaled Usage Double_Type[] bessel_k2_scaled (Double_Type[] x) 5.2.28. bessel_kl_scaled Synopsis S-Lang version of gsl_sf_bessel_kl_scaled Usage Double_Type[] bessel_kl_scaled (Int_Type[] l, Double_Type[] x) 5.2.29. bessel_Kn Synopsis S-Lang version of gsl_sf_bessel_Kn Usage Double_Type[] bessel_Kn (Int_Type[] n, Double_Type[] x) 5.2.30. bessel_Kn_scaled Synopsis S-Lang version of gsl_sf_bessel_Kn_scaled Usage Double_Type[] bessel_Kn_scaled (Int_Type[] n, Double_Type[] x) 5.2.31. bessel_Knu Synopsis S-Lang version of gsl_sf_bessel_Knu Usage Double_Type[] bessel_Knu (Double_Type[] nu, Double_Type[] x) 5.2.32. bessel_Knu_scaled Synopsis S-Lang version of gsl_sf_bessel_Knu_scaled Usage Double_Type[] bessel_Knu_scaled (Double_Type[] nu, Double_Type[] x) 5.2.33. bessel_lnKnu Synopsis S-Lang version of gsl_sf_bessel_lnKnu Usage Double_Type[] bessel_lnKnu (Double_Type[] nu, Double_Type[] x) 5.2.34. bessel_y0 Synopsis S-Lang version of gsl_sf_bessel_y0 Usage Double_Type[] bessel_y0 (Double_Type[] x) 5.2.35. bessel_Y0 Synopsis S-Lang version of gsl_sf_bessel_Y0 Usage Double_Type[] bessel_Y0 (Double_Type[] x) 5.2.36. bessel_y1 Synopsis S-Lang version of gsl_sf_bessel_y1 Usage Double_Type[] bessel_y1 (Double_Type[] x) 5.2.37. bessel_Y1 Synopsis S-Lang version of gsl_sf_bessel_Y1 Usage Double_Type[] bessel_Y1 (Double_Type[] x) 5.2.38. bessel_y2 Synopsis S-Lang version of gsl_sf_bessel_y2 Usage Double_Type[] bessel_y2 (Double_Type[] x) 5.2.39. bessel_yl Synopsis S-Lang version of gsl_sf_bessel_yl Usage Double_Type[] bessel_yl (Int_Type[] l, Double_Type[] x) 5.2.40. bessel_Yn Synopsis S-Lang version of gsl_sf_bessel_Yn Usage Double_Type[] bessel_Yn (Int_Type[] n, Double_Type[] x) 5.2.41. bessel_Ynu Synopsis S-Lang version of gsl_sf_bessel_Ynu Usage Double_Type[] bessel_Ynu (Double_Type[] nu, Double_Type[] x) 5.3. Beta Functions 5.3.1. beta Synopsis S-Lang version of gsl_sf_beta Usage Double_Type[] beta (Double_Type[] a, Double_Type[] b) 5.3.2. beta_inc Synopsis S-Lang version of gsl_sf_beta_inc Usage Double_Type[] beta_inc (Double_Type[] a, Double_Type[] b, Double_Type[] x) 5.3.3. lnbeta Synopsis S-Lang version of gsl_sf_lnbeta Usage Double_Type[] lnbeta (Double_Type[] a, Double_Type[] b) 5.4. Clausen Functions 5.4.1. clausen Synopsis S-Lang version of gsl_sf_clausen Usage Double_Type[] clausen (Double_Type[] x) 5.5. Conical Functions 5.5.1. conicalP_0 Synopsis S-Lang version of gsl_sf_conicalP_0 Usage Double_Type[] conicalP_0 (Double_Type[] lambda, Double_Type[] x) 5.5.2. conicalP_1 Synopsis S-Lang version of gsl_sf_conicalP_1 Usage Double_Type[] conicalP_1 (Double_Type[] lambda, Double_Type[] x) 5.5.3. conicalP_cyl_reg Synopsis S-Lang version of gsl_sf_conicalP_cyl_reg Usage Double_Type[] conicalP_cyl_reg (m, lambda, x) Int_Type[] m Double_Type[] lambda Double_Type[] x 5.5.4. conicalP_half Synopsis S-Lang version of gsl_sf_conicalP_half Usage Double_Type[] conicalP_half (Double_Type[] lambda, Double_Type[] x) 5.5.5. conicalP_mhalf Synopsis S-Lang version of gsl_sf_conicalP_mhalf Usage Double_Type[] conicalP_mhalf (Double_Type[] lambda, Double_Type[] x) 5.5.6. conicalP_sph_reg Synopsis S-Lang version of gsl_sf_conicalP_sph_reg Usage Double_Type[] conicalP_sph_reg (l, lambda, x) Int_Type[] l Double_Type[] lambda Double_Type[] x 5.6. Coulomb Functions 5.6.1. hydrogenicR Synopsis S-Lang version of gsl_sf_hydrogenicR Usage Double_Type[] hydrogenicR (n, l, Z, r) Int_Type[] n Int_Type[] l Double_Type[] Z Double_Type[] r 5.6.2. hydrogenicR_1 Synopsis S-Lang version of gsl_sf_hydrogenicR_1 Usage Double_Type[] hydrogenicR_1 (Double_Type[] Z, Double_Type[] r) 5.7. Debye Functions 5.7.1. debye_1 Synopsis S-Lang version of gsl_sf_debye_1 Usage Double_Type[] debye_1 (Double_Type[] x) 5.7.2. debye_2 Synopsis S-Lang version of gsl_sf_debye_2 Usage Double_Type[] debye_2 (Double_Type[] x) 5.7.3. debye_3 Synopsis S-Lang version of gsl_sf_debye_3 Usage Double_Type[] debye_3 (Double_Type[] x) 5.7.4. debye_4 Synopsis S-Lang version of gsl_sf_debye_4 Usage Double_Type[] debye_4 (Double_Type[] x) 5.7.5. debye_5 Synopsis S-Lang version of gsl_sf_debye_5 Usage Double_Type[] debye_5 (Double_Type[] x) 5.7.6. debye_6 Synopsis S-Lang version of gsl_sf_debye_6 Usage Double_Type[] debye_6 (Double_Type[] x) 5.8. Di/Tri and Polygamma Functions 5.8.1. psi Synopsis S-Lang version of gsl_sf_psi Usage Double_Type[] psi (Double_Type[] x) 5.8.2. psi_1 Synopsis S-Lang version of gsl_sf_psi_1 Usage Double_Type[] psi_1 (Double_Type[] x) 5.8.3. psi_1_int Synopsis S-Lang version of gsl_sf_psi_1_int Usage Double_Type[] psi_1_int (Int_Type[] n) 5.8.4. psi_1piy Synopsis S-Lang version of gsl_sf_psi_1piy Usage Double_Type[] psi_1piy (Double_Type[] y) 5.8.5. psi_int Synopsis S-Lang version of gsl_sf_psi_int Usage Double_Type[] psi_int (Int_Type[] n) 5.8.6. psi_n Synopsis S-Lang version of gsl_sf_psi_n Usage Double_Type[] psi_n (Int_Type[] n, Double_Type[] x) 5.9. Elliptic Integrals 5.9.1. ellint_D Synopsis S-Lang version of gsl_sf_ellint_D Usage Double_Type[] ellint_D (phi, k [,mode]) Double_Type[] phi Double_Type[] k Int_Type mode 5.9.2. ellint_Dcomp Synopsis S-Lang version of gsl_sf_ellint_Dcomp Usage Double_Type[] ellint_Dcomp (Double_Type[] k [,Int_Type mode]) 5.9.3. ellint_E Synopsis S-Lang version of gsl_sf_ellint_E Usage Double_Type[] ellint_E (phi, k [,mode]) Double_Type[] phi Double_Type[] k Int_Type mode 5.9.4. ellint_Ecomp Synopsis S-Lang version of gsl_sf_ellint_Ecomp Usage Double_Type[] ellint_Ecomp (Double_Type[] k [,Int_Type mode]) 5.9.5. ellint_F Synopsis S-Lang version of gsl_sf_ellint_F Usage Double_Type[] ellint_F (phi, k [,mode]) Double_Type[] phi Double_Type[] k Int_Type mode 5.9.6. ellint_Kcomp Synopsis S-Lang version of gsl_sf_ellint_Kcomp Usage Double_Type[] ellint_Kcomp (Double_Type[] k [,Int_Type mode]) 5.9.7. ellint_P Synopsis S-Lang version of gsl_sf_ellint_P Usage Double_Type[] ellint_P (phi, k, n [,mode]) Double_Type[] phi Double_Type[] k Double_Type[] n Int_Type mode 5.9.8. ellint_Pcomp Synopsis S-Lang version of gsl_sf_ellint_Pcomp Usage Double_Type[] ellint_Pcomp (k, n [,mode]) Double_Type[] k Double_Type[] n Int_Type mode 5.9.9. ellint_RC Synopsis S-Lang version of gsl_sf_ellint_RC Usage Double_Type[] ellint_RC (Double_Type[] x, Double_Type[] y [,Int_Type mode]) 5.9.10. ellint_RD Synopsis S-Lang version of gsl_sf_ellint_RD Usage Double_Type[] ellint_RD (x, y, z [,mode]) Double_Type[] x Double_Type[] y Double_Type[] z Int_Type mode 5.9.11. ellint_RF Synopsis S-Lang version of gsl_sf_ellint_RF Usage Double_Type[] ellint_RF (x, y, z [,mode]) Double_Type[] x Double_Type[] y Double_Type[] z Int_Type mode 5.9.12. ellint_RJ Synopsis S-Lang version of gsl_sf_ellint_RJ Usage Double_Type[] ellint_RJ (x, y, z, p [,mode]) Double_Type[] x Double_Type[] y Double_Type[] z Double_Type[] p Int_Type mode 5.10. Error Functions 5.10.1. erf Synopsis S-Lang version of gsl_sf_erf Usage Double_Type[] erf (Double_Type[] x) 5.10.2. erf_Q Synopsis S-Lang version of gsl_sf_erf_Q Usage Double_Type[] erf_Q (Double_Type[] x) 5.10.3. erf_Z Synopsis S-Lang version of gsl_sf_erf_Z Usage Double_Type[] erf_Z (Double_Type[] x) 5.10.4. erfc Synopsis S-Lang version of gsl_sf_erfc Usage Double_Type[] erfc (Double_Type[] x) 5.10.5. log_erfc Synopsis S-Lang version of gsl_sf_log_erfc Usage Double_Type[] log_erfc (Double_Type[] x) 5.11. Eta/Zeta Functions 5.11.1. eta Synopsis S-Lang version of gsl_sf_eta Usage Double_Type[] eta (Double_Type[] s) 5.11.2. eta_int Synopsis S-Lang version of gsl_sf_eta_int Usage Double_Type[] eta_int (Int_Type[] n) 5.11.3. hzeta Synopsis S-Lang version of gsl_sf_hzeta Usage Double_Type[] hzeta (Double_Type[] s, Double_Type[] q) 5.11.4. zeta Synopsis S-Lang version of gsl_sf_zeta Usage Double_Type[] zeta (Double_Type[] s) 5.11.5. zeta_int Synopsis S-Lang version of gsl_sf_zeta_int Usage Double_Type[] zeta_int (Int_Type[] n) 5.11.6. zetam1 Synopsis S-Lang version of gsl_sf_zetam1 Usage Double_Type[] zetam1 (Double_Type[] s) 5.11.7. zetam1_int Synopsis S-Lang version of gsl_sf_zetam1_int Usage Double_Type[] zetam1_int (Int_Type[] s) 5.12. Exponential Functions and Integrals 5.12.1. exp_mult Synopsis S-Lang version of gsl_sf_exp_mult Usage Double_Type[] exp_mult (Double_Type[] x, Double_Type[] y) 5.12.2. expint_3 Synopsis S-Lang version of gsl_sf_expint_3 Usage Double_Type[] expint_3 (Double_Type[] x) 5.12.3. expint_E1 Synopsis S-Lang version of gsl_sf_expint_E1 Usage Double_Type[] expint_E1 (Double_Type[] x) 5.12.4. expint_E1_scaled Synopsis S-Lang version of gsl_sf_expint_E1_scaled Usage Double_Type[] expint_E1_scaled (Double_Type[] x) 5.12.5. expint_E2 Synopsis S-Lang version of gsl_sf_expint_E2 Usage Double_Type[] expint_E2 (Double_Type[] x) 5.12.6. expint_E2_scaled Synopsis S-Lang version of gsl_sf_expint_E2_scaled Usage Double_Type[] expint_E2_scaled (Double_Type[] x) 5.12.7. expint_Ei Synopsis S-Lang version of gsl_sf_expint_Ei Usage Double_Type[] expint_Ei (Double_Type[] x) 5.12.8. expint_Ei_scaled Synopsis S-Lang version of gsl_sf_expint_Ei_scaled Usage Double_Type[] expint_Ei_scaled (Double_Type[] x) 5.12.9. expint_En Synopsis S-Lang version of gsl_sf_expint_En Usage Double_Type[] expint_En (Int_Type[] n, Double_Type[] x) 5.12.10. expint_En_scaled Synopsis S-Lang version of gsl_sf_expint_En_scaled Usage Double_Type[] expint_En_scaled (Int_Type[] n, Double_Type[] x) 5.12.11. expm1 Synopsis S-Lang version of gsl_sf_expm1 Usage Double_Type[] expm1 (Double_Type[] x) 5.12.12. exprel Synopsis S-Lang version of gsl_sf_exprel Usage Double_Type[] exprel (Double_Type[] x) 5.12.13. exprel_2 Synopsis S-Lang version of gsl_sf_exprel_2 Usage Double_Type[] exprel_2 (Double_Type[] x) 5.12.14. exprel_n Synopsis S-Lang version of gsl_sf_exprel_n Usage Double_Type[] exprel_n (Int_Type[] n, Double_Type[] x) 5.13. Fermi-Dirac Functions 5.13.1. fermi_dirac_0 Synopsis S-Lang version of gsl_sf_fermi_dirac_0 Usage Double_Type[] fermi_dirac_0 (Double_Type[] x) 5.13.2. fermi_dirac_1 Synopsis S-Lang version of gsl_sf_fermi_dirac_1 Usage Double_Type[] fermi_dirac_1 (Double_Type[] x) 5.13.3. fermi_dirac_2 Synopsis S-Lang version of gsl_sf_fermi_dirac_2 Usage Double_Type[] fermi_dirac_2 (Double_Type[] x) 5.13.4. fermi_dirac_3half Synopsis S-Lang version of gsl_sf_fermi_dirac_3half Usage Double_Type[] fermi_dirac_3half (Double_Type[] x) 5.13.5. fermi_dirac_half Synopsis S-Lang version of gsl_sf_fermi_dirac_half Usage Double_Type[] fermi_dirac_half (Double_Type[] x) 5.13.6. fermi_dirac_inc_0 Synopsis S-Lang version of gsl_sf_fermi_dirac_inc_0 Usage Double_Type[] fermi_dirac_inc_0 (Double_Type[] x, Double_Type[] b) 5.13.7. fermi_dirac_int Synopsis S-Lang version of gsl_sf_fermi_dirac_int Usage Double_Type[] fermi_dirac_int (Int_Type[] j, Double_Type[] x) 5.13.8. fermi_dirac_m1 Synopsis S-Lang version of gsl_sf_fermi_dirac_m1 Usage Double_Type[] fermi_dirac_m1 (Double_Type[] x) 5.13.9. fermi_dirac_mhalf Synopsis S-Lang version of gsl_sf_fermi_dirac_mhalf Usage Double_Type[] fermi_dirac_mhalf (Double_Type[] x) 5.14. Gamma Functions 5.14.1. gamma Synopsis S-Lang version of gsl_sf_gamma Usage Double_Type[] gamma (Double_Type[] x) 5.14.2. gamma_inc Synopsis S-Lang version of gsl_sf_gamma_inc Usage Double_Type[] gamma_inc (Double_Type[] a, Double_Type[] x) 5.14.3. gamma_inc_P Synopsis S-Lang version of gsl_sf_gamma_inc_P Usage Double_Type[] gamma_inc_P (Double_Type[] a, Double_Type[] x) 5.14.4. gamma_inc_Q Synopsis S-Lang version of gsl_sf_gamma_inc_Q Usage Double_Type[] gamma_inc_Q (Double_Type[] a, Double_Type[] x) 5.14.5. gammainv Synopsis S-Lang version of gsl_sf_gammainv Usage Double_Type[] gammainv (Double_Type[] x) 5.14.6. gammastar Synopsis S-Lang version of gsl_sf_gammastar Usage Double_Type[] gammastar (Double_Type[] x) 5.14.7. lngamma Synopsis S-Lang version of gsl_sf_lngamma Usage Double_Type[] lngamma (Double_Type[] x) 5.15. Gegenbauer Functions 5.15.1. gegenpoly_1 Synopsis S-Lang version of gsl_sf_gegenpoly_1 Usage Double_Type[] gegenpoly_1 (Double_Type[] lambda, Double_Type[] x) 5.15.2. gegenpoly_2 Synopsis S-Lang version of gsl_sf_gegenpoly_2 Usage Double_Type[] gegenpoly_2 (Double_Type[] lambda, Double_Type[] x) 5.15.3. gegenpoly_3 Synopsis S-Lang version of gsl_sf_gegenpoly_3 Usage Double_Type[] gegenpoly_3 (Double_Type[] lambda, Double_Type[] x) 5.15.4. gegenpoly_n Synopsis S-Lang version of gsl_sf_gegenpoly_n Usage Double_Type[] gegenpoly_n (n, lambda, x) Int_Type[] n Double_Type[] lambda Double_Type[] x 5.16. Hypergeometric Functions 5.16.1. hyperg_0F1 Synopsis S-Lang version of gsl_sf_hyperg_0F1 Usage Double_Type[] hyperg_0F1 (Double_Type[] c, Double_Type[] x) 5.16.2. hyperg_1F1 Synopsis S-Lang version of gsl_sf_hyperg_1F1 Usage Double_Type[] hyperg_1F1 (a, b, x) Double_Type[] a Double_Type[] b Double_Type[] x 5.16.3. hyperg_1F1_int Synopsis S-Lang version of gsl_sf_hyperg_1F1_int Usage Double_Type[] hyperg_1F1_int (Int_Type[] m, Int_Type[] n, Double_Type[] x) 5.16.4. hyperg_2F0 Synopsis S-Lang version of gsl_sf_hyperg_2F0 Usage Double_Type[] hyperg_2F0 (a, b, x) Double_Type[] a Double_Type[] b Double_Type[] x 5.16.5. hyperg_2F1 Synopsis S-Lang version of gsl_sf_hyperg_2F1 Usage Double_Type[] hyperg_2F1 (a, b, c, x) Double_Type[] a Double_Type[] b Double_Type[] c Double_Type[] x 5.16.6. hyperg_2F1_conj Synopsis S-Lang version of gsl_sf_hyperg_2F1_conj Usage Double_Type[] hyperg_2F1_conj (aR, aI, c, x) Double_Type[] aR Double_Type[] aI Double_Type[] c Double_Type[] x 5.16.7. hyperg_2F1_conj_renorm Synopsis S-Lang version of gsl_sf_hyperg_2F1_conj_renorm Usage Double_Type[] hyperg_2F1_conj_renorm (aR, aI, c, x) Double_Type[] aR Double_Type[] aI Double_Type[] c Double_Type[] x 5.16.8. hyperg_2F1_renorm Synopsis S-Lang version of gsl_sf_hyperg_2F1_renorm Usage Double_Type[] hyperg_2F1_renorm (a, b, c, x) Double_Type[] a Double_Type[] b Double_Type[] c Double_Type[] x 5.16.9. hyperg_U Synopsis S-Lang version of gsl_sf_hyperg_U Usage Double_Type[] hyperg_U (Double_Type[] a, Double_Type[] b, Double_Type[] x) 5.16.10. hyperg_U_int Synopsis S-Lang version of gsl_sf_hyperg_U_int Usage Double_Type[] hyperg_U_int (Int_Type[] m, Int_Type[] n, Double_Type[] x) 5.17. Laguerre Functions 5.17.1. laguerre_1 Synopsis S-Lang version of gsl_sf_laguerre_1 Usage Double_Type[] laguerre_1 (Double_Type[] a, Double_Type[] x) 5.17.2. laguerre_2 Synopsis S-Lang version of gsl_sf_laguerre_2 Usage Double_Type[] laguerre_2 (Double_Type[] a, Double_Type[] x) 5.17.3. laguerre_3 Synopsis S-Lang version of gsl_sf_laguerre_3 Usage Double_Type[] laguerre_3 (Double_Type[] a, Double_Type[] x) 5.17.4. laguerre_n Synopsis S-Lang version of gsl_sf_laguerre_n Usage Double_Type[] laguerre_n (Int_Type[] n, Double_Type[] a, Double_Type[] x) 5.18. Lambert Functions 5.18.1. lambert_W0 Synopsis S-Lang version of gsl_sf_lambert_W0 Usage Double_Type[] lambert_W0 (Double_Type[] x) 5.18.2. lambert_Wm1 Synopsis S-Lang version of gsl_sf_lambert_Wm1 Usage Double_Type[] lambert_Wm1 (Double_Type[] x) 5.19. Legendre Functions and Spherical Harmonics 5.19.1. legendre_H3d Synopsis S-Lang version of gsl_sf_legendre_H3d Usage Double_Type[] legendre_H3d (l, lambda, eta) Int_Type[] l Double_Type[] lambda Double_Type[] eta 5.19.2. legendre_H3d_0 Synopsis S-Lang version of gsl_sf_legendre_H3d_0 Usage Double_Type[] legendre_H3d_0 (Double_Type[] lambda, Double_Type[] eta) 5.19.3. legendre_H3d_1 Synopsis S-Lang version of gsl_sf_legendre_H3d_1 Usage Double_Type[] legendre_H3d_1 (Double_Type[] lambda, Double_Type[] eta) 5.19.4. legendre_P1 Synopsis S-Lang version of gsl_sf_legendre_P1 Usage Double_Type[] legendre_P1 (Double_Type[] x) 5.19.5. legendre_P2 Synopsis S-Lang version of gsl_sf_legendre_P2 Usage Double_Type[] legendre_P2 (Double_Type[] x) 5.19.6. legendre_P3 Synopsis S-Lang version of gsl_sf_legendre_P3 Usage Double_Type[] legendre_P3 (Double_Type[] x) 5.19.7. legendre_Pl Synopsis S-Lang version of gsl_sf_legendre_Pl Usage Double_Type[] legendre_Pl (Int_Type[] l, Double_Type[] x) 5.19.8. legendre_Plm Synopsis S-Lang version of gsl_sf_legendre_Plm Usage Double_Type[] legendre_Plm (Int_Type[] l, Int_Type[] m, Double_Type[] x) 5.19.9. legendre_Q0 Synopsis S-Lang version of gsl_sf_legendre_Q0 Usage Double_Type[] legendre_Q0 (Double_Type[] x) 5.19.10. legendre_Q1 Synopsis S-Lang version of gsl_sf_legendre_Q1 Usage Double_Type[] legendre_Q1 (Double_Type[] x) 5.19.11. legendre_Ql Synopsis S-Lang version of gsl_sf_legendre_Ql Usage Double_Type[] legendre_Ql (Int_Type[] l, Double_Type[] x) 5.19.12. legendre_sphPlm Synopsis S-Lang version of gsl_sf_legendre_sphPlm Usage Double_Type[] legendre_sphPlm (Int_Type[] l, Int_Type[] m, Double_Type[] x) 5.20. Logarithm and Related Functions 5.20.1. log_1plusx Synopsis S-Lang version of gsl_sf_log_1plusx Usage Double_Type[] log_1plusx (Double_Type[] x) 5.20.2. log_1plusx_mx Synopsis S-Lang version of gsl_sf_log_1plusx_mx Usage Double_Type[] log_1plusx_mx (Double_Type[] x) 5.20.3. log_abs Synopsis S-Lang version of gsl_sf_log_abs Usage Double_Type[] log_abs (Double_Type[] x) 5.21. Transport Functions 5.21.1. transport_2 Synopsis S-Lang version of gsl_sf_transport_2 Usage Double_Type[] transport_2 (Double_Type[] x) 5.21.2. transport_3 Synopsis S-Lang version of gsl_sf_transport_3 Usage Double_Type[] transport_3 (Double_Type[] x) 5.21.3. transport_4 Synopsis S-Lang version of gsl_sf_transport_4 Usage Double_Type[] transport_4 (Double_Type[] x) 5.21.4. transport_5 Synopsis S-Lang version of gsl_sf_transport_5 Usage Double_Type[] transport_5 (Double_Type[] x) 5.22. Miscellaneous Functions 5.22.1. angle_restrict_pos Synopsis S-Lang version of gsl_sf_angle_restrict_pos Usage Double_Type[] angle_restrict_pos (Double_Type[] theta) 5.22.2. angle_restrict_symm Synopsis S-Lang version of gsl_sf_angle_restrict_symm Usage Double_Type[] angle_restrict_symm (Double_Type[] theta) 5.22.3. atanint Synopsis S-Lang version of gsl_sf_atanint Usage Double_Type[] atanint (Double_Type[] x) 5.22.4. Chi Synopsis S-Lang version of gsl_sf_Chi Usage Double_Type[] Chi (Double_Type[] x) 5.22.5. Ci Synopsis S-Lang version of gsl_sf_Ci Usage Double_Type[] Ci (Double_Type[] x) 5.22.6. dawson Synopsis S-Lang version of gsl_sf_dawson Usage Double_Type[] dawson (Double_Type[] x) 5.22.7. dilog Synopsis S-Lang version of gsl_sf_dilog Usage Double_Type[] dilog (Double_Type[] x) 5.22.8. hazard Synopsis S-Lang version of gsl_sf_hazard Usage Double_Type[] hazard (Double_Type[] x) 5.22.9. hypot Synopsis S-Lang version of gsl_sf_hypot Usage Double_Type[] hypot (Double_Type[] x, Double_Type[] y) 5.22.10. lncosh Synopsis S-Lang version of gsl_sf_lncosh Usage Double_Type[] lncosh (Double_Type[] x) 5.22.11. lnpoch Synopsis S-Lang version of gsl_sf_lnpoch Usage Double_Type[] lnpoch (Double_Type[] a, Double_Type[] x) 5.22.12. lnsinh Synopsis S-Lang version of gsl_sf_lnsinh Usage Double_Type[] lnsinh (Double_Type[] x) 5.22.13. mathieu_a Synopsis S-Lang version of gsl_sf_mathieu_a Usage Double_Type[] mathieu_a (Int_Type[] order, Double_Type[] qq) 5.22.14. mathieu_b Synopsis S-Lang version of gsl_sf_mathieu_b Usage Double_Type[] mathieu_b (Int_Type[] order, Double_Type[] qq) 5.22.15. mathieu_ce Synopsis S-Lang version of gsl_sf_mathieu_ce Usage Double_Type[] mathieu_ce (order, qq, zz) Int_Type[] order Double_Type[] qq Double_Type[] zz 5.22.16. mathieu_Mc Synopsis S-Lang version of gsl_sf_mathieu_Mc Usage Double_Type[] mathieu_Mc (kind, order, qq, zz) Int_Type[] kind Int_Type[] order Double_Type[] qq Double_Type[] zz 5.22.17. mathieu_Ms Synopsis S-Lang version of gsl_sf_mathieu_Ms Usage Double_Type[] mathieu_Ms (kind, order, qq, zz) Int_Type[] kind Int_Type[] order Double_Type[] qq Double_Type[] zz 5.22.18. mathieu_se Synopsis S-Lang version of gsl_sf_mathieu_se Usage Double_Type[] mathieu_se (order, qq, zz) Int_Type[] order Double_Type[] qq Double_Type[] zz 5.22.19. poch Synopsis S-Lang version of gsl_sf_poch Usage Double_Type[] poch (Double_Type[] a, Double_Type[] x) 5.22.20. pochrel Synopsis S-Lang version of gsl_sf_pochrel Usage Double_Type[] pochrel (Double_Type[] a, Double_Type[] x) 5.22.21. Shi Synopsis S-Lang version of gsl_sf_Shi Usage Double_Type[] Shi (Double_Type[] x) 5.22.22. Si Synopsis S-Lang version of gsl_sf_Si Usage Double_Type[] Si (Double_Type[] x) 5.22.23. sinc Synopsis S-Lang version of gsl_sf_sinc Usage Double_Type[] sinc (Double_Type[] x) 5.22.24. synchrotron_1 Synopsis S-Lang version of gsl_sf_synchrotron_1 Usage Double_Type[] synchrotron_1 (Double_Type[] x) 5.22.25. synchrotron_2 Synopsis S-Lang version of gsl_sf_synchrotron_2 Usage Double_Type[] synchrotron_2 (Double_Type[] x) 5.22.26. taylorcoeff Synopsis S-Lang version of gsl_sf_taylorcoeff Usage Double_Type[] taylorcoeff (Int_Type[] n, Double_Type[] x) 6. gslrand: The GSL Random Number Module GSL provides more than 60 types of random number generators and about 40 random number distributions. The gslrand module provides access to all of the GSL random number generators and to nearly all of its random number distributions. Using the gslrand module is rather straightforward. First, import the module into the interpreter as described above via a statement such as require ("gslrand"); The next step is to allocate a random number generator via the rng_al- loc function. As stated above, there are more than 60 generators to choose from. To allocate an instance of the default generator ("mt19937"), use r = rng_alloc (); Or to allocate an instance of some other generator, e.g., the lagged- fibonacci generator "gfsr4", use r = rng_alloc ("gfsr4"); Once the generator has been allocated, it may be used to construct random number sequences from a specific random distribution. For exam- ple, x = ran_flat (r, 0, 1); may be used to obtain a random number uniformly distributed between 0 and 1. In a similar vein, x = ran_gaussian (r, 2.0); will produce a gaussian distributed random number with a sigma of 2.0. For many applications, it is desirable to be able to produce arrays of random numbers. This may be accomplished by passing an addition argument to the random number distribution function that specifies how many random numbers to produce. For example, a = ran_gaussian (r, 2.0, 10000); will create an array of 10000 gaussian distributed random numbers with a sigma of 2.0. If the random generator is omitted from the call to the random number distribution routines, then a default generator will be used. For example, x = ran_gaussian (2.0); will generate a gaussian distributed random number with a sigma of 2.0 using the default generator. 6.1. Random Number Generation Routines 6.1.1. rng_alloc Synopsis Allocate an instance of a random number generator Usage Rand_Type rng_alloc ([generator]) 6.1.2. rng_set Synopsis Seed a random number generator Usage rng_set ([Rand_Type gen,] ULong_Type seed) 6.1.3. rng_get Synopsis rng_get Usage x = rng_get ([Rand_Type gen] [, Int_Type num]) 6.1.4. rng_get_rng_types Synopsis Get a list of all supported generators Usage String_Type[] = rng_get_rng_types () 6.1.5. rng_uniform Synopsis Get a uniformly distributed random number Usage x = rng_uniform ([Rand_Type gen] [, Int_Type num]) 6.1.6. rng_uniform_pos Synopsis Generate a uniformly distributed non-zero random number Usage x = rng_uniform_pos ([Rand_Type gen] [, Int_Type num]) 6.1.7. rng_max Synopsis Obtain the maximum value produced by a random number generator Usage ULong_Type rng_max (Rand_Type gen) 6.1.8. rng_min Synopsis Obtain the minimum value produced by a random number generator Usage ULong_Type rng_min (Rand_Type gen) 6.2. Random Number Distributions 6.2.1. ran_bernoulli Synopsis Produce Bernoulli distributed random numbers Usage x = ran_bernoulli ([Rand_Type gen,] Double_Type p [,Int_Type num] 6.2.2. ran_beta Synopsis Produce distributed random numbers Usage x = ran_beta ([Rand_Type gen,] Double_Type a, Double_Type b [,Int_Type num]) 6.2.3. ran_binomial Synopsis Produce random numbers from the binomial distribution Usage x = ran_binomial ([Rand_Type gen,] Double_Type p, Int_Type n [,Int_Type num]) 6.2.4. ran_cauchy Synopsis Produce random numbers from the Cauchy distribution Usage x = ran_cauchy ([Rand_Type gen,] Double_Type mu [,Int_Type num]) 6.2.5. ran_chisq Synopsis Produce chi-squared distributed random numbers Usage x = ran_chisq ([Rand_Type gen,] Double_Type nu [,Int_Type num]) 6.2.6. ran_exponential Synopsis Produce exponentially distributed random numbers Usage x = ran_exponential ([Rand_Type gen,] Double_Type mu [,Int_Type num]) 6.2.7. ran_exppow Synopsis Produce random numbers from the exponential power distribution Usage x = ran_exppow ([Rand_Type gen,] Double_Type mu, Double_Type a [,Int_Type num]) 6.2.8. ran_fdist Synopsis Produce F-distributed random numbers Usage x = ran_fdist ([Rand_Type gen,] Double_Type nu1, Double_Type nu2 [,Int_Type num]) 6.2.9. ran_flat Synopsis Produce uniformly distributed random numbers Usage x = ran_flat ([Rand_Type gen,] Double_Type a, Double_Type b [,Int_Type num]) 6.2.10. ran_gamma Synopsis Produce a random number from the gamma distribution Usage x = ran_gamma ([Rand_Type gen,] Double_Type a, Double_Type b [,Int_Type num]) 6.2.11. ran_gaussian Synopsis Produce gaussian distributed random numbers Usage x = ran_gaussian ([Rand_Type gen,] Double_Type sigma [,Int_Type num]) 6.2.12. ran_gaussian_ratio_method Synopsis Produce gaussian distributed random numbers Usage x = ran_gaussian_ratio_method ([Rand_Type gen,] Double_Type sigma [,Int_Type num]) 6.2.13. ran_gaussian_tail Synopsis Produce gaussian distributed random numbers from the tail Usage x = ran_gaussian_tail ([Rand_Type gen,] Double_Type a, Double_Type sigma [,Int_Type num]) 6.2.14. ran_geometric Synopsis Produce random integers from the geometric distribution Usage x = ran_geometric ([Rand_Type gen,] Double_Type p [,Int_Type num]) 6.2.15. ran_gumbel1 Synopsis Produce random numbers from the type-1 Gumbel distribution Usage x = ran_gumbel1 ([Rand_Type gen,] Double_Type a, Double_Type b [,Int_Type num]) 6.2.16. ran_gumbel2 Synopsis Produce random numbers from the type-2 Gumbel distribution Usage x = ran_gumbel2 ([Rand_Type gen,] Double_Type a, Double_Type b [,Int_Type num]) 6.2.17. ran_laplace Synopsis Produce random numbers from the Laplace distribution Usage x = ran_laplace ([Rand_Type gen,] Double_Type mu [,Int_Type num]) 6.2.18. ran_levy Synopsis Produce random numbers from the Levy distribution Usage x = ran_levy ([Rand_Type gen,] Double_Type mu, Double_Type a [,Int_Type num]) 6.2.19. ran_logarithmic Synopsis Produce random numbers from the logarithmic distribution Usage x = ran_logarithmic ([Rand_Type gen,] Double_Type p [,Int_Type num]) 6.2.20. ran_logistic Synopsis Produce random numbers from the logistic distribution Usage x = ran_logistic ([Rand_Type gen,] Double_Type mu [,Int_Type num]) 6.2.21. ran_lognormal Synopsis Produce random numbers from the lognormal distribution Usage x = ran_lognormal ([Rand_Type gen,] Double_Type zeta, Double_Type sigma [,Int_Type num]) 6.2.22. ran_negative_binomial Synopsis Produce random numbers from the negative binomial distribution Usage x = ran_negative_binomial ([Rand_Type gen,] Double_Type p, Double_Type n [,Int_Type num]) 6.2.23. ran_pareto Synopsis Produce random numbers from the Pareto distribution Usage x = ran_pareto ([Rand_Type gen,] Double_Type a, Double_Type b [,Int_Type num]) 6.2.24. ran_pascal Synopsis Produce random numbers from the Pascal distribution Usage x = ran_pascal ([Rand_Type gen,] Double_Type p, Int_Type k [,Int_Type num]) 6.2.25. ran_poisson Synopsis Produce random numbers from the Poisson distribution Usage x = ran_poisson ([Rand_Type gen,] Double_Type mu [,Int_Type num]) 6.2.26. ran_rayleigh Synopsis Produce random numbers from the Rayleigh distribution Usage x = ran_rayleigh ([Rand_Type gen,] Double_Type sigma [,Int_Type num]) 6.2.27. ran_rayleigh_tail Synopsis Produce random numbers from the tail of the Rayleigh distribution Usage x = ran_rayleigh_tail ([Rand_Type gen,] Double_Type a, Double_Type sigma [,Int_Type num]) 6.2.28. ran_tdist Synopsis Produce random numbers from the t-distribution Usage x = ran_tdist ([Rand_Type gen,] Double_Type nu [,Int_Type num]) 6.2.29. ran_ugaussian Synopsis Produce random numbers from the gaussian distribution Usage x = ran_ugaussian ([Rand_Type gen] [,Int_Type num]) 6.2.30. ran_ugaussian_ratio_method Synopsis Produce random numbers from the gaussian distribution Usage x = ran_ugaussian_ratio_method ([Rand_Type gen] [,Int_Type num]) 6.2.31. ran_ugaussian_tail Synopsis Produce random numbers from the tail of the gaussian distribution Usage x = ran_ugaussian_tail ([Rand_Type gen,] Double_Type a [,Int_Type num]) 6.2.32. ran_weibull Synopsis Produce random numbers from the Weibull distribution Usage x = ran_weibull ([Rand_Type gen,] Double_Type mu, Double_Type a [,Int_Type num]) 6.3. PDF Functions 6.3.1. ran_beta_pdf Synopsis S-Lang version of gsl_ran_beta_pdf Usage Double_Type[] ran_beta_pdf (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 6.3.2. ran_cauchy_pdf Synopsis S-Lang version of gsl_ran_cauchy_pdf Usage Double_Type[] ran_cauchy_pdf (Double_Type[] x, Double_Type[] a) 6.3.3. ran_chisq_pdf Synopsis S-Lang version of gsl_ran_chisq_pdf Usage Double_Type[] ran_chisq_pdf (Double_Type[] x, Double_Type[] nu) 6.3.4. ran_erlang_pdf Synopsis S-Lang version of gsl_ran_erlang_pdf Usage Double_Type[] ran_erlang_pdf (x, a, n) Double_Type[] x Double_Type[] a Double_Type[] n 6.3.5. ran_exponential_pdf Synopsis S-Lang version of gsl_ran_exponential_pdf Usage Double_Type[] ran_exponential_pdf (Double_Type[] x, Double_Type[] mu) 6.3.6. ran_exppow_pdf Synopsis S-Lang version of gsl_ran_exppow_pdf Usage Double_Type[] ran_exppow_pdf (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 6.3.7. ran_fdist_pdf Synopsis S-Lang version of gsl_ran_fdist_pdf Usage Double_Type[] ran_fdist_pdf (x, nu1, nu2) Double_Type[] x Double_Type[] nu1 Double_Type[] nu2 6.3.8. ran_flat_pdf Synopsis S-Lang version of gsl_ran_flat_pdf Usage Double_Type[] ran_flat_pdf (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 6.3.9. ran_gamma_pdf Synopsis S-Lang version of gsl_ran_gamma_pdf Usage Double_Type[] ran_gamma_pdf (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 6.3.10. ran_gaussian_pdf Synopsis S-Lang version of gsl_ran_gaussian_pdf Usage Double_Type[] ran_gaussian_pdf (Double_Type[] x, Double_Type[] sigma) 6.3.11. ran_gaussian_tail_pdf Synopsis S-Lang version of gsl_ran_gaussian_tail_pdf Usage Double_Type[] ran_gaussian_tail_pdf (x, a, sigma) Double_Type[] x Double_Type[] a Double_Type[] sigma 6.3.12. ran_gumbel1_pdf Synopsis S-Lang version of gsl_ran_gumbel1_pdf Usage Double_Type[] ran_gumbel1_pdf (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 6.3.13. ran_gumbel2_pdf Synopsis S-Lang version of gsl_ran_gumbel2_pdf Usage Double_Type[] ran_gumbel2_pdf (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 6.3.14. ran_landau_pdf Synopsis S-Lang version of gsl_ran_landau_pdf Usage Double_Type[] ran_landau_pdf (Double_Type[] x) 6.3.15. ran_laplace_pdf Synopsis S-Lang version of gsl_ran_laplace_pdf Usage Double_Type[] ran_laplace_pdf (Double_Type[] x, Double_Type[] a) 6.3.16. ran_logistic_pdf Synopsis S-Lang version of gsl_ran_logistic_pdf Usage Double_Type[] ran_logistic_pdf (Double_Type[] x, Double_Type[] a) 6.3.17. ran_lognormal_pdf Synopsis S-Lang version of gsl_ran_lognormal_pdf Usage Double_Type[] ran_lognormal_pdf (x, zeta, sigma) Double_Type[] x Double_Type[] zeta Double_Type[] sigma 6.3.18. ran_pareto_pdf Synopsis S-Lang version of gsl_ran_pareto_pdf Usage Double_Type[] ran_pareto_pdf (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 6.3.19. ran_rayleigh_pdf Synopsis S-Lang version of gsl_ran_rayleigh_pdf Usage Double_Type[] ran_rayleigh_pdf (Double_Type[] x, Double_Type[] sigma) 6.3.20. ran_rayleigh_tail_pdf Synopsis S-Lang version of gsl_ran_rayleigh_tail_pdf Usage Double_Type[] ran_rayleigh_tail_pdf (x, a, sigma) Double_Type[] x Double_Type[] a Double_Type[] sigma 6.3.21. ran_tdist_pdf Synopsis S-Lang version of gsl_ran_tdist_pdf Usage Double_Type[] ran_tdist_pdf (Double_Type[] x, Double_Type[] nu) 6.3.22. ran_ugaussian_pdf Synopsis S-Lang version of gsl_ran_ugaussian_pdf Usage Double_Type[] ran_ugaussian_pdf (Double_Type[] x) 6.3.23. ran_ugaussian_tail_pdf Synopsis S-Lang version of gsl_ran_ugaussian_tail_pdf Usage Double_Type[] ran_ugaussian_tail_pdf (Double_Type[] x, Double_Type[] a) 6.3.24. ran_weibull_pdf Synopsis S-Lang version of gsl_ran_weibull_pdf Usage Double_Type[] ran_weibull_pdf (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 7. gslfft: The GSL FFT module The gslfft may be used to compute N dimensional fast fourier transforms (FFT). The module itself currently provides a single function called _gsl_fft_complex that performs a forward or backward n-dimensional FFT. The underlying GSL routines used by this function are the Swarztrauber mixed-radix routines from FFTPACK and the more general Singleton routine. The _gsl_fft_complex function is not meant to be called directly; rather the user should call the fft function, which provides a convenient wrapper for the _gsl_fft_complex function. 7.1. Fast Fourier Transform Routines 7.1.1. _gsl_fft_complex Synopsis Perform an N-d FFT Usage y = _gsl_fft_complex (x, dir) Description This routine computes the FFT of an array x and returns the result. The integer-valued parameter dir parameter specifies the direction of the transform. A forward transform will be produced for positive values of dir and a reverse transform will be computed for negative values. The result will be a complex array of the same size and dimensionality as the the input array. Notes It is better to call this routine indirectly using the fft function. See Also ``fft'' 7.1.2. fft Synopsis Perform an N-d FFT Usage y = fft (x, dir) Description This routine computes the FFT of an array x and returns the result. The integer-valued parameter dir parameter specifies the direction of the transform. A forward transform will be produced for positive values of dir and a reverse transform will be computed for negative values. The result will be a complex array of the same size and dimensionality as the the input array. Notes This routine is currently a wrapper for the _gsl_fft_complex function. See Also ``_gsl_fft_complex'' 7.1.3. convolve Synopsis Perform a convolution Usage b = convolve (array, kernel) Description This function performs a convolution of the specified array and kernel using FFTs. One of the following qualifiers may be used to indicate how the overlap of the kernel with the edges of the array are to be handled: pad=value Pad the array with the specified value wrap Use periodic boundary-conditions reflect Reflect the pixels at the boundary nearest Use the value of the nearest edge pixel The default behavior is to use pad=0.0. Notes The current implementation utilizes ffts and will expand the array to the nearest multiple of small primes for run-time efficiency. A future version may allow different methods to be used. See Also ``fft'', ``correlate'' 7.1.4. correlate Synopsis Perform a correlation Usage b = correlate (array, kernel) Description This function performs a correlation of the specified array and kernel using FFTs. One of the following qualifiers may be used to indicate how the overlap of the kernel with the edges of the array are to be handled: pad=value Pad the array with the specified value wrap Use periodic boundary-conditions reflect Reflect the pixels at the boundary nearest Use the value of the nearest edge pixel The default behavior is to use pad=0.0. Notes The current implementation utilizes ffts and will expand the array to the nearest multiple of small primes for run-time efficiency. A future version may allow different methods to be used. See Also ``fft'', ``convolve'' 8. gsldwt: The GSL Discrete Wavelet Transform module The gsldwt may be used to perform discrete wavelet transforms (DWT) for real data in both one and two dimensions. The module itself currently provides a single function called dwt that performs a forward or backward n-dimensional DWT. 8.1. Discrete Wavelet Transform Routines 8.1.1. wavelet_transform Synopsis Perform an N-d Discrete Wavelet Transform Usage w = wavelet_transform (x, dir) Description This routine computes the DWT of an array x and returns the result. The optional dir parameter specifies the direction of the transform. A forward transform will be produced for positive values of dir (default value) and a reverse transform will be computed for negative values. Array dimension(s) must be an integer power of two. The result will be an array of the same size and dimensionality as the the input array. The following qualifiers may be used : type = DWT_HAAR|DWT_DAUBECHIES|DWT_BSPLINE k = value Selects the specific member of the wavelet family. centered The centered forms of the wavelets align the coefficients of the various sub-bands on edges. nsf Choose the "non-standard" forms ordering of the rows and columns in the two-dimensional wavelet transform. The following wavelet types are implemented : Daubechies (k = 4, 6, ..., 20, with k even), Haar (k = 2), bsplines (k = 100*i + j are 103, 105, 202, 204, 206, 208, 301, 303, 305 307, 309). 9. gslmatrix: A Collection of Matrix-Oriented GSL functions The S-lang interpreter has wide-spread native support for manipulating arrays and matrices. The gslmatrix supplements this by adding some linear algebra routines such LU decomposition as well as routines for dealing with eigenvalues and eigenvectors. GSL has separate functions for complex numbers. Rather than creating separate wrappers for each of these functions, the complex-valued routines have been incorporated into single wrappers that support for both real and complex numbers. In this way the interface is polymorphic. 9.1. Linear Algebra and Matrix-Oriented Routines 9.1.1. linalg_LU_decomp Synopsis Factorize a square matrix into its LU decomposition Usage (LU,p) = linalg_LU_decomp (A [,&signum]) Description This routines returns the LU decomposition of the square matrix A such that P#A == LU. See the corresponding GSL documentation for how L and U are stored in LU, and how the permutation matrix P is defined. For many applications, it is unnecessary to unpack the matrix LU into its separate components. If the optional argument &signum is given, upon return signum will be set to the sign of the permutation that relates P to the identity matrix. See Also ``linalg_LU_det'', ``linalg_LU_invert'', ``linalg_LU_solve'' 9.1.2. linalg_LU_det Synopsis Compute the determinant of a matrix from its LU decomposition Usage det = linalg_LU_det (LU, signum) Description This function computes the determinant of a matrix from its LU decomposition. In the LU form, determinant is given by the product of the diagonal elements with the sign of the permutation. require ("gslmatrix"); define determinant (A) { variable LU, sig; (LU,) = linalg_LU_decomp (A, &sig); return linalg_LU_det (LU,sig); } See Also ``linalg_LU_lndet'', ``linalg_LU_decomp'', ``linalg_LU_invert'', ``linalg_LU_solve'' 9.1.3. linalg_LU_lndet Synopsis Compute the log of a determinant using LU decomposition Usage det = linalg_LU_lndet (LU) Description This function computes the natural logarithm of the determinant of a matrix from its LU decomposition. In the LU form, determinant is given by the product of the diagonal elements with the sign of the permutation. This function is useful for cases where the product of the diagonal elements would overflow. See Also ``linalg_LU_det'', ``linalg_LU_decomp'', ``linalg_LU_solve'', ``linalg_LU_invert'' 9.1.4. linalg_LU_invert Synopsis Compute the inverse of a matrix via its LU decomposition Usage inv = linalg_LU_invert (LU, p) Description This function may be used to compute the inverse of a matrix from its LU decomposition. For the purposes of inverting a set of linear equations, it is preferable to use the linalg_LU_solve function rather than inverting the equations via the inverse. define matrix_inverse (A) { return linalg_LU_invert (linalg_LU_decomp (A)); } See Also ``linalg_LU_decomp'', ``linalg_LU_solve'', ``linalg_LU_det'' 9.1.5. linalg_LU_solve Synopsis Solve a set of linear equations using LU decomposition Usage x = linalg_LU_solve (LU, p, b) Description This function solves the square linear system of equations A#x=b for the vector x via the LU decomposition of A. define solve_equations (A, b) { return linalg_LU_solve (linalg_LU_decomp (A), b); } See Also ``linalg_LU_decomp'', ``linalg_LU_det'', ``linalg_LU_invert'' 9.1.6. linalg_QR_decomp Synopsis Factor a matrix into its QR form Usage (QR, tau) = linalg_QR_decomp(A) Description This function may be used to decompose a rectangular matrix into its so-called QR such that A=Q#R where Q is a square orthogonal matrix and R is a rectangular right-triangular matrix. The factor R encoded in the diagonal and upper-triangular elements of the first return value QR. The matrix Q is encoded in the lower triangular part of QR and the vector tau via Householder vectors and coefficients. See the corresponding GSL documentation for the details of the encoding. For most uses encoding details are not required. See Also ``linalg_QR_solve'' 9.1.7. linalg_QR_solve Synopsis Solve a system of linear equations using QR decomposition Usage x = linalg_QR_solve(QR, tau, b [,&residual]) Description This function may be used to solve the linear system A#x=b using the QR decomposition of A. If the optional fourth argument is present (&residual), or if QR is not a square matrix, then the linear system will be solved in the least-squares sense by minimizing the (Euclidean) norm of A#x-b. Upon return, the value of the variable residual is set to the the norm of A#x-b. Notes GSL has a separate function called gsl_linalg_QR_lssolve for computing this least-squares solution. The linalg_QR_solve combines both gsl_linalg_QR_lssolve and gsl_linalg_QR_solve into a single routine. See Also ``linalg_QR_decomp'' 9.1.8. linalg_SV_decomp Synopsis Perform a singular-value decomposition on a matrix Usage (U,S,V) = linalg_SV_decomp(A) Description This function factors a MxN (M>=N) rectangular matrix A into three factors such that A = U#S#transpose(V), where S is diagonal matrix containing the singular values of A and V is a square orthogonal matrix. Since S is diagonal, it is returned as a 1-d array. See Also ``linalg_SV_solve'' 9.1.9. linalg_SV_solve Synopsis Solve a linear system using Singular-Value Decomposition Usage x = linalg_SV_solve (U,V,S,b) Description This function ``solves'' the linear system A#x=b using the SVD form of A. Example define svd_solve (A, b) { variable U, V, S; (U,V,S) = linalg_SV_decomp (A); return linalg_SV_solve (U,V,S,b); } See Also ``linalg_SV_decomp'', ``linalg_QR_solve'', ``linalg_LU_solve'' 9.1.10. eigen_symmv Synopsis Compute the eigenvalues and eigenvectors of a Hermitian matrix Usage (eigvecs, eigvals)=eigen_symmv(A) Description This function computes the eigenvalues and eigenvectors of a Hermitian (or real-symmetric) square matrix A. The eigenvalues are returned sorted on their absolute value (or norm) in descending order. See Also ``eigen_nonsymmv'' 9.1.11. eigen_nonsymmv Synopsis Compute the eigenvalues and eigenvectors of a matrix Usage (eigvecs, eigvals)=eigen_nonsymmv(A) Description This function returns the eigenvalues and eigenvectors of a real non-symmetric matrix A. As such quantities are in general complex, complex-valued arrays will be returned. The eigenvalues are returned in descending order sorted upon norm. See Also ``eigen_symmv'' 10. gslcdf: The GSL Cumulative Distribution Function Module The gslcdf module wraps the GSL cumulative distribution functions. 10.1. CDF Functions 10.1.1. cdf_beta_P Synopsis S-Lang version of gsl_cdf_beta_P Usage Double_Type[] cdf_beta_P (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 10.1.2. cdf_beta_Pinv Synopsis S-Lang version of gsl_cdf_beta_Pinv Usage Double_Type[] cdf_beta_Pinv (P, a, b) Double_Type[] P Double_Type[] a Double_Type[] b 10.1.3. cdf_beta_Q Synopsis S-Lang version of gsl_cdf_beta_Q Usage Double_Type[] cdf_beta_Q (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 10.1.4. cdf_beta_Qinv Synopsis S-Lang version of gsl_cdf_beta_Qinv Usage Double_Type[] cdf_beta_Qinv (Q, a, b) Double_Type[] Q Double_Type[] a Double_Type[] b 10.1.5. cdf_cauchy_P Synopsis S-Lang version of gsl_cdf_cauchy_P Usage Double_Type[] cdf_cauchy_P (Double_Type[] x, Double_Type[] a) 10.1.6. cdf_cauchy_Pinv Synopsis S-Lang version of gsl_cdf_cauchy_Pinv Usage Double_Type[] cdf_cauchy_Pinv (Double_Type[] P, Double_Type[] a) 10.1.7. cdf_cauchy_Q Synopsis S-Lang version of gsl_cdf_cauchy_Q Usage Double_Type[] cdf_cauchy_Q (Double_Type[] x, Double_Type[] a) 10.1.8. cdf_cauchy_Qinv Synopsis S-Lang version of gsl_cdf_cauchy_Qinv Usage Double_Type[] cdf_cauchy_Qinv (Double_Type[] Q, Double_Type[] a) 10.1.9. cdf_chisq_P Synopsis S-Lang version of gsl_cdf_chisq_P Usage Double_Type[] cdf_chisq_P (Double_Type[] x, Double_Type[] nu) 10.1.10. cdf_chisq_Pinv Synopsis S-Lang version of gsl_cdf_chisq_Pinv Usage Double_Type[] cdf_chisq_Pinv (Double_Type[] P, Double_Type[] nu) 10.1.11. cdf_chisq_Q Synopsis S-Lang version of gsl_cdf_chisq_Q Usage Double_Type[] cdf_chisq_Q (Double_Type[] x, Double_Type[] nu) 10.1.12. cdf_chisq_Qinv Synopsis S-Lang version of gsl_cdf_chisq_Qinv Usage Double_Type[] cdf_chisq_Qinv (Double_Type[] Q, Double_Type[] nu) 10.1.13. cdf_exponential_P Synopsis S-Lang version of gsl_cdf_exponential_P Usage Double_Type[] cdf_exponential_P (Double_Type[] x, Double_Type[] mu) 10.1.14. cdf_exponential_Pinv Synopsis S-Lang version of gsl_cdf_exponential_Pinv Usage Double_Type[] cdf_exponential_Pinv (Double_Type[] P, Double_Type[] mu) 10.1.15. cdf_exponential_Q Synopsis S-Lang version of gsl_cdf_exponential_Q Usage Double_Type[] cdf_exponential_Q (Double_Type[] x, Double_Type[] mu) 10.1.16. cdf_exponential_Qinv Synopsis S-Lang version of gsl_cdf_exponential_Qinv Usage Double_Type[] cdf_exponential_Qinv (Double_Type[] Q, Double_Type[] mu) 10.1.17. cdf_exppow_P Synopsis S-Lang version of gsl_cdf_exppow_P Usage Double_Type[] cdf_exppow_P (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 10.1.18. cdf_exppow_Q Synopsis S-Lang version of gsl_cdf_exppow_Q Usage Double_Type[] cdf_exppow_Q (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 10.1.19. cdf_fdist_P Synopsis S-Lang version of gsl_cdf_fdist_P Usage Double_Type[] cdf_fdist_P (x, nu1, nu2) Double_Type[] x Double_Type[] nu1 Double_Type[] nu2 10.1.20. cdf_fdist_Pinv Synopsis S-Lang version of gsl_cdf_fdist_Pinv Usage Double_Type[] cdf_fdist_Pinv (P, nu1, nu2) Double_Type[] P Double_Type[] nu1 Double_Type[] nu2 10.1.21. cdf_fdist_Q Synopsis S-Lang version of gsl_cdf_fdist_Q Usage Double_Type[] cdf_fdist_Q (x, nu1, nu2) Double_Type[] x Double_Type[] nu1 Double_Type[] nu2 10.1.22. cdf_fdist_Qinv Synopsis S-Lang version of gsl_cdf_fdist_Qinv Usage Double_Type[] cdf_fdist_Qinv (Q, nu1, nu2) Double_Type[] Q Double_Type[] nu1 Double_Type[] nu2 10.1.23. cdf_flat_P Synopsis S-Lang version of gsl_cdf_flat_P Usage Double_Type[] cdf_flat_P (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 10.1.24. cdf_flat_Pinv Synopsis S-Lang version of gsl_cdf_flat_Pinv Usage Double_Type[] cdf_flat_Pinv (P, a, b) Double_Type[] P Double_Type[] a Double_Type[] b 10.1.25. cdf_flat_Q Synopsis S-Lang version of gsl_cdf_flat_Q Usage Double_Type[] cdf_flat_Q (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 10.1.26. cdf_flat_Qinv Synopsis S-Lang version of gsl_cdf_flat_Qinv Usage Double_Type[] cdf_flat_Qinv (Q, a, b) Double_Type[] Q Double_Type[] a Double_Type[] b 10.1.27. cdf_gamma_P Synopsis S-Lang version of gsl_cdf_gamma_P Usage Double_Type[] cdf_gamma_P (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 10.1.28. cdf_gamma_Pinv Synopsis S-Lang version of gsl_cdf_gamma_Pinv Usage Double_Type[] cdf_gamma_Pinv (P, a, b) Double_Type[] P Double_Type[] a Double_Type[] b 10.1.29. cdf_gamma_Q Synopsis S-Lang version of gsl_cdf_gamma_Q Usage Double_Type[] cdf_gamma_Q (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 10.1.30. cdf_gamma_Qinv Synopsis S-Lang version of gsl_cdf_gamma_Qinv Usage Double_Type[] cdf_gamma_Qinv (Q, a, b) Double_Type[] Q Double_Type[] a Double_Type[] b 10.1.31. cdf_gaussian_P Synopsis S-Lang version of gsl_cdf_gaussian_P Usage Double_Type[] cdf_gaussian_P (Double_Type[] x, Double_Type[] sigma) 10.1.32. cdf_gaussian_Pinv Synopsis S-Lang version of gsl_cdf_gaussian_Pinv Usage Double_Type[] cdf_gaussian_Pinv (Double_Type[] P, Double_Type[] sigma) 10.1.33. cdf_gaussian_Q Synopsis S-Lang version of gsl_cdf_gaussian_Q Usage Double_Type[] cdf_gaussian_Q (Double_Type[] x, Double_Type[] sigma) 10.1.34. cdf_gaussian_Qinv Synopsis S-Lang version of gsl_cdf_gaussian_Qinv Usage Double_Type[] cdf_gaussian_Qinv (Double_Type[] Q, Double_Type[] sigma) 10.1.35. cdf_gumbel1_P Synopsis S-Lang version of gsl_cdf_gumbel1_P Usage Double_Type[] cdf_gumbel1_P (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 10.1.36. cdf_gumbel1_Pinv Synopsis S-Lang version of gsl_cdf_gumbel1_Pinv Usage Double_Type[] cdf_gumbel1_Pinv (P, a, b) Double_Type[] P Double_Type[] a Double_Type[] b 10.1.37. cdf_gumbel1_Q Synopsis S-Lang version of gsl_cdf_gumbel1_Q Usage Double_Type[] cdf_gumbel1_Q (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 10.1.38. cdf_gumbel1_Qinv Synopsis S-Lang version of gsl_cdf_gumbel1_Qinv Usage Double_Type[] cdf_gumbel1_Qinv (Q, a, b) Double_Type[] Q Double_Type[] a Double_Type[] b 10.1.39. cdf_gumbel2_P Synopsis S-Lang version of gsl_cdf_gumbel2_P Usage Double_Type[] cdf_gumbel2_P (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 10.1.40. cdf_gumbel2_Pinv Synopsis S-Lang version of gsl_cdf_gumbel2_Pinv Usage Double_Type[] cdf_gumbel2_Pinv (P, a, b) Double_Type[] P Double_Type[] a Double_Type[] b 10.1.41. cdf_gumbel2_Q Synopsis S-Lang version of gsl_cdf_gumbel2_Q Usage Double_Type[] cdf_gumbel2_Q (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 10.1.42. cdf_gumbel2_Qinv Synopsis S-Lang version of gsl_cdf_gumbel2_Qinv Usage Double_Type[] cdf_gumbel2_Qinv (Q, a, b) Double_Type[] Q Double_Type[] a Double_Type[] b 10.1.43. cdf_laplace_P Synopsis S-Lang version of gsl_cdf_laplace_P Usage Double_Type[] cdf_laplace_P (Double_Type[] x, Double_Type[] a) 10.1.44. cdf_laplace_Pinv Synopsis S-Lang version of gsl_cdf_laplace_Pinv Usage Double_Type[] cdf_laplace_Pinv (Double_Type[] P, Double_Type[] a) 10.1.45. cdf_laplace_Q Synopsis S-Lang version of gsl_cdf_laplace_Q Usage Double_Type[] cdf_laplace_Q (Double_Type[] x, Double_Type[] a) 10.1.46. cdf_laplace_Qinv Synopsis S-Lang version of gsl_cdf_laplace_Qinv Usage Double_Type[] cdf_laplace_Qinv (Double_Type[] Q, Double_Type[] a) 10.1.47. cdf_logistic_P Synopsis S-Lang version of gsl_cdf_logistic_P Usage Double_Type[] cdf_logistic_P (Double_Type[] x, Double_Type[] a) 10.1.48. cdf_logistic_Pinv Synopsis S-Lang version of gsl_cdf_logistic_Pinv Usage Double_Type[] cdf_logistic_Pinv (Double_Type[] P, Double_Type[] a) 10.1.49. cdf_logistic_Q Synopsis S-Lang version of gsl_cdf_logistic_Q Usage Double_Type[] cdf_logistic_Q (Double_Type[] x, Double_Type[] a) 10.1.50. cdf_logistic_Qinv Synopsis S-Lang version of gsl_cdf_logistic_Qinv Usage Double_Type[] cdf_logistic_Qinv (Double_Type[] Q, Double_Type[] a) 10.1.51. cdf_lognormal_P Synopsis S-Lang version of gsl_cdf_lognormal_P Usage Double_Type[] cdf_lognormal_P (x, zeta, sigma) Double_Type[] x Double_Type[] zeta Double_Type[] sigma 10.1.52. cdf_lognormal_Pinv Synopsis S-Lang version of gsl_cdf_lognormal_Pinv Usage Double_Type[] cdf_lognormal_Pinv (P, zeta, sigma) Double_Type[] P Double_Type[] zeta Double_Type[] sigma 10.1.53. cdf_lognormal_Q Synopsis S-Lang version of gsl_cdf_lognormal_Q Usage Double_Type[] cdf_lognormal_Q (x, zeta, sigma) Double_Type[] x Double_Type[] zeta Double_Type[] sigma 10.1.54. cdf_lognormal_Qinv Synopsis S-Lang version of gsl_cdf_lognormal_Qinv Usage Double_Type[] cdf_lognormal_Qinv (Q, zeta, sigma) Double_Type[] Q Double_Type[] zeta Double_Type[] sigma 10.1.55. cdf_pareto_P Synopsis S-Lang version of gsl_cdf_pareto_P Usage Double_Type[] cdf_pareto_P (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 10.1.56. cdf_pareto_Pinv Synopsis S-Lang version of gsl_cdf_pareto_Pinv Usage Double_Type[] cdf_pareto_Pinv (P, a, b) Double_Type[] P Double_Type[] a Double_Type[] b 10.1.57. cdf_pareto_Q Synopsis S-Lang version of gsl_cdf_pareto_Q Usage Double_Type[] cdf_pareto_Q (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 10.1.58. cdf_pareto_Qinv Synopsis S-Lang version of gsl_cdf_pareto_Qinv Usage Double_Type[] cdf_pareto_Qinv (Q, a, b) Double_Type[] Q Double_Type[] a Double_Type[] b 10.1.59. cdf_rayleigh_P Synopsis S-Lang version of gsl_cdf_rayleigh_P Usage Double_Type[] cdf_rayleigh_P (Double_Type[] x, Double_Type[] sigma) 10.1.60. cdf_rayleigh_Pinv Synopsis S-Lang version of gsl_cdf_rayleigh_Pinv Usage Double_Type[] cdf_rayleigh_Pinv (Double_Type[] P, Double_Type[] sigma) 10.1.61. cdf_rayleigh_Q Synopsis S-Lang version of gsl_cdf_rayleigh_Q Usage Double_Type[] cdf_rayleigh_Q (Double_Type[] x, Double_Type[] sigma) 10.1.62. cdf_rayleigh_Qinv Synopsis S-Lang version of gsl_cdf_rayleigh_Qinv Usage Double_Type[] cdf_rayleigh_Qinv (Double_Type[] Q, Double_Type[] sigma) 10.1.63. cdf_tdist_P Synopsis S-Lang version of gsl_cdf_tdist_P Usage Double_Type[] cdf_tdist_P (Double_Type[] x, Double_Type[] nu) 10.1.64. cdf_tdist_Pinv Synopsis S-Lang version of gsl_cdf_tdist_Pinv Usage Double_Type[] cdf_tdist_Pinv (Double_Type[] P, Double_Type[] nu) 10.1.65. cdf_tdist_Q Synopsis S-Lang version of gsl_cdf_tdist_Q Usage Double_Type[] cdf_tdist_Q (Double_Type[] x, Double_Type[] nu) 10.1.66. cdf_tdist_Qinv Synopsis S-Lang version of gsl_cdf_tdist_Qinv Usage Double_Type[] cdf_tdist_Qinv (Double_Type[] Q, Double_Type[] nu) 10.1.67. cdf_ugaussian_P Synopsis S-Lang version of gsl_cdf_ugaussian_P Usage Double_Type[] cdf_ugaussian_P (Double_Type[] x) 10.1.68. cdf_ugaussian_Pinv Synopsis S-Lang version of gsl_cdf_ugaussian_Pinv Usage Double_Type[] cdf_ugaussian_Pinv (Double_Type[] P) 10.1.69. cdf_ugaussian_Q Synopsis S-Lang version of gsl_cdf_ugaussian_Q Usage Double_Type[] cdf_ugaussian_Q (Double_Type[] x) 10.1.70. cdf_ugaussian_Qinv Synopsis S-Lang version of gsl_cdf_ugaussian_Qinv Usage Double_Type[] cdf_ugaussian_Qinv (Double_Type[] Q) 10.1.71. cdf_weibull_P Synopsis S-Lang version of gsl_cdf_weibull_P Usage Double_Type[] cdf_weibull_P (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 10.1.72. cdf_weibull_Pinv Synopsis S-Lang version of gsl_cdf_weibull_Pinv Usage Double_Type[] cdf_weibull_Pinv (P, a, b) Double_Type[] P Double_Type[] a Double_Type[] b 10.1.73. cdf_weibull_Q Synopsis S-Lang version of gsl_cdf_weibull_Q Usage Double_Type[] cdf_weibull_Q (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 10.1.74. cdf_weibull_Qinv Synopsis S-Lang version of gsl_cdf_weibull_Qinv Usage Double_Type[] cdf_weibull_Qinv (Q, a, b) Double_Type[] Q Double_Type[] a Double_Type[] b 11. gslconst: The GSL Constants Module The GSL constants module gslconst defines about 200 physical constants such as the speed of light (CONST_MKSA_SPEED_OF_LIGHT) and Boltzmann's constant (CONST_MKSA_BOLTZMANN). In addition to providing values in the MKSA (meters, kilograms, seconds, amperes) system, the module also includes CGSM (centimeters, grams, seconds, gauss) versions, e.g., CONST_CGSM_SPEED_OF_LIGHT. 11.1. MKSA Constants o CONST_MKSA_ACRE o CONST_MKSA_ANGSTROM o CONST_MKSA_ASTRONOMICAL_UNIT o CONST_MKSA_BAR o CONST_MKSA_BARN o CONST_MKSA_BOHR_MAGNETON o CONST_MKSA_BOHR_RADIUS o CONST_MKSA_BOLTZMANN o CONST_MKSA_BTU o CONST_MKSA_CALORIE o CONST_MKSA_CANADIAN_GALLON o CONST_MKSA_CARAT o CONST_MKSA_CUP o CONST_MKSA_CURIE o CONST_MKSA_DAY o CONST_MKSA_DEBYE o CONST_MKSA_DYNE o CONST_MKSA_ELECTRON_CHARGE o CONST_MKSA_ELECTRON_MAGNETIC_MOMENT o CONST_MKSA_ELECTRON_VOLT o CONST_MKSA_ERG o CONST_MKSA_FARADAY o CONST_MKSA_FATHOM o CONST_MKSA_FLUID_OUNCE o CONST_MKSA_FOOT o CONST_MKSA_FOOTCANDLE o CONST_MKSA_FOOTLAMBERT o CONST_MKSA_GAUSS o CONST_MKSA_GRAM_FORCE o CONST_MKSA_GRAVITATIONAL_CONSTANT o CONST_MKSA_GRAV_ACCEL o CONST_MKSA_HECTARE o CONST_MKSA_HORSEPOWER o CONST_MKSA_HOUR o CONST_MKSA_INCH o CONST_MKSA_INCH_OF_MERCURY o CONST_MKSA_INCH_OF_WATER o CONST_MKSA_JOULE o CONST_MKSA_KILOMETERS_PER_HOUR o CONST_MKSA_KILOPOUND_FORCE o CONST_MKSA_KNOT o CONST_MKSA_LAMBERT o CONST_MKSA_LIGHT_YEAR o CONST_MKSA_LITER o CONST_MKSA_LUMEN o CONST_MKSA_LUX o CONST_MKSA_MASS_ELECTRON o CONST_MKSA_MASS_MUON o CONST_MKSA_MASS_NEUTRON o CONST_MKSA_MASS_PROTON o CONST_MKSA_METER_OF_MERCURY o CONST_MKSA_METRIC_TON o CONST_MKSA_MICRON o CONST_MKSA_MIL o CONST_MKSA_MILE o CONST_MKSA_MILES_PER_HOUR o CONST_MKSA_MINUTE o CONST_MKSA_MOLAR_GAS o CONST_MKSA_NAUTICAL_MILE o CONST_MKSA_NEWTON o CONST_MKSA_NUCLEAR_MAGNETON o CONST_MKSA_OUNCE_MASS o CONST_MKSA_PARSEC o CONST_MKSA_PHOT o CONST_MKSA_PINT o CONST_MKSA_PLANCKS_CONSTANT_H o CONST_MKSA_PLANCKS_CONSTANT_HBAR o CONST_MKSA_POINT o CONST_MKSA_POISE o CONST_MKSA_POUNDAL o CONST_MKSA_POUND_FORCE o CONST_MKSA_POUND_MASS o CONST_MKSA_PROTON_MAGNETIC_MOMENT o CONST_MKSA_PSI o CONST_MKSA_QUART o CONST_MKSA_RAD o CONST_MKSA_ROENTGEN o CONST_MKSA_RYDBERG o CONST_MKSA_SOLAR_MASS o CONST_MKSA_SPEED_OF_LIGHT o CONST_MKSA_STANDARD_GAS_VOLUME o CONST_MKSA_STD_ATMOSPHERE o CONST_MKSA_STEFAN_BOLTZMANN_CONSTANT o CONST_MKSA_STILB o CONST_MKSA_STOKES o CONST_MKSA_TABLESPOON o CONST_MKSA_TEASPOON o CONST_MKSA_TEXPOINT o CONST_MKSA_THERM o CONST_MKSA_THOMSON_CROSS_SECTION o CONST_MKSA_TON o CONST_MKSA_TORR o CONST_MKSA_TROY_OUNCE o CONST_MKSA_UK_GALLON o CONST_MKSA_UK_TON o CONST_MKSA_UNIFIED_ATOMIC_MASS o CONST_MKSA_US_GALLON o CONST_MKSA_VACUUM_PERMEABILITY o CONST_MKSA_VACUUM_PERMITTIVITY o CONST_MKSA_WEEK o CONST_MKSA_YARD 11.2. CGSM Constants o CONST_CGSM_ACRE o CONST_CGSM_ANGSTROM o CONST_CGSM_ASTRONOMICAL_UNIT o CONST_CGSM_BAR o CONST_CGSM_BARN o CONST_CGSM_BOHR_MAGNETON o CONST_CGSM_BOHR_RADIUS o CONST_CGSM_BOLTZMANN o CONST_CGSM_BTU o CONST_CGSM_CALORIE o CONST_CGSM_CANADIAN_GALLON o CONST_CGSM_CARAT o CONST_CGSM_CUP o CONST_CGSM_CURIE o CONST_CGSM_DAY o CONST_CGSM_DYNE o CONST_CGSM_ELECTRON_CHARGE o CONST_CGSM_ELECTRON_MAGNETIC_MOMENT o CONST_CGSM_ELECTRON_VOLT o CONST_CGSM_ERG o CONST_CGSM_FARADAY o CONST_CGSM_FATHOM o CONST_CGSM_FLUID_OUNCE o CONST_CGSM_FOOT o CONST_CGSM_FOOTCANDLE o CONST_CGSM_FOOTLAMBERT o CONST_CGSM_GRAM_FORCE o CONST_CGSM_GRAVITATIONAL_CONSTANT o CONST_CGSM_GRAV_ACCEL o CONST_CGSM_HECTARE o CONST_CGSM_HORSEPOWER o CONST_CGSM_HOUR o CONST_CGSM_INCH o CONST_CGSM_INCH_OF_MERCURY o CONST_CGSM_INCH_OF_WATER o CONST_CGSM_JOULE o CONST_CGSM_KILOMETERS_PER_HOUR o CONST_CGSM_KILOPOUND_FORCE o CONST_CGSM_KNOT o CONST_CGSM_LAMBERT o CONST_CGSM_LIGHT_YEAR o CONST_CGSM_LITER o CONST_CGSM_LUMEN o CONST_CGSM_LUX o CONST_CGSM_MASS_ELECTRON o CONST_CGSM_MASS_MUON o CONST_CGSM_MASS_NEUTRON o CONST_CGSM_MASS_PROTON o CONST_CGSM_METER_OF_MERCURY o CONST_CGSM_METRIC_TON o CONST_CGSM_MICRON o CONST_CGSM_MIL o CONST_CGSM_MILE o CONST_CGSM_MILES_PER_HOUR o CONST_CGSM_MINUTE o CONST_CGSM_MOLAR_GAS o CONST_CGSM_NAUTICAL_MILE o CONST_CGSM_NEWTON o CONST_CGSM_NUCLEAR_MAGNETON o CONST_CGSM_OUNCE_MASS o CONST_CGSM_PARSEC o CONST_CGSM_PHOT o CONST_CGSM_PINT o CONST_CGSM_PLANCKS_CONSTANT_H o CONST_CGSM_PLANCKS_CONSTANT_HBAR o CONST_CGSM_POINT o CONST_CGSM_POISE o CONST_CGSM_POUNDAL o CONST_CGSM_POUND_FORCE o CONST_CGSM_POUND_MASS o CONST_CGSM_PROTON_MAGNETIC_MOMENT o CONST_CGSM_PSI o CONST_CGSM_QUART o CONST_CGSM_RAD o CONST_CGSM_ROENTGEN o CONST_CGSM_RYDBERG o CONST_CGSM_SOLAR_MASS o CONST_CGSM_SPEED_OF_LIGHT o CONST_CGSM_STANDARD_GAS_VOLUME o CONST_CGSM_STD_ATMOSPHERE o CONST_CGSM_STEFAN_BOLTZMANN_CONSTANT o CONST_CGSM_STILB o CONST_CGSM_STOKES o CONST_CGSM_TABLESPOON o CONST_CGSM_TEASPOON o CONST_CGSM_TEXPOINT o CONST_CGSM_THERM o CONST_CGSM_THOMSON_CROSS_SECTION o CONST_CGSM_TON o CONST_CGSM_TORR o CONST_CGSM_TROY_OUNCE o CONST_CGSM_UK_GALLON o CONST_CGSM_UK_TON o CONST_CGSM_UNIFIED_ATOMIC_MASS o CONST_CGSM_US_GALLON o CONST_CGSM_WEEK o CONST_CGSM_YARD 12. gslcdf: The GSL Cumulative Distribution Function Module The gslcdf module wraps the GSL cumulative distribution functions. 12.1. CDF Functions 12.1.1. cdf_beta_P Synopsis S-Lang version of gsl_cdf_beta_P Usage Double_Type[] cdf_beta_P (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 12.1.2. cdf_beta_Pinv Synopsis S-Lang version of gsl_cdf_beta_Pinv Usage Double_Type[] cdf_beta_Pinv (P, a, b) Double_Type[] P Double_Type[] a Double_Type[] b 12.1.3. cdf_beta_Q Synopsis S-Lang version of gsl_cdf_beta_Q Usage Double_Type[] cdf_beta_Q (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 12.1.4. cdf_beta_Qinv Synopsis S-Lang version of gsl_cdf_beta_Qinv Usage Double_Type[] cdf_beta_Qinv (Q, a, b) Double_Type[] Q Double_Type[] a Double_Type[] b 12.1.5. cdf_cauchy_P Synopsis S-Lang version of gsl_cdf_cauchy_P Usage Double_Type[] cdf_cauchy_P (Double_Type[] x, Double_Type[] a) 12.1.6. cdf_cauchy_Pinv Synopsis S-Lang version of gsl_cdf_cauchy_Pinv Usage Double_Type[] cdf_cauchy_Pinv (Double_Type[] P, Double_Type[] a) 12.1.7. cdf_cauchy_Q Synopsis S-Lang version of gsl_cdf_cauchy_Q Usage Double_Type[] cdf_cauchy_Q (Double_Type[] x, Double_Type[] a) 12.1.8. cdf_cauchy_Qinv Synopsis S-Lang version of gsl_cdf_cauchy_Qinv Usage Double_Type[] cdf_cauchy_Qinv (Double_Type[] Q, Double_Type[] a) 12.1.9. cdf_chisq_P Synopsis S-Lang version of gsl_cdf_chisq_P Usage Double_Type[] cdf_chisq_P (Double_Type[] x, Double_Type[] nu) 12.1.10. cdf_chisq_Pinv Synopsis S-Lang version of gsl_cdf_chisq_Pinv Usage Double_Type[] cdf_chisq_Pinv (Double_Type[] P, Double_Type[] nu) 12.1.11. cdf_chisq_Q Synopsis S-Lang version of gsl_cdf_chisq_Q Usage Double_Type[] cdf_chisq_Q (Double_Type[] x, Double_Type[] nu) 12.1.12. cdf_chisq_Qinv Synopsis S-Lang version of gsl_cdf_chisq_Qinv Usage Double_Type[] cdf_chisq_Qinv (Double_Type[] Q, Double_Type[] nu) 12.1.13. cdf_exponential_P Synopsis S-Lang version of gsl_cdf_exponential_P Usage Double_Type[] cdf_exponential_P (Double_Type[] x, Double_Type[] mu) 12.1.14. cdf_exponential_Pinv Synopsis S-Lang version of gsl_cdf_exponential_Pinv Usage Double_Type[] cdf_exponential_Pinv (Double_Type[] P, Double_Type[] mu) 12.1.15. cdf_exponential_Q Synopsis S-Lang version of gsl_cdf_exponential_Q Usage Double_Type[] cdf_exponential_Q (Double_Type[] x, Double_Type[] mu) 12.1.16. cdf_exponential_Qinv Synopsis S-Lang version of gsl_cdf_exponential_Qinv Usage Double_Type[] cdf_exponential_Qinv (Double_Type[] Q, Double_Type[] mu) 12.1.17. cdf_exppow_P Synopsis S-Lang version of gsl_cdf_exppow_P Usage Double_Type[] cdf_exppow_P (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 12.1.18. cdf_exppow_Q Synopsis S-Lang version of gsl_cdf_exppow_Q Usage Double_Type[] cdf_exppow_Q (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 12.1.19. cdf_fdist_P Synopsis S-Lang version of gsl_cdf_fdist_P Usage Double_Type[] cdf_fdist_P (x, nu1, nu2) Double_Type[] x Double_Type[] nu1 Double_Type[] nu2 12.1.20. cdf_fdist_Pinv Synopsis S-Lang version of gsl_cdf_fdist_Pinv Usage Double_Type[] cdf_fdist_Pinv (P, nu1, nu2) Double_Type[] P Double_Type[] nu1 Double_Type[] nu2 12.1.21. cdf_fdist_Q Synopsis S-Lang version of gsl_cdf_fdist_Q Usage Double_Type[] cdf_fdist_Q (x, nu1, nu2) Double_Type[] x Double_Type[] nu1 Double_Type[] nu2 12.1.22. cdf_fdist_Qinv Synopsis S-Lang version of gsl_cdf_fdist_Qinv Usage Double_Type[] cdf_fdist_Qinv (Q, nu1, nu2) Double_Type[] Q Double_Type[] nu1 Double_Type[] nu2 12.1.23. cdf_flat_P Synopsis S-Lang version of gsl_cdf_flat_P Usage Double_Type[] cdf_flat_P (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 12.1.24. cdf_flat_Pinv Synopsis S-Lang version of gsl_cdf_flat_Pinv Usage Double_Type[] cdf_flat_Pinv (P, a, b) Double_Type[] P Double_Type[] a Double_Type[] b 12.1.25. cdf_flat_Q Synopsis S-Lang version of gsl_cdf_flat_Q Usage Double_Type[] cdf_flat_Q (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 12.1.26. cdf_flat_Qinv Synopsis S-Lang version of gsl_cdf_flat_Qinv Usage Double_Type[] cdf_flat_Qinv (Q, a, b) Double_Type[] Q Double_Type[] a Double_Type[] b 12.1.27. cdf_gamma_P Synopsis S-Lang version of gsl_cdf_gamma_P Usage Double_Type[] cdf_gamma_P (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 12.1.28. cdf_gamma_Pinv Synopsis S-Lang version of gsl_cdf_gamma_Pinv Usage Double_Type[] cdf_gamma_Pinv (P, a, b) Double_Type[] P Double_Type[] a Double_Type[] b 12.1.29. cdf_gamma_Q Synopsis S-Lang version of gsl_cdf_gamma_Q Usage Double_Type[] cdf_gamma_Q (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 12.1.30. cdf_gamma_Qinv Synopsis S-Lang version of gsl_cdf_gamma_Qinv Usage Double_Type[] cdf_gamma_Qinv (Q, a, b) Double_Type[] Q Double_Type[] a Double_Type[] b 12.1.31. cdf_gaussian_P Synopsis S-Lang version of gsl_cdf_gaussian_P Usage Double_Type[] cdf_gaussian_P (Double_Type[] x, Double_Type[] sigma) 12.1.32. cdf_gaussian_Pinv Synopsis S-Lang version of gsl_cdf_gaussian_Pinv Usage Double_Type[] cdf_gaussian_Pinv (Double_Type[] P, Double_Type[] sigma) 12.1.33. cdf_gaussian_Q Synopsis S-Lang version of gsl_cdf_gaussian_Q Usage Double_Type[] cdf_gaussian_Q (Double_Type[] x, Double_Type[] sigma) 12.1.34. cdf_gaussian_Qinv Synopsis S-Lang version of gsl_cdf_gaussian_Qinv Usage Double_Type[] cdf_gaussian_Qinv (Double_Type[] Q, Double_Type[] sigma) 12.1.35. cdf_gumbel1_P Synopsis S-Lang version of gsl_cdf_gumbel1_P Usage Double_Type[] cdf_gumbel1_P (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 12.1.36. cdf_gumbel1_Pinv Synopsis S-Lang version of gsl_cdf_gumbel1_Pinv Usage Double_Type[] cdf_gumbel1_Pinv (P, a, b) Double_Type[] P Double_Type[] a Double_Type[] b 12.1.37. cdf_gumbel1_Q Synopsis S-Lang version of gsl_cdf_gumbel1_Q Usage Double_Type[] cdf_gumbel1_Q (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 12.1.38. cdf_gumbel1_Qinv Synopsis S-Lang version of gsl_cdf_gumbel1_Qinv Usage Double_Type[] cdf_gumbel1_Qinv (Q, a, b) Double_Type[] Q Double_Type[] a Double_Type[] b 12.1.39. cdf_gumbel2_P Synopsis S-Lang version of gsl_cdf_gumbel2_P Usage Double_Type[] cdf_gumbel2_P (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 12.1.40. cdf_gumbel2_Pinv Synopsis S-Lang version of gsl_cdf_gumbel2_Pinv Usage Double_Type[] cdf_gumbel2_Pinv (P, a, b) Double_Type[] P Double_Type[] a Double_Type[] b 12.1.41. cdf_gumbel2_Q Synopsis S-Lang version of gsl_cdf_gumbel2_Q Usage Double_Type[] cdf_gumbel2_Q (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 12.1.42. cdf_gumbel2_Qinv Synopsis S-Lang version of gsl_cdf_gumbel2_Qinv Usage Double_Type[] cdf_gumbel2_Qinv (Q, a, b) Double_Type[] Q Double_Type[] a Double_Type[] b 12.1.43. cdf_laplace_P Synopsis S-Lang version of gsl_cdf_laplace_P Usage Double_Type[] cdf_laplace_P (Double_Type[] x, Double_Type[] a) 12.1.44. cdf_laplace_Pinv Synopsis S-Lang version of gsl_cdf_laplace_Pinv Usage Double_Type[] cdf_laplace_Pinv (Double_Type[] P, Double_Type[] a) 12.1.45. cdf_laplace_Q Synopsis S-Lang version of gsl_cdf_laplace_Q Usage Double_Type[] cdf_laplace_Q (Double_Type[] x, Double_Type[] a) 12.1.46. cdf_laplace_Qinv Synopsis S-Lang version of gsl_cdf_laplace_Qinv Usage Double_Type[] cdf_laplace_Qinv (Double_Type[] Q, Double_Type[] a) 12.1.47. cdf_logistic_P Synopsis S-Lang version of gsl_cdf_logistic_P Usage Double_Type[] cdf_logistic_P (Double_Type[] x, Double_Type[] a) 12.1.48. cdf_logistic_Pinv Synopsis S-Lang version of gsl_cdf_logistic_Pinv Usage Double_Type[] cdf_logistic_Pinv (Double_Type[] P, Double_Type[] a) 12.1.49. cdf_logistic_Q Synopsis S-Lang version of gsl_cdf_logistic_Q Usage Double_Type[] cdf_logistic_Q (Double_Type[] x, Double_Type[] a) 12.1.50. cdf_logistic_Qinv Synopsis S-Lang version of gsl_cdf_logistic_Qinv Usage Double_Type[] cdf_logistic_Qinv (Double_Type[] Q, Double_Type[] a) 12.1.51. cdf_lognormal_P Synopsis S-Lang version of gsl_cdf_lognormal_P Usage Double_Type[] cdf_lognormal_P (x, zeta, sigma) Double_Type[] x Double_Type[] zeta Double_Type[] sigma 12.1.52. cdf_lognormal_Pinv Synopsis S-Lang version of gsl_cdf_lognormal_Pinv Usage Double_Type[] cdf_lognormal_Pinv (P, zeta, sigma) Double_Type[] P Double_Type[] zeta Double_Type[] sigma 12.1.53. cdf_lognormal_Q Synopsis S-Lang version of gsl_cdf_lognormal_Q Usage Double_Type[] cdf_lognormal_Q (x, zeta, sigma) Double_Type[] x Double_Type[] zeta Double_Type[] sigma 12.1.54. cdf_lognormal_Qinv Synopsis S-Lang version of gsl_cdf_lognormal_Qinv Usage Double_Type[] cdf_lognormal_Qinv (Q, zeta, sigma) Double_Type[] Q Double_Type[] zeta Double_Type[] sigma 12.1.55. cdf_pareto_P Synopsis S-Lang version of gsl_cdf_pareto_P Usage Double_Type[] cdf_pareto_P (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 12.1.56. cdf_pareto_Pinv Synopsis S-Lang version of gsl_cdf_pareto_Pinv Usage Double_Type[] cdf_pareto_Pinv (P, a, b) Double_Type[] P Double_Type[] a Double_Type[] b 12.1.57. cdf_pareto_Q Synopsis S-Lang version of gsl_cdf_pareto_Q Usage Double_Type[] cdf_pareto_Q (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 12.1.58. cdf_pareto_Qinv Synopsis S-Lang version of gsl_cdf_pareto_Qinv Usage Double_Type[] cdf_pareto_Qinv (Q, a, b) Double_Type[] Q Double_Type[] a Double_Type[] b 12.1.59. cdf_rayleigh_P Synopsis S-Lang version of gsl_cdf_rayleigh_P Usage Double_Type[] cdf_rayleigh_P (Double_Type[] x, Double_Type[] sigma) 12.1.60. cdf_rayleigh_Pinv Synopsis S-Lang version of gsl_cdf_rayleigh_Pinv Usage Double_Type[] cdf_rayleigh_Pinv (Double_Type[] P, Double_Type[] sigma) 12.1.61. cdf_rayleigh_Q Synopsis S-Lang version of gsl_cdf_rayleigh_Q Usage Double_Type[] cdf_rayleigh_Q (Double_Type[] x, Double_Type[] sigma) 12.1.62. cdf_rayleigh_Qinv Synopsis S-Lang version of gsl_cdf_rayleigh_Qinv Usage Double_Type[] cdf_rayleigh_Qinv (Double_Type[] Q, Double_Type[] sigma) 12.1.63. cdf_tdist_P Synopsis S-Lang version of gsl_cdf_tdist_P Usage Double_Type[] cdf_tdist_P (Double_Type[] x, Double_Type[] nu) 12.1.64. cdf_tdist_Pinv Synopsis S-Lang version of gsl_cdf_tdist_Pinv Usage Double_Type[] cdf_tdist_Pinv (Double_Type[] P, Double_Type[] nu) 12.1.65. cdf_tdist_Q Synopsis S-Lang version of gsl_cdf_tdist_Q Usage Double_Type[] cdf_tdist_Q (Double_Type[] x, Double_Type[] nu) 12.1.66. cdf_tdist_Qinv Synopsis S-Lang version of gsl_cdf_tdist_Qinv Usage Double_Type[] cdf_tdist_Qinv (Double_Type[] Q, Double_Type[] nu) 12.1.67. cdf_ugaussian_P Synopsis S-Lang version of gsl_cdf_ugaussian_P Usage Double_Type[] cdf_ugaussian_P (Double_Type[] x) 12.1.68. cdf_ugaussian_Pinv Synopsis S-Lang version of gsl_cdf_ugaussian_Pinv Usage Double_Type[] cdf_ugaussian_Pinv (Double_Type[] P) 12.1.69. cdf_ugaussian_Q Synopsis S-Lang version of gsl_cdf_ugaussian_Q Usage Double_Type[] cdf_ugaussian_Q (Double_Type[] x) 12.1.70. cdf_ugaussian_Qinv Synopsis S-Lang version of gsl_cdf_ugaussian_Qinv Usage Double_Type[] cdf_ugaussian_Qinv (Double_Type[] Q) 12.1.71. cdf_weibull_P Synopsis S-Lang version of gsl_cdf_weibull_P Usage Double_Type[] cdf_weibull_P (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 12.1.72. cdf_weibull_Pinv Synopsis S-Lang version of gsl_cdf_weibull_Pinv Usage Double_Type[] cdf_weibull_Pinv (P, a, b) Double_Type[] P Double_Type[] a Double_Type[] b 12.1.73. cdf_weibull_Q Synopsis S-Lang version of gsl_cdf_weibull_Q Usage Double_Type[] cdf_weibull_Q (x, a, b) Double_Type[] x Double_Type[] a Double_Type[] b 12.1.74. cdf_weibull_Qinv Synopsis S-Lang version of gsl_cdf_weibull_Qinv Usage Double_Type[] cdf_weibull_Qinv (Q, a, b) Double_Type[] Q Double_Type[] a Double_Type[] b 13. gslinteg: The GSL Numerical Integration Module The gslinteg wraps the GSL 1-d numerical integration of functions of the form \int_a^b dx\;w(x)f(x;p) , where w(x) is a weight function whose form depends upon the specific integration routine, and p represents an optional set of paramters that the function depends upon. The function f(x;p) must be supplied by the user in one of the following forms, depending upon the existence of the optional parameters. define func (x) { ...; return f }; define func (x, parms) { ...; return f; } The parms variable in the second form is the list of optional parame- ters represented by p. For example, consider the function f(x;a,b) = (x-a)^b It may be coded as define func (x,parms) { variable a = parms[0], b = parms[1]; return (x-a)^b; } To illustrate the use of module, the example for the gsl_integration_fixed function that appears in the GSL documentation. will be given: define example_func (x, parms) { return x^parms[0] + 1.0; } define slsh_main () { variable m = 10, n = 6; variable w = integration_fixed_alloc ("hermite", n, 0, 1, 0, 0); variable parms = {m}; % parms is a list of optional parameters variable res = integration_fixed (&example_func, parms, w); vmessage ("Result = %S", res.result); vmessage ("Function calls: %S", res.neval); vmessage ("Status: %S", res.status); vmessage ("Abserror: %S", res.abserr); } As the example illustrates, the integration function returns a struc- ture with the following fields: result : The value computed by the integrator abserr : An estimate the absolute error neval : The number of function evaluations status : The status value returned from the integrator Not all of the integration routines return a meaningful value of the abserr. Many of the underlying integration routines require a workspace to be allocated. For such cases, the module handles handles this internally. Compare the following with the corresponding example given in the GSL documentation that utilizes the gsl_integration_qags integrator: define example_func (x, parms) { variable alpha = parms[0]; return log (alpha*x)/sqrt(x); } define slsh_main () { variable alpha = 1.0; variable parms = {alpha}; variable res = integration_qags (&example_func, parms, 0, 1, 0, 1e-7, 1000); vmessage ("Result = %S", res.result); vmessage ("Function calls: %S", res.neval); vmessage ("Status: %S", res.status); vmessage ("Abserror: %S", res.abserr); } 13.1. Numerical Integration Routines 13.1.1. integration_qng Synopsis non-adaptive Gauss-Kronrod integration Usage res = integration_qng (&func, [optargs-list,] a, b, epsabs, relabs Description This function wraps the gsl_integration_qng function. See the GSL documentation for more information. 13.1.2. integration_qag Synopsis Adaptive integration Usage res = integration_qag (&func, [optargs_list,] a, b, epsabs, relabs, limit, key) Description This function wraps the gsl_integration_qag function. See the GSL documentation for more information. 13.1.3. integration_qags Synopsis Adaptive integration with singularities Usage res = integration_qags (&func, [optargs_list,] a, b, epsabs, relabs, limit, key) Description This function wraps the gsl_integration_qags function. See the GSL documentation for more information. 13.1.4. integration_qagp Synopsis Adaptive integration with known singular points Usage res = integration_qagp (&func, [optargs_list, pts, epsabs, epsrel, limit) Description This function wraps the gsl_integration_qagp function. See the GSL documentation for more information. 13.1.5. integration_qagi Synopsis Adaptive integration on infinite intervals Usage res = integration_qagi (&func, [optargs_list,] epsabs, epsrel, limit) Description This function wraps the gsl_integration_qagi function. See the GSL documentation for more information. 13.1.6. integration_qagiu Synopsis Adaptive integration on semi-infinite intervals Usage res = integration_qagiu (&func, [optargs_list,] a, epsabs, epsrel, limit) Description This function wraps the gsl_integration_qagiu function. See the GSL documentation for more information. 13.1.7. integration_qagil Synopsis Adaptive integration on semi-infinite intervals Usage res = integration_qagil (&func, [optargs_list,] b, epsabs, epsrel, limit) Description This function wraps the gsl_integration_qagil function. See the GSL documentation for more information. 13.1.8. integration_qawc Synopsis Adaptive integration for Cauchy principal values Usage res = integration_qawc (&func, [optargs_list,] a, b, c, epsabs, epsrel, limit) Description This function wraps the gsl_integration_qawc function. See the GSL documentation for more information. #% See Also 13.1.9. integration_cquad Synopsis Doubly-adaptive integration Usage res = integration_cquad (&func, [optargs_list,] a, b, epsabs, epsrel, limit) Description This function wraps the gsl_integration_cquad function. See the GSL documentation for more information. #% See Also 13.1.10. integration_romberg Synopsis Romberg integration Usage res = integration_romberg (&func, [optargs_list,] a, b, epsabs, epsrel, limit) Description This function wraps the gsl_integration_romberg function. See the GSL documentation for more information. #% See Also 13.1.11. integration_fixed_alloc Synopsis Create a workspace for the integration_fixed function Usage fixedobj = integration_fixed_alloc (typestr, n, a, b, alpha, beta) Description This function wraps the gsl_integration_fixed_alloc function. It return a workspace that is to be passed to the integration_fixed function. The typestr parameter is used to specify the weighting functions using by the integrator. It must be one of the following: #v+ "legendre", "chebyshev", "gegenbauer", "jacobi", "laguerre", "hermite", "exponential", "rational", "chebyshev2" #v- See the GSL documentation for more information. #% See Also 13.1.12. integration_fixed Synopsis Fixed point quadrature integration Usage res = integration_fixed (&func, [optargs_list,] fixedobj) Description This function wraps the gsl_integration_fixed function. Here, fixedobj is the workspace returned by the integration_fixed_alloc function. See the GSL documentation for more information. #% See Also 13.1.13. integration_glfixed_alloc Synopsis Create a table of precomputed values for the integration_fixed function Usage glfixed_table = integration_glfixed_alloc (n) Description This function wraps the gsl_integration_glfixed_table_alloc function. It returns a table of values that is to be passed to the integration_glfixed function to perform an n-point fixed order integration. See the GSL documentation for more information. #% See Also 13.1.14. integration_glfixed Synopsis Gauss-Legendre integration Usage res = integration_glfixed (&func, [optargs_list,] a, b, glfixed_table) Description This function wraps the gsl_integration_glfixed function. The glfixed_table represents the precomputed values returned by the integration_glfixed_alloc function. See the GSL documentation for more information. #% See Also 13.1.15. integration_qaws_alloc Synopsis Create a table of precomputed values for the integration_qaws function Usage qaws_table = integration_qaws_alloc (alpha, beta, mu, nu) Description This function wraps the gsl_integration_qaws_table_alloc function. It returns a precomputed table of values that is to be passed to the integration_qaws function. See the GSL documentation for more information. #% See Also 13.1.16. integration_qaws Synopsis Adaptive integration for singular functions Usage res = integration_qaws (&func, [optargs_list,] a, b, epsabs, epsrel, limit, qaws_table) Description This function wraps the gsl_integration_qaws function. Here, qaws_table represents the pre-computed values returned by the integration_qaws_alloc function. See the GSL documentation for more information. #% See Also 13.1.17. integration_qawo_alloc Synopsis Create a table of precomputed values for the integration_qawo function Usage res = integration_qawo_alloc (omega, L, type, n) Description This function wraps the gsl_integration_qawo_table_alloc function. It returns a precomputed table of Chebyshev moments that is to be passed to the integration_qawo function. Here, type must be one of the symbolic constants GSL_INTEG_COSINE or GSL_INTEG_SINE. See the GSL documentation for more information. #% See Also 13.1.18. integration_qawo Synopsis Adaptive integration for oscillatory functions Usage res = integration_qawo (&func, [optargs_list,] a, epsabs, epsrel, limit, qawo_table) Description This function wraps the gsl_integration_qawo function. Here, qawo_table is to be precomputed using the integration_qawo_alloc function. See the GSL documentation for more information. #% See Also 13.1.19. integration_qawf Synopsis Adaptive integration for Fourier integrals Usage res = integration_qawf (&func, [optargs_list, a, epsabs, limit, qawo_table] ) Description This function wraps the gsl_integration_qawf function. Here, qawo_table is to be precomputed using the integration_qawo_alloc function. See the GSL documentation for more information. #% See Also slgsl-pre0.10.0-7/doc/index.html0000644000175000000620000000046212105106006015140 0ustar johnstaff GSL Module Documentation HTML and PDF versions of the GSL Module documentation may be found at http://space.mit.edu/cxc/software/slang/modules/gsl/docs.html. slgsl-pre0.10.0-7/doc/tm/0002755000175000000620000000000014001614376013576 5ustar johnstaffslgsl-pre0.10.0-7/doc/tm/Makefile0000644000175000000620000000534714001614376015245 0ustar johnstaff# -*- sh -*- # # To create the SGML files, you will need to install the tm-utils # package. See http://www.jedsoft.org/ for more information. # TMEXPAND = tmexpand SL2TM = tm-strip TM2HLP = $(TMEXPAND) -Mslhlp MODULE = slgsl HLPFUNS_TM = $(MODULE)funs.tm AUTOGEN_TM = MODULE_DEPS = $(MODULE)funs.tm $(AUTOGEN_TM) HLP_FILE_DEPS = rtl/*.tm TXT_FILES = $(MODULE).txt SGML_FILES = $(MODULE).sgml HTML_FILES = $(MODULE).html TEX_FILES = $(MODULE).tex PS_FILES = $(MODULE).ps PDF_FILES = $(MODULE).pdf HLP_FILE = $(MODULE).hlp SGML2LATEX = sgml2latex -p letter -o tex SGML2HTML = sgml2html SGML2TXT = sgml2txt -f LATEX = latex PDFLATEX = pdflatex TEXTDIR = ../text PSDIR = ../ps HTMLDIR = ../html SGMLDIR = ../sgml PDFDIR = ../pdf HELPDIR = ../help SUBDIRS = $(TEXTDIR) $(HTMLDIR) $(PSDIR) $(SGMLDIR) $(PDFDIR) $(HELPDIR) SRCDIR = `pwd` default: $(TXT_FILES) $(HLP_FILE) all: $(HTML_FILES) $(PDF_FILES) $(TXT_FILES) $(HLP_FILE) text-files: $(TXT_FILES) #----- SGML Files ----------------------------------------------------------- $(MODULE).sgml : $(MODULE).tm $(MODULE_DEPS) $(TMEXPAND) -I. -I$(MACRODIR) $(MODULE).tm $(MODULE).sgml #----- HTML Files ----------------------------------------------------------- $(MODULE).html : $(MODULE).sgml $(SGML2HTML) $(MODULE).sgml #----- TeX Files ------------------------------------------------------------ $(MODULE).tex : $(MODULE).sgml $(SGML2LATEX) $(MODULE).sgml ./fixtex.sl $(MODULE).tex #----- PDF Files ----------------------------------------------------------- $(MODULE).pdf : $(MODULE).tex $(MAKE) texclean $(PDFLATEX) $(MODULE).tex $(PDFLATEX) $(MODULE).tex $(PDFLATEX) $(MODULE).tex #----- PS Files ----------------------------------------------------------- $(MODULE).ps : $(MODULE).tex texclean $(LATEX) $(MODULE).tex $(LATEX) $(MODULE).tex $(LATEX) $(MODULE).tex dvips -o $(MODULE).ps $(MODULE).dvi #----- Text Files ----------------------------------------------------------- $(MODULE).txt: $(MODULE).sgml $(SGML2TXT) $(MODULE).sgml ./fixtxt $(MODULE).txt #---------------------------------------------------------------------------- help-files: $(HLP_FILE) $(HLP_FILE): $(HLPFUNS_TM) $(HLP_FILE_DEPS) $(TMEXPAND) -I$(MACRODIR) -Mslhlp $(HLPFUNS_TM) $(HLP_FILE) texclean: -rm -f *.dvi *.log *.aux *.toc *.out clean: texclean -rm -f *~ rtl/*.BAK rtl/*~ *.tmp *-error distclean: clean -rm -f *.html *.ps $(HLP_FILE) $(TXT_FILES) $(TEX_FILES) $(SGML_FILES) $(PDF_FILES) $(AUTOGEN_TM) install-txt: $(TXT_FILES) -mv $(TXT_FILES) ../text install-help: $(HLP_FILE) -mkdir -p $(HELPDIR) -mv $(HLP_FILE) $(HELPDIR) install-all: all install-help install-txt $(PDF_FILES) -mkdir -p $(HTMLDIR) $(PSDIR) $(PDFDIR) -mv *.html $(HTMLDIR) -mv $(PDF_FILES) ../pdf # -mv $(PS_FILES) ../ps install: install-txt install-help slgsl-pre0.10.0-7/doc/tm/slgsl.tm0000644000175000000620000004733414001614376015275 0ustar johnstaff#% -*- mode: tm; mode: fold -*- #%{{{Macros #i linuxdoc.tm #i mathsym.tm #d slang \bf{S-lang} #d exmp#1 \tt{$1} #d var#1 \tt{$1} #d ivar#1 \tt{$1} #d ifun#1 \tt{$1} #d cvar#1 \tt{$1} #d cfun#1 \tt{$1} #d svar#1 \tt{$1} #d sfun#1 \tt{$1} #d icon#1 \tt{$1} #d chapter#1 $1

#d preface #d tag#1 $1 #d function#1 \sect1{$1\label{$1}} #d variable#1 \sect1{$1\label{$1}} #d function_sect#1 \sect{$1} #d begin_constant_sect#1 \sect{$1} #d constant#1 $1 #d end_constant_sect #d synopsis#1 Synopsis $1 #d keywords#1 Keywords $1 #d usage#1 Usage $1 #d description Description #d example Example #d notes Notes #d seealso#1 See Also \linuxdoc_list_to_ref{$1} #d done

#d -1 -1 #d 0 0 #d 1 1 #d 2 2 #d 3 3 #d 4 4 #d 5 5 #d 6 6 #d 7 7 #d 8 8 #d 9 9 #d NULL NULL #d documentstyle book #%}}} #d GSLurl http://www.gnu.org/software/gsl/ #d GSLdoc http://www.gnu.org/software/gsl/manual/gsl-ref_toc.html #d GSLmoduleurl http://space.mit.edu/CXC/software/slang/modules/gsl/ #d GSL \url{\GSLurl}{GSL} #d module#1 \tt{$1} #d file#1 \tt{$1} #d slang-documentation \ \url{http://www.jedsoft.org/slang/doc/html/slang.html}{S-Lang documentation} \linuxdoc \begin{\documentstyle} \title S-Lang GSL Module Reference \author John E. Davis, \tt{jed@jedsoft.org} \date \__today__ \toc \chapter{Introduction to GSL} #%{{{ The GNU Scientific Library (\GSL) is a vast collection of robust and well documented numerical functions. It includes support for many special functions, random numbers, interpolation and integration routines, and much more. For more information about GSL, visit \url{\GSLurl}. Many of the routines in the GSL may be made available to the \slang interpreter via the GSL modules described by this document, whose most recent version may be found at \url{\GSLmoduleurl}. At the moment, the following GSL modules are available: \itemize{ \item \module{gslsf}: The GSL special function module. Currently, this module provides an interface to nearly 200 GSL special functions. \item \module{gslconst}: The GSL constants module. This module defines many constants such as \icon{CONST_MKSA_SPEED_OF_LIGHT}, \icon{CONST_CGSM_BOLTZMANN}, etc. \item \module{gslinterp}: The GSL interpolation module, which includes routines for linear interpolation, cubic splines, etc. \item \module{gslrand}: The GSL random number module. This module supports most of GSL's random number generators and distributions. \item \module{gslcdf} The GSL cumulative distribution function module. \item \module{gslfft} The GSL fast-fourier transform module. \item \module{gslmatrix} A set of GSL routines that deal with matrices. These include eigenvalue, eigenvector, and a number of other linear algebra functions. \item\module{gsldwt} The GSL Discrete Wavelet Transform module \item\module{gslinteg} The GSL numerical integration module } There are many functions that are not yet wrapped. For example, none of GSL's ODE functions have been wrapped. Future releases of the GSL module will include more functionality. Nevertheless, what has been implemented should prove useful. #%}}} \chapter{Using the GSL Modules} #%{{{ To use one of the GSL modules in a \slang script, the module must first be loaded using the \sfun{require} function. For example, to load the GSL special function module, use #v+ require ("gslsf"); #v- The \file{gsl.sl} file exists as a convenient way to load all GSL modules (\module{gslsf}, \module{gslrand}, etc.), e.g., #v+ require ("gsl"); #v- Finally, it may be desirable to import the GSL module into a separate namespace. For example, to load the GSL special function module \module{gslsf} into a namespace called \exmp{GSL}, use #v+ require ("gsl", "G") #v- Then to access, e.g., the \exmp{hypot} function, use the \exmp{GSL->hypot}. See the \slang-documentation for more information about namespaces. Once the desired module has been loaded, intrinsics functions and variables defined by the module may be used in the usual way, e.g., #v+ require ("gslsf"); . . % Use the GSL hypot function to filter a list of (x,y) pairs % to those values that fall in a circle of radius R centered % on (0,0) define filter_region_in_circle (x, y, R) { variable i = where (hypot (x,y) < R); return (x[i], y[i]); } #v- #%}}} \chapter{Error Handling} #%{{{ This section describes how the GSL modules handle errors reported by the GSL library. The following GSL error codes are defined by the \module{gsl} module: #v+ GSL_EDOM input domain error, e.g sqrt(-1) GSL_ERANGE output range error, e.g. exp(1e100) GSL_EFAULT invalid pointer GSL_EINVAL invalid argument supplied by user GSL_EFAILED generic failure GSL_EFACTOR factorization failed GSL_ESANITY sanity check failed - shouldn't happen GSL_ENOMEM malloc failed GSL_EBADFUNC problem with user-supplied function GSL_ERUNAWAY iterative process is out of control GSL_EMAXITER exceeded max number of iterations GSL_EZERODIV tried to divide by zero GSL_EBADTOL user specified an invalid tolerance GSL_ETOL failed to reach the specified tolerance GSL_EUNDRFLW underflow GSL_EOVRFLW overflow GSL_ELOSS loss of accuracy GSL_EROUND failed because of roundoff error GSL_EBADLEN matrix, vector lengths are not conformant GSL_ENOTSQR matrix not square GSL_ESING apparent singularity detected GSL_EDIVERGE integral or series is divergent GSL_EUNSUP requested feature is not supported by the hardware GSL_EUNIMPL requested feature not (yet) implemented GSL_ECACHE cache limit exceeded GSL_ETABLE table limit exceeded GSL_ENOPROG iteration is not making progress towards solution GSL_ENOPROGJ jacobian evaluations are not improving the solution GSL_ETOLF cannot reach the specified tolerance in F GSL_ETOLX cannot reach the specified tolerance in X GSL_ETOLG cannot reach the specified tolerance in gradient GSL_EOF end of file #v- The \ifun{gsl_set_error_disposition} function may be used to indicate how the module is to handle a specified error. It takes two arguments: an error code and a value controlling how the error is to be handled: #v+ gsl_set_error_disposition (error_code, control_value) #v- If the control value is 0, the error will be ignored by the module. If the control value is 1, the module will print a warning message when the specified error is encountered. If the control value is -1, the module will generate an exception when the error is encountered. For example, #v+ gsl_set_error_disposition (GSL_EDOM, -1); #v- will cause domain errors to generate an exception, whereas #v+ gsl_set_error_disposition (GSL_EUNDRFLW, 0); #v- will cause the GSL modules to ignore underflow errors. Alternatively, the control value may be the reference to a function to be called when the specified error occurs. The function will be passed two arguments: a string whose value is the function name generating the error and the error code itself, e.g., #v+ static define edom_callback (fname, err_code) { vmessage ("%s: domain error.", fname); } gsl_set_error_disposition (GSL_EDOM, &edom_callback); y = log_1plusx (-10); #v- will result in the message \exmp{"log_1plusx: domain error."}. By default, all errors will generate exceptions except for the following, which will generate warnings: #v+ GSL_EDOM GSL_ERANGE GSL_EUNDRFLW GSL_EOVRFLW #v- #%}}} \chapter{gslinterp: The GSL Interpolation Module} #%{{{ The \module{gslinterp} module provides S-Lang interpreter access to GSL's interpolations routines. The interpolation methods include linear, polynomial, and spline interpolation. Both Cubic and Akima splines are supported with normal or periodic boundary conditions. In addition, routines for computing first and second order derivatives, as well as integrals based upon these interpolation methods are included. The wrapping of these functions differs somewhat from the interface provided by the GSL API in the interest of ease of use. The \module{gslinterp} modules actual defines two interfaces to the underlying GSL routines. The higher-level interface is the simplest to use and should suffice for most applications. As an example of its use, suppose one has a set of (x,y) pairs represented by the arrays \exmp{xa} and \exmp{ya} that one wants to use for interpolation. Then #v+ y = interp_cspline (x, xa, ya); #v- will fit a cubic spline to the points and return the of the spline at the point \exmp{x}. If \exmp{x} is an array, then the spline will be evaluated at each of the points in the array returning an array of the same shape. The low-level interface consists of several method-specific initialization functions and functions that carry out the actual interpolation. The above example may be written in terms of this interface as #v+ c = interp_cspline_init (xa, ya); y = interp_eval (c, x); #v- Here \ifun{interp_cspline_init} returns an object of type \var{GSL_Interp_Type} that represents the spline function. It is then passed to the \ifun{interp_eval} function to evaluate the spline at \exmp{x}. The advantage of the lower level interface is that it moves the overhead associated with the computation of the interpolating function (the spline in the above example) out of the function that performs the interpolation. This means that code such as #v+ c = interp_cspline_init (xa, ya); y0 = interp_eval (c, x0); y1 = interp_eval (c, x1); #v- will execute in less time than #v+ y0 = interp_cspline (x0, xa, ya); y1 = interp_cspline (x1, xa, ya); #v- #i rtl/gslinterp.tm #%}}} \chapter{gslsf: The GSL Special Functions Module} #%{{{ The special function module, \module{gslsf}, wraps nearly 200 GSL special functions. Since the special functions are described in detail in the \url{\GSLdoc}{documentation for the GSL library}, no attempt will be made here to duplicate the main documentation. Rather, a description of how the special functions have been wrapped by the module is given. GSL prefixes the special functions with the string \exmp{gsl_sf_}. This prefix is omitted from the corresponding intrinsic functions of the \module{gslsf} module. For example, the GSL function that computes spherical harmonics is called \exmp{gsl_sf_legendre_sphPlm}. However, it is represented in the module by simply \exmp{legendre_sphPlm}. Most of GSL's special functions take scalar arguments and returns a scalar. For example, \exmp{gsl_sf_legendre_sphPlm} takes three arguments (int, int, and a double) and returns a double, e.g., #v+ int l = 5, m = 0; double x = 0.5; double y = gsl_sf_legendre_sphPlm (l, m, x); #v- While the module supports the scalar usage, e.g, #v+ variable l = 5, m = 0, x = 0.5; variable y = legendre_sphPlm (l, m, x); #v- it also supports vector arguments, e.g., #v+ variable l = 5, m = 0, x = [-1:1:0.1]; variable y = legendre_sphPlm (l, m, x); #v- and #v+ variable l = 5, m = [0:l], x = 0.5; variable y = legendre_sphPlm (l, m, x); #v- Some of the functions are expensive to compute to full double precision accuracy. In the interest of speed, it may want to perform perform the computation with less precision. Hence, several of the special functions take an optional mode argument that specifies the desired precision: \icon{GSL_PREC_DOUBLE} for double precision accuracy, \icon{GSL_PREC_SINGLE} for single precision accuracy, and \icon{GSL_PREC_APPROX} for a relative accuracy of 5e-4. For example, to compute the Airy function to double precision accuracy use: #v+ y = airy_Ai (x, GSL_PREC_DOUBLE); #v- If called without the mode argument, i.e., #v+ y = airy_Ai (x); #v- the function will be computed to a default precision of \icon{GSL_PREC_SINGLE}. The default precision can be set and queried by the \ifun{gslsf_set_precision} and \ifun{gslsf_get_precision} functions, resp. Functions that do not take the optional mode argument will always be computed at full precision. #i rtl/gslsf-module.tm #%}}} \chapter{gslrand: The GSL Random Number Module} #%{{{ GSL provides more than 60 types of random number generators and about 40 random number distributions. The \module{gslrand} module provides access to all of the GSL random number generators and to nearly all of its random number distributions. Using the \module{gslrand} module is rather straightforward. First, import the module into the interpreter as described above via a statement such as #v+ require ("gslrand"); #v- The next step is to allocate a random number generator via the \ifun{rng_alloc} function. As stated above, there are more than 60 generators to choose from. To allocate an instance of the default generator (\exmp{"mt19937"}), use #v+ r = rng_alloc (); #v- Or to allocate an instance of some other generator, e.g., the lagged-fibonacci generator \exmp{"gfsr4"}, use #v+ r = rng_alloc ("gfsr4"); #v- Once the generator has been allocated, it may be used to construct random number sequences from a specific random distribution. For example, #v+ x = ran_flat (r, 0, 1); #v- may be used to obtain a random number uniformly distributed between 0 and 1. In a similar vein, #v+ x = ran_gaussian (r, 2.0); #v- will produce a gaussian distributed random number with a sigma of 2.0. For many applications, it is desirable to be able to produce arrays of random numbers. This may be accomplished by passing an addition argument to the random number distribution function that specifies how many random numbers to produce. For example, #v+ a = ran_gaussian (r, 2.0, 10000); #v- will create an array of 10000 gaussian distributed random numbers with a sigma of 2.0. If the random generator is omitted from the call to the random number distribution routines, then a default generator will be used. For example, #v+ x = ran_gaussian (2.0); #v- will generate a gaussian distributed random number with a sigma of 2.0 using the default generator. #i rtl/gslrand.tm #%}}} \chapter{gslfft: The GSL FFT module} #%{{{ The \module{gslfft} may be used to compute N dimensional fast fourier transforms (FFT). The module itself currently provides a single function called \ifun{_gsl_fft_complex} that performs a forward or backward n-dimensional FFT. The underlying GSL routines used by this function are the Swarztrauber mixed-radix routines from FFTPACK and the more general Singleton routine. The \ifun{_gsl_fft_complex} function is not meant to be called directly; rather the user should call the \sfun{fft} function, which provides a convenient wrapper for the \ifun{_gsl_fft_complex} function. #i rtl/gslfft.tm #%}}} \chapter{gsldwt: The GSL Discrete Wavelet Transform module} #%{{{ The \module{gsldwt} may be used to perform discrete wavelet transforms (DWT) for real data in both one and two dimensions. The module itself currently provides a single function called \ifun{dwt} that performs a forward or backward n-dimensional DWT. #i rtl/gsldwt.tm #%}}} \chapter{gslmatrix: A Collection of Matrix-Oriented GSL functions} #%{{{ The \slang interpreter has wide-spread native support for manipulating arrays and matrices. The \module{gslmatrix} supplements this by adding some linear algebra routines such LU decomposition as well as routines for dealing with eigenvalues and eigenvectors. \GSL has separate functions for complex numbers. Rather than creating separate wrappers for each of these functions, the complex-valued routines have been incorporated into single wrappers that support for both real and complex numbers. In this way the interface is polymorphic. #i rtl/gslmatrix.tm #%}}} \chapter{gslcdf: The GSL Cumulative Distribution Function Module} #%{{{ The \module{gslcdf} module wraps the GSL cumulative distribution functions. #i rtl/gslcdf-module.tm #%}}} \chapter{gslconst: The GSL Constants Module} #%{{{ The GSL constants module \module{gslconst} defines about 200 physical constants such as the speed of light (\icon{CONST_MKSA_SPEED_OF_LIGHT}) and Boltzmann's constant (\icon{CONST_MKSA_BOLTZMANN}). In addition to providing values in the MKSA (meters, kilograms, seconds, amperes) system, the module also includes CGSM (centimeters, grams, seconds, gauss) versions, e.g., \icon{CONST_CGSM_SPEED_OF_LIGHT}. #i rtl/gslconst-module.tm #%}}} \chapter{gslcdf: The GSL Cumulative Distribution Function Module} #%{{{ The \module{gslcdf} module wraps the GSL cumulative distribution functions. #i rtl/gslcdf-module.tm #%}}} \chapter{gslinteg: The GSL Numerical Integration Module} #%{{{ The \module{gslinteg} wraps the GSL 1-d numerical integration of functions of the form \displayeq{\\int_a^b dx\\;w(x)f(x;p)}{\\Large}, where \em{w(x)} is a weight function whose form depends upon the specific integration routine, and \em{p} represents an optional set of paramters that the function depends upon. The function \em{f(x;p)} must be supplied by the user in one of the following forms, depending upon the existence of the optional parameters. #v+ define func (x) { ...; return f }; define func (x, parms) { ...; return f; } #v- The \exmp{parms} variable in the second form is the list of optional parameters represented by \em{p}. For example, consider the function \displayeq{f(x;a,b) = (x-a)^b} It may be coded as #v+ define func (x,parms) { variable a = parms[0], b = parms[1]; return (x-a)^b; } #v- To illustrate the use of module, the example for the \exmp{gsl_integration_fixed} function that appears in the GSL documentation. \url{https://www.gnu.org/software/gsl/doc/html/integration.html#c.gsl_integration_fixed_workspace} will be given: #v+ define example_func (x, parms) { return x^parms[0] + 1.0; } define slsh_main () { variable m = 10, n = 6; variable w = integration_fixed_alloc ("hermite", n, 0, 1, 0, 0); variable parms = {m}; % parms is a list of optional parameters variable res = integration_fixed (&example_func, parms, w); vmessage ("Result = %S", res.result); vmessage ("Function calls: %S", res.neval); vmessage ("Status: %S", res.status); vmessage ("Abserror: %S", res.abserr); } #v- As the example illustrates, the integration function returns a structure with the following fields: #v+ result : The value computed by the integrator abserr : An estimate the absolute error neval : The number of function evaluations status : The status value returned from the integrator #v- Not all of the integration routines return a meaningful value of the \exmp{abserr}. Many of the underlying integration routines require a workspace to be allocated. For such cases, the module handles handles this internally. Compare the following with the corresponding example given in the GSL documentation that utilizes the \exmp{gsl_integration_qags} integrator: #v+ define example_func (x, parms) { variable alpha = parms[0]; return log (alpha*x)/sqrt(x); } define slsh_main () { variable alpha = 1.0; variable parms = {alpha}; variable res = integration_qags (&example_func, parms, 0, 1, 0, 1e-7, 1000); vmessage ("Result = %S", res.result); vmessage ("Function calls: %S", res.neval); vmessage ("Status: %S", res.status); vmessage ("Abserror: %S", res.abserr); } #v- #i rtl/gslinteg.tm #%}}} \end{\documentstyle} slgsl-pre0.10.0-7/doc/tm/slgslfuns.tm0000644000175000000620000000035414001614376016160 0ustar johnstaff#d function_sect#1 #d GSL GNU Scientific Library #i rtl/gslcdf-module.tm #i rtl/gslfft.tm #i rtl/gslrand.tm #i rtl/gslsf-module.tm #% #i rtl/gslconst-module.tm #i rtl/gslinterp.tm #i rtl/gslmatrix.tm #i rtl/gsldwt.tm #i rtl/gslinteg.tm slgsl-pre0.10.0-7/doc/tm/rtl/0002755000175000000620000000000014713350753014405 5ustar johnstaffslgsl-pre0.10.0-7/doc/tm/rtl/gslinteg.tm0000644000175000000620000001721414074757130016566 0ustar johnstaff\function_sect{Numerical Integration Routines} \function{integration_qng} \synopsis{non-adaptive Gauss-Kronrod integration} \usage{res = integration_qng (&func, [optargs-list,] a, b, epsabs, relabs} \description This function wraps the \exmp{gsl_integration_qng} function. See the GSL documentation for more information. #% \seealso{} \done \function{integration_qag} \synopsis{Adaptive integration} \usage{res = integration_qag (&func, [optargs_list,] a, b, epsabs, relabs, limit, key)} \description This function wraps the \exmp{gsl_integration_qag} function. The paramter \exmp{key} must be set to one of the following symbolic constants: #v+ GSL_INTEG_GAUSS15 GSL_INTEG_GAUSS21 GSL_INTEG_GAUSS31 GSL_INTEG_GAUSS41 GSL_INTEG_GAUSS51 GSL_INTEG_GAUSS61 #v- See the GSL documentation for more information. #% \seealso{} \done \function{integration_qags} \synopsis{Adaptive integration with singularities} \usage{res = integration_qags (&func, [optargs_list,] a, b, epsabs, relabs, limit)} \description This function wraps the \exmp{gsl_integration_qags} function. See the GSL documentation for more information. #% \seealso{} \done \function{integration_qagp} \synopsis{Adaptive integration with known singular points} \usage{res = integration_qagp (&func, [optargs_list,] pts, epsabs, epsrel, limit)} \description This function wraps the \exmp{gsl_integration_qagp} function. Here, \exmp{pts} is an array of ordered values \exmp{[a, x1, x2, ..., xn, b]} that contain the end-points and the locations \exmp{x1, ..., xn} of singularities. See the GSL documentation for more information. #% \seealso{} \done \function{integration_qagi} \synopsis{Adaptive integration on infinite intervals} \usage{res = integration_qagi (&func, [optargs_list,] epsabs, epsrel, limit)} \description This function wraps the \exmp{gsl_integration_qagi} function. See the GSL documentation for more information. #% \seealso{} \done \function{integration_qagiu} \synopsis{Adaptive integration on semi-infinite intervals} \usage{res = integration_qagiu (&func, [optargs_list,] a, epsabs, epsrel, limit)} \description This function wraps the \exmp{gsl_integration_qagiu} function. See the GSL documentation for more information. #% \seealso{} \done \function{integration_qagil} \synopsis{Adaptive integration on semi-infinite intervals} \usage{res = integration_qagil (&func, [optargs_list,] b, epsabs, epsrel, limit)} \description This function wraps the \exmp{gsl_integration_qagil} function. See the GSL documentation for more information. #% \seealso{} \done \function{integration_qawc} \synopsis{Adaptive integration for Cauchy principal values} \usage{res = integration_qawc (&func, [optargs_list,] a, b, c, epsabs, epsrel, limit)} \description This function wraps the \exmp{gsl_integration_qawc} function. See the GSL documentation for more information. #% \seealso{} \done \function{integration_cquad} \synopsis{Doubly-adaptive integration} \usage{res = integration_cquad (&func, [optargs_list,] a, b, epsabs, epsrel, limit)} \description This function wraps the \exmp{gsl_integration_cquad} function. See the GSL documentation for more information. #% \seealso{} \done \function{integration_romberg} \synopsis{Romberg integration} \usage{res = integration_romberg (&func, [optargs_list,] a, b, epsabs, epsrel, limit)} \description This function wraps the \exmp{gsl_integration_romberg} function. See the GSL documentation for more information. #% \seealso{} \done \function{integration_fixed_alloc} \synopsis{Create a workspace for the integration_fixed function} \usage{fixedobj = integration_fixed_alloc (typestr, n, a, b, alpha, beta)} \description This function wraps the \exmp{gsl_integration_fixed_alloc} function. It return a workspace that is to be passed to the \ifun{integration_fixed} function. The \exmp{typestr} parameter is used to specify the weighting functions using by the integrator. It must be one of the following: #v+ "legendre", "chebyshev", "gegenbauer", "jacobi", "laguerre", "hermite", "exponential", "rational", "chebyshev2" #v- See the GSL documentation for more information. #% \seealso{} \done \function{integration_fixed} \synopsis{Fixed point quadrature integration} \usage{res = integration_fixed (&func, [optargs_list,] fixedobj)} \description This function wraps the \exmp{gsl_integration_fixed} function. Here, \exmp{fixedobj} is the workspace returned by the \exmp{integration_fixed_alloc} function. See the GSL documentation for more information. #% \seealso{} \done \function{integration_glfixed_alloc} \synopsis{Create a table of precomputed values for the integration_fixed function} \usage{glfixed_table = integration_glfixed_alloc (n)} \description This function wraps the \exmp{gsl_integration_glfixed_table_alloc} function. It returns a table of values that is to be passed to the \ifun{integration_glfixed} function to perform an n-point fixed order integration. See the GSL documentation for more information. #% \seealso{} \done \function{integration_glfixed} \synopsis{Gauss-Legendre integration} \usage{res = integration_glfixed (&func, [optargs_list,] a, b, glfixed_table)} \description This function wraps the \exmp{gsl_integration_glfixed} function. The \exmp{glfixed_table} represents the precomputed values returned by the \ifun{integration_glfixed_alloc} function. See the GSL documentation for more information. #% \seealso{} \done \function{integration_qaws_alloc} \synopsis{Create a table of precomputed values for the integration_qaws function} \usage{qaws_table = integration_qaws_alloc (alpha, beta, mu, nu)} \description This function wraps the \exmp{gsl_integration_qaws_table_alloc} function. It returns a precomputed table of values that is to be passed to the \ifun{integration_qaws} function. See the GSL documentation for more information. #% \seealso{} \done \function{integration_qaws} \synopsis{Adaptive integration for singular functions} \usage{res = integration_qaws (&func, [optargs_list,] a, b, epsabs, epsrel, limit, qaws_table)} \description This function wraps the \exmp{gsl_integration_qaws} function. Here, \exmp{qaws_table} represents the pre-computed values returned by the \exmp{integration_qaws_alloc} function. See the GSL documentation for more information. #% \seealso{} \done \function{integration_qawo_alloc} \synopsis{Create a table of precomputed values for the integration_qawo function} \usage{res = integration_qawo_alloc (omega, L, type, n)} \description This function wraps the \exmp{gsl_integration_qawo_table_alloc} function. It returns a precomputed table of Chebyshev moments that is to be passed to the \ifun{integration_qawo} function. Here, \exmp{type} must be one of the symbolic constants \exmp{GSL_INTEG_COSINE} or \exmp{GSL_INTEG_SINE}. See the GSL documentation for more information. #% \seealso{} \done \function{integration_qawo} \synopsis{Adaptive integration for oscillatory functions} \usage{res = integration_qawo (&func, [optargs_list,] a, epsabs, epsrel, limit, qawo_table)} \description This function wraps the \exmp{gsl_integration_qawo} function. Here, \exmp{qawo_table} is to be precomputed using the \ifun{integration_qawo_alloc} function. See the GSL documentation for more information. #% \seealso{} \done \function{integration_qawf} \synopsis{Adaptive integration for Fourier integrals} \usage{res = integration_qawf (&func, [optargs_list, a, epsabs, limit, qawo_table] )} \description This function wraps the \exmp{gsl_integration_qawf} function. Here, \exmp{qawo_table} is to be precomputed using the \ifun{integration_qawo_alloc} function. See the GSL documentation for more information. #% \seealso{} \done slgsl-pre0.10.0-7/doc/tm/rtl/gslrand.tm0000644000175000000620000002653112105106006016365 0ustar johnstaff\function_sect{Random Number Generation Routines} \function{rng_alloc} \synopsis{Allocate an instance of a random number generator} \usage{Rand_Type rng_alloc ([generator])} \done \function{rng_set} \synopsis{Seed a random number generator} \usage{rng_set ([Rand_Type gen,] ULong_Type seed)} \done \function{rng_get} \synopsis{rng_get} \usage{x = rng_get ([Rand_Type gen] [, Int_Type num])} \done \function{rng_get_rng_types} \synopsis{Get a list of all supported generators} \usage{String_Type[] = rng_get_rng_types ()} \done \function{rng_uniform} \synopsis{Get a uniformly distributed random number} \usage{x = rng_uniform ([Rand_Type gen] [, Int_Type num])} \done \function{rng_uniform_pos} \synopsis{Generate a uniformly distributed non-zero random number} \usage{x = rng_uniform_pos ([Rand_Type gen] [, Int_Type num])} \done \function{rng_max} \synopsis{Obtain the maximum value produced by a random number generator } \usage{ULong_Type rng_max (Rand_Type gen)} \done \function{rng_min} \synopsis{Obtain the minimum value produced by a random number generator } \usage{ULong_Type rng_min (Rand_Type gen)} \done \function_sect{Random Number Distributions} \function{ran_bernoulli} \synopsis{Produce Bernoulli distributed random numbers} \usage{x = ran_bernoulli ([Rand_Type gen,] Double_Type p [,Int_Type num] } \done \function{ran_beta} \synopsis{Produce distributed random numbers} \usage{x = ran_beta ([Rand_Type gen,] Double_Type a, Double_Type b [,Int_Type num])} \done \function{ran_binomial} \synopsis{Produce random numbers from the binomial distribution} \usage{x = ran_binomial ([Rand_Type gen,] Double_Type p, Int_Type n [,Int_Type num])} \done \function{ran_cauchy} \synopsis{Produce random numbers from the Cauchy distribution} \usage{x = ran_cauchy ([Rand_Type gen,] Double_Type mu [,Int_Type num])} \done \function{ran_chisq} \synopsis{Produce chi-squared distributed random numbers} \usage{x = ran_chisq ([Rand_Type gen,] Double_Type nu [,Int_Type num])} \done #%+ \function{ran_erlang} \synopsis{Produce distributed random numbers} \usage{x = ran_erlang ([Rand_Type gen] [,Int_Type num])} \done #%- \function{ran_exponential} \synopsis{Produce exponentially distributed random numbers} \usage{x = ran_exponential ([Rand_Type gen,] Double_Type mu [,Int_Type num])} \done \function{ran_exppow} \synopsis{Produce random numbers from the exponential power distribution} \usage{x = ran_exppow ([Rand_Type gen,] Double_Type mu, Double_Type a [,Int_Type num])} \done \function{ran_fdist} \synopsis{Produce F-distributed random numbers} \usage{x = ran_fdist ([Rand_Type gen,] Double_Type nu1, Double_Type nu2 [,Int_Type num])} \done \function{ran_flat} \synopsis{Produce uniformly distributed random numbers} \usage{x = ran_flat ([Rand_Type gen,] Double_Type a, Double_Type b [,Int_Type num])} \done \function{ran_gamma} \synopsis{Produce a random number from the gamma distribution} \usage{x = ran_gamma ([Rand_Type gen,] Double_Type a, Double_Type b [,Int_Type num])} \done #%+ \function{ran_gamma_int} \synopsis{Produce distributed random numbers} \usage{x = ran_gamma_int ([Rand_Type gen] [,Int_Type num])} \done #%- \function{ran_gaussian} \synopsis{Produce gaussian distributed random numbers} \usage{x = ran_gaussian ([Rand_Type gen,] Double_Type sigma [,Int_Type num])} \done \function{ran_gaussian_ratio_method} \synopsis{Produce gaussian distributed random numbers} \usage{x = ran_gaussian_ratio_method ([Rand_Type gen,] Double_Type sigma [,Int_Type num])} \done \function{ran_gaussian_tail} \synopsis{Produce gaussian distributed random numbers from the tail} \usage{x = ran_gaussian_tail ([Rand_Type gen,] Double_Type a, Double_Type sigma [,Int_Type num])} \done \function{ran_geometric} \synopsis{Produce random integers from the geometric distribution} \usage{x = ran_geometric ([Rand_Type gen,] Double_Type p [,Int_Type num])} \done \function{ran_gumbel1} \synopsis{Produce random numbers from the type-1 Gumbel distribution} \usage{x = ran_gumbel1 ([Rand_Type gen,] Double_Type a, Double_Type b [,Int_Type num])} \done \function{ran_gumbel2} \synopsis{Produce random numbers from the type-2 Gumbel distribution} \usage{x = ran_gumbel2 ([Rand_Type gen,] Double_Type a, Double_Type b [,Int_Type num])} \done #%+ \function{ran_landau} \synopsis{Produce random numbers from the landau distribution} \usage{x = ran_landau ([Rand_Type gen] [,Int_Type num])} \done #%- \function{ran_laplace} \synopsis{Produce random numbers from the Laplace distribution} \usage{x = ran_laplace ([Rand_Type gen,] Double_Type mu [,Int_Type num])} \done \function{ran_levy} \synopsis{Produce random numbers from the Levy distribution} \usage{x = ran_levy ([Rand_Type gen,] Double_Type mu, Double_Type a [,Int_Type num])} \done \function{ran_logarithmic} \synopsis{Produce random numbers from the logarithmic distribution} \usage{x = ran_logarithmic ([Rand_Type gen,] Double_Type p [,Int_Type num])} \done \function{ran_logistic} \synopsis{Produce random numbers from the logistic distribution} \usage{x = ran_logistic ([Rand_Type gen,] Double_Type mu [,Int_Type num])} \done \function{ran_lognormal} \synopsis{Produce random numbers from the lognormal distribution} \usage{x = ran_lognormal ([Rand_Type gen,] Double_Type zeta, Double_Type sigma [,Int_Type num])} \done \function{ran_negative_binomial} \synopsis{Produce random numbers from the negative binomial distribution} \usage{x = ran_negative_binomial ([Rand_Type gen,] Double_Type p, Double_Type n [,Int_Type num])} \done \function{ran_pareto} \synopsis{Produce random numbers from the Pareto distribution} \usage{x = ran_pareto ([Rand_Type gen,] Double_Type a, Double_Type b [,Int_Type num])} \done \function{ran_pascal} \synopsis{Produce random numbers from the Pascal distribution} \usage{x = ran_pascal ([Rand_Type gen,] Double_Type p, Int_Type k [,Int_Type num])} \done \function{ran_poisson} \synopsis{Produce random numbers from the Poisson distribution} \usage{x = ran_poisson ([Rand_Type gen,] Double_Type mu [,Int_Type num])} \done \function{ran_rayleigh} \synopsis{Produce random numbers from the Rayleigh distribution} \usage{x = ran_rayleigh ([Rand_Type gen,] Double_Type sigma [,Int_Type num])} \done \function{ran_rayleigh_tail} \synopsis{Produce random numbers from the tail of the Rayleigh distribution} \usage{x = ran_rayleigh_tail ([Rand_Type gen,] Double_Type a, Double_Type sigma [,Int_Type num])} \done \function{ran_tdist} \synopsis{Produce random numbers from the t-distribution} \usage{x = ran_tdist ([Rand_Type gen,] Double_Type nu [,Int_Type num])} \done \function{ran_ugaussian} \synopsis{Produce random numbers from the gaussian distribution} \usage{x = ran_ugaussian ([Rand_Type gen] [,Int_Type num])} \done \function{ran_ugaussian_ratio_method} \synopsis{Produce random numbers from the gaussian distribution} \usage{x = ran_ugaussian_ratio_method ([Rand_Type gen] [,Int_Type num])} \done \function{ran_ugaussian_tail} \synopsis{Produce random numbers from the tail of the gaussian distribution} \usage{x = ran_ugaussian_tail ([Rand_Type gen,] Double_Type a [,Int_Type num])} \done \function{ran_weibull} \synopsis{Produce random numbers from the Weibull distribution} \usage{x = ran_weibull ([Rand_Type gen,] Double_Type mu, Double_Type a [,Int_Type num])} \done \function_sect{PDF Functions} \function{ran_beta_pdf} \synopsis{S-Lang version of gsl_ran_beta_pdf} \usage{Double_Type[] ran_beta_pdf (x, a, b)} #v+ Double_Type[] x Double_Type[] a Double_Type[] b #v- \done \function{ran_cauchy_pdf} \synopsis{S-Lang version of gsl_ran_cauchy_pdf} \usage{Double_Type[] ran_cauchy_pdf (Double_Type[] x, Double_Type[] a)} \done \function{ran_chisq_pdf} \synopsis{S-Lang version of gsl_ran_chisq_pdf} \usage{Double_Type[] ran_chisq_pdf (Double_Type[] x, Double_Type[] nu)} \done \function{ran_erlang_pdf} \synopsis{S-Lang version of gsl_ran_erlang_pdf} \usage{Double_Type[] ran_erlang_pdf (x, a, n)} #v+ Double_Type[] x Double_Type[] a Double_Type[] n #v- \done \function{ran_exponential_pdf} \synopsis{S-Lang version of gsl_ran_exponential_pdf} \usage{Double_Type[] ran_exponential_pdf (Double_Type[] x, Double_Type[] mu)} \done \function{ran_exppow_pdf} \synopsis{S-Lang version of gsl_ran_exppow_pdf} \usage{Double_Type[] ran_exppow_pdf (x, a, b)} #v+ Double_Type[] x Double_Type[] a Double_Type[] b #v- \done \function{ran_fdist_pdf} \synopsis{S-Lang version of gsl_ran_fdist_pdf} \usage{Double_Type[] ran_fdist_pdf (x, nu1, nu2)} #v+ Double_Type[] x Double_Type[] nu1 Double_Type[] nu2 #v- \done \function{ran_flat_pdf} \synopsis{S-Lang version of gsl_ran_flat_pdf} \usage{Double_Type[] ran_flat_pdf (x, a, b)} #v+ Double_Type[] x Double_Type[] a Double_Type[] b #v- \done \function{ran_gamma_pdf} \synopsis{S-Lang version of gsl_ran_gamma_pdf} \usage{Double_Type[] ran_gamma_pdf (x, a, b)} #v+ Double_Type[] x Double_Type[] a Double_Type[] b #v- \done \function{ran_gaussian_pdf} \synopsis{S-Lang version of gsl_ran_gaussian_pdf} \usage{Double_Type[] ran_gaussian_pdf (Double_Type[] x, Double_Type[] sigma)} \done \function{ran_gaussian_tail_pdf} \synopsis{S-Lang version of gsl_ran_gaussian_tail_pdf} \usage{Double_Type[] ran_gaussian_tail_pdf (x, a, sigma)} #v+ Double_Type[] x Double_Type[] a Double_Type[] sigma #v- \done \function{ran_gumbel1_pdf} \synopsis{S-Lang version of gsl_ran_gumbel1_pdf} \usage{Double_Type[] ran_gumbel1_pdf (x, a, b)} #v+ Double_Type[] x Double_Type[] a Double_Type[] b #v- \done \function{ran_gumbel2_pdf} \synopsis{S-Lang version of gsl_ran_gumbel2_pdf} \usage{Double_Type[] ran_gumbel2_pdf (x, a, b)} #v+ Double_Type[] x Double_Type[] a Double_Type[] b #v- \done \function{ran_landau_pdf} \synopsis{S-Lang version of gsl_ran_landau_pdf} \usage{Double_Type[] ran_landau_pdf (Double_Type[] x)} \done \function{ran_laplace_pdf} \synopsis{S-Lang version of gsl_ran_laplace_pdf} \usage{Double_Type[] ran_laplace_pdf (Double_Type[] x, Double_Type[] a)} \done \function{ran_logistic_pdf} \synopsis{S-Lang version of gsl_ran_logistic_pdf} \usage{Double_Type[] ran_logistic_pdf (Double_Type[] x, Double_Type[] a)} \done \function{ran_lognormal_pdf} \synopsis{S-Lang version of gsl_ran_lognormal_pdf} \usage{Double_Type[] ran_lognormal_pdf (x, zeta, sigma)} #v+ Double_Type[] x Double_Type[] zeta Double_Type[] sigma #v- \done \function{ran_pareto_pdf} \synopsis{S-Lang version of gsl_ran_pareto_pdf} \usage{Double_Type[] ran_pareto_pdf (x, a, b)} #v+ Double_Type[] x Double_Type[] a Double_Type[] b #v- \done \function{ran_rayleigh_pdf} \synopsis{S-Lang version of gsl_ran_rayleigh_pdf} \usage{Double_Type[] ran_rayleigh_pdf (Double_Type[] x, Double_Type[] sigma)} \done \function{ran_rayleigh_tail_pdf} \synopsis{S-Lang version of gsl_ran_rayleigh_tail_pdf} \usage{Double_Type[] ran_rayleigh_tail_pdf (x, a, sigma)} #v+ Double_Type[] x Double_Type[] a Double_Type[] sigma #v- \done \function{ran_tdist_pdf} \synopsis{S-Lang version of gsl_ran_tdist_pdf} \usage{Double_Type[] ran_tdist_pdf (Double_Type[] x, Double_Type[] nu)} \done \function{ran_ugaussian_pdf} \synopsis{S-Lang version of gsl_ran_ugaussian_pdf} \usage{Double_Type[] ran_ugaussian_pdf (Double_Type[] x)} \done \function{ran_ugaussian_tail_pdf} \synopsis{S-Lang version of gsl_ran_ugaussian_tail_pdf} \usage{Double_Type[] ran_ugaussian_tail_pdf (Double_Type[] x, Double_Type[] a)} \done \function{ran_weibull_pdf} \synopsis{S-Lang version of gsl_ran_weibull_pdf} \usage{Double_Type[] ran_weibull_pdf (x, a, b)} #v+ Double_Type[] x Double_Type[] a Double_Type[] b #v- \done slgsl-pre0.10.0-7/doc/tm/rtl/gsldwt.tm0000644000175000000620000000251212320462336016242 0ustar johnstaff\function_sect{Discrete Wavelet Transform Routines} \function{wavelet_transform} \synopsis{Perform an N-d Discrete Wavelet Transform} \usage{w = wavelet_transform (x, dir)} \description This routine computes the DWT of an array \exmp{x} and returns the result. The optional \exmp{dir} parameter specifies the direction of the transform. A forward transform will be produced for positive values of \exmp{dir} (default value) and a reverse transform will be computed for negative values. Array dimension(s) must be an integer power of two. The result will be an array of the same size and dimensionality as the the input array. The following qualifiers may be used : #v+ type = DWT_HAAR|DWT_DAUBECHIES|DWT_BSPLINE k = value Selects the specific member of the wavelet family. centered The centered forms of the wavelets align the coefficients of the various sub-bands on edges. nsf Choose the "non-standard" forms ordering of the rows and columns in the two-dimensional wavelet transform. #v- The following wavelet types are implemented : Daubechies (k = 4, 6, ..., 20, with k even), Haar (k = 2), bsplines (k = 100*i + j are 103, 105, 202, 204, 206, 208, 301, 303, 305 307, 309). \done slgsl-pre0.10.0-7/doc/tm/rtl/gslfft.tm0000644000175000000620000000727514540776552016254 0ustar johnstaff\function_sect{Fast Fourier Transform Routines} \function{_gsl_fft_complex} \synopsis{Perform an N-d FFT} \usage{y = _gsl_fft_complex (x, dir)} \description This routine computes the FFT of an array \exmp{x} and returns the result. The integer-valued parameter \exmp{dir} parameter specifies the direction of the transform. A forward transform will be produced for positive values of \exmp{dir} and a reverse transform will be computed for negative values. The result will be a complex array of the same size and dimensionality as the the input array. \notes It is better to call this routine indirectly using the \sfun{fft} function. \seealso{fft} \done \function{fft} \synopsis{Perform an N-d FFT} \usage{y = fft (x, dir)} \description This routine computes the FFT of an array \exmp{x} and returns the result. The integer-valued parameter \exmp{dir} parameter specifies the direction of the transform. A forward transform will be produced for positive values of \exmp{dir} and a reverse transform will be computed for negative values. The result will be a complex array of the same size and dimensionality as the the input array. \example Assume that the array \exmp{x} represents the values of a signal that is sampled at 10 Hz, i.e., with a period \exmp{T} of 0.1 secs. Then #v+ T = 0.1; N = length(x); y = fft (x, 1); #v- will result in the \exmp{y} being set to the FFT of the samples \var{x}. The frequencies represented by \var{y} contains both positive and negative frequencies from from \exmp{-1/2T} to \exmp{+1/2T}. The frequency \exmp{f} represented by \exmp{y[i]} is given by \exmp{i/(NT)} for \exmp{i<=N/2}, and \exmp{(i-N))/NT} for \exmp{i>N/2}. If \exmp{N} is even, then the frequency appearing at \exmp{i=N/2} represents both positive and negatives values of \exmp{1/2T}. Programatically, this corresponds to #v+ f = [[0:N/2], [N/2+1-N:-1]]/double(N*T); #v- \notes This routine is currently a wrapper for the \exmp{_gsl_fft_complex} function. \seealso{_gsl_fft_complex} \done \function{convolve} \synopsis{Perform a convolution} \usage{b = convolve (array, kernel)} \description This function performs a convolution of the specified array and kernel using FFTs. One of the following qualifiers may be used to indicate how the overlap of the kernel with the edges of the array are to be handled: #v+ pad=value Pad the array with the specified value wrap Use periodic boundary-conditions reflect Reflect the pixels at the boundary nearest Use the value of the nearest edge pixel #v- The default behavior is to use pad=0.0. \notes The current implementation utilizes ffts and will expand the array to the nearest multiple of small primes for run-time efficiency. A future version may allow different methods to be used. \seealso{fft, correlate} \done \function{correlate} \synopsis{Perform a correlation} \usage{b = correlate (array, kernel)} \description This function performs a correlation of the specified array and kernel using FFTs. One of the following qualifiers may be used to indicate how the overlap of the kernel with the edges of the array are to be handled: #v+ pad=value Pad the array with the specified value wrap Use periodic boundary-conditions reflect Reflect the pixels at the boundary nearest Use the value of the nearest edge pixel #v- The default behavior is to use pad=0.0. \notes The current implementation utilizes ffts and will expand the array to the nearest multiple of small primes for run-time efficiency. A future version may allow different methods to be used. \seealso{fft, convolve} \done slgsl-pre0.10.0-7/doc/tm/rtl/gslconst-module.tm0000644000175000000620000001455212105106006020052 0ustar johnstaff\begin_constant_sect{MKSA Constants} \constant{CONST_MKSA_ACRE} \constant{CONST_MKSA_ANGSTROM} \constant{CONST_MKSA_ASTRONOMICAL_UNIT} \constant{CONST_MKSA_BAR} \constant{CONST_MKSA_BARN} \constant{CONST_MKSA_BOHR_MAGNETON} \constant{CONST_MKSA_BOHR_RADIUS} \constant{CONST_MKSA_BOLTZMANN} \constant{CONST_MKSA_BTU} \constant{CONST_MKSA_CALORIE} \constant{CONST_MKSA_CANADIAN_GALLON} \constant{CONST_MKSA_CARAT} \constant{CONST_MKSA_CUP} \constant{CONST_MKSA_CURIE} \constant{CONST_MKSA_DAY} \constant{CONST_MKSA_DEBYE} \constant{CONST_MKSA_DYNE} \constant{CONST_MKSA_ELECTRON_CHARGE} \constant{CONST_MKSA_ELECTRON_MAGNETIC_MOMENT} \constant{CONST_MKSA_ELECTRON_VOLT} \constant{CONST_MKSA_ERG} \constant{CONST_MKSA_FARADAY} \constant{CONST_MKSA_FATHOM} \constant{CONST_MKSA_FLUID_OUNCE} \constant{CONST_MKSA_FOOT} \constant{CONST_MKSA_FOOTCANDLE} \constant{CONST_MKSA_FOOTLAMBERT} \constant{CONST_MKSA_GAUSS} \constant{CONST_MKSA_GRAM_FORCE} \constant{CONST_MKSA_GRAVITATIONAL_CONSTANT} \constant{CONST_MKSA_GRAV_ACCEL} \constant{CONST_MKSA_HECTARE} \constant{CONST_MKSA_HORSEPOWER} \constant{CONST_MKSA_HOUR} \constant{CONST_MKSA_INCH} \constant{CONST_MKSA_INCH_OF_MERCURY} \constant{CONST_MKSA_INCH_OF_WATER} \constant{CONST_MKSA_JOULE} \constant{CONST_MKSA_KILOMETERS_PER_HOUR} \constant{CONST_MKSA_KILOPOUND_FORCE} \constant{CONST_MKSA_KNOT} \constant{CONST_MKSA_LAMBERT} \constant{CONST_MKSA_LIGHT_YEAR} \constant{CONST_MKSA_LITER} \constant{CONST_MKSA_LUMEN} \constant{CONST_MKSA_LUX} \constant{CONST_MKSA_MASS_ELECTRON} \constant{CONST_MKSA_MASS_MUON} \constant{CONST_MKSA_MASS_NEUTRON} \constant{CONST_MKSA_MASS_PROTON} \constant{CONST_MKSA_METER_OF_MERCURY} \constant{CONST_MKSA_METRIC_TON} \constant{CONST_MKSA_MICRON} \constant{CONST_MKSA_MIL} \constant{CONST_MKSA_MILE} \constant{CONST_MKSA_MILES_PER_HOUR} \constant{CONST_MKSA_MINUTE} \constant{CONST_MKSA_MOLAR_GAS} \constant{CONST_MKSA_NAUTICAL_MILE} \constant{CONST_MKSA_NEWTON} \constant{CONST_MKSA_NUCLEAR_MAGNETON} \constant{CONST_MKSA_OUNCE_MASS} \constant{CONST_MKSA_PARSEC} \constant{CONST_MKSA_PHOT} \constant{CONST_MKSA_PINT} \constant{CONST_MKSA_PLANCKS_CONSTANT_H} \constant{CONST_MKSA_PLANCKS_CONSTANT_HBAR} \constant{CONST_MKSA_POINT} \constant{CONST_MKSA_POISE} \constant{CONST_MKSA_POUNDAL} \constant{CONST_MKSA_POUND_FORCE} \constant{CONST_MKSA_POUND_MASS} \constant{CONST_MKSA_PROTON_MAGNETIC_MOMENT} \constant{CONST_MKSA_PSI} \constant{CONST_MKSA_QUART} \constant{CONST_MKSA_RAD} \constant{CONST_MKSA_ROENTGEN} \constant{CONST_MKSA_RYDBERG} \constant{CONST_MKSA_SOLAR_MASS} \constant{CONST_MKSA_SPEED_OF_LIGHT} \constant{CONST_MKSA_STANDARD_GAS_VOLUME} \constant{CONST_MKSA_STD_ATMOSPHERE} \constant{CONST_MKSA_STEFAN_BOLTZMANN_CONSTANT} \constant{CONST_MKSA_STILB} \constant{CONST_MKSA_STOKES} \constant{CONST_MKSA_TABLESPOON} \constant{CONST_MKSA_TEASPOON} \constant{CONST_MKSA_TEXPOINT} \constant{CONST_MKSA_THERM} \constant{CONST_MKSA_THOMSON_CROSS_SECTION} \constant{CONST_MKSA_TON} \constant{CONST_MKSA_TORR} \constant{CONST_MKSA_TROY_OUNCE} \constant{CONST_MKSA_UK_GALLON} \constant{CONST_MKSA_UK_TON} \constant{CONST_MKSA_UNIFIED_ATOMIC_MASS} \constant{CONST_MKSA_US_GALLON} \constant{CONST_MKSA_VACUUM_PERMEABILITY} \constant{CONST_MKSA_VACUUM_PERMITTIVITY} \constant{CONST_MKSA_WEEK} \constant{CONST_MKSA_YARD} \end_constant_sect \begin_constant_sect{CGSM Constants} \constant{CONST_CGSM_ACRE} \constant{CONST_CGSM_ANGSTROM} \constant{CONST_CGSM_ASTRONOMICAL_UNIT} \constant{CONST_CGSM_BAR} \constant{CONST_CGSM_BARN} \constant{CONST_CGSM_BOHR_MAGNETON} \constant{CONST_CGSM_BOHR_RADIUS} \constant{CONST_CGSM_BOLTZMANN} \constant{CONST_CGSM_BTU} \constant{CONST_CGSM_CALORIE} \constant{CONST_CGSM_CANADIAN_GALLON} \constant{CONST_CGSM_CARAT} \constant{CONST_CGSM_CUP} \constant{CONST_CGSM_CURIE} \constant{CONST_CGSM_DAY} \constant{CONST_CGSM_DYNE} \constant{CONST_CGSM_ELECTRON_CHARGE} \constant{CONST_CGSM_ELECTRON_MAGNETIC_MOMENT} \constant{CONST_CGSM_ELECTRON_VOLT} \constant{CONST_CGSM_ERG} \constant{CONST_CGSM_FARADAY} \constant{CONST_CGSM_FATHOM} \constant{CONST_CGSM_FLUID_OUNCE} \constant{CONST_CGSM_FOOT} \constant{CONST_CGSM_FOOTCANDLE} \constant{CONST_CGSM_FOOTLAMBERT} \constant{CONST_CGSM_GRAM_FORCE} \constant{CONST_CGSM_GRAVITATIONAL_CONSTANT} \constant{CONST_CGSM_GRAV_ACCEL} \constant{CONST_CGSM_HECTARE} \constant{CONST_CGSM_HORSEPOWER} \constant{CONST_CGSM_HOUR} \constant{CONST_CGSM_INCH} \constant{CONST_CGSM_INCH_OF_MERCURY} \constant{CONST_CGSM_INCH_OF_WATER} \constant{CONST_CGSM_JOULE} \constant{CONST_CGSM_KILOMETERS_PER_HOUR} \constant{CONST_CGSM_KILOPOUND_FORCE} \constant{CONST_CGSM_KNOT} \constant{CONST_CGSM_LAMBERT} \constant{CONST_CGSM_LIGHT_YEAR} \constant{CONST_CGSM_LITER} \constant{CONST_CGSM_LUMEN} \constant{CONST_CGSM_LUX} \constant{CONST_CGSM_MASS_ELECTRON} \constant{CONST_CGSM_MASS_MUON} \constant{CONST_CGSM_MASS_NEUTRON} \constant{CONST_CGSM_MASS_PROTON} \constant{CONST_CGSM_METER_OF_MERCURY} \constant{CONST_CGSM_METRIC_TON} \constant{CONST_CGSM_MICRON} \constant{CONST_CGSM_MIL} \constant{CONST_CGSM_MILE} \constant{CONST_CGSM_MILES_PER_HOUR} \constant{CONST_CGSM_MINUTE} \constant{CONST_CGSM_MOLAR_GAS} \constant{CONST_CGSM_NAUTICAL_MILE} \constant{CONST_CGSM_NEWTON} \constant{CONST_CGSM_NUCLEAR_MAGNETON} \constant{CONST_CGSM_OUNCE_MASS} \constant{CONST_CGSM_PARSEC} \constant{CONST_CGSM_PHOT} \constant{CONST_CGSM_PINT} \constant{CONST_CGSM_PLANCKS_CONSTANT_H} \constant{CONST_CGSM_PLANCKS_CONSTANT_HBAR} \constant{CONST_CGSM_POINT} \constant{CONST_CGSM_POISE} \constant{CONST_CGSM_POUNDAL} \constant{CONST_CGSM_POUND_FORCE} \constant{CONST_CGSM_POUND_MASS} \constant{CONST_CGSM_PROTON_MAGNETIC_MOMENT} \constant{CONST_CGSM_PSI} \constant{CONST_CGSM_QUART} \constant{CONST_CGSM_RAD} \constant{CONST_CGSM_ROENTGEN} \constant{CONST_CGSM_RYDBERG} \constant{CONST_CGSM_SOLAR_MASS} \constant{CONST_CGSM_SPEED_OF_LIGHT} \constant{CONST_CGSM_STANDARD_GAS_VOLUME} \constant{CONST_CGSM_STD_ATMOSPHERE} \constant{CONST_CGSM_STEFAN_BOLTZMANN_CONSTANT} \constant{CONST_CGSM_STILB} \constant{CONST_CGSM_STOKES} \constant{CONST_CGSM_TABLESPOON} \constant{CONST_CGSM_TEASPOON} \constant{CONST_CGSM_TEXPOINT} \constant{CONST_CGSM_THERM} \constant{CONST_CGSM_THOMSON_CROSS_SECTION} \constant{CONST_CGSM_TON} \constant{CONST_CGSM_TORR} \constant{CONST_CGSM_TROY_OUNCE} \constant{CONST_CGSM_UK_GALLON} \constant{CONST_CGSM_UK_TON} \constant{CONST_CGSM_UNIFIED_ATOMIC_MASS} \constant{CONST_CGSM_US_GALLON} \constant{CONST_CGSM_WEEK} \constant{CONST_CGSM_YARD} \end_constant_sect slgsl-pre0.10.0-7/doc/tm/rtl/gslsf-module.tm0000644000175000000620000007311114713350753017351 0ustar johnstaff\function_sect{Airy Functions} \function{airy_Ai} \synopsis{S-Lang version of gsl_sf_airy_Ai} \usage{Double_Type[] airy_Ai (Double_Type[] x [,Int_Type mode])} \done \function{airy_Ai_deriv} \synopsis{S-Lang version of gsl_sf_airy_Ai_deriv} \usage{Double_Type[] airy_Ai_deriv (Double_Type[] x [,Int_Type mode])} \done \function{airy_Ai_deriv_scaled} \synopsis{S-Lang version of gsl_sf_airy_Ai_deriv_scaled} \usage{Double_Type[] airy_Ai_deriv_scaled (Double_Type[] x [,Int_Type mode])} \done \function{airy_Ai_scaled} \synopsis{S-Lang version of gsl_sf_airy_Ai_scaled} \usage{Double_Type[] airy_Ai_scaled (Double_Type[] x [,Int_Type mode])} \done \function{airy_Bi} \synopsis{S-Lang version of gsl_sf_airy_Bi} \usage{Double_Type[] airy_Bi (Double_Type[] x [,Int_Type mode])} \done \function{airy_Bi_deriv} \synopsis{S-Lang version of gsl_sf_airy_Bi_deriv} \usage{Double_Type[] airy_Bi_deriv (Double_Type[] x [,Int_Type mode])} \done \function{airy_Bi_deriv_scaled} \synopsis{S-Lang version of gsl_sf_airy_Bi_deriv_scaled} \usage{Double_Type[] airy_Bi_deriv_scaled (Double_Type[] x [,Int_Type mode])} \done \function{airy_Bi_scaled} \synopsis{S-Lang version of gsl_sf_airy_Bi_scaled} \usage{Double_Type[] airy_Bi_scaled (Double_Type[] x [,Int_Type mode])} \done \function_sect{Bessel Functions} \function{bessel_I0} \synopsis{S-Lang version of gsl_sf_bessel_I0} \usage{Double_Type[] bessel_I0 (Double_Type[] x)} \done \function{bessel_i0_scaled} \synopsis{S-Lang version of gsl_sf_bessel_i0_scaled} \usage{Double_Type[] bessel_i0_scaled (Double_Type[] x)} \done \function{bessel_I0_scaled} \synopsis{S-Lang version of gsl_sf_bessel_I0_scaled} \usage{Double_Type[] bessel_I0_scaled (Double_Type[] x)} \done \function{bessel_I1} \synopsis{S-Lang version of gsl_sf_bessel_I1} \usage{Double_Type[] bessel_I1 (Double_Type[] x)} \done \function{bessel_i1_scaled} \synopsis{S-Lang version of gsl_sf_bessel_i1_scaled} \usage{Double_Type[] bessel_i1_scaled (Double_Type[] x)} \done \function{bessel_I1_scaled} \synopsis{S-Lang version of gsl_sf_bessel_I1_scaled} \usage{Double_Type[] bessel_I1_scaled (Double_Type[] x)} \done \function{bessel_i2_scaled} \synopsis{S-Lang version of gsl_sf_bessel_i2_scaled} \usage{Double_Type[] bessel_i2_scaled (Double_Type[] x)} \done \function{bessel_il_scaled} \synopsis{S-Lang version of gsl_sf_bessel_il_scaled} \usage{Double_Type[] bessel_il_scaled (Int_Type[] l, Double_Type[] x)} \done \function{bessel_In} \synopsis{S-Lang version of gsl_sf_bessel_In} \usage{Double_Type[] bessel_In (Int_Type[] n, Double_Type[] x)} \done \function{bessel_In_scaled} \synopsis{S-Lang version of gsl_sf_bessel_In_scaled} \usage{Double_Type[] bessel_In_scaled (Int_Type[] n, Double_Type[] x)} \done \function{bessel_Inu} \synopsis{S-Lang version of gsl_sf_bessel_Inu} \usage{Double_Type[] bessel_Inu (Double_Type[] nu, Double_Type[] x)} \done \function{bessel_Inu_scaled} \synopsis{S-Lang version of gsl_sf_bessel_Inu_scaled} \usage{Double_Type[] bessel_Inu_scaled (Double_Type[] nu, Double_Type[] x)} \done \function{bessel_J0} \synopsis{S-Lang version of gsl_sf_bessel_J0} \usage{Double_Type[] bessel_J0 (Double_Type[] x)} \done \function{bessel_j0} \synopsis{S-Lang version of gsl_sf_bessel_j0} \usage{Double_Type[] bessel_j0 (Double_Type[] x)} \done \function{bessel_j1} \synopsis{S-Lang version of gsl_sf_bessel_j1} \usage{Double_Type[] bessel_j1 (Double_Type[] x)} \done \function{bessel_J1} \synopsis{S-Lang version of gsl_sf_bessel_J1} \usage{Double_Type[] bessel_J1 (Double_Type[] x)} \done \function{bessel_j2} \synopsis{S-Lang version of gsl_sf_bessel_j2} \usage{Double_Type[] bessel_j2 (Double_Type[] x)} \done \function{bessel_jl} \synopsis{S-Lang version of gsl_sf_bessel_jl} \usage{Double_Type[] bessel_jl (Int_Type[] l, Double_Type[] x)} \done \function{bessel_Jn} \synopsis{S-Lang version of gsl_sf_bessel_Jn} \usage{Double_Type[] bessel_Jn (Int_Type[] n, Double_Type[] x)} \done \function{bessel_Jnu} \synopsis{S-Lang version of gsl_sf_bessel_Jnu} \usage{Double_Type[] bessel_Jnu (Double_Type[] nu, Double_Type[] x)} \done \function{bessel_K0} \synopsis{S-Lang version of gsl_sf_bessel_K0} \usage{Double_Type[] bessel_K0 (Double_Type[] x)} \done \function{bessel_K0_scaled} \synopsis{S-Lang version of gsl_sf_bessel_K0_scaled} \usage{Double_Type[] bessel_K0_scaled (Double_Type[] x)} \done \function{bessel_k0_scaled} \synopsis{S-Lang version of gsl_sf_bessel_k0_scaled} \usage{Double_Type[] bessel_k0_scaled (Double_Type[] x)} \done \function{bessel_K1} \synopsis{S-Lang version of gsl_sf_bessel_K1} \usage{Double_Type[] bessel_K1 (Double_Type[] x)} \done \function{bessel_K1_scaled} \synopsis{S-Lang version of gsl_sf_bessel_K1_scaled} \usage{Double_Type[] bessel_K1_scaled (Double_Type[] x)} \done \function{bessel_k1_scaled} \synopsis{S-Lang version of gsl_sf_bessel_k1_scaled} \usage{Double_Type[] bessel_k1_scaled (Double_Type[] x)} \done \function{bessel_k2_scaled} \synopsis{S-Lang version of gsl_sf_bessel_k2_scaled} \usage{Double_Type[] bessel_k2_scaled (Double_Type[] x)} \done \function{bessel_kl_scaled} \synopsis{S-Lang version of gsl_sf_bessel_kl_scaled} \usage{Double_Type[] bessel_kl_scaled (Int_Type[] l, Double_Type[] x)} \done \function{bessel_Kn} \synopsis{S-Lang version of gsl_sf_bessel_Kn} \usage{Double_Type[] bessel_Kn (Int_Type[] n, Double_Type[] x)} \done \function{bessel_Kn_scaled} \synopsis{S-Lang version of gsl_sf_bessel_Kn_scaled} \usage{Double_Type[] bessel_Kn_scaled (Int_Type[] n, Double_Type[] x)} \done \function{bessel_Knu} \synopsis{S-Lang version of gsl_sf_bessel_Knu} \usage{Double_Type[] bessel_Knu (Double_Type[] nu, Double_Type[] x)} \done \function{bessel_Knu_scaled} \synopsis{S-Lang version of gsl_sf_bessel_Knu_scaled} \usage{Double_Type[] bessel_Knu_scaled (Double_Type[] nu, Double_Type[] x)} \done \function{bessel_lnKnu} \synopsis{S-Lang version of gsl_sf_bessel_lnKnu} \usage{Double_Type[] bessel_lnKnu (Double_Type[] nu, Double_Type[] x)} \done \function{bessel_y0} \synopsis{S-Lang version of gsl_sf_bessel_y0} \usage{Double_Type[] bessel_y0 (Double_Type[] x)} \done \function{bessel_Y0} \synopsis{S-Lang version of gsl_sf_bessel_Y0} \usage{Double_Type[] bessel_Y0 (Double_Type[] x)} \done \function{bessel_y1} \synopsis{S-Lang version of gsl_sf_bessel_y1} \usage{Double_Type[] bessel_y1 (Double_Type[] x)} \done \function{bessel_Y1} \synopsis{S-Lang version of gsl_sf_bessel_Y1} \usage{Double_Type[] bessel_Y1 (Double_Type[] x)} \done \function{bessel_y2} \synopsis{S-Lang version of gsl_sf_bessel_y2} \usage{Double_Type[] bessel_y2 (Double_Type[] x)} \done \function{bessel_yl} \synopsis{S-Lang version of gsl_sf_bessel_yl} \usage{Double_Type[] bessel_yl (Int_Type[] l, Double_Type[] x)} \done \function{bessel_Yn} \synopsis{S-Lang version of gsl_sf_bessel_Yn} \usage{Double_Type[] bessel_Yn (Int_Type[] n, Double_Type[] x)} \done \function{bessel_Ynu} \synopsis{S-Lang version of gsl_sf_bessel_Ynu} \usage{Double_Type[] bessel_Ynu (Double_Type[] nu, Double_Type[] x)} \done \function_sect{Beta Functions} \function{beta} \synopsis{S-Lang version of gsl_sf_beta} \usage{Double_Type[] beta (Double_Type[] a, Double_Type[] b)} \done \function{beta_inc} \synopsis{S-Lang version of gsl_sf_beta_inc} \usage{Double_Type[] beta_inc (Double_Type[] a, Double_Type[] b, Double_Type[] x)} \done \function{lnbeta} \synopsis{S-Lang version of gsl_sf_lnbeta} \usage{Double_Type[] lnbeta (Double_Type[] a, Double_Type[] b)} \done \function_sect{Clausen Functions} \function{clausen} \synopsis{S-Lang version of gsl_sf_clausen} \usage{Double_Type[] clausen (Double_Type[] x)} \done \function_sect{Conical Functions} \function{conicalP_0} \synopsis{S-Lang version of gsl_sf_conicalP_0} \usage{Double_Type[] conicalP_0 (Double_Type[] lambda, Double_Type[] x)} \done \function{conicalP_1} \synopsis{S-Lang version of gsl_sf_conicalP_1} \usage{Double_Type[] conicalP_1 (Double_Type[] lambda, Double_Type[] x)} \done \function{conicalP_cyl_reg} \synopsis{S-Lang version of gsl_sf_conicalP_cyl_reg} \usage{Double_Type[] conicalP_cyl_reg (m, lambda, x)} #v+ Int_Type[] m Double_Type[] lambda Double_Type[] x #v- \done \function{conicalP_half} \synopsis{S-Lang version of gsl_sf_conicalP_half} \usage{Double_Type[] conicalP_half (Double_Type[] lambda, Double_Type[] x)} \done \function{conicalP_mhalf} \synopsis{S-Lang version of gsl_sf_conicalP_mhalf} \usage{Double_Type[] conicalP_mhalf (Double_Type[] lambda, Double_Type[] x)} \done \function{conicalP_sph_reg} \synopsis{S-Lang version of gsl_sf_conicalP_sph_reg} \usage{Double_Type[] conicalP_sph_reg (l, lambda, x)} #v+ Int_Type[] l Double_Type[] lambda Double_Type[] x #v- \done \function_sect{Coulomb Functions} \function{hydrogenicR} \synopsis{S-Lang version of gsl_sf_hydrogenicR} \usage{Double_Type[] hydrogenicR (n, l, Z, r)} #v+ Int_Type[] n Int_Type[] l Double_Type[] Z Double_Type[] r #v- \done \function{hydrogenicR_1} \synopsis{S-Lang version of gsl_sf_hydrogenicR_1} \usage{Double_Type[] hydrogenicR_1 (Double_Type[] Z, Double_Type[] r)} \done \function_sect{Debye Functions} \function{debye_1} \synopsis{S-Lang version of gsl_sf_debye_1} \usage{Double_Type[] debye_1 (Double_Type[] x)} \done \function{debye_2} \synopsis{S-Lang version of gsl_sf_debye_2} \usage{Double_Type[] debye_2 (Double_Type[] x)} \done \function{debye_3} \synopsis{S-Lang version of gsl_sf_debye_3} \usage{Double_Type[] debye_3 (Double_Type[] x)} \done \function{debye_4} \synopsis{S-Lang version of gsl_sf_debye_4} \usage{Double_Type[] debye_4 (Double_Type[] x)} \done \function{debye_5} \synopsis{S-Lang version of gsl_sf_debye_5} \usage{Double_Type[] debye_5 (Double_Type[] x)} \done \function{debye_6} \synopsis{S-Lang version of gsl_sf_debye_6} \usage{Double_Type[] debye_6 (Double_Type[] x)} \done \function_sect{Di/Tri and Polygamma Functions} \function{psi} \synopsis{S-Lang version of gsl_sf_psi} \usage{Double_Type[] psi (Double_Type[] x)} \done \function{psi_1} \synopsis{S-Lang version of gsl_sf_psi_1} \usage{Double_Type[] psi_1 (Double_Type[] x)} \done \function{psi_1_int} \synopsis{S-Lang version of gsl_sf_psi_1_int} \usage{Double_Type[] psi_1_int (Int_Type[] n)} \done \function{psi_1piy} \synopsis{S-Lang version of gsl_sf_psi_1piy} \usage{Double_Type[] psi_1piy (Double_Type[] y)} \done \function{psi_int} \synopsis{S-Lang version of gsl_sf_psi_int} \usage{Double_Type[] psi_int (Int_Type[] n)} \done \function{psi_n} \synopsis{S-Lang version of gsl_sf_psi_n} \usage{Double_Type[] psi_n (Int_Type[] n, Double_Type[] x)} \done \function_sect{Elliptic Integrals} \function{ellint_D} \synopsis{S-Lang version of gsl_sf_ellint_D} \usage{Double_Type[] ellint_D (phi, k [,mode])} #v+ Double_Type[] phi Double_Type[] k Int_Type mode #v- \done \function{ellint_Dcomp} \synopsis{S-Lang version of gsl_sf_ellint_Dcomp} \usage{Double_Type[] ellint_Dcomp (Double_Type[] k [,Int_Type mode])} \done \function{ellint_E} \synopsis{S-Lang version of gsl_sf_ellint_E} \usage{Double_Type[] ellint_E (phi, k [,mode])} #v+ Double_Type[] phi Double_Type[] k Int_Type mode #v- \done \function{ellint_Ecomp} \synopsis{S-Lang version of gsl_sf_ellint_Ecomp} \usage{Double_Type[] ellint_Ecomp (Double_Type[] k [,Int_Type mode])} \done \function{ellint_F} \synopsis{S-Lang version of gsl_sf_ellint_F} \usage{Double_Type[] ellint_F (phi, k [,mode])} #v+ Double_Type[] phi Double_Type[] k Int_Type mode #v- \done \function{ellint_Kcomp} \synopsis{S-Lang version of gsl_sf_ellint_Kcomp} \usage{Double_Type[] ellint_Kcomp (Double_Type[] k [,Int_Type mode])} \done \function{ellint_P} \synopsis{S-Lang version of gsl_sf_ellint_P} \usage{Double_Type[] ellint_P (phi, k, n [,mode])} #v+ Double_Type[] phi Double_Type[] k Double_Type[] n Int_Type mode #v- \done \function{ellint_Pcomp} \synopsis{S-Lang version of gsl_sf_ellint_Pcomp} \usage{Double_Type[] ellint_Pcomp (k, n [,mode])} #v+ Double_Type[] k Double_Type[] n Int_Type mode #v- \done \function{ellint_RC} \synopsis{S-Lang version of gsl_sf_ellint_RC} \usage{Double_Type[] ellint_RC (Double_Type[] x, Double_Type[] y [,Int_Type mode])} \done \function{ellint_RD} \synopsis{S-Lang version of gsl_sf_ellint_RD} \usage{Double_Type[] ellint_RD (x, y, z [,mode])} #v+ Double_Type[] x Double_Type[] y Double_Type[] z Int_Type mode #v- \done \function{ellint_RF} \synopsis{S-Lang version of gsl_sf_ellint_RF} \usage{Double_Type[] ellint_RF (x, y, z [,mode])} #v+ Double_Type[] x Double_Type[] y Double_Type[] z Int_Type mode #v- \done \function{ellint_RJ} \synopsis{S-Lang version of gsl_sf_ellint_RJ} \usage{Double_Type[] ellint_RJ (x, y, z, p [,mode])} #v+ Double_Type[] x Double_Type[] y Double_Type[] z Double_Type[] p Int_Type mode #v- \done \function_sect{Error Functions} \function{erf} \synopsis{S-Lang version of gsl_sf_erf} \usage{Double_Type[] erf (Double_Type[] x)} \done \function{erf_Q} \synopsis{S-Lang version of gsl_sf_erf_Q} \usage{Double_Type[] erf_Q (Double_Type[] x)} \done \function{erf_Z} \synopsis{S-Lang version of gsl_sf_erf_Z} \usage{Double_Type[] erf_Z (Double_Type[] x)} \done \function{erfc} \synopsis{S-Lang version of gsl_sf_erfc} \usage{Double_Type[] erfc (Double_Type[] x)} \done \function{log_erfc} \synopsis{S-Lang version of gsl_sf_log_erfc} \usage{Double_Type[] log_erfc (Double_Type[] x)} \done \function_sect{Eta/Zeta Functions} \function{eta} \synopsis{S-Lang version of gsl_sf_eta} \usage{Double_Type[] eta (Double_Type[] s)} \done \function{eta_int} \synopsis{S-Lang version of gsl_sf_eta_int} \usage{Double_Type[] eta_int (Int_Type[] n)} \done \function{hzeta} \synopsis{S-Lang version of gsl_sf_hzeta} \usage{Double_Type[] hzeta (Double_Type[] s, Double_Type[] q)} \done \function{zeta} \synopsis{S-Lang version of gsl_sf_zeta} \usage{Double_Type[] zeta (Double_Type[] s)} \done \function{zeta_int} \synopsis{S-Lang version of gsl_sf_zeta_int} \usage{Double_Type[] zeta_int (Int_Type[] n)} \done \function{zetam1} \synopsis{S-Lang version of gsl_sf_zetam1} \usage{Double_Type[] zetam1 (Double_Type[] s)} \done \function{zetam1_int} \synopsis{S-Lang version of gsl_sf_zetam1_int} \usage{Double_Type[] zetam1_int (Int_Type[] s)} \done \function_sect{Exponential Functions and Integrals} \function{exp_mult} \synopsis{S-Lang version of gsl_sf_exp_mult} \usage{Double_Type[] exp_mult (Double_Type[] x, Double_Type[] y)} \done \function{expint_3} \synopsis{S-Lang version of gsl_sf_expint_3} \usage{Double_Type[] expint_3 (Double_Type[] x)} \done \function{expint_E1} \synopsis{S-Lang version of gsl_sf_expint_E1} \usage{Double_Type[] expint_E1 (Double_Type[] x)} \done \function{expint_E1_scaled} \synopsis{S-Lang version of gsl_sf_expint_E1_scaled} \usage{Double_Type[] expint_E1_scaled (Double_Type[] x)} \done \function{expint_E2} \synopsis{S-Lang version of gsl_sf_expint_E2} \usage{Double_Type[] expint_E2 (Double_Type[] x)} \done \function{expint_E2_scaled} \synopsis{S-Lang version of gsl_sf_expint_E2_scaled} \usage{Double_Type[] expint_E2_scaled (Double_Type[] x)} \done \function{expint_Ei} \synopsis{S-Lang version of gsl_sf_expint_Ei} \usage{Double_Type[] expint_Ei (Double_Type[] x)} \done \function{expint_Ei_scaled} \synopsis{S-Lang version of gsl_sf_expint_Ei_scaled} \usage{Double_Type[] expint_Ei_scaled (Double_Type[] x)} \done \function{expint_En} \synopsis{S-Lang version of gsl_sf_expint_En} \usage{Double_Type[] expint_En (Int_Type[] n, Double_Type[] x)} \done \function{expint_En_scaled} \synopsis{S-Lang version of gsl_sf_expint_En_scaled} \usage{Double_Type[] expint_En_scaled (Int_Type[] n, Double_Type[] x)} \done \function{expm1} \synopsis{S-Lang version of gsl_sf_expm1} \usage{Double_Type[] expm1 (Double_Type[] x)} \done \function{exprel} \synopsis{S-Lang version of gsl_sf_exprel} \usage{Double_Type[] exprel (Double_Type[] x)} \done \function{exprel_2} \synopsis{S-Lang version of gsl_sf_exprel_2} \usage{Double_Type[] exprel_2 (Double_Type[] x)} \done \function{exprel_n} \synopsis{S-Lang version of gsl_sf_exprel_n} \usage{Double_Type[] exprel_n (Int_Type[] n, Double_Type[] x)} \done \function_sect{Fermi-Dirac Functions} \function{fermi_dirac_0} \synopsis{S-Lang version of gsl_sf_fermi_dirac_0} \usage{Double_Type[] fermi_dirac_0 (Double_Type[] x)} \done \function{fermi_dirac_1} \synopsis{S-Lang version of gsl_sf_fermi_dirac_1} \usage{Double_Type[] fermi_dirac_1 (Double_Type[] x)} \done \function{fermi_dirac_2} \synopsis{S-Lang version of gsl_sf_fermi_dirac_2} \usage{Double_Type[] fermi_dirac_2 (Double_Type[] x)} \done \function{fermi_dirac_3half} \synopsis{S-Lang version of gsl_sf_fermi_dirac_3half} \usage{Double_Type[] fermi_dirac_3half (Double_Type[] x)} \done \function{fermi_dirac_half} \synopsis{S-Lang version of gsl_sf_fermi_dirac_half} \usage{Double_Type[] fermi_dirac_half (Double_Type[] x)} \done \function{fermi_dirac_inc_0} \synopsis{S-Lang version of gsl_sf_fermi_dirac_inc_0} \usage{Double_Type[] fermi_dirac_inc_0 (Double_Type[] x, Double_Type[] b)} \done \function{fermi_dirac_int} \synopsis{S-Lang version of gsl_sf_fermi_dirac_int} \usage{Double_Type[] fermi_dirac_int (Int_Type[] j, Double_Type[] x)} \done \function{fermi_dirac_m1} \synopsis{S-Lang version of gsl_sf_fermi_dirac_m1} \usage{Double_Type[] fermi_dirac_m1 (Double_Type[] x)} \done \function{fermi_dirac_mhalf} \synopsis{S-Lang version of gsl_sf_fermi_dirac_mhalf} \usage{Double_Type[] fermi_dirac_mhalf (Double_Type[] x)} \done \function_sect{Gamma Functions} \function{gamma} \synopsis{S-Lang version of gsl_sf_gamma} \usage{Double_Type[] gamma (Double_Type[] x)} \done \function{gamma_inc} \synopsis{S-Lang version of gsl_sf_gamma_inc} \usage{Double_Type[] gamma_inc (Double_Type[] a, Double_Type[] x)} \done \function{gamma_inc_P} \synopsis{S-Lang version of gsl_sf_gamma_inc_P} \usage{Double_Type[] gamma_inc_P (Double_Type[] a, Double_Type[] x)} \done \function{gamma_inc_Q} \synopsis{S-Lang version of gsl_sf_gamma_inc_Q} \usage{Double_Type[] gamma_inc_Q (Double_Type[] a, Double_Type[] x)} \done \function{gammainv} \synopsis{S-Lang version of gsl_sf_gammainv} \usage{Double_Type[] gammainv (Double_Type[] x)} \done \function{gammastar} \synopsis{S-Lang version of gsl_sf_gammastar} \usage{Double_Type[] gammastar (Double_Type[] x)} \done \function{lngamma} \synopsis{S-Lang version of gsl_sf_lngamma} \usage{Double_Type[] lngamma (Double_Type[] x)} \done \function{lngamma_complex} \synopsis{S-Lang version of gsl_sf_lngamma_complex_e} \usage{Complex_Type[] lngamma_complex (Complex_Type[])} \done \function_sect{Gegenbauer Functions} \function{gegenpoly_1} \synopsis{S-Lang version of gsl_sf_gegenpoly_1} \usage{Double_Type[] gegenpoly_1 (Double_Type[] lambda, Double_Type[] x)} \done \function{gegenpoly_2} \synopsis{S-Lang version of gsl_sf_gegenpoly_2} \usage{Double_Type[] gegenpoly_2 (Double_Type[] lambda, Double_Type[] x)} \done \function{gegenpoly_3} \synopsis{S-Lang version of gsl_sf_gegenpoly_3} \usage{Double_Type[] gegenpoly_3 (Double_Type[] lambda, Double_Type[] x)} \done \function{gegenpoly_n} \synopsis{S-Lang version of gsl_sf_gegenpoly_n} \usage{Double_Type[] gegenpoly_n (n, lambda, x)} #v+ Int_Type[] n Double_Type[] lambda Double_Type[] x #v- \done \function_sect{Hypergeometric Functions} \function{hyperg_0F1} \synopsis{S-Lang version of gsl_sf_hyperg_0F1} \usage{Double_Type[] hyperg_0F1 (Double_Type[] c, Double_Type[] x)} \done \function{hyperg_1F1} \synopsis{S-Lang version of gsl_sf_hyperg_1F1} \usage{Double_Type[] hyperg_1F1 (a, b, x)} #v+ Double_Type[] a Double_Type[] b Double_Type[] x #v- \done \function{hyperg_1F1_int} \synopsis{S-Lang version of gsl_sf_hyperg_1F1_int} \usage{Double_Type[] hyperg_1F1_int (Int_Type[] m, Int_Type[] n, Double_Type[] x)} \done \function{hyperg_2F0} \synopsis{S-Lang version of gsl_sf_hyperg_2F0} \usage{Double_Type[] hyperg_2F0 (a, b, x)} #v+ Double_Type[] a Double_Type[] b Double_Type[] x #v- \done \function{hyperg_2F1} \synopsis{S-Lang version of gsl_sf_hyperg_2F1} \usage{Double_Type[] hyperg_2F1 (a, b, c, x)} #v+ Double_Type[] a Double_Type[] b Double_Type[] c Double_Type[] x #v- \done \function{hyperg_2F1_conj} \synopsis{S-Lang version of gsl_sf_hyperg_2F1_conj} \usage{Double_Type[] hyperg_2F1_conj (aR, aI, c, x)} #v+ Double_Type[] aR Double_Type[] aI Double_Type[] c Double_Type[] x #v- \done \function{hyperg_2F1_conj_renorm} \synopsis{S-Lang version of gsl_sf_hyperg_2F1_conj_renorm} \usage{Double_Type[] hyperg_2F1_conj_renorm (aR, aI, c, x)} #v+ Double_Type[] aR Double_Type[] aI Double_Type[] c Double_Type[] x #v- \done \function{hyperg_2F1_renorm} \synopsis{S-Lang version of gsl_sf_hyperg_2F1_renorm} \usage{Double_Type[] hyperg_2F1_renorm (a, b, c, x)} #v+ Double_Type[] a Double_Type[] b Double_Type[] c Double_Type[] x #v- \done \function{hyperg_U} \synopsis{S-Lang version of gsl_sf_hyperg_U} \usage{Double_Type[] hyperg_U (Double_Type[] a, Double_Type[] b, Double_Type[] x)} \done \function{hyperg_U_int} \synopsis{S-Lang version of gsl_sf_hyperg_U_int} \usage{Double_Type[] hyperg_U_int (Int_Type[] m, Int_Type[] n, Double_Type[] x)} \done \function_sect{Laguerre Functions} \function{laguerre_1} \synopsis{S-Lang version of gsl_sf_laguerre_1} \usage{Double_Type[] laguerre_1 (Double_Type[] a, Double_Type[] x)} \done \function{laguerre_2} \synopsis{S-Lang version of gsl_sf_laguerre_2} \usage{Double_Type[] laguerre_2 (Double_Type[] a, Double_Type[] x)} \done \function{laguerre_3} \synopsis{S-Lang version of gsl_sf_laguerre_3} \usage{Double_Type[] laguerre_3 (Double_Type[] a, Double_Type[] x)} \done \function{laguerre_n} \synopsis{S-Lang version of gsl_sf_laguerre_n} \usage{Double_Type[] laguerre_n (Int_Type[] n, Double_Type[] a, Double_Type[] x)} \done \function_sect{Lambert Functions} \function{lambert_W0} \synopsis{S-Lang version of gsl_sf_lambert_W0} \usage{Double_Type[] lambert_W0 (Double_Type[] x)} \done \function{lambert_Wm1} \synopsis{S-Lang version of gsl_sf_lambert_Wm1} \usage{Double_Type[] lambert_Wm1 (Double_Type[] x)} \done \function_sect{Legendre Functions and Spherical Harmonics} \function{legendre_H3d} \synopsis{S-Lang version of gsl_sf_legendre_H3d} \usage{Double_Type[] legendre_H3d (l, lambda, eta)} #v+ Int_Type[] l Double_Type[] lambda Double_Type[] eta #v- \done \function{legendre_H3d_0} \synopsis{S-Lang version of gsl_sf_legendre_H3d_0} \usage{Double_Type[] legendre_H3d_0 (Double_Type[] lambda, Double_Type[] eta)} \done \function{legendre_H3d_1} \synopsis{S-Lang version of gsl_sf_legendre_H3d_1} \usage{Double_Type[] legendre_H3d_1 (Double_Type[] lambda, Double_Type[] eta)} \done \function{legendre_P1} \synopsis{S-Lang version of gsl_sf_legendre_P1} \usage{Double_Type[] legendre_P1 (Double_Type[] x)} \done \function{legendre_P2} \synopsis{S-Lang version of gsl_sf_legendre_P2} \usage{Double_Type[] legendre_P2 (Double_Type[] x)} \done \function{legendre_P3} \synopsis{S-Lang version of gsl_sf_legendre_P3} \usage{Double_Type[] legendre_P3 (Double_Type[] x)} \done \function{legendre_Pl} \synopsis{S-Lang version of gsl_sf_legendre_Pl} \usage{Double_Type[] legendre_Pl (Int_Type[] l, Double_Type[] x)} \done \function{legendre_Plm} \synopsis{S-Lang version of gsl_sf_legendre_Plm} \usage{Double_Type[] legendre_Plm (Int_Type[] l, Int_Type[] m, Double_Type[] x)} \done \function{legendre_Q0} \synopsis{S-Lang version of gsl_sf_legendre_Q0} \usage{Double_Type[] legendre_Q0 (Double_Type[] x)} \done \function{legendre_Q1} \synopsis{S-Lang version of gsl_sf_legendre_Q1} \usage{Double_Type[] legendre_Q1 (Double_Type[] x)} \done \function{legendre_Ql} \synopsis{S-Lang version of gsl_sf_legendre_Ql} \usage{Double_Type[] legendre_Ql (Int_Type[] l, Double_Type[] x)} \done \function{legendre_sphPlm} \synopsis{S-Lang version of gsl_sf_legendre_sphPlm} \usage{Double_Type[] legendre_sphPlm (Int_Type[] l, Int_Type[] m, Double_Type[] x)} \done \function_sect{Logarithm and Related Functions} \function{log_1plusx} \synopsis{S-Lang version of gsl_sf_log_1plusx} \usage{Double_Type[] log_1plusx (Double_Type[] x)} \done \function{log_1plusx_mx} \synopsis{S-Lang version of gsl_sf_log_1plusx_mx} \usage{Double_Type[] log_1plusx_mx (Double_Type[] x)} \done \function{log_abs} \synopsis{S-Lang version of gsl_sf_log_abs} \usage{Double_Type[] log_abs (Double_Type[] x)} \done \function{log_complex} \synopsis{S-Lang version of gsl_sf_complex_log_e} \usage{Complex_Type[] log_complex (Complex_Type[])} \done \function{logsin_complex} \synopsis{S-Lang version of gsl_sf_complex_logsin_e} \usage{Complex_Type[] logsin_complex (Complex_Type[])} \done \function_sect{Transport Functions} \function{transport_2} \synopsis{S-Lang version of gsl_sf_transport_2} \usage{Double_Type[] transport_2 (Double_Type[] x)} \done \function{transport_3} \synopsis{S-Lang version of gsl_sf_transport_3} \usage{Double_Type[] transport_3 (Double_Type[] x)} \done \function{transport_4} \synopsis{S-Lang version of gsl_sf_transport_4} \usage{Double_Type[] transport_4 (Double_Type[] x)} \done \function{transport_5} \synopsis{S-Lang version of gsl_sf_transport_5} \usage{Double_Type[] transport_5 (Double_Type[] x)} \done \function_sect{Miscellaneous Functions} \function{angle_restrict_pos} \synopsis{S-Lang version of gsl_sf_angle_restrict_pos} \usage{Double_Type[] angle_restrict_pos (Double_Type[] theta)} \done \function{angle_restrict_symm} \synopsis{S-Lang version of gsl_sf_angle_restrict_symm} \usage{Double_Type[] angle_restrict_symm (Double_Type[] theta)} \done \function{atanint} \synopsis{S-Lang version of gsl_sf_atanint} \usage{Double_Type[] atanint (Double_Type[] x)} \done \function{Chi} \synopsis{S-Lang version of gsl_sf_Chi} \usage{Double_Type[] Chi (Double_Type[] x)} \done \function{Ci} \synopsis{S-Lang version of gsl_sf_Ci} \usage{Double_Type[] Ci (Double_Type[] x)} \done \function{cos_complex} \synopsis{S-Lang version of gsl_sf_complex_cos_e} \usage{Complex_Type[] cos_complex (Complex_Type[])} \done \function{cos_pi} \synopsis{S-Lang version of gsl_sf_cos_pi} \usage{Double_Type[] cos_pi (Double_Type[] x)} \done \function{dawson} \synopsis{S-Lang version of gsl_sf_dawson} \usage{Double_Type[] dawson (Double_Type[] x)} \done \function{dilog} \synopsis{S-Lang version of gsl_sf_dilog} \usage{Double_Type[] dilog (Double_Type[] x)} \done \function{hazard} \synopsis{S-Lang version of gsl_sf_hazard} \usage{Double_Type[] hazard (Double_Type[] x)} \done \function{hermite_func} \synopsis{S-Lang version of gsl_sf_hermite_func} \usage{Double_Type[] hermite_func (Int_Type[] n, Double_Type[] x)} \done \function{hermite_func_der} \synopsis{S-Lang version of gsl_sf_hermite_func_der} \usage{Double_Type[] hermite_func_der (m, n, x)} #v+ Int_Type[] m Int_Type[] n Double_Type[] x #v- \done \function{hermite_phys} \synopsis{S-Lang version of gsl_sf_hermite_phys} \usage{Double_Type[] hermite_phys (Int_Type[] n, Double_Type[] x)} \done \function{hermite_phys_der} \synopsis{S-Lang version of gsl_sf_hermite_phys_der} \usage{Double_Type[] hermite_phys_der (m, n, x)} #v+ Int_Type[] m Int_Type[] n Double_Type[] x #v- \done \function{hermite_prob} \synopsis{S-Lang version of gsl_sf_hermite_prob} \usage{Double_Type[] hermite_prob (Int_Type[] n, Double_Type[] x)} \done \function{hermite_prob_der} \synopsis{S-Lang version of gsl_sf_hermite_prob_der} \usage{Double_Type[] hermite_prob_der (m, n, x)} #v+ Int_Type[] m Int_Type[] n Double_Type[] x #v- \done \function{hypot} \synopsis{S-Lang version of gsl_sf_hypot} \usage{Double_Type[] hypot (Double_Type[] x, Double_Type[] y)} \done \function{lncosh} \synopsis{S-Lang version of gsl_sf_lncosh} \usage{Double_Type[] lncosh (Double_Type[] x)} \done \function{lnpoch} \synopsis{S-Lang version of gsl_sf_lnpoch} \usage{Double_Type[] lnpoch (Double_Type[] a, Double_Type[] x)} \done \function{lnsinh} \synopsis{S-Lang version of gsl_sf_lnsinh} \usage{Double_Type[] lnsinh (Double_Type[] x)} \done \function{mathieu_a} \synopsis{S-Lang version of gsl_sf_mathieu_a} \usage{Double_Type[] mathieu_a (Int_Type[] order, Double_Type[] qq)} \done \function{mathieu_b} \synopsis{S-Lang version of gsl_sf_mathieu_b} \usage{Double_Type[] mathieu_b (Int_Type[] order, Double_Type[] qq)} \done \function{mathieu_ce} \synopsis{S-Lang version of gsl_sf_mathieu_ce} \usage{Double_Type[] mathieu_ce (order, qq, zz)} #v+ Int_Type[] order Double_Type[] qq Double_Type[] zz #v- \done \function{mathieu_Mc} \synopsis{S-Lang version of gsl_sf_mathieu_Mc} \usage{Double_Type[] mathieu_Mc (kind, order, qq, zz)} #v+ Int_Type[] kind Int_Type[] order Double_Type[] qq Double_Type[] zz #v- \done \function{mathieu_Ms} \synopsis{S-Lang version of gsl_sf_mathieu_Ms} \usage{Double_Type[] mathieu_Ms (kind, order, qq, zz)} #v+ Int_Type[] kind Int_Type[] order Double_Type[] qq Double_Type[] zz #v- \done \function{mathieu_se} \synopsis{S-Lang version of gsl_sf_mathieu_se} \usage{Double_Type[] mathieu_se (order, qq, zz)} #v+ Int_Type[] order Double_Type[] qq Double_Type[] zz #v- \done \function{poch} \synopsis{S-Lang version of gsl_sf_poch} \usage{Double_Type[] poch (Double_Type[] a, Double_Type[] x)} \done \function{pochrel} \synopsis{S-Lang version of gsl_sf_pochrel} \usage{Double_Type[] pochrel (Double_Type[] a, Double_Type[] x)} \done \function{Shi} \synopsis{S-Lang version of gsl_sf_Shi} \usage{Double_Type[] Shi (Double_Type[] x)} \done \function{Si} \synopsis{S-Lang version of gsl_sf_Si} \usage{Double_Type[] Si (Double_Type[] x)} \done \function{sin_complex} \synopsis{S-Lang version of gsl_sf_complex_sin_e} \usage{Complex_Type[] sin_complex (Complex_Type[])} \done \function{sin_pi} \synopsis{S-Lang version of gsl_sf_sin_pi} \usage{Double_Type[] sin_pi (Double_Type[] x)} \done \function{sinc} \synopsis{S-Lang version of gsl_sf_sinc} \usage{Double_Type[] sinc (Double_Type[] x)} \done \function{synchrotron_1} \synopsis{S-Lang version of gsl_sf_synchrotron_1} \usage{Double_Type[] synchrotron_1 (Double_Type[] x)} \done \function{synchrotron_2} \synopsis{S-Lang version of gsl_sf_synchrotron_2} \usage{Double_Type[] synchrotron_2 (Double_Type[] x)} \done \function{taylorcoeff} \synopsis{S-Lang version of gsl_sf_taylorcoeff} \usage{Double_Type[] taylorcoeff (Int_Type[] n, Double_Type[] x)} \done slgsl-pre0.10.0-7/doc/tm/rtl/gslinterp.tm0000644000175000000620000004634412105106006016746 0ustar johnstaff\function_sect{Interpolation Routines} \function{interp_linear} \synopsis{Linear Interpolation} \usage{y = interp_linear (x, Double_Type xa[], Double_Type ya[])} \description Use linear interpolation to determine the value at \var{x} given the points (\var{xa}, \var{ya}). The first argument, \var{x}, may be either a scalar or an array, and a result of the corresponding type will be returned. \seealso{interp_polynomial, interp_cspline, interp_cspline_periodic, interp_akima, interp_akima_periodic} \done \function{interp_polynomial} \synopsis{Polynomial Interpolation} \usage{y = interp_polynomial (x, Double_Type xa[], Double_Type ya[])} \description Use polynomial interpolation to determine the value at \var{x} given the points (\var{xa}, \var{ya}). The first argument, \var{x}, may be either a scalar or an array, and a result of the corresponding type will be returned. The degree of the interpolating polynomial is given by one less than the number of points in the \var{xa} array. For example, if \exmp{length(xa)} is 3, then a quadratic polynomial will be used. \seealso{interp_linear, interp_cspline, interp_cspline_periodic, interp_akima, interp_akima_periodic} \done \function{interp_cspline} \synopsis{Cubic Spline Interpolation} \usage{y = interp_cspline (x, Double_Type xa[], Double_Type ya[])} \description Use cubic spline interpolation with natural boundary conditions to determine the value at \var{x} given the points (\var{xa}, \var{ya}). The first argument, \var{x}, may be either a scalar or an array, and a result of the corresponding type will be returned. \seealso{interp_linear, interp_polynomial, interp_cspline_periodic, interp_akima, interp_akima_periodic} \done \function{interp_cspline_periodic} \synopsis{Cubic spline interpolation with periodic boundary conditions} \usage{y = interp_cspline_periodic (x, Double_Type xa[], Double_Type ya[])} \description Use cubic spline interpolation with periodic boundary conditions to determine the value at \var{x} given the points (\var{xa}, \var{ya}). The first argument, \var{x}, may be either a scalar or an array, and a result of the corresponding type will be returned. \seealso{interp_linear, interp_polynomial, interp_cspline, interp_akima, interp_akima_periodic} \done \function{interp_akima} \synopsis{Akima spline interpolation} \usage{y = interp_akima (x, Double_Type xa[], Double_Type ya[])} \description Use an Akima spline with natural boundary conditions to determine the value at \var{x} given the points (\var{xa}, \var{ya}). The first argument, \var{x}, may be either a scalar or an array, and a result of the corresponding type will be returned. \seealso{interp_linear, interp_polynomial, interp_cspline, interp_cspline_periodic, interp_akima_periodic} \done \function{interp_akima_periodic} \synopsis{Akima spline interpolation with periodic boundary conditions} \usage{y = interp_akima_periodic (x, Double_Type xa[], Double_Type ya[])} \description Use an Akima spline with periodic boundary conditions to determine the value at \var{x} given the points (\var{xa}, \var{ya}). The first argument, \var{x}, may be either a scalar or an array, and a result of the corresponding type will be returned. \seealso{interp_linear, interp_polynomial, interp_cspline, interp_cspline_periodic, interp_akima} \done #% -------------------------------------------------------------------- \function_sect{First Derivative via Interpolation} \function{interp_linear_deriv} \synopsis{Compute derivative using linear interpolation} \usage{y = interp_linear_deriv (x, Double_Type xa[], Double_Type ya[])} \description Use linear interpolation to determine the value of the first derivative at \var{x} given the points (\var{xa}, \var{ya}). The first argument, \var{x}, may be either a scalar or an array, and a result of the corresponding type will be returned. \seealso{interp_polynomial_deriv, interp_cspline_deriv, interp_cspline_periodic_deriv, interp_akima_deriv, interp_akima_periodic_deriv} \done \function{interp_polynomial_deriv} \synopsis{Compute derivative using polynomial interpolation} \usage{y = interp_polynomial_deriv (x, Double_Type xa[], Double_Type ya[])} \description Use polynomial interpolation to determine the value of the first derivative at \var{x} given the points (\var{xa}, \var{ya}). The first argument, \var{x}, may be either a scalar or an array, and a result of the corresponding type will be returned. The degree of the interpolating polynomial is given by one less than the number of points in the \var{xa} array. For example, if \exmp{length(xa)} is 3, then a quadratic polynomial will be used. \seealso{interp_linear_deriv, interp_cspline_deriv, interp_cspline_periodic_deriv, interp_akima_deriv, interp_akima_periodic_deriv} \done \function{interp_cspline_deriv} \synopsis{Compute derivative using a cubic spline} \usage{y = interp_cspline_deriv (x, Double_Type xa[], Double_Type ya[])} \description Use cubic spline interpolation with natural boundary conditions to determine the value of the first derivative at \var{x} given the points (\var{xa}, \var{ya}). The first argument, \var{x}, may be either a scalar or an array, and a result of the corresponding type will be returned. \seealso{interp_linear_deriv, interp_polynomial_deriv, interp_cspline_periodic_deriv, interp_akima_deriv, interp_akima_periodic_deriv} \done \function{interp_cspline_periodic_deriv} \synopsis{Compute derivative using a cubic spline} \usage{y = interp_cspline_periodic_deriv (x, Double_Type xa[], Double_Type ya[])} \description Use cubic spline interpolation with periodic boundary conditions to determine the value of the first derivative at \var{x} given the points (\var{xa}, \var{ya}). The first argument, \var{x}, may be either a scalar or an array, and a result of the corresponding type will be returned. \seealso{interp_linear_deriv, interp_polynomial_deriv, interp_cspline_deriv, interp_akima_deriv, interp_akima_periodic_deriv} \done \function{interp_akima_deriv} \synopsis{Compute derivative using an Akima spline} \usage{y = interp_akima_deriv (x, Double_Type xa[], Double_Type ya[])} \description Use Akima spline interpolation with natural boundary conditions to determine the value of the first derivative at \var{x} given the points (\var{xa}, \var{ya}). The first argument, \var{x}, may be either a scalar or an array, and a result of the corresponding type will be returned. \seealso{interp_linear_deriv, interp_polynomial_deriv, interp_cspline_deriv, interp_cspline_periodic_deriv, interp_akima_periodic_deriv} \done \function{interp_akima_periodic_deriv} \synopsis{Compute derivative using an Akima spline} \usage{y = interp_cspline_deriv (x, Double_Type xa[], Double_Type ya[])} \description Use Akima spline interpolation with periodic boundary conditions to determine the value of the first derivative at \var{x} given the points (\var{xa}, \var{ya}). The first argument, \var{x}, may be either a scalar or an array, and a result of the corresponding type will be returned. \seealso{interp_linear_deriv, interp_polynomial_deriv, interp_cspline_deriv, interp_cspline_periodic_deriv, interp_akima_deriv} \done #% -------------------------------------------------------------------- \function_sect{Second Derivative via Interpolation} \function{interp_linear_deriv2} \synopsis{Compute second derivative using linear interpolation} \usage{y = interp_linear_deriv2 (x, Double_Type xa[], Double_Type ya[])} \description Use linear interpolation to determine the value of the second derivative at \var{x} given the points (\var{xa}, \var{ya}). The first argument, \var{x}, may be either a scalar or an array, and a result of the corresponding type will be returned. \seealso{interp_polynomial_deriv2, interp_cspline_deriv2, interp_cspline_periodic_deriv2, interp_akima_deriv2, interp_akima_periodic_deriv2} \done \function{interp_polynomial_deriv2} \synopsis{Compute second derivative using polynomial interpolation} \usage{y = interp_polynomial_deriv2 (x, Double_Type xa[], Double_Type ya[])} \description Use polynomial interpolation to determine the value of the second derivative at \var{x} given the points (\var{xa}, \var{ya}). The first argument, \var{x}, may be either a scalar or an array, and a result of the corresponding type will be returned. The degree of the interpolating polynomial is given by one less than the number of points in the \var{xa} array. For example, if \exmp{length(xa)} is 3, then a quadratic polynomial will be used. \seealso{interp_linear_deriv2, interp_cspline_deriv2, interp_cspline_periodic_deriv2, interp_akima_deriv2, interp_akima_periodic_deriv2} \done \function{interp_cspline_deriv2} \synopsis{Compute second derivative using a cubic spline} \usage{y = interp_cspline_deriv2 (x, Double_Type xa[], Double_Type ya[])} \description Use cubic spline interpolation with natural boundary conditions to determine the value of the second derivative at \var{x} given the points (\var{xa}, \var{ya}). The first argument, \var{x}, may be either a scalar or an array, and a result of the corresponding type will be returned. \seealso{interp_linear_deriv2, interp_polynomial_deriv2, interp_cspline_periodic_deriv2, interp_akima_deriv2, interp_akima_periodic_deriv2} \done \function{interp_cspline_periodic_deriv2} \synopsis{Compute second derivative using a cubic spline} \usage{y = interp_cspline_periodic_deriv2 (x, Double_Type xa[], Double_Type ya[])} \description Use cubic spline interpolation with periodic boundary conditions to determine the value of the second derivative at \var{x} given the points (\var{xa}, \var{ya}). The first argument, \var{x}, may be either a scalar or an array, and a result of the corresponding type will be returned. \seealso{interp_linear_deriv2, interp_polynomial_deriv2, interp_cspline_deriv2, interp_akima_deriv2, interp_akima_periodic_deriv2} \done \function{interp_akima_deriv2} \synopsis{Compute second derivative using an Akima spline} \usage{y = interp_akima_deriv2 (x, Double_Type xa[], Double_Type ya[])} \description Use Akima spline interpolation with natural boundary conditions to determine the value of the second derivative at \var{x} given the points (\var{xa}, \var{ya}). The first argument, \var{x}, may be either a scalar or an array, and a result of the corresponding type will be returned. \seealso{interp_linear_deriv2, interp_polynomial_deriv2, interp_cspline_deriv2, interp_cspline_periodic_deriv2, interp_akima_periodic_deriv2} \done \function{interp_akima_periodic_deriv2} \synopsis{Compute second derivative using an Akima spline} \usage{y = interp_cspline_deriv2 (x, Double_Type xa[], Double_Type ya[])} \description Use Akima spline interpolation with periodic boundary conditions to determine the value of the second derivative at \var{x} given the points (\var{xa}, \var{ya}). The first argument, \var{x}, may be either a scalar or an array, and a result of the corresponding type will be returned. \seealso{interp_linear_deriv2, interp_polynomial_deriv2, interp_cspline_deriv2, interp_cspline_periodic_deriv2, interp_akima_deriv2, interp_akima_periodic_deriv2} \done #% -------------------------------------------------------------------- \function_sect{Integration via Interpolation} \function{interp_linear_integ} \synopsis{Compute an integral using linear interpolation} \usage{y = interp_linear_integ (Double_Type xa[], Double_Type ya[], a, b)} \description This function computes the integral from \var{a} to \var{b} of the linear interpolating function associated with the set of points (\var{xa}, \var{ya}). See \ifun{interp_linear} for more information about the interpolating function. \seealso{interp_polynomial_integ, interp_cspline_integ, interp_cspline_periodic_integ, interp_akima_integ, interp_akima_periodic_integ} \done \function{interp_polynomial_integ} \synopsis{Compute an integral using polynomial interpolation} \usage{y = interp_polynomial_integ (Double_Type xa[], Double_Type ya[], a, b)} \description This function computes the integral from \var{a} to \var{b} of the polynomial interpolating function associated with the set of points (\var{xa}, \var{ya}). See \ifun{interp_polynomial} for more information about the interpolating function. \seealso{interp_linear_integ, interp_cspline_integ, interp_cspline_periodic_integ, interp_akima_integ, interp_akima_periodic_integ} \done \function{interp_cspline_integ} \synopsis{Compute an integral using a cubic spline} \usage{y = interp_cspline_integ (Double_Type xa[], Double_Type ya[], a, b)} \description This function computes the integral from \var{a} to \var{b} of the cubic spline interpolating function associated with the set of points (\var{xa}, \var{ya}). See \ifun{interp_cspline} for more information about the interpolating function. \seealso{interp_linear_integ, interp_polynomial_integ, interp_cspline_periodic_integ, interp_akima_integ, interp_akima_periodic_integ} \done \function{interp_cspline_periodic_integ} \synopsis{Compute an integral using a cubic spline} \usage{y = interp_cspline_periodic_integ (Double_Type xa[], Double_Type ya[], a, b)} \description This function computes the integral from \var{a} to \var{b} of the cubic spline interpolating function associated with the set of points (\var{xa}, \var{ya}). See \ifun{interp_cspline_periodic} for more information about the interpolating function. \seealso{interp_linear_integ, interp_polynomial_integ, interp_cspline_integ, interp_akima_integ, interp_akima_periodic_integ} \done \function{interp_akima_integ} \synopsis{Compute an integral using an Akima spline} \usage{y = interp_akima_integ (Double_Type xa[], Double_Type ya[], a, b)} \description This function computes the integral from \var{a} to \var{b} of the Akima spline interpolating function associated with the set of points (\var{xa}, \var{ya}). See \ifun{interp_akima} for more information about the interpolating function. \seealso{interp_linear_integ, interp_polynomial_integ, interp_cspline_integ, interp_cspline_periodic_integ, interp_akima_periodic_integ} \done \function{interp_akima_periodic_integ} \synopsis{Compute an integral using an Akima spline} \usage{y = interp_akima_periodic_integ (Double_Type xa[], Double_Type ya[], a, b)} \description This function computes the integral from \var{a} to \var{b} of the Akima spline interpolating function associated with the set of points (\var{xa}, \var{ya}). See \ifun{interp_akima_periodic} for more information about the interpolating function. \seealso{interp_linear_integ, interp_polynomial_integ, interp_cspline_integ, interp_cspline_periodic_integ, interp_akima_integ} \done #% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \function_sect{Low-level Interpolation Routines} \function{interp_linear_init} \synopsis{Compute a linear interpolation object} \usage{GSL_Interp_Type interp_linear_init (Double_Type_Type xa[], Double_Type_Type ya[])} \description This function computes an interpolation object appropriate for linear interpolation on the specified \var{xa} and \var{ya} arrays. \seealso{interp_eval, interp_polynomial_init, interp_cspline_init, interp_cspline_periodic_init, interp_akima_init, interp_akima_periodic_init} \done \function{interp_polynomial_init} \synopsis{Compute a polynomial interpolation object} \usage{GSL_Interp_Type interp_polynomial_init (Double_Type xa[], Double_Type ya[])} \description This function computes an interpolation object appropriate for polynomial interpolation on the specified \var{xa} and \var{ya} arrays. \seealso{interp_eval, interp_linear_init, interp_cspline_init, interp_cspline_periodic_init, interp_akima_init, interp_akima_periodic_init} \done \function{interp_cspline_init} \synopsis{Compute a cubic spline Interpolation object} \usage{GSL_Interp_Type interp_cspline_init (Double_Type xa[], Double_Type ya[])} \description This function computes an interpolation object appropriate for cubic spline interpolation with natural boundary conditions on the specified \var{xa} and \var{ya} arrays. \seealso{interp_eval, interp_linear_init, interp_polynomial_init, interp_cspline_periodic_init, interp_akima_init, interp_akima_periodic_init} \done \function{interp_cspline_periodic_init} \synopsis{Compute a cubic spline interpolation object} \usage{GSL_Interp_Type interp_cspline_periodic_init (Double_Type xa[], Double_Type ya[])} \description This function computes an interpolation object appropriate for cubic spline interpolation with periodic boundary conditions on the specified \var{xa} and \var{ya} arrays. \seealso{interp_eval, interp_linear_init, interp_polynomial_init, interp_cspline_init, interp_akima_init, interp_akima_periodic_init} \done \function{interp_akima_init} \synopsis{Compute an Akima spline interpolation object} \usage{GSL_Interp_Type interp_akima_init (Double_Type xa[], Double_Type ya[])} \description This function computes an interpolation object appropriate for Akima spline interpolation with natural boundary conditions on the specified \var{xa} and \var{ya} arrays. \seealso{interp_eval, interp_linear_init, interp_polynomial_init, interp_cspline_init, interp_cspline_periodic_init, interp_akima_periodic_init} \done \function{interp_akima_periodic_init} \synopsis{Compute an Akima spline interpolation object} \usage{GSL_Interp_Type interp_akima_periodic_init (Double_Type xa[], Double_Type ya[])} \description This function computes an interpolation object appropriate for Akima spline interpolation with periodic boundary conditions on the specified \var{xa} and \var{ya} arrays. \seealso{interp_eval, interp_linear_init, interp_polynomial_init, interp_cspline_init, interp_cspline_periodic_init, interp_akima_periodic} \done \function{interp_eval} \synopsis{Evaluate an interpolation object} \usage{y = interp_eval (GSL_Interp_Type c, x)} \description Use the precomputed interpolation object \var{c} to interpolate its value at \var{x}, which may be either a scalar or an array. An interpolated value of the corresponding shape will be returned. \seealso{interp_linear_init, interp_eval_deriv, interp_eval_deriv2, interp_eval_integ} \done \function{interp_eval_deriv} \synopsis{Evaluate the derivative of an interpolation object} \usage{dydx = interp_eval_deriv (GSL_Interp_Type c, x)} \description Use the precomputed interpolation object \var{c} to interpolate its first derivative at \var{x}, which may be either a scalar or an array. An interpolated value of the corresponding shape will be returned. \seealso{interp_linear_init, interp_eval, interp_eval_deriv2, interp_eval_integ} \done \function{interp_eval_deriv2} \synopsis{Evaluate the derivative of an interpolation object} \usage{d2ydx2 = interp_eval_deriv2 (GSL_Interp_Type c, x)} \description Use the precomputed interpolation object \var{c} to interpolate its second derivative at \var{x}, which may be either a scalar or an array. An interpolated value of the corresponding shape will be returned. \seealso{interp_linear_init, interp_eval, interp_eval_deriv, interp_eval_integ} \done \function{interp_eval_integ} \synopsis{Compute the integral of an interpolation object} \usage{integral = interp_eval_integ (GSL_Interp_Type c, a, b)} \description Use the precomputed interpolation object \var{c} to interpolate its integral from \var{a} to \var{b}. \seealso{interp_linear_init, interp_eval, interp_eval_deriv, interp_eval_deriv2} \done slgsl-pre0.10.0-7/doc/tm/rtl/gslcdf-module.tm0000644000175000000620000003107212105106006017454 0ustar johnstaff\function_sect{CDF Functions} \function{cdf_beta_P} \synopsis{S-Lang version of gsl_cdf_beta_P} \usage{Double_Type[] cdf_beta_P (x, a, b)} #v+ Double_Type[] x Double_Type[] a Double_Type[] b #v- \done \function{cdf_beta_Pinv} \synopsis{S-Lang version of gsl_cdf_beta_Pinv} \usage{Double_Type[] cdf_beta_Pinv (P, a, b)} #v+ Double_Type[] P Double_Type[] a Double_Type[] b #v- \done \function{cdf_beta_Q} \synopsis{S-Lang version of gsl_cdf_beta_Q} \usage{Double_Type[] cdf_beta_Q (x, a, b)} #v+ Double_Type[] x Double_Type[] a Double_Type[] b #v- \done \function{cdf_beta_Qinv} \synopsis{S-Lang version of gsl_cdf_beta_Qinv} \usage{Double_Type[] cdf_beta_Qinv (Q, a, b)} #v+ Double_Type[] Q Double_Type[] a Double_Type[] b #v- \done \function{cdf_cauchy_P} \synopsis{S-Lang version of gsl_cdf_cauchy_P} \usage{Double_Type[] cdf_cauchy_P (Double_Type[] x, Double_Type[] a)} \done \function{cdf_cauchy_Pinv} \synopsis{S-Lang version of gsl_cdf_cauchy_Pinv} \usage{Double_Type[] cdf_cauchy_Pinv (Double_Type[] P, Double_Type[] a)} \done \function{cdf_cauchy_Q} \synopsis{S-Lang version of gsl_cdf_cauchy_Q} \usage{Double_Type[] cdf_cauchy_Q (Double_Type[] x, Double_Type[] a)} \done \function{cdf_cauchy_Qinv} \synopsis{S-Lang version of gsl_cdf_cauchy_Qinv} \usage{Double_Type[] cdf_cauchy_Qinv (Double_Type[] Q, Double_Type[] a)} \done \function{cdf_chisq_P} \synopsis{S-Lang version of gsl_cdf_chisq_P} \usage{Double_Type[] cdf_chisq_P (Double_Type[] x, Double_Type[] nu)} \done \function{cdf_chisq_Pinv} \synopsis{S-Lang version of gsl_cdf_chisq_Pinv} \usage{Double_Type[] cdf_chisq_Pinv (Double_Type[] P, Double_Type[] nu)} \done \function{cdf_chisq_Q} \synopsis{S-Lang version of gsl_cdf_chisq_Q} \usage{Double_Type[] cdf_chisq_Q (Double_Type[] x, Double_Type[] nu)} \done \function{cdf_chisq_Qinv} \synopsis{S-Lang version of gsl_cdf_chisq_Qinv} \usage{Double_Type[] cdf_chisq_Qinv (Double_Type[] Q, Double_Type[] nu)} \done \function{cdf_exponential_P} \synopsis{S-Lang version of gsl_cdf_exponential_P} \usage{Double_Type[] cdf_exponential_P (Double_Type[] x, Double_Type[] mu)} \done \function{cdf_exponential_Pinv} \synopsis{S-Lang version of gsl_cdf_exponential_Pinv} \usage{Double_Type[] cdf_exponential_Pinv (Double_Type[] P, Double_Type[] mu)} \done \function{cdf_exponential_Q} \synopsis{S-Lang version of gsl_cdf_exponential_Q} \usage{Double_Type[] cdf_exponential_Q (Double_Type[] x, Double_Type[] mu)} \done \function{cdf_exponential_Qinv} \synopsis{S-Lang version of gsl_cdf_exponential_Qinv} \usage{Double_Type[] cdf_exponential_Qinv (Double_Type[] Q, Double_Type[] mu)} \done \function{cdf_exppow_P} \synopsis{S-Lang version of gsl_cdf_exppow_P} \usage{Double_Type[] cdf_exppow_P (x, a, b)} #v+ Double_Type[] x Double_Type[] a Double_Type[] b #v- \done \function{cdf_exppow_Q} \synopsis{S-Lang version of gsl_cdf_exppow_Q} \usage{Double_Type[] cdf_exppow_Q (x, a, b)} #v+ Double_Type[] x Double_Type[] a Double_Type[] b #v- \done \function{cdf_fdist_P} \synopsis{S-Lang version of gsl_cdf_fdist_P} \usage{Double_Type[] cdf_fdist_P (x, nu1, nu2)} #v+ Double_Type[] x Double_Type[] nu1 Double_Type[] nu2 #v- \done \function{cdf_fdist_Pinv} \synopsis{S-Lang version of gsl_cdf_fdist_Pinv} \usage{Double_Type[] cdf_fdist_Pinv (P, nu1, nu2)} #v+ Double_Type[] P Double_Type[] nu1 Double_Type[] nu2 #v- \done \function{cdf_fdist_Q} \synopsis{S-Lang version of gsl_cdf_fdist_Q} \usage{Double_Type[] cdf_fdist_Q (x, nu1, nu2)} #v+ Double_Type[] x Double_Type[] nu1 Double_Type[] nu2 #v- \done \function{cdf_fdist_Qinv} \synopsis{S-Lang version of gsl_cdf_fdist_Qinv} \usage{Double_Type[] cdf_fdist_Qinv (Q, nu1, nu2)} #v+ Double_Type[] Q Double_Type[] nu1 Double_Type[] nu2 #v- \done \function{cdf_flat_P} \synopsis{S-Lang version of gsl_cdf_flat_P} \usage{Double_Type[] cdf_flat_P (x, a, b)} #v+ Double_Type[] x Double_Type[] a Double_Type[] b #v- \done \function{cdf_flat_Pinv} \synopsis{S-Lang version of gsl_cdf_flat_Pinv} \usage{Double_Type[] cdf_flat_Pinv (P, a, b)} #v+ Double_Type[] P Double_Type[] a Double_Type[] b #v- \done \function{cdf_flat_Q} \synopsis{S-Lang version of gsl_cdf_flat_Q} \usage{Double_Type[] cdf_flat_Q (x, a, b)} #v+ Double_Type[] x Double_Type[] a Double_Type[] b #v- \done \function{cdf_flat_Qinv} \synopsis{S-Lang version of gsl_cdf_flat_Qinv} \usage{Double_Type[] cdf_flat_Qinv (Q, a, b)} #v+ Double_Type[] Q Double_Type[] a Double_Type[] b #v- \done \function{cdf_gamma_P} \synopsis{S-Lang version of gsl_cdf_gamma_P} \usage{Double_Type[] cdf_gamma_P (x, a, b)} #v+ Double_Type[] x Double_Type[] a Double_Type[] b #v- \done \function{cdf_gamma_Pinv} \synopsis{S-Lang version of gsl_cdf_gamma_Pinv} \usage{Double_Type[] cdf_gamma_Pinv (P, a, b)} #v+ Double_Type[] P Double_Type[] a Double_Type[] b #v- \done \function{cdf_gamma_Q} \synopsis{S-Lang version of gsl_cdf_gamma_Q} \usage{Double_Type[] cdf_gamma_Q (x, a, b)} #v+ Double_Type[] x Double_Type[] a Double_Type[] b #v- \done \function{cdf_gamma_Qinv} \synopsis{S-Lang version of gsl_cdf_gamma_Qinv} \usage{Double_Type[] cdf_gamma_Qinv (Q, a, b)} #v+ Double_Type[] Q Double_Type[] a Double_Type[] b #v- \done \function{cdf_gaussian_P} \synopsis{S-Lang version of gsl_cdf_gaussian_P} \usage{Double_Type[] cdf_gaussian_P (Double_Type[] x, Double_Type[] sigma)} \done \function{cdf_gaussian_Pinv} \synopsis{S-Lang version of gsl_cdf_gaussian_Pinv} \usage{Double_Type[] cdf_gaussian_Pinv (Double_Type[] P, Double_Type[] sigma)} \done \function{cdf_gaussian_Q} \synopsis{S-Lang version of gsl_cdf_gaussian_Q} \usage{Double_Type[] cdf_gaussian_Q (Double_Type[] x, Double_Type[] sigma)} \done \function{cdf_gaussian_Qinv} \synopsis{S-Lang version of gsl_cdf_gaussian_Qinv} \usage{Double_Type[] cdf_gaussian_Qinv (Double_Type[] Q, Double_Type[] sigma)} \done \function{cdf_gumbel1_P} \synopsis{S-Lang version of gsl_cdf_gumbel1_P} \usage{Double_Type[] cdf_gumbel1_P (x, a, b)} #v+ Double_Type[] x Double_Type[] a Double_Type[] b #v- \done \function{cdf_gumbel1_Pinv} \synopsis{S-Lang version of gsl_cdf_gumbel1_Pinv} \usage{Double_Type[] cdf_gumbel1_Pinv (P, a, b)} #v+ Double_Type[] P Double_Type[] a Double_Type[] b #v- \done \function{cdf_gumbel1_Q} \synopsis{S-Lang version of gsl_cdf_gumbel1_Q} \usage{Double_Type[] cdf_gumbel1_Q (x, a, b)} #v+ Double_Type[] x Double_Type[] a Double_Type[] b #v- \done \function{cdf_gumbel1_Qinv} \synopsis{S-Lang version of gsl_cdf_gumbel1_Qinv} \usage{Double_Type[] cdf_gumbel1_Qinv (Q, a, b)} #v+ Double_Type[] Q Double_Type[] a Double_Type[] b #v- \done \function{cdf_gumbel2_P} \synopsis{S-Lang version of gsl_cdf_gumbel2_P} \usage{Double_Type[] cdf_gumbel2_P (x, a, b)} #v+ Double_Type[] x Double_Type[] a Double_Type[] b #v- \done \function{cdf_gumbel2_Pinv} \synopsis{S-Lang version of gsl_cdf_gumbel2_Pinv} \usage{Double_Type[] cdf_gumbel2_Pinv (P, a, b)} #v+ Double_Type[] P Double_Type[] a Double_Type[] b #v- \done \function{cdf_gumbel2_Q} \synopsis{S-Lang version of gsl_cdf_gumbel2_Q} \usage{Double_Type[] cdf_gumbel2_Q (x, a, b)} #v+ Double_Type[] x Double_Type[] a Double_Type[] b #v- \done \function{cdf_gumbel2_Qinv} \synopsis{S-Lang version of gsl_cdf_gumbel2_Qinv} \usage{Double_Type[] cdf_gumbel2_Qinv (Q, a, b)} #v+ Double_Type[] Q Double_Type[] a Double_Type[] b #v- \done \function{cdf_laplace_P} \synopsis{S-Lang version of gsl_cdf_laplace_P} \usage{Double_Type[] cdf_laplace_P (Double_Type[] x, Double_Type[] a)} \done \function{cdf_laplace_Pinv} \synopsis{S-Lang version of gsl_cdf_laplace_Pinv} \usage{Double_Type[] cdf_laplace_Pinv (Double_Type[] P, Double_Type[] a)} \done \function{cdf_laplace_Q} \synopsis{S-Lang version of gsl_cdf_laplace_Q} \usage{Double_Type[] cdf_laplace_Q (Double_Type[] x, Double_Type[] a)} \done \function{cdf_laplace_Qinv} \synopsis{S-Lang version of gsl_cdf_laplace_Qinv} \usage{Double_Type[] cdf_laplace_Qinv (Double_Type[] Q, Double_Type[] a)} \done \function{cdf_logistic_P} \synopsis{S-Lang version of gsl_cdf_logistic_P} \usage{Double_Type[] cdf_logistic_P (Double_Type[] x, Double_Type[] a)} \done \function{cdf_logistic_Pinv} \synopsis{S-Lang version of gsl_cdf_logistic_Pinv} \usage{Double_Type[] cdf_logistic_Pinv (Double_Type[] P, Double_Type[] a)} \done \function{cdf_logistic_Q} \synopsis{S-Lang version of gsl_cdf_logistic_Q} \usage{Double_Type[] cdf_logistic_Q (Double_Type[] x, Double_Type[] a)} \done \function{cdf_logistic_Qinv} \synopsis{S-Lang version of gsl_cdf_logistic_Qinv} \usage{Double_Type[] cdf_logistic_Qinv (Double_Type[] Q, Double_Type[] a)} \done \function{cdf_lognormal_P} \synopsis{S-Lang version of gsl_cdf_lognormal_P} \usage{Double_Type[] cdf_lognormal_P (x, zeta, sigma)} #v+ Double_Type[] x Double_Type[] zeta Double_Type[] sigma #v- \done \function{cdf_lognormal_Pinv} \synopsis{S-Lang version of gsl_cdf_lognormal_Pinv} \usage{Double_Type[] cdf_lognormal_Pinv (P, zeta, sigma)} #v+ Double_Type[] P Double_Type[] zeta Double_Type[] sigma #v- \done \function{cdf_lognormal_Q} \synopsis{S-Lang version of gsl_cdf_lognormal_Q} \usage{Double_Type[] cdf_lognormal_Q (x, zeta, sigma)} #v+ Double_Type[] x Double_Type[] zeta Double_Type[] sigma #v- \done \function{cdf_lognormal_Qinv} \synopsis{S-Lang version of gsl_cdf_lognormal_Qinv} \usage{Double_Type[] cdf_lognormal_Qinv (Q, zeta, sigma)} #v+ Double_Type[] Q Double_Type[] zeta Double_Type[] sigma #v- \done \function{cdf_pareto_P} \synopsis{S-Lang version of gsl_cdf_pareto_P} \usage{Double_Type[] cdf_pareto_P (x, a, b)} #v+ Double_Type[] x Double_Type[] a Double_Type[] b #v- \done \function{cdf_pareto_Pinv} \synopsis{S-Lang version of gsl_cdf_pareto_Pinv} \usage{Double_Type[] cdf_pareto_Pinv (P, a, b)} #v+ Double_Type[] P Double_Type[] a Double_Type[] b #v- \done \function{cdf_pareto_Q} \synopsis{S-Lang version of gsl_cdf_pareto_Q} \usage{Double_Type[] cdf_pareto_Q (x, a, b)} #v+ Double_Type[] x Double_Type[] a Double_Type[] b #v- \done \function{cdf_pareto_Qinv} \synopsis{S-Lang version of gsl_cdf_pareto_Qinv} \usage{Double_Type[] cdf_pareto_Qinv (Q, a, b)} #v+ Double_Type[] Q Double_Type[] a Double_Type[] b #v- \done \function{cdf_rayleigh_P} \synopsis{S-Lang version of gsl_cdf_rayleigh_P} \usage{Double_Type[] cdf_rayleigh_P (Double_Type[] x, Double_Type[] sigma)} \done \function{cdf_rayleigh_Pinv} \synopsis{S-Lang version of gsl_cdf_rayleigh_Pinv} \usage{Double_Type[] cdf_rayleigh_Pinv (Double_Type[] P, Double_Type[] sigma)} \done \function{cdf_rayleigh_Q} \synopsis{S-Lang version of gsl_cdf_rayleigh_Q} \usage{Double_Type[] cdf_rayleigh_Q (Double_Type[] x, Double_Type[] sigma)} \done \function{cdf_rayleigh_Qinv} \synopsis{S-Lang version of gsl_cdf_rayleigh_Qinv} \usage{Double_Type[] cdf_rayleigh_Qinv (Double_Type[] Q, Double_Type[] sigma)} \done \function{cdf_tdist_P} \synopsis{S-Lang version of gsl_cdf_tdist_P} \usage{Double_Type[] cdf_tdist_P (Double_Type[] x, Double_Type[] nu)} \done \function{cdf_tdist_Pinv} \synopsis{S-Lang version of gsl_cdf_tdist_Pinv} \usage{Double_Type[] cdf_tdist_Pinv (Double_Type[] P, Double_Type[] nu)} \done \function{cdf_tdist_Q} \synopsis{S-Lang version of gsl_cdf_tdist_Q} \usage{Double_Type[] cdf_tdist_Q (Double_Type[] x, Double_Type[] nu)} \done \function{cdf_tdist_Qinv} \synopsis{S-Lang version of gsl_cdf_tdist_Qinv} \usage{Double_Type[] cdf_tdist_Qinv (Double_Type[] Q, Double_Type[] nu)} \done \function{cdf_ugaussian_P} \synopsis{S-Lang version of gsl_cdf_ugaussian_P} \usage{Double_Type[] cdf_ugaussian_P (Double_Type[] x)} \done \function{cdf_ugaussian_Pinv} \synopsis{S-Lang version of gsl_cdf_ugaussian_Pinv} \usage{Double_Type[] cdf_ugaussian_Pinv (Double_Type[] P)} \done \function{cdf_ugaussian_Q} \synopsis{S-Lang version of gsl_cdf_ugaussian_Q} \usage{Double_Type[] cdf_ugaussian_Q (Double_Type[] x)} \done \function{cdf_ugaussian_Qinv} \synopsis{S-Lang version of gsl_cdf_ugaussian_Qinv} \usage{Double_Type[] cdf_ugaussian_Qinv (Double_Type[] Q)} \done \function{cdf_weibull_P} \synopsis{S-Lang version of gsl_cdf_weibull_P} \usage{Double_Type[] cdf_weibull_P (x, a, b)} #v+ Double_Type[] x Double_Type[] a Double_Type[] b #v- \done \function{cdf_weibull_Pinv} \synopsis{S-Lang version of gsl_cdf_weibull_Pinv} \usage{Double_Type[] cdf_weibull_Pinv (P, a, b)} #v+ Double_Type[] P Double_Type[] a Double_Type[] b #v- \done \function{cdf_weibull_Q} \synopsis{S-Lang version of gsl_cdf_weibull_Q} \usage{Double_Type[] cdf_weibull_Q (x, a, b)} #v+ Double_Type[] x Double_Type[] a Double_Type[] b #v- \done \function{cdf_weibull_Qinv} \synopsis{S-Lang version of gsl_cdf_weibull_Qinv} \usage{Double_Type[] cdf_weibull_Qinv (Q, a, b)} #v+ Double_Type[] Q Double_Type[] a Double_Type[] b #v- \done slgsl-pre0.10.0-7/doc/tm/rtl/gslmatrix.tm0000644000175000000620000001447612105106006016752 0ustar johnstaff\function_sect{Linear Algebra and Matrix-Oriented Routines} \function{linalg_LU_decomp} \synopsis{Factorize a square matrix into its LU decomposition} \usage{(LU,p) = linalg_LU_decomp (A [,&signum])} \description This routines returns the LU decomposition of the square matrix \exmp{A} such that \exmp{P#A == LU}. See the corresponding GSL documentation for how \exmp{L} and \exmp{U} are stored in \exmp{LU}, and how the permutation matrix \exmp{P} is defined. For many applications, it is unnecessary to unpack the matrix \exmp{LU} into its separate components. If the optional argument \exmp{&signum} is given, upon return \exmp{signum} will be set to the sign of the permutation that relates \exmp{P} to the identity matrix. \seealso{linalg_LU_det, linalg_LU_invert, linalg_LU_solve} \done \function{linalg_LU_det} \synopsis{Compute the determinant of a matrix from its LU decomposition} \usage{det = linalg_LU_det (LU, signum)} \description This function computes the determinant of a matrix from its LU decomposition. In the LU form, determinant is given by the product of the diagonal elements with the sign of the permutation. #v+ require ("gslmatrix"); define determinant (A) { variable LU, sig; (LU,) = linalg_LU_decomp (A, &sig); return linalg_LU_det (LU,sig); } #v- \seealso{linalg_LU_lndet, linalg_LU_decomp, linalg_LU_invert, linalg_LU_solve} \done \function{linalg_LU_lndet} \synopsis{Compute the log of a determinant using LU decomposition} \usage{det = linalg_LU_lndet (LU)} \description This function computes the natural logarithm of the determinant of a matrix from its LU decomposition. In the LU form, determinant is given by the product of the diagonal elements with the sign of the permutation. This function is useful for cases where the product of the diagonal elements would overflow. \seealso{linalg_LU_det, linalg_LU_decomp, linalg_LU_solve, linalg_LU_invert} \done \function{linalg_LU_invert} \synopsis{Compute the inverse of a matrix via its LU decomposition} \usage{inv = linalg_LU_invert (LU, p)} \description This function may be used to compute the inverse of a matrix from its LU decomposition. For the purposes of inverting a set of linear equations, it is preferable to use the \ifun{linalg_LU_solve} function rather than inverting the equations via the inverse. #v+ define matrix_inverse (A) { return linalg_LU_invert (linalg_LU_decomp (A)); } #v- \seealso{linalg_LU_decomp, linalg_LU_solve, linalg_LU_det} \done \function{linalg_LU_solve} \synopsis{Solve a set of linear equations using LU decomposition} \usage{x = linalg_LU_solve (LU, p, b)} \description This function solves the square linear system of equations \exmp{A#x=b} for the vector \exmp{x} via the LU decomposition of \exmp{A}. #v+ define solve_equations (A, b) { return linalg_LU_solve (linalg_LU_decomp (A), b); } #v- \seealso{linalg_LU_decomp, linalg_LU_det, linalg_LU_invert} \done \function{linalg_QR_decomp} \synopsis{Factor a matrix into its QR form} \usage{(QR, tau) = linalg_QR_decomp(A)} \description This function may be used to decompose a rectangular matrix into its so-called QR such that \exmp{A=Q#R} where \exmp{Q} is a square orthogonal matrix and \exmp{R} is a rectangular right-triangular matrix. The factor \exmp{R} encoded in the diagonal and upper-triangular elements of the first return value \exmp{QR}. The matrix \exmp{Q} is encoded in the lower triangular part of \exmp{QR} and the vector \exmp{tau} via Householder vectors and coefficients. See the corresponding \GSL documentation for the details of the encoding. For most uses encoding details are not required. \seealso{linalg_QR_solve, } \done \function{linalg_QR_solve} \synopsis{Solve a system of linear equations using QR decomposition} \usage{x = linalg_QR_solve(QR, tau, b [,&residual])} \description This function may be used to solve the linear system \exmp{A#x=b} using the \exmp{QR} decomposition of \exmp{A}. If the optional fourth argument is present (\exmp{&residual}), or if \exmp{QR} is not a square matrix, then the linear system will be solved in the least-squares sense by minimizing the (Euclidean) norm of \exmp{A#x-b}. Upon return, the value of the variable \exmp{residual} is set to the the norm of \exmp{A#x-b}. \notes \GSL has a separate function called \exmp{gsl_linalg_QR_lssolve} for computing this least-squares solution. The \ifun{linalg_QR_solve} combines both \exmp{gsl_linalg_QR_lssolve} and \exmp{gsl_linalg_QR_solve} into a single routine. \seealso{linalg_QR_decomp} \done \function{linalg_SV_decomp} \synopsis{Perform a singular-value decomposition on a matrix} \usage{(U,S,V) = linalg_SV_decomp(A)} \description This function factors a MxN (M>=N) rectangular matrix \exmp{A} into three factors such that \exmp{A = U#S#transpose(V)}, where \exmp{S} is diagonal matrix containing the singular values of \exmp{A} and \exmp{V} is a square orthogonal matrix. Since \exmp{S} is diagonal, it is returned as a 1-d array. \seealso{linalg_SV_solve} \done \function{linalg_SV_solve} \synopsis{Solve a linear system using Singular-Value Decomposition} \usage{x = linalg_SV_solve (U,V,S,b)} \description This function ``solves'' the linear system \exmp{A#x=b} using the SVD form of \exmp{A}. \example #v+ define svd_solve (A, b) { variable U, V, S; (U,V,S) = linalg_SV_decomp (A); return linalg_SV_solve (U,V,S,b); } #v- \seealso{linalg_SV_decomp, linalg_QR_solve, linalg_LU_solve} \done \function{eigen_symmv} \synopsis{Compute the eigenvalues and eigenvectors of a Hermitian matrix} \usage{(eigvecs, eigvals)=eigen_symmv(A)} \description This function computes the eigenvalues and eigenvectors of a Hermitian (or real-symmetric) square matrix \exmp{A}. The eigenvalues are returned sorted on their absolute value (or norm) in descending order. \seealso{eigen_nonsymmv} \done \function{eigen_nonsymmv} \synopsis{Compute the eigenvalues and eigenvectors of a matrix} \usage{(eigvecs, eigvals)=eigen_nonsymmv(A)} \description This function returns the eigenvalues and eigenvectors of a real non-symmetric matrix \exmp{A}. As such quantities are in general complex, complex-valued arrays will be returned. The eigenvalues are returned in descending order sorted upon norm. \seealso{eigen_symmv} \done slgsl-pre0.10.0-7/doc/tm/fixtxt0000755000175000000620000000400112105106006015030 0ustar johnstaff#!/usr/bin/env jed-script if (__argc != 2) { () = fprintf (stderr, "Usage: %s file.txt\n", __argv[0]); exit (1); } % The txt file looks ugly and the contents at the beginning are % totally misleading. static define process_file (file) { variable txt; () = read_file (file); % trim excess blank lines trim_buffer (); % fix the underscore chars bob (); while (fsearch ("_.ds h ")) { deln (7); insert ("_"); % Unfortunately, there are other things associated with this that are % messed up. See my debian linuxdoc bug report. In particular, the % table of contents associated with this are hosed and possibly the % rest of the text on this line. Here is a fix for contents. push_spot (); bol_skip_white (); push_mark (); skip_chars ("0-9."); variable sect = bufsubstr (); skip_white (); push_mark (); eol (); txt = bufsubstr (); eob (); () = bsearch ("Table of Contents"); sect = strcat (" ",sect," "); if (bol_fsearch (sect)) { go_right(strlen (sect)); del_eol (); insert (txt); } pop_spot (); } % Delete the contents at the beginning. They are wrong. bob (); if (fsearch ("Table of Contents")) { bol (); push_mark (); if (fsearch ("____________________________________________")) { go_down(1); del_region (); % Grab the contents from the bottom push_spot (); eob (); () = bsearch ("Table of Contents"); bol (); push_mark (); % Get rid of . . . stufff since the page numbers are meaningless while (re_fsearch ("\\d$")) { bol_skip_white (); % Keep only levels 1. and 1.2. if (re_looking_at ("\d+\.\d+\.\d+"R)) { delete_line (); continue; } eol (); push_mark (); bskip_chars ("[0-9]"); bskip_chars (" ."); del_region (); } eob (); txt = bufsubstr_delete (); pop_spot (); insert (txt); } else pop_mark (0); } save_buffer (); } process_file (__argv[1]); exit (0); slgsl-pre0.10.0-7/doc/tm/fixtex.sl0000755000175000000620000000516514001614376015455 0ustar johnstaff#!/usr/bin/env jed-script private variable Version = "0.3.2-0"; if (__argc != 2) { message ("Version $Version Usage: ./fixtex.sl "$); quit_jed (); } variable file = __argv[1]; () = read_file (file); % Patch up the >,< signs bob (); replace ("$<$", "<"); replace ("$>$", ">"); % It appears that sgml2tex screws up _for in section titles, producing \_{for}. replace ("ion\\_{", "ion{\\_"); % Make the first chapter a preface bob (); if (bol_fsearch ("\\chapter{Preface}")) { push_spot (); push_mark (); go_right (8); insert ("*"); % \chapter{ --> \chapter*{ () = bol_fsearch ("\\chapter{"); push_spot (); insert("\\tableofcontents\n"); eol (); insert ("\n\\pagenumbering{arabic}"); pop_spot (); narrow (); bob (); replace ("\\section{", "\\section*{"); widen (); if (bol_bsearch ("\\tableofcontents")) delete_line (); pop_spot (); if (bol_bsearch ("\\maketitle")) insert ("\\pagenumbering{roman}\n"); } static define fixup_urldefs () { % pdflatex cannot grok urldef bob (); while (bol_fsearch("\\urldef{") and ffind ("\\url{")) { variable line = line_as_string (); bol (); insert ("\\ifpdf\n"); deln (7); insert ("\\newcommand"); push_mark (); ()=ffind ("}"); variable macro = bufsubstr (); () = ffind ("\\url"); go_left (1); trim (); insert("{"); % pdflatex cannot grok # in urls. Nuke em. if (ffind ("#")) { del_eol (); insert ("}"); } eol (); insert ("}\n\\else\n"); insert (line); newline (); insert ("\\fi\n"); } } static define remove_repeated_urls () { variable name, url; variable names = Assoc_Type[Int_Type, 0]; while (bol_fsearch ("{\\em ")) { go_right (4); skip_white (); push_mark (); () = ffind ("}"); !if (looking_at ("} {\\tt ")) { pop_mark(0); continue; } name = bufsubstr (); if (names[name]) { go_right(1); push_mark (); () = ffind ("}"); go_right(1); del_region (); } else { names[name] = 1; go_right(1); () = ffind ("}"); go_right (1); } % Now remove empty lines inserted by the broken sgml2latex program. skip_white (); !if (eolp ()) continue; go_right(1); skip_white (); if (eolp ()) del (); } } private define fix_equations () { bob (); replace ("$\\backslash$begin$\\{$", "\\begin{"); replace ("$\\backslash$end$\\{$", "\\end{"); replace ("$\\}$", "}"); replace ("\\^{}", "^"); replace ("$\\backslash$int\\_", "\\int_"); replace ("$\\backslash$;", "\\;"); } fixup_urldefs (); remove_repeated_urls (); fix_equations (); save_buffer (); quit_jed (); slgsl-pre0.10.0-7/COPYRIGHT0000644000175000000620000000261012105106006013666 0ustar johnstaff Copyright (c) 2003-2011 Massachusetts Institute of Technology This software was developed by the MIT Center for Space Research under contract SV1-61010 from the Smithsonian Institution. Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in the supporting documentation, and that the name of the Massachusetts Institute of Technology not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The Massachusetts Institute of Technology makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. THE MASSACHUSETTS INSTITUTE OF TECHNOLOGY DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE MASSACHUSETTS INSTITUTE OF TECHNOLOGY BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.