slgsl-0.7.0/0000755002657400265740000000000010674313140011665 5ustar davisdavisslgsl-0.7.0/doc/0000755002657400265740000000000010674311422012433 5ustar davisdavisslgsl-0.7.0/doc/tm/0000755002657400265740000000000010674311422013053 5ustar davisdavisslgsl-0.7.0/doc/tm/rtl/0000755002657400265740000000000010674311422013654 5ustar davisdavisslgsl-0.7.0/doc/tm/rtl/gslconst-module.tm0000644002657400265740000001426210062071264017340 0ustar davisdavis\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_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_STILB} \constant{CONST_MKSA_STOKES} \constant{CONST_MKSA_TABLESPOON} \constant{CONST_MKSA_TEASPOON} \constant{CONST_MKSA_TEXPOINT} \constant{CONST_MKSA_THERM} \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_GAUSS} \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_STILB} \constant{CONST_CGSM_STOKES} \constant{CONST_CGSM_TABLESPOON} \constant{CONST_CGSM_TEASPOON} \constant{CONST_CGSM_TEXPOINT} \constant{CONST_CGSM_THERM} \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-0.7.0/doc/tm/rtl/gslsf-module.tm0000644002657400265740000006270410244673067016641 0ustar davisdavis\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_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_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, n [,mode])} #v+ Double_Type[] phi Double_Type[] k Double_Type[] n Int_Type mode #v- \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_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_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{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_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_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{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{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{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{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-0.7.0/doc/tm/rtl/gslcdf-module.tm0000644002657400265740000002671010244673067016762 0ustar davisdavis\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_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_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_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_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_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-0.7.0/doc/tm/rtl/gslfft.tm0000644002657400265740000000242610244673067015520 0ustar davisdavis\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. \notes This routine is currently a wrapper for the \exmp{_gsl_fft_complex} function. \seealso{_gsl_fft_complex} \done slgsl-0.7.0/doc/tm/rtl/gslinterp.tm0000644002657400265740000004633410062071264016235 0ustar davisdavis\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_cspline_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{d2ydx2 = interp_eval_deriv2 (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-0.7.0/doc/tm/rtl/gslmatrix.tm0000644002657400265740000001447610674311023016241 0ustar davisdavis\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-0.7.0/doc/tm/rtl/gslrand.tm0000644002657400265740000002653110244673067015670 0ustar davisdavis\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-0.7.0/doc/tm/slgslfuns.tm0000644002657400265740000000031010674311023015424 0ustar davisdavis#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 slgsl-0.7.0/doc/tm/fixtex.sl0000644002657400265740000000450510674311023014723 0ustar davisdavis#!/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 (); } } fixup_urldefs (); remove_repeated_urls (); save_buffer (); quit_jed (); slgsl-0.7.0/doc/tm/slgsl.tm0000644002657400265740000004030410674311023014537 0ustar davisdavis#% -*- mode: tm; mode: fold -*- #%{{{Macros #i linuxdoc.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.s-lang.org/doc/html/slang.html}{S-Lang documentation} \linuxdoc \begin{\documentstyle} \title S-Lang GSL Module Reference \author John E. Davis, \tt{davis@space.mit.edu} \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. } 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{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 separater 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 #%}}} \end{\documentstyle} slgsl-0.7.0/doc/tm/fixtxt0000755002657400265740000000400110244673067014333 0ustar davisdavis#!/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-0.7.0/doc/tm/Makefile0000644002657400265740000000546210674311023014517 0ustar davisdavis# -*- sh -*- # # To create the SGML files, you will need to install the tm-utils # package. See http://www.jedsoft.org/ for more information. # TMEXPAND = /aluche/d1/web/tm-dist/bin/tmexpand SL2TM = sl2tm MACRODIR = /aluche/d1/web/tm-dist/macros TM2HLP = $(TMEXPAND) -I$(MACRODIR) -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$(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-0.7.0/doc/html/0000755002657400265740000000000010674311422013377 5ustar davisdavisslgsl-0.7.0/doc/html/slgsl-10.html0000644002657400265740000002257610674311023015640 0ustar davisdavis S-Lang GSL Module Reference: gslconst: The GSL Constants Module Next Previous Contents


10. 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.

10.1 MKSA Constants

10.2 CGSM Constants


Next Previous Contents slgsl-0.7.0/doc/html/slgsl-1.html0000644002657400265740000000473510674311023015555 0ustar davisdavis S-Lang GSL Module Reference: Introduction to GSL Next Previous Contents

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 http://www.gnu.org/software/gsl/.

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 http://space.mit.edu/CXC/software/slang/modules/gsl/.

At the moment, the following GSL modules are available:

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.


Next Previous Contents slgsl-0.7.0/doc/html/slgsl-2.html0000644002657400265740000000417010674311023015547 0ustar davisdavis S-Lang GSL Module Reference: Using the GSL Modules Next Previous Contents

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 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.,

    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]);
    }


Next Previous Contents slgsl-0.7.0/doc/html/slgsl.html0000644002657400265740000001073110674311023015410 0ustar davisdavis S-Lang GSL Module Reference Next Previous Contents

S-Lang GSL Module Reference

John E. Davis, davis@space.mit.edu

Sep 19, 2007

1. Introduction to GSL

2. Using the GSL Modules

3. Error Handling

4. gslinterp: The GSL Interpolation Module

5. gslsf: The GSL Special Functions Module

6. gslrand: The GSL Random Number Module

7. gslfft: The GSL FFT module

8. gslmatrix: A Collection of Matrix-Oriented GSL functions

9. gslcdf: The GSL Cumulative Distribution Function Module

10. gslconst: The GSL Constants Module


Next Previous Contents slgsl-0.7.0/doc/html/slgsl-3.html0000644002657400265740000001017210674311023015547 0ustar davisdavis S-Lang GSL Module Reference: Error Handling Next Previous Contents

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


Next Previous Contents slgsl-0.7.0/doc/html/slgsl-4.html0000644002657400265740000010552510674311023015557 0ustar davisdavis S-Lang GSL Module Reference: gslinterp: The GSL Interpolation Module Next Previous Contents

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 interp_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

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

4.2 First Derivative via Interpolation

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

4.3 Second Derivative via Interpolation

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

4.4 Integration via Interpolation

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_cspline_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

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

d2ydx2 = interp_eval_deriv2 (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


Next Previous Contents slgsl-0.7.0/doc/html/slgsl-5.html0000644002657400265740000014074610674311023015564 0ustar davisdavis S-Lang GSL Module Reference: gslsf: The GSL Special Functions Module Next Previous Contents

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_SINGLE. 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

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])

5.2 Bessel Functions

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)

5.3 Beta Functions

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)

5.4 Clausen Functions

clausen

Synopsis

S-Lang version of gsl_sf_clausen

Usage

Double_Type[] clausen (Double_Type[] x)

5.5 Conical Functions

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

5.6 Coulomb Functions

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)

5.7 Debye Functions

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)

5.8 Di/Tri and Polygamma Functions

psi

Synopsis

S-Lang version of gsl_sf_psi

Usage

Double_Type[] psi (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)

5.9 Elliptic Integrals

ellint_D

Synopsis

S-Lang version of gsl_sf_ellint_D

Usage

Double_Type[] ellint_D (phi, k, n [,mode])

  Double_Type[] phi
  Double_Type[] k
  Double_Type[] n 
  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_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

5.10 Error Functions

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)

5.11 Eta/Zeta Functions

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)

5.12 Exponential Functions and Integrals

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)

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)

5.13 Fermi-Dirac Functions

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)

5.14 Gamma Functions

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)

5.15 Gegenbauer Functions

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

5.16 Hypergeometric Functions

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)

5.17 Laguerre Functions

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)

5.18 Lambert Functions

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)

5.19 Legendre Functions and Spherical Harmonics

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)

5.20 Logarithm and Related Functions

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)

5.21 Transport Functions

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)

5.22 Miscellaneous Functions

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)

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)


Next Previous Contents slgsl-0.7.0/doc/html/slgsl-6.html0000644002657400265740000005217510674311023015563 0ustar davisdavis S-Lang GSL Module Reference: gslrand: The GSL Random Number Module Next Previous Contents

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_alloc 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 example,
   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

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)

6.2 Random Number Distributions

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])

6.3 PDF Functions

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


Next Previous Contents slgsl-0.7.0/doc/html/slgsl-7.html0000644002657400265740000000602010674311023015550 0ustar davisdavis S-Lang GSL Module Reference: gslfft: The GSL FFT module Next Previous Contents

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

_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.

Notes

This routine is currently a wrapper for the _gsl_fft_complex function.

See Also

_gsl_fft_complex


Next Previous Contents slgsl-0.7.0/doc/html/slgsl-8.html0000644002657400265740000002531410674311023015560 0ustar davisdavis S-Lang GSL Module Reference: gslmatrix: A Collection of Matrix-Oriented GSL functions Next Previous Contents

8. 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 separater 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.

8.1 Linear Algebra and Matrix-Oriented Routines

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 GSL 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

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

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


Next Previous Contents slgsl-0.7.0/doc/html/slgsl-9.html0000644002657400265740000005144510674311023015565 0ustar davisdavis S-Lang GSL Module Reference: gslcdf: The GSL Cumulative Distribution Function Module Next Previous Contents

9. gslcdf: The GSL Cumulative Distribution Function Module

The gslcdf module wraps the GSL cumulative distribution functions.

9.1 CDF Functions

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

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_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_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_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_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


Next Previous Contents slgsl-0.7.0/doc/help/0000755002657400265740000000000010674311422013363 5ustar davisdavisslgsl-0.7.0/doc/help/slgsl.hlp0000644002657400265740000026337110674311023015225 0ustar davisdaviscdf_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_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_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_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_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_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. NOTES This routine is currently a wrapper for the `_gsl_fft_complex' function. SEE ALSO _gsl_fft_complex -------------------------------------------------------------- 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) -------------------------------------------------------------- psi SYNOPSIS S-Lang version of gsl_sf_psi USAGE Double_Type[] psi (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, n [,mode]) Double_Type[] phi Double_Type[] k Double_Type[] n 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_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) -------------------------------------------------------------- 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) -------------------------------------------------------------- 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) -------------------------------------------------------------- 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_cspline_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 d2ydx2 = interp_eval_deriv2 (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 -------------------------------------------------------------- slgsl-0.7.0/doc/index.html0000644002657400265740000000046210244673067014443 0ustar davisdavis 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-0.7.0/src/0000755002657400265740000000000010674311422012455 5ustar davisdavisslgsl-0.7.0/src/gslsf-module.c0000644002657400265740000007164210665603423015241 0ustar davisdavis/* -*- mode: C; mode: fold; -*- */ /* This file was automatically generated. */ /* 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 (davis@space.mit.edu) */ #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 (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 (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 (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 (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); } #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); } /*}}}*/ D_FDDDDM(gsl_sf_ellint_RJ,"ellint_RJ") D_FDDDM(gsl_sf_ellint_RD,"ellint_RD") D_FDDDM(gsl_sf_ellint_RF,"ellint_RF") D_FDDDM(gsl_sf_ellint_P,"ellint_P") D_FDDDM(gsl_sf_ellint_D,"ellint_D") D_FDDM(gsl_sf_ellint_F,"ellint_F") D_FDDM(gsl_sf_ellint_E,"ellint_E") D_FDDM(gsl_sf_ellint_RC,"ellint_RC") D_FDM(gsl_sf_ellint_Kcomp,"ellint_Kcomp") D_FDM(gsl_sf_airy_Ai_deriv,"airy_Ai_deriv") D_FDM(gsl_sf_airy_Bi_deriv,"airy_Bi_deriv") D_FDM(gsl_sf_airy_Ai_scaled,"airy_Ai_scaled") D_FDM(gsl_sf_ellint_Ecomp,"ellint_Ecomp") D_FDM(gsl_sf_airy_Bi_scaled,"airy_Bi_scaled") D_FDM(gsl_sf_airy_Bi,"airy_Bi") D_FDM(gsl_sf_airy_Ai,"airy_Ai") D_FDM(gsl_sf_airy_Ai_deriv_scaled,"airy_Ai_deriv_scaled") D_FDM(gsl_sf_airy_Bi_deriv_scaled,"airy_Bi_deriv_scaled") D_FIIDD(gsl_sf_hydrogenicR,"hydrogenicR") D_FIID(gsl_sf_hyperg_1F1_int,"hyperg_1F1_int") D_FIID(gsl_sf_legendre_sphPlm,"legendre_sphPlm") D_FIID(gsl_sf_hyperg_U_int,"hyperg_U_int") D_FIID(gsl_sf_legendre_Plm,"legendre_Plm") D_FIDD(gsl_sf_laguerre_n,"laguerre_n") D_FIDD(gsl_sf_gegenpoly_n,"gegenpoly_n") D_FIDD(gsl_sf_legendre_H3d,"legendre_H3d") D_FIDD(gsl_sf_conicalP_cyl_reg,"conicalP_cyl_reg") D_FIDD(gsl_sf_conicalP_sph_reg,"conicalP_sph_reg") D_FID(gsl_sf_taylorcoeff,"taylorcoeff") D_FID(gsl_sf_bessel_il_scaled,"bessel_il_scaled") D_FID(gsl_sf_exprel_n,"exprel_n") D_FID(gsl_sf_bessel_In,"bessel_In") D_FID(gsl_sf_psi_n,"psi_n") D_FID(gsl_sf_bessel_In_scaled,"bessel_In_scaled") D_FID(gsl_sf_bessel_Jn,"bessel_Jn") D_FID(gsl_sf_legendre_Pl,"legendre_Pl") D_FID(gsl_sf_bessel_kl_scaled,"bessel_kl_scaled") D_FID(gsl_sf_bessel_jl,"bessel_jl") D_FID(gsl_sf_bessel_yl,"bessel_yl") D_FID(gsl_sf_bessel_Kn,"bessel_Kn") D_FID(gsl_sf_bessel_Yn,"bessel_Yn") D_FID(gsl_sf_legendre_Ql,"legendre_Ql") D_FID(gsl_sf_bessel_Kn_scaled,"bessel_Kn_scaled") D_FID(gsl_sf_fermi_dirac_int,"fermi_dirac_int") D_FI(gsl_sf_psi_int,"psi_int") D_FI(gsl_sf_psi_1_int,"psi_1_int") D_FI(gsl_sf_zeta_int,"zeta_int") D_FI(gsl_sf_eta_int,"eta_int") 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_FDDDD(gsl_sf_hyperg_2F1,"hyperg_2F1") D_FDDD(gsl_sf_hyperg_U,"hyperg_U") D_FDDD(gsl_sf_hyperg_1F1,"hyperg_1F1") D_FDDD(gsl_sf_beta_inc,"beta_inc") D_FDDD(gsl_sf_hyperg_2F0,"hyperg_2F0") D_FDD(gsl_sf_conicalP_half,"conicalP_half") D_FDD(gsl_sf_gamma_inc,"gamma_inc") D_FDD(gsl_sf_gamma_inc_Q,"gamma_inc_Q") D_FDD(gsl_sf_bessel_Knu,"bessel_Knu") D_FDD(gsl_sf_laguerre_2,"laguerre_2") D_FDD(gsl_sf_conicalP_0,"conicalP_0") D_FDD(gsl_sf_gamma_inc_P,"gamma_inc_P") D_FDD(gsl_sf_hydrogenicR_1,"hydrogenicR_1") D_FDD(gsl_sf_bessel_Jnu,"bessel_Jnu") D_FDD(gsl_sf_bessel_Inu,"bessel_Inu") D_FDD(gsl_sf_gegenpoly_2,"gegenpoly_2") D_FDD(gsl_sf_hzeta,"hzeta") D_FDD(gsl_sf_bessel_Inu_scaled,"bessel_Inu_scaled") D_FDD(gsl_sf_gegenpoly_3,"gegenpoly_3") D_FDD(gsl_sf_legendre_H3d_1,"legendre_H3d_1") D_FDD(gsl_sf_conicalP_mhalf,"conicalP_mhalf") D_FDD(gsl_sf_bessel_lnKnu,"bessel_lnKnu") D_FDD(gsl_sf_legendre_H3d_0,"legendre_H3d_0") D_FDD(gsl_sf_hyperg_0F1,"hyperg_0F1") D_FDD(gsl_sf_bessel_Ynu,"bessel_Ynu") D_FDD(gsl_sf_beta,"beta") D_FDD(gsl_sf_gegenpoly_1,"gegenpoly_1") D_FDD(gsl_sf_lnpoch,"lnpoch") D_FDD(gsl_sf_pochrel,"pochrel") D_FDD(gsl_sf_fermi_dirac_inc_0,"fermi_dirac_inc_0") D_FDD(gsl_sf_lnbeta,"lnbeta") D_FDD(gsl_sf_conicalP_1,"conicalP_1") D_FDD(gsl_sf_exp_mult,"exp_mult") D_FDD(gsl_sf_laguerre_1,"laguerre_1") D_FDD(gsl_sf_laguerre_3,"laguerre_3") D_FDD(gsl_sf_poch,"poch") D_FDD(gsl_sf_bessel_Knu_scaled,"bessel_Knu_scaled") D_FD(gsl_sf_expint_E1,"expint_E1") D_FD(gsl_sf_expint_E1_scaled,"expint_E1_scaled") D_FD(gsl_sf_fermi_dirac_1,"fermi_dirac_1") D_FD(gsl_sf_dilog,"dilog") D_FD(gsl_sf_gamma,"gamma") D_FD(gsl_sf_log_1plusx,"log_1plusx") D_FD(gsl_sf_bessel_i1_scaled,"bessel_i1_scaled") D_FD(gsl_sf_exprel_2,"exprel_2") D_FD(gsl_sf_legendre_Q0,"legendre_Q0") D_FD(gsl_sf_gammainv,"gammainv") D_FD(gsl_sf_psi,"psi") D_FD(gsl_sf_lambert_W0,"lambert_W0") D_FD(gsl_sf_bessel_y2,"bessel_y2") D_FD(gsl_sf_expint_E2,"expint_E2") D_FD(gsl_sf_erf_Q,"erf_Q") D_FD(gsl_sf_expint_E2_scaled,"expint_E2_scaled") D_FD(gsl_sf_bessel_i2_scaled,"bessel_i2_scaled") D_FD(gsl_sf_bessel_K0_scaled,"bessel_K0_scaled") D_FD(gsl_sf_bessel_I0,"bessel_I0") D_FD(gsl_sf_bessel_K1,"bessel_K1") D_FD(gsl_sf_debye_3,"debye_3") D_FD(gsl_sf_expint_Ei,"expint_Ei") D_FD(gsl_sf_bessel_y0,"bessel_y0") D_FD(gsl_sf_exprel,"exprel") D_FD(gsl_sf_Ci,"Ci") D_FD(gsl_sf_atanint,"atanint") D_FD(gsl_sf_synchrotron_2,"synchrotron_2") D_FD(gsl_sf_Si,"Si") D_FD(gsl_sf_transport_3,"transport_3") D_FD(gsl_sf_sinc,"sinc") D_FD(gsl_sf_expint_Ei_scaled,"expint_Ei_scaled") D_FD(gsl_sf_legendre_P3,"legendre_P3") D_FD(gsl_sf_erf,"erf") D_FD(gsl_sf_clausen,"clausen") D_FD(gsl_sf_dawson,"dawson") D_FD(gsl_sf_fermi_dirac_3half,"fermi_dirac_3half") D_FD(gsl_sf_eta,"eta") D_FD(gsl_sf_erfc,"erfc") D_FD(gsl_sf_angle_restrict_symm,"angle_restrict_symm") D_FD(gsl_sf_zeta,"zeta") D_FD(gsl_sf_expm1,"expm1") D_FD(gsl_sf_fermi_dirac_0,"fermi_dirac_0") D_FD(gsl_sf_bessel_k2_scaled,"bessel_k2_scaled") D_FD(gsl_sf_fermi_dirac_2,"fermi_dirac_2") D_FD(gsl_sf_log_erfc,"log_erfc") D_FD(gsl_sf_legendre_Q1,"legendre_Q1") D_FD(gsl_sf_bessel_K1_scaled,"bessel_K1_scaled") D_FD(gsl_sf_angle_restrict_pos,"angle_restrict_pos") D_FD(gsl_sf_erf_Z,"erf_Z") D_FD(gsl_sf_gammastar,"gammastar") D_FD(gsl_sf_fermi_dirac_mhalf,"fermi_dirac_mhalf") D_FD(gsl_sf_legendre_P1,"legendre_P1") D_FD(gsl_sf_bessel_I1,"bessel_I1") D_FD(gsl_sf_transport_5,"transport_5") D_FD(gsl_sf_Shi,"Shi") D_FD(gsl_sf_legendre_P2,"legendre_P2") D_FD(gsl_sf_bessel_j1,"bessel_j1") D_FD(gsl_sf_bessel_K0,"bessel_K0") D_FD(gsl_sf_bessel_Y0,"bessel_Y0") D_FD(gsl_sf_log_1plusx_mx,"log_1plusx_mx") D_FD(gsl_sf_expint_3,"expint_3") D_FD(gsl_sf_lngamma,"lngamma") D_FD(gsl_sf_debye_1,"debye_1") D_FD(gsl_sf_hazard,"hazard") D_FD(gsl_sf_transport_2,"transport_2") D_FD(gsl_sf_bessel_i0_scaled,"bessel_i0_scaled") D_FD(gsl_sf_transport_4,"transport_4") D_FD(gsl_sf_lncosh,"lncosh") D_FD(gsl_sf_debye_4,"debye_4") D_FD(gsl_sf_Chi,"Chi") D_FD(gsl_sf_bessel_I0_scaled,"bessel_I0_scaled") D_FD(gsl_sf_bessel_y1,"bessel_y1") D_FD(gsl_sf_bessel_J0,"bessel_J0") D_FD(gsl_sf_bessel_j2,"bessel_j2") D_FD(gsl_sf_debye_2,"debye_2") D_FD(gsl_sf_bessel_k0_scaled,"bessel_k0_scaled") D_FD(gsl_sf_bessel_J1,"bessel_J1") D_FD(gsl_sf_lnsinh,"lnsinh") D_FD(gsl_sf_fermi_dirac_half,"fermi_dirac_half") D_FD(gsl_sf_lambert_Wm1,"lambert_Wm1") D_FD(gsl_sf_log_abs,"log_abs") D_FD(gsl_sf_bessel_I1_scaled,"bessel_I1_scaled") D_FD(gsl_sf_bessel_k1_scaled,"bessel_k1_scaled") D_FD(gsl_sf_synchrotron_1,"synchrotron_1") D_FD(gsl_sf_psi_1piy,"psi_1piy") D_FD(gsl_sf_bessel_j0,"bessel_j0") D_FD(gsl_sf_bessel_Y1,"bessel_Y1") D_FD(gsl_sf_fermi_dirac_m1,"fermi_dirac_m1") #if SLANG_VERSION < 20000 D_FDD(gsl_sf_hypot,"hypot") #endif /* SLANG_VERSION < 20000 */ #define V SLANG_VOID_TYPE static SLang_Intrin_Fun_Type Module_Intrinsics [] = { MAKE_INTRINSIC_0("ellint_RJ", SLF(gsl_sf_ellint_RJ), 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_P", SLF(gsl_sf_ellint_P), V), MAKE_INTRINSIC_0("ellint_D", SLF(gsl_sf_ellint_D), V), MAKE_INTRINSIC_0("ellint_F", SLF(gsl_sf_ellint_F), V), MAKE_INTRINSIC_0("ellint_E", SLF(gsl_sf_ellint_E), V), MAKE_INTRINSIC_0("ellint_RC", SLF(gsl_sf_ellint_RC), V), MAKE_INTRINSIC_0("ellint_Kcomp", SLF(gsl_sf_ellint_Kcomp), V), MAKE_INTRINSIC_0("airy_Ai_deriv", SLF(gsl_sf_airy_Ai_deriv), V), MAKE_INTRINSIC_0("airy_Bi_deriv", SLF(gsl_sf_airy_Bi_deriv), V), MAKE_INTRINSIC_0("airy_Ai_scaled", SLF(gsl_sf_airy_Ai_scaled), V), MAKE_INTRINSIC_0("ellint_Ecomp", SLF(gsl_sf_ellint_Ecomp), V), MAKE_INTRINSIC_0("airy_Bi_scaled", SLF(gsl_sf_airy_Bi_scaled), V), MAKE_INTRINSIC_0("airy_Bi", SLF(gsl_sf_airy_Bi), V), MAKE_INTRINSIC_0("airy_Ai", SLF(gsl_sf_airy_Ai), V), MAKE_INTRINSIC_0("airy_Ai_deriv_scaled", SLF(gsl_sf_airy_Ai_deriv_scaled), V), MAKE_INTRINSIC_0("airy_Bi_deriv_scaled", SLF(gsl_sf_airy_Bi_deriv_scaled), V), MAKE_INTRINSIC_0("hydrogenicR", SLF(gsl_sf_hydrogenicR), V), MAKE_INTRINSIC_0("hyperg_1F1_int", SLF(gsl_sf_hyperg_1F1_int), V), MAKE_INTRINSIC_0("legendre_sphPlm", SLF(gsl_sf_legendre_sphPlm), 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("laguerre_n", SLF(gsl_sf_laguerre_n), V), MAKE_INTRINSIC_0("gegenpoly_n", SLF(gsl_sf_gegenpoly_n), V), MAKE_INTRINSIC_0("legendre_H3d", SLF(gsl_sf_legendre_H3d), 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("taylorcoeff", SLF(gsl_sf_taylorcoeff), V), MAKE_INTRINSIC_0("bessel_il_scaled", SLF(gsl_sf_bessel_il_scaled), V), MAKE_INTRINSIC_0("exprel_n", SLF(gsl_sf_exprel_n), V), MAKE_INTRINSIC_0("bessel_In", SLF(gsl_sf_bessel_In), V), MAKE_INTRINSIC_0("psi_n", SLF(gsl_sf_psi_n), 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("legendre_Pl", SLF(gsl_sf_legendre_Pl), V), MAKE_INTRINSIC_0("bessel_kl_scaled", SLF(gsl_sf_bessel_kl_scaled), V), MAKE_INTRINSIC_0("bessel_jl", SLF(gsl_sf_bessel_jl), V), MAKE_INTRINSIC_0("bessel_yl", SLF(gsl_sf_bessel_yl), V), MAKE_INTRINSIC_0("bessel_Kn", SLF(gsl_sf_bessel_Kn), V), MAKE_INTRINSIC_0("bessel_Yn", SLF(gsl_sf_bessel_Yn), V), MAKE_INTRINSIC_0("legendre_Ql", SLF(gsl_sf_legendre_Ql), V), MAKE_INTRINSIC_0("bessel_Kn_scaled", SLF(gsl_sf_bessel_Kn_scaled), V), MAKE_INTRINSIC_0("fermi_dirac_int", SLF(gsl_sf_fermi_dirac_int), V), MAKE_INTRINSIC_0("psi_int", SLF(gsl_sf_psi_int), V), MAKE_INTRINSIC_0("psi_1_int", SLF(gsl_sf_psi_1_int), V), MAKE_INTRINSIC_0("zeta_int", SLF(gsl_sf_zeta_int), V), MAKE_INTRINSIC_0("eta_int", SLF(gsl_sf_eta_int), 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("hyperg_2F1", SLF(gsl_sf_hyperg_2F1), V), MAKE_INTRINSIC_0("hyperg_U", SLF(gsl_sf_hyperg_U), V), MAKE_INTRINSIC_0("hyperg_1F1", SLF(gsl_sf_hyperg_1F1), V), MAKE_INTRINSIC_0("beta_inc", SLF(gsl_sf_beta_inc), V), MAKE_INTRINSIC_0("hyperg_2F0", SLF(gsl_sf_hyperg_2F0), V), MAKE_INTRINSIC_0("conicalP_half", SLF(gsl_sf_conicalP_half), V), MAKE_INTRINSIC_0("gamma_inc", SLF(gsl_sf_gamma_inc), V), MAKE_INTRINSIC_0("gamma_inc_Q", SLF(gsl_sf_gamma_inc_Q), V), MAKE_INTRINSIC_0("bessel_Knu", SLF(gsl_sf_bessel_Knu), V), MAKE_INTRINSIC_0("laguerre_2", SLF(gsl_sf_laguerre_2), V), MAKE_INTRINSIC_0("conicalP_0", SLF(gsl_sf_conicalP_0), V), MAKE_INTRINSIC_0("gamma_inc_P", SLF(gsl_sf_gamma_inc_P), V), MAKE_INTRINSIC_0("hydrogenicR_1", SLF(gsl_sf_hydrogenicR_1), V), MAKE_INTRINSIC_0("bessel_Jnu", SLF(gsl_sf_bessel_Jnu), V), MAKE_INTRINSIC_0("bessel_Inu", SLF(gsl_sf_bessel_Inu), V), MAKE_INTRINSIC_0("gegenpoly_2", SLF(gsl_sf_gegenpoly_2), V), MAKE_INTRINSIC_0("hzeta", SLF(gsl_sf_hzeta), V), MAKE_INTRINSIC_0("bessel_Inu_scaled", SLF(gsl_sf_bessel_Inu_scaled), V), MAKE_INTRINSIC_0("gegenpoly_3", SLF(gsl_sf_gegenpoly_3), V), MAKE_INTRINSIC_0("legendre_H3d_1", SLF(gsl_sf_legendre_H3d_1), V), MAKE_INTRINSIC_0("conicalP_mhalf", SLF(gsl_sf_conicalP_mhalf), V), MAKE_INTRINSIC_0("bessel_lnKnu", SLF(gsl_sf_bessel_lnKnu), V), MAKE_INTRINSIC_0("legendre_H3d_0", SLF(gsl_sf_legendre_H3d_0), V), MAKE_INTRINSIC_0("hyperg_0F1", SLF(gsl_sf_hyperg_0F1), V), MAKE_INTRINSIC_0("bessel_Ynu", SLF(gsl_sf_bessel_Ynu), V), MAKE_INTRINSIC_0("beta", SLF(gsl_sf_beta), V), MAKE_INTRINSIC_0("gegenpoly_1", SLF(gsl_sf_gegenpoly_1), V), MAKE_INTRINSIC_0("lnpoch", SLF(gsl_sf_lnpoch), V), MAKE_INTRINSIC_0("pochrel", SLF(gsl_sf_pochrel), V), MAKE_INTRINSIC_0("fermi_dirac_inc_0", SLF(gsl_sf_fermi_dirac_inc_0), V), MAKE_INTRINSIC_0("lnbeta", SLF(gsl_sf_lnbeta), V), MAKE_INTRINSIC_0("conicalP_1", SLF(gsl_sf_conicalP_1), V), MAKE_INTRINSIC_0("exp_mult", SLF(gsl_sf_exp_mult), V), MAKE_INTRINSIC_0("laguerre_1", SLF(gsl_sf_laguerre_1), V), MAKE_INTRINSIC_0("laguerre_3", SLF(gsl_sf_laguerre_3), V), MAKE_INTRINSIC_0("poch", SLF(gsl_sf_poch), V), MAKE_INTRINSIC_0("bessel_Knu_scaled", SLF(gsl_sf_bessel_Knu_scaled), 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("fermi_dirac_1", SLF(gsl_sf_fermi_dirac_1), V), MAKE_INTRINSIC_0("dilog", SLF(gsl_sf_dilog), V), MAKE_INTRINSIC_0("gamma", SLF(gsl_sf_gamma), V), MAKE_INTRINSIC_0("log_1plusx", SLF(gsl_sf_log_1plusx), V), MAKE_INTRINSIC_0("bessel_i1_scaled", SLF(gsl_sf_bessel_i1_scaled), V), MAKE_INTRINSIC_0("exprel_2", SLF(gsl_sf_exprel_2), V), MAKE_INTRINSIC_0("legendre_Q0", SLF(gsl_sf_legendre_Q0), V), MAKE_INTRINSIC_0("gammainv", SLF(gsl_sf_gammainv), V), MAKE_INTRINSIC_0("psi", SLF(gsl_sf_psi), V), MAKE_INTRINSIC_0("lambert_W0", SLF(gsl_sf_lambert_W0), V), MAKE_INTRINSIC_0("bessel_y2", SLF(gsl_sf_bessel_y2), V), MAKE_INTRINSIC_0("expint_E2", SLF(gsl_sf_expint_E2), V), MAKE_INTRINSIC_0("erf_Q", SLF(gsl_sf_erf_Q), V), MAKE_INTRINSIC_0("expint_E2_scaled", SLF(gsl_sf_expint_E2_scaled), V), MAKE_INTRINSIC_0("bessel_i2_scaled", SLF(gsl_sf_bessel_i2_scaled), V), MAKE_INTRINSIC_0("bessel_K0_scaled", SLF(gsl_sf_bessel_K0_scaled), V), MAKE_INTRINSIC_0("bessel_I0", SLF(gsl_sf_bessel_I0), V), MAKE_INTRINSIC_0("bessel_K1", SLF(gsl_sf_bessel_K1), V), MAKE_INTRINSIC_0("debye_3", SLF(gsl_sf_debye_3), V), MAKE_INTRINSIC_0("expint_Ei", SLF(gsl_sf_expint_Ei), V), MAKE_INTRINSIC_0("bessel_y0", SLF(gsl_sf_bessel_y0), V), MAKE_INTRINSIC_0("exprel", SLF(gsl_sf_exprel), V), MAKE_INTRINSIC_0("Ci", SLF(gsl_sf_Ci), V), MAKE_INTRINSIC_0("atanint", SLF(gsl_sf_atanint), V), MAKE_INTRINSIC_0("synchrotron_2", SLF(gsl_sf_synchrotron_2), V), MAKE_INTRINSIC_0("Si", SLF(gsl_sf_Si), V), MAKE_INTRINSIC_0("transport_3", SLF(gsl_sf_transport_3), V), MAKE_INTRINSIC_0("sinc", SLF(gsl_sf_sinc), V), MAKE_INTRINSIC_0("expint_Ei_scaled", SLF(gsl_sf_expint_Ei_scaled), V), MAKE_INTRINSIC_0("legendre_P3", SLF(gsl_sf_legendre_P3), V), MAKE_INTRINSIC_0("erf", SLF(gsl_sf_erf), V), MAKE_INTRINSIC_0("clausen", SLF(gsl_sf_clausen), V), MAKE_INTRINSIC_0("dawson", SLF(gsl_sf_dawson), V), MAKE_INTRINSIC_0("fermi_dirac_3half", SLF(gsl_sf_fermi_dirac_3half), V), MAKE_INTRINSIC_0("eta", SLF(gsl_sf_eta), V), MAKE_INTRINSIC_0("erfc", SLF(gsl_sf_erfc), V), MAKE_INTRINSIC_0("angle_restrict_symm", SLF(gsl_sf_angle_restrict_symm), V), MAKE_INTRINSIC_0("zeta", SLF(gsl_sf_zeta), V), MAKE_INTRINSIC_0("expm1", SLF(gsl_sf_expm1), V), MAKE_INTRINSIC_0("fermi_dirac_0", SLF(gsl_sf_fermi_dirac_0), V), MAKE_INTRINSIC_0("bessel_k2_scaled", SLF(gsl_sf_bessel_k2_scaled), V), MAKE_INTRINSIC_0("fermi_dirac_2", SLF(gsl_sf_fermi_dirac_2), V), MAKE_INTRINSIC_0("log_erfc", SLF(gsl_sf_log_erfc), V), MAKE_INTRINSIC_0("legendre_Q1", SLF(gsl_sf_legendre_Q1), V), MAKE_INTRINSIC_0("bessel_K1_scaled", SLF(gsl_sf_bessel_K1_scaled), V), MAKE_INTRINSIC_0("angle_restrict_pos", SLF(gsl_sf_angle_restrict_pos), V), MAKE_INTRINSIC_0("erf_Z", SLF(gsl_sf_erf_Z), V), MAKE_INTRINSIC_0("gammastar", SLF(gsl_sf_gammastar), V), MAKE_INTRINSIC_0("fermi_dirac_mhalf", SLF(gsl_sf_fermi_dirac_mhalf), V), MAKE_INTRINSIC_0("legendre_P1", SLF(gsl_sf_legendre_P1), V), MAKE_INTRINSIC_0("bessel_I1", SLF(gsl_sf_bessel_I1), V), MAKE_INTRINSIC_0("transport_5", SLF(gsl_sf_transport_5), V), MAKE_INTRINSIC_0("Shi", SLF(gsl_sf_Shi), V), MAKE_INTRINSIC_0("legendre_P2", SLF(gsl_sf_legendre_P2), 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_Y0", SLF(gsl_sf_bessel_Y0), V), MAKE_INTRINSIC_0("log_1plusx_mx", SLF(gsl_sf_log_1plusx_mx), V), MAKE_INTRINSIC_0("expint_3", SLF(gsl_sf_expint_3), V), MAKE_INTRINSIC_0("lngamma", SLF(gsl_sf_lngamma), V), MAKE_INTRINSIC_0("debye_1", SLF(gsl_sf_debye_1), V), MAKE_INTRINSIC_0("hazard", SLF(gsl_sf_hazard), V), MAKE_INTRINSIC_0("transport_2", SLF(gsl_sf_transport_2), V), MAKE_INTRINSIC_0("bessel_i0_scaled", SLF(gsl_sf_bessel_i0_scaled), V), MAKE_INTRINSIC_0("transport_4", SLF(gsl_sf_transport_4), V), MAKE_INTRINSIC_0("lncosh", SLF(gsl_sf_lncosh), V), MAKE_INTRINSIC_0("debye_4", SLF(gsl_sf_debye_4), V), MAKE_INTRINSIC_0("Chi", SLF(gsl_sf_Chi), V), MAKE_INTRINSIC_0("bessel_I0_scaled", SLF(gsl_sf_bessel_I0_scaled), V), MAKE_INTRINSIC_0("bessel_y1", SLF(gsl_sf_bessel_y1), V), MAKE_INTRINSIC_0("bessel_J0", SLF(gsl_sf_bessel_J0), V), MAKE_INTRINSIC_0("bessel_j2", SLF(gsl_sf_bessel_j2), V), MAKE_INTRINSIC_0("debye_2", SLF(gsl_sf_debye_2), V), MAKE_INTRINSIC_0("bessel_k0_scaled", SLF(gsl_sf_bessel_k0_scaled), V), MAKE_INTRINSIC_0("bessel_J1", SLF(gsl_sf_bessel_J1), V), MAKE_INTRINSIC_0("lnsinh", SLF(gsl_sf_lnsinh), V), MAKE_INTRINSIC_0("fermi_dirac_half", SLF(gsl_sf_fermi_dirac_half), V), MAKE_INTRINSIC_0("lambert_Wm1", SLF(gsl_sf_lambert_Wm1), V), MAKE_INTRINSIC_0("log_abs", SLF(gsl_sf_log_abs), V), MAKE_INTRINSIC_0("bessel_I1_scaled", SLF(gsl_sf_bessel_I1_scaled), V), MAKE_INTRINSIC_0("bessel_k1_scaled", SLF(gsl_sf_bessel_k1_scaled), V), MAKE_INTRINSIC_0("synchrotron_1", SLF(gsl_sf_synchrotron_1), V), MAKE_INTRINSIC_0("psi_1piy", SLF(gsl_sf_psi_1piy), V), MAKE_INTRINSIC_0("bessel_j0", SLF(gsl_sf_bessel_j0), V), MAKE_INTRINSIC_0("bessel_Y1", SLF(gsl_sf_bessel_Y1), V), MAKE_INTRINSIC_0("fermi_dirac_m1", SLF(gsl_sf_fermi_dirac_m1), V), #if SLANG_VERSION < 20000 MAKE_INTRINSIC_0("hypot", SLF(gsl_sf_hypot), V), #endif /* SLANG_VERSION < 20000 */ #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-0.7.0/src/gslcdf.sl0000644002657400265740000000014110665603423014260 0ustar davisdavisrequire ("gslcore"); _gslcore_import_module ("gslcdf", current_namespace()); provide ("gslcdf"); slgsl-0.7.0/src/Makefile.in0000644002657400265740000001337510674311065014536 0ustar davisdavis# -*- 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 # SL_FILES = gsl.sl gslcore.sl gslsf.sl gslconst.sl gslinterp.sl gslrand.sl \ gslcdf.sl gslfft.sl gslmatrix.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@ # COMPILE = $(CC) -c $(CFLAGS) $(INCS) #--------------------------------------------------------------------------- # 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) #--------------------------------------------------------------------------- LIBS = $(SLANG_LIB) $(MODULE_LIBS) $(RPATH) $(DL_LIB) -lm INCS = $(SLANG_INC) $(GSL_INC) DEPS = config.h 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) $(INCS) gslvers.c -o gslvers $(LIBS) #--------------------------------------------------------------------------- # Put Rules to create the modules here #--------------------------------------------------------------------------- gsl-module.so: $(OFILES) $(CC_SHARED) $(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 #--------------------------------------------------------------------------- # Regression tests #--------------------------------------------------------------------------- test: @for X in tests/test_*.sl; \ do \ slsh $$X; \ done #--------------------------------------------------------------------------- # Installation Rules #--------------------------------------------------------------------------- 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: @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: @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: @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: @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_directories install_modules install_slfiles \ install_hlpfiles install_docfiles clean: -/bin/rm -f $(MODULES) $(OFILES) *~ \#* gslvers gslvers.out config.h distclean: clean -/bin/rm -f sysconf.h Makefile config.h slgsl-0.7.0/src/gslfft-module.c0000644002657400265740000001443510665603423015405 0ustar davisdavis/* -*- 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 (davis@space.mit.edu) */ #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; 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; } if (dir < 0) dir = -1; else dir = 1; 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)) || (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-0.7.0/src/config.hin0000644002657400265740000000042410062071264014420 0ustar davisdavis/* -*- 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-0.7.0/src/gslinterp.sl0000644002657400265740000000014710665603423015033 0ustar davisdavisrequire ("gslcore"); _gslcore_import_module ("gslinterp", current_namespace()); provide ("gslinterp"); slgsl-0.7.0/src/mkversion.sh0000755002657400265740000000034410244673067015043 0ustar davisdavis#version 1.0 # The initial echo is necessary because the solaris version of sed cannot # grok input without a trailing newline. echo `grep "^#define MODULE_[MP]" version.h | sed -e 's/[^0-9]*//' | tr '\012' .` | sed -e 's/.$//' slgsl-0.7.0/src/gslmatrix.sl0000644002657400265740000000014710665603423015036 0ustar davisdavisrequire ("gslcore"); _gslcore_import_module ("gslmatrix", current_namespace()); provide ("gslmatrix"); slgsl-0.7.0/src/gslrand-module.c0000644002657400265740000006720510665603423015555 0ustar davisdavis/* -*- 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 (davis@space.mit.edu) */ #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++) { 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 (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 (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 (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 (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 (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 (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 (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 (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 [,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); } #if 0 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); } 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") /* U_FDD(u_dd_gsl_ran_binomial,"ran_binomial") */ #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") /* PDF_D_FUDU(gsl_ran_binomial_pdf, "binomial_pdf") */ 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; 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), /* MAKE_INTRINSIC_0("ran_binomial", SLF(u_dd_gsl_ran_binomial), V), */ 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), /* MAKE_INTRINSIC_0("binomial_pdf", SLF(gsl_ran_binomial_pdf), V), */ 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-0.7.0/src/gsl-module.c0000644002657400265740000007013210665603423014701 0ustar davisdavis/* -*- 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 (davis@space.mit.edu) */ #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 (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 (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 */ 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 } 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; } /*}}}*/ /*{{{ 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); } /*}}}*/ typedef struct { 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_gslcdf_module, 0}, {"gslfft", init_gslfft_module_ns, deinit_gslcdf_module, 0}, {"gslinterp", init_gslinterp_module_ns, deinit_gslcdf_module, 0}, {"gslmatrix", init_gslmatrix_module_ns, deinit_gslcdf_module, 0}, {"gslrand", init_gslrand_module_ns, deinit_gslcdf_module, 0}, {"gslsf", init_gslsf_module_ns, deinit_gslcdf_module, 0}, {NULL, NULL, NULL, 0} }; static void import_module (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-0.7.0/src/gslsf.sl0000644002657400265740000000013710665603423014141 0ustar davisdavisrequire ("gslcore"); _gslcore_import_module ("gslsf", current_namespace()); provide ("gslsf"); slgsl-0.7.0/src/tests/0000755002657400265740000000000010674311422013617 5ustar davisdavisslgsl-0.7.0/src/tests/test_import.sl0000644002657400265740000000117010665603423016534 0ustar davisdavisprepend_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-0.7.0/src/tests/test_rand.sl0000644002657400265740000000257710244673067016166 0ustar davisdavisprepend_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-0.7.0/src/tests/test_err.sl0000644002657400265740000000100710062071264016002 0ustar davisdavisprepend_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-0.7.0/src/tests/test_interp.sl0000644002657400265740000000673010062071264016523 0ustar davisdavisprepend_to_slang_load_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-0.7.0/src/tests/test_fft.sl0000644002657400265740000000030710244673067016006 0ustar davisdavisprepend_to_slang_load_path ("."); set_import_module_path (".:" + get_import_module_path ()); require ("gslfft"); () = fprintf (stderr, "*** tests for fft not yet ready\n"); exit (0); slgsl-0.7.0/src/gsl.sl0000644002657400265740000000024510665603423013610 0ustar davisdavisrequire ("gslsf"); require ("gslconst"); require ("gslinterp"); require ("gslrand"); require ("gslcdf"); require ("gslfft"); require ("gslmatrix"); provide ("gsl"); slgsl-0.7.0/src/gslconst-module.c0000644002657400265740000010167310665603423015755 0ustar davisdavis/* -*- mode: C; mode: fold; -*- */ /* This file was automatically generated. */ /* 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 (davis@space.mit.edu) */ #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 (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 (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 (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 (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); } #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); } /*}}}*/ #if SLANG_VERSION < 20000 #endif /* SLANG_VERSION < 20000 */ #define V SLANG_VOID_TYPE static SLang_Intrin_Fun_Type Module_Intrinsics [] = { #if SLANG_VERSION < 20000 #endif /* SLANG_VERSION < 20000 */ #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_MKSA_CURIE MAKE_DCONSTANT("CONST_MKSA_CURIE", GSL_CONST_MKSA_CURIE), #endif #ifdef GSL_CONST_CGSM_MIL MAKE_DCONSTANT("CONST_CGSM_MIL", GSL_CONST_CGSM_MIL), #endif #ifdef GSL_CONST_CGSM_LUMEN MAKE_DCONSTANT("CONST_CGSM_LUMEN", GSL_CONST_CGSM_LUMEN), #endif #ifdef GSL_CONST_MKSA_ERG MAKE_DCONSTANT("CONST_MKSA_ERG", GSL_CONST_MKSA_ERG), #endif #ifdef GSL_CONST_MKSA_ASTRONOMICAL_UNIT MAKE_DCONSTANT("CONST_MKSA_ASTRONOMICAL_UNIT", GSL_CONST_MKSA_ASTRONOMICAL_UNIT), #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_MKSA_QUART MAKE_DCONSTANT("CONST_MKSA_QUART", GSL_CONST_MKSA_QUART), #endif #ifdef GSL_CONST_CGSM_POINT MAKE_DCONSTANT("CONST_CGSM_POINT", GSL_CONST_CGSM_POINT), #endif #ifdef GSL_CONST_MKSA_RAD MAKE_DCONSTANT("CONST_MKSA_RAD", GSL_CONST_MKSA_RAD), #endif #ifdef GSL_CONST_CGSM_HORSEPOWER MAKE_DCONSTANT("CONST_CGSM_HORSEPOWER", GSL_CONST_CGSM_HORSEPOWER), #endif #ifdef GSL_CONST_CGSM_STD_ATMOSPHERE MAKE_DCONSTANT("CONST_CGSM_STD_ATMOSPHERE", GSL_CONST_CGSM_STD_ATMOSPHERE), #endif #ifdef GSL_CONST_MKSA_VACUUM_PERMITTIVITY MAKE_DCONSTANT("CONST_MKSA_VACUUM_PERMITTIVITY", GSL_CONST_MKSA_VACUUM_PERMITTIVITY), #endif #ifdef GSL_CONST_MKSA_POUND_FORCE MAKE_DCONSTANT("CONST_MKSA_POUND_FORCE", GSL_CONST_MKSA_POUND_FORCE), #endif #ifdef GSL_CONST_MKSA_LIGHT_YEAR MAKE_DCONSTANT("CONST_MKSA_LIGHT_YEAR", GSL_CONST_MKSA_LIGHT_YEAR), #endif #ifdef GSL_CONST_MKSA_RYDBERG MAKE_DCONSTANT("CONST_MKSA_RYDBERG", GSL_CONST_MKSA_RYDBERG), #endif #ifdef GSL_CONST_CGSM_CURIE MAKE_DCONSTANT("CONST_CGSM_CURIE", GSL_CONST_CGSM_CURIE), #endif #ifdef GSL_CONST_CGSM_KILOPOUND_FORCE MAKE_DCONSTANT("CONST_CGSM_KILOPOUND_FORCE", GSL_CONST_CGSM_KILOPOUND_FORCE), #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_POINT MAKE_DCONSTANT("CONST_MKSA_POINT", GSL_CONST_MKSA_POINT), #endif #ifdef GSL_CONST_CGSM_SOLAR_MASS MAKE_DCONSTANT("CONST_CGSM_SOLAR_MASS", GSL_CONST_CGSM_SOLAR_MASS), #endif #ifdef GSL_CONST_CGSM_POUND_MASS MAKE_DCONSTANT("CONST_CGSM_POUND_MASS", GSL_CONST_CGSM_POUND_MASS), #endif #ifdef GSL_CONST_MKSA_LUX MAKE_DCONSTANT("CONST_MKSA_LUX", GSL_CONST_MKSA_LUX), #endif #ifdef GSL_CONST_MKSA_BAR MAKE_DCONSTANT("CONST_MKSA_BAR", GSL_CONST_MKSA_BAR), #endif #ifdef GSL_CONST_MKSA_LITER MAKE_DCONSTANT("CONST_MKSA_LITER", GSL_CONST_MKSA_LITER), #endif #ifdef GSL_CONST_CGSM_POUNDAL MAKE_DCONSTANT("CONST_CGSM_POUNDAL", GSL_CONST_CGSM_POUNDAL), #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_MKSA_NEWTON MAKE_DCONSTANT("CONST_MKSA_NEWTON", GSL_CONST_MKSA_NEWTON), #endif #ifdef GSL_CONST_MKSA_BOLTZMANN MAKE_DCONSTANT("CONST_MKSA_BOLTZMANN", GSL_CONST_MKSA_BOLTZMANN), #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_CGSM_BOHR_MAGNETON MAKE_DCONSTANT("CONST_CGSM_BOHR_MAGNETON", GSL_CONST_CGSM_BOHR_MAGNETON), #endif #ifdef GSL_CONST_NUM_ATTO MAKE_DCONSTANT("CONST_NUM_ATTO", GSL_CONST_NUM_ATTO), #endif #ifdef GSL_CONST_MKSA_MASS_NEUTRON MAKE_DCONSTANT("CONST_MKSA_MASS_NEUTRON", GSL_CONST_MKSA_MASS_NEUTRON), #endif #ifdef GSL_CONST_MKSA_WEEK MAKE_DCONSTANT("CONST_MKSA_WEEK", GSL_CONST_MKSA_WEEK), #endif #ifdef GSL_CONST_CGSM_NEWTON MAKE_DCONSTANT("CONST_CGSM_NEWTON", GSL_CONST_CGSM_NEWTON), #endif #ifdef GSL_CONST_NUM_PETA MAKE_DCONSTANT("CONST_NUM_PETA", GSL_CONST_NUM_PETA), #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_MKSA_CANADIAN_GALLON MAKE_DCONSTANT("CONST_MKSA_CANADIAN_GALLON", GSL_CONST_MKSA_CANADIAN_GALLON), #endif #ifdef GSL_CONST_MKSA_TEASPOON MAKE_DCONSTANT("CONST_MKSA_TEASPOON", GSL_CONST_MKSA_TEASPOON), #endif #ifdef GSL_CONST_MKSA_TORR MAKE_DCONSTANT("CONST_MKSA_TORR", GSL_CONST_MKSA_TORR), #endif #ifdef GSL_CONST_MKSA_MICRON MAKE_DCONSTANT("CONST_MKSA_MICRON", GSL_CONST_MKSA_MICRON), #endif #ifdef GSL_CONST_CGSM_NAUTICAL_MILE MAKE_DCONSTANT("CONST_CGSM_NAUTICAL_MILE", GSL_CONST_CGSM_NAUTICAL_MILE), #endif #ifdef GSL_CONST_MKSA_FATHOM MAKE_DCONSTANT("CONST_MKSA_FATHOM", GSL_CONST_MKSA_FATHOM), #endif #ifdef GSL_CONST_CGSM_ACRE MAKE_DCONSTANT("CONST_CGSM_ACRE", GSL_CONST_CGSM_ACRE), #endif #ifdef GSL_CONST_MKSA_TABLESPOON MAKE_DCONSTANT("CONST_MKSA_TABLESPOON", GSL_CONST_MKSA_TABLESPOON), #endif #ifdef GSL_CONST_MKSA_HORSEPOWER MAKE_DCONSTANT("CONST_MKSA_HORSEPOWER", GSL_CONST_MKSA_HORSEPOWER), #endif #ifdef GSL_CONST_MKSA_CARAT MAKE_DCONSTANT("CONST_MKSA_CARAT", GSL_CONST_MKSA_CARAT), #endif #ifdef GSL_CONST_CGSM_FOOTCANDLE MAKE_DCONSTANT("CONST_CGSM_FOOTCANDLE", GSL_CONST_CGSM_FOOTCANDLE), #endif #ifdef GSL_CONST_CGSM_ROENTGEN MAKE_DCONSTANT("CONST_CGSM_ROENTGEN", GSL_CONST_CGSM_ROENTGEN), #endif #ifdef GSL_CONST_MKSA_STOKES MAKE_DCONSTANT("CONST_MKSA_STOKES", GSL_CONST_MKSA_STOKES), #endif #ifdef GSL_CONST_CGSM_BARN MAKE_DCONSTANT("CONST_CGSM_BARN", GSL_CONST_CGSM_BARN), #endif #ifdef GSL_CONST_CGSM_TORR MAKE_DCONSTANT("CONST_CGSM_TORR", GSL_CONST_CGSM_TORR), #endif #ifdef GSL_CONST_MKSA_HOUR MAKE_DCONSTANT("CONST_MKSA_HOUR", GSL_CONST_MKSA_HOUR), #endif #ifdef GSL_CONST_MKSA_POUNDAL MAKE_DCONSTANT("CONST_MKSA_POUNDAL", GSL_CONST_MKSA_POUNDAL), #endif #ifdef GSL_CONST_MKSA_FOOTLAMBERT MAKE_DCONSTANT("CONST_MKSA_FOOTLAMBERT", GSL_CONST_MKSA_FOOTLAMBERT), #endif #ifdef GSL_CONST_NUM_KILO MAKE_DCONSTANT("CONST_NUM_KILO", GSL_CONST_NUM_KILO), #endif #ifdef GSL_CONST_MKSA_OUNCE_MASS MAKE_DCONSTANT("CONST_MKSA_OUNCE_MASS", GSL_CONST_MKSA_OUNCE_MASS), #endif #ifdef GSL_CONST_MKSA_MOLAR_GAS MAKE_DCONSTANT("CONST_MKSA_MOLAR_GAS", GSL_CONST_MKSA_MOLAR_GAS), #endif #ifdef GSL_CONST_CGSM_QUART MAKE_DCONSTANT("CONST_CGSM_QUART", GSL_CONST_CGSM_QUART), #endif #ifdef GSL_CONST_CGSM_FOOTLAMBERT MAKE_DCONSTANT("CONST_CGSM_FOOTLAMBERT", GSL_CONST_CGSM_FOOTLAMBERT), #endif #ifdef GSL_CONST_CGSM_NUCLEAR_MAGNETON MAKE_DCONSTANT("CONST_CGSM_NUCLEAR_MAGNETON", GSL_CONST_CGSM_NUCLEAR_MAGNETON), #endif #ifdef GSL_CONST_MKSA_TROY_OUNCE MAKE_DCONSTANT("CONST_MKSA_TROY_OUNCE", GSL_CONST_MKSA_TROY_OUNCE), #endif #ifdef GSL_CONST_CGSM_GAUSS MAKE_DCONSTANT("CONST_CGSM_GAUSS", GSL_CONST_CGSM_GAUSS), #endif #ifdef GSL_CONST_MKSA_MASS_PROTON MAKE_DCONSTANT("CONST_MKSA_MASS_PROTON", GSL_CONST_MKSA_MASS_PROTON), #endif #ifdef GSL_CONST_MKSA_METRIC_TON MAKE_DCONSTANT("CONST_MKSA_METRIC_TON", GSL_CONST_MKSA_METRIC_TON), #endif #ifdef GSL_CONST_MKSA_FLUID_OUNCE MAKE_DCONSTANT("CONST_MKSA_FLUID_OUNCE", GSL_CONST_MKSA_FLUID_OUNCE), #endif #ifdef GSL_CONST_MKSA_PSI MAKE_DCONSTANT("CONST_MKSA_PSI", GSL_CONST_MKSA_PSI), #endif #ifdef GSL_CONST_NUM_FINE_STRUCTURE MAKE_DCONSTANT("CONST_NUM_FINE_STRUCTURE", GSL_CONST_NUM_FINE_STRUCTURE), #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_HECTARE MAKE_DCONSTANT("CONST_CGSM_HECTARE", GSL_CONST_CGSM_HECTARE), #endif #ifdef GSL_CONST_CGSM_MASS_MUON MAKE_DCONSTANT("CONST_CGSM_MASS_MUON", GSL_CONST_CGSM_MASS_MUON), #endif #ifdef GSL_CONST_CGSM_LAMBERT MAKE_DCONSTANT("CONST_CGSM_LAMBERT", GSL_CONST_CGSM_LAMBERT), #endif #ifdef GSL_CONST_MKSA_BOHR_MAGNETON MAKE_DCONSTANT("CONST_MKSA_BOHR_MAGNETON", GSL_CONST_MKSA_BOHR_MAGNETON), #endif #ifdef GSL_CONST_CGSM_US_GALLON MAKE_DCONSTANT("CONST_CGSM_US_GALLON", GSL_CONST_CGSM_US_GALLON), #endif #ifdef GSL_CONST_CGSM_POUND_FORCE MAKE_DCONSTANT("CONST_CGSM_POUND_FORCE", GSL_CONST_CGSM_POUND_FORCE), #endif #ifdef GSL_CONST_NUM_MILLI MAKE_DCONSTANT("CONST_NUM_MILLI", GSL_CONST_NUM_MILLI), #endif #ifdef GSL_CONST_MKSA_DAY MAKE_DCONSTANT("CONST_MKSA_DAY", GSL_CONST_MKSA_DAY), #endif #ifdef GSL_CONST_CGSM_FLUID_OUNCE MAKE_DCONSTANT("CONST_CGSM_FLUID_OUNCE", GSL_CONST_CGSM_FLUID_OUNCE), #endif #ifdef GSL_CONST_CGSM_MASS_ELECTRON MAKE_DCONSTANT("CONST_CGSM_MASS_ELECTRON", GSL_CONST_CGSM_MASS_ELECTRON), #endif #ifdef GSL_CONST_NUM_YOTTA MAKE_DCONSTANT("CONST_NUM_YOTTA", GSL_CONST_NUM_YOTTA), #endif #ifdef GSL_CONST_CGSM_INCH MAKE_DCONSTANT("CONST_CGSM_INCH", GSL_CONST_CGSM_INCH), #endif #ifdef GSL_CONST_MKSA_CALORIE MAKE_DCONSTANT("CONST_MKSA_CALORIE", GSL_CONST_MKSA_CALORIE), #endif #ifdef GSL_CONST_CGSM_TEXPOINT MAKE_DCONSTANT("CONST_CGSM_TEXPOINT", GSL_CONST_CGSM_TEXPOINT), #endif #ifdef GSL_CONST_CGSM_METRIC_TON MAKE_DCONSTANT("CONST_CGSM_METRIC_TON", GSL_CONST_CGSM_METRIC_TON), #endif #ifdef GSL_CONST_CGSM_BOLTZMANN MAKE_DCONSTANT("CONST_CGSM_BOLTZMANN", GSL_CONST_CGSM_BOLTZMANN), #endif #ifdef GSL_CONST_MKSA_SOLAR_MASS MAKE_DCONSTANT("CONST_MKSA_SOLAR_MASS", GSL_CONST_MKSA_SOLAR_MASS), #endif #ifdef GSL_CONST_MKSA_BTU MAKE_DCONSTANT("CONST_MKSA_BTU", GSL_CONST_MKSA_BTU), #endif #ifdef GSL_CONST_CGSM_TEASPOON MAKE_DCONSTANT("CONST_CGSM_TEASPOON", GSL_CONST_CGSM_TEASPOON), #endif #ifdef GSL_CONST_MKSA_CUP MAKE_DCONSTANT("CONST_MKSA_CUP", GSL_CONST_MKSA_CUP), #endif #ifdef GSL_CONST_CGSM_STILB MAKE_DCONSTANT("CONST_CGSM_STILB", GSL_CONST_CGSM_STILB), #endif #ifdef GSL_CONST_MKSA_MILE MAKE_DCONSTANT("CONST_MKSA_MILE", GSL_CONST_MKSA_MILE), #endif #ifdef GSL_CONST_MKSA_GRAM_FORCE MAKE_DCONSTANT("CONST_MKSA_GRAM_FORCE", GSL_CONST_MKSA_GRAM_FORCE), #endif #ifdef GSL_CONST_MKSA_ANGSTROM MAKE_DCONSTANT("CONST_MKSA_ANGSTROM", GSL_CONST_MKSA_ANGSTROM), #endif #ifdef GSL_CONST_MKSA_US_GALLON MAKE_DCONSTANT("CONST_MKSA_US_GALLON", GSL_CONST_MKSA_US_GALLON), #endif #ifdef GSL_CONST_CGSM_BTU MAKE_DCONSTANT("CONST_CGSM_BTU", GSL_CONST_CGSM_BTU), #endif #ifdef GSL_CONST_CGSM_TABLESPOON MAKE_DCONSTANT("CONST_CGSM_TABLESPOON", GSL_CONST_CGSM_TABLESPOON), #endif #ifdef GSL_CONST_MKSA_JOULE MAKE_DCONSTANT("CONST_MKSA_JOULE", GSL_CONST_MKSA_JOULE), #endif #ifdef GSL_CONST_NUM_GIGA MAKE_DCONSTANT("CONST_NUM_GIGA", GSL_CONST_NUM_GIGA), #endif #ifdef GSL_CONST_CGSM_PARSEC MAKE_DCONSTANT("CONST_CGSM_PARSEC", GSL_CONST_CGSM_PARSEC), #endif #ifdef GSL_CONST_MKSA_PARSEC MAKE_DCONSTANT("CONST_MKSA_PARSEC", GSL_CONST_MKSA_PARSEC), #endif #ifdef GSL_CONST_MKSA_FOOTCANDLE MAKE_DCONSTANT("CONST_MKSA_FOOTCANDLE", GSL_CONST_MKSA_FOOTCANDLE), #endif #ifdef GSL_CONST_NUM_FEMTO MAKE_DCONSTANT("CONST_NUM_FEMTO", GSL_CONST_NUM_FEMTO), #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_MKSA_LUMEN MAKE_DCONSTANT("CONST_MKSA_LUMEN", GSL_CONST_MKSA_LUMEN), #endif #ifdef GSL_CONST_CGSM_UK_TON MAKE_DCONSTANT("CONST_CGSM_UK_TON", GSL_CONST_CGSM_UK_TON), #endif #ifdef GSL_CONST_CGSM_LUX MAKE_DCONSTANT("CONST_CGSM_LUX", GSL_CONST_CGSM_LUX), #endif #ifdef GSL_CONST_NUM_MICRO MAKE_DCONSTANT("CONST_NUM_MICRO", GSL_CONST_NUM_MICRO), #endif #ifdef GSL_CONST_CGSM_ELECTRON_CHARGE MAKE_DCONSTANT("CONST_CGSM_ELECTRON_CHARGE", GSL_CONST_CGSM_ELECTRON_CHARGE), #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_MKSA_MASS_ELECTRON MAKE_DCONSTANT("CONST_MKSA_MASS_ELECTRON", GSL_CONST_MKSA_MASS_ELECTRON), #endif #ifdef GSL_CONST_CGSM_JOULE MAKE_DCONSTANT("CONST_CGSM_JOULE", GSL_CONST_CGSM_JOULE), #endif #ifdef GSL_CONST_CGSM_STOKES MAKE_DCONSTANT("CONST_CGSM_STOKES", GSL_CONST_CGSM_STOKES), #endif #ifdef GSL_CONST_MKSA_ROENTGEN MAKE_DCONSTANT("CONST_MKSA_ROENTGEN", GSL_CONST_MKSA_ROENTGEN), #endif #ifdef GSL_CONST_CGSM_KNOT MAKE_DCONSTANT("CONST_CGSM_KNOT", GSL_CONST_CGSM_KNOT), #endif #ifdef GSL_CONST_CGSM_DAY MAKE_DCONSTANT("CONST_CGSM_DAY", GSL_CONST_CGSM_DAY), #endif #ifdef GSL_CONST_MKSA_UK_GALLON MAKE_DCONSTANT("CONST_MKSA_UK_GALLON", GSL_CONST_MKSA_UK_GALLON), #endif #ifdef GSL_CONST_CGSM_CUP MAKE_DCONSTANT("CONST_CGSM_CUP", GSL_CONST_CGSM_CUP), #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_TON MAKE_DCONSTANT("CONST_CGSM_TON", GSL_CONST_CGSM_TON), #endif #ifdef GSL_CONST_MKSA_MASS_MUON MAKE_DCONSTANT("CONST_MKSA_MASS_MUON", GSL_CONST_MKSA_MASS_MUON), #endif #ifdef GSL_CONST_CGSM_GRAV_ACCEL MAKE_DCONSTANT("CONST_CGSM_GRAV_ACCEL", GSL_CONST_CGSM_GRAV_ACCEL), #endif #ifdef GSL_CONST_NUM_YOCTO MAKE_DCONSTANT("CONST_NUM_YOCTO", GSL_CONST_NUM_YOCTO), #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_PLANCKS_CONSTANT_HBAR MAKE_DCONSTANT("CONST_MKSA_PLANCKS_CONSTANT_HBAR", GSL_CONST_MKSA_PLANCKS_CONSTANT_HBAR), #endif #ifdef GSL_CONST_MKSA_YARD MAKE_DCONSTANT("CONST_MKSA_YARD", GSL_CONST_MKSA_YARD), #endif #ifdef GSL_CONST_MKSA_GRAV_ACCEL MAKE_DCONSTANT("CONST_MKSA_GRAV_ACCEL", GSL_CONST_MKSA_GRAV_ACCEL), #endif #ifdef GSL_CONST_CGSM_POISE MAKE_DCONSTANT("CONST_CGSM_POISE", GSL_CONST_CGSM_POISE), #endif #ifdef GSL_CONST_NUM_AVOGADRO MAKE_DCONSTANT("CONST_NUM_AVOGADRO", GSL_CONST_NUM_AVOGADRO), #endif #ifdef GSL_CONST_MKSA_MIL MAKE_DCONSTANT("CONST_MKSA_MIL", GSL_CONST_MKSA_MIL), #endif #ifdef GSL_CONST_NUM_NANO MAKE_DCONSTANT("CONST_NUM_NANO", GSL_CONST_NUM_NANO), #endif #ifdef GSL_CONST_MKSA_HECTARE MAKE_DCONSTANT("CONST_MKSA_HECTARE", GSL_CONST_MKSA_HECTARE), #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_MKSA_ELECTRON_VOLT MAKE_DCONSTANT("CONST_MKSA_ELECTRON_VOLT", GSL_CONST_MKSA_ELECTRON_VOLT), #endif #ifdef GSL_CONST_MKSA_ELECTRON_CHARGE MAKE_DCONSTANT("CONST_MKSA_ELECTRON_CHARGE", GSL_CONST_MKSA_ELECTRON_CHARGE), #endif #ifdef GSL_CONST_NUM_ZETTA MAKE_DCONSTANT("CONST_NUM_ZETTA", GSL_CONST_NUM_ZETTA), #endif #ifdef GSL_CONST_CGSM_RAD MAKE_DCONSTANT("CONST_CGSM_RAD", GSL_CONST_CGSM_RAD), #endif #ifdef GSL_CONST_CGSM_ERG MAKE_DCONSTANT("CONST_CGSM_ERG", GSL_CONST_CGSM_ERG), #endif #ifdef GSL_CONST_CGSM_BAR MAKE_DCONSTANT("CONST_CGSM_BAR", GSL_CONST_CGSM_BAR), #endif #ifdef GSL_CONST_MKSA_FOOT MAKE_DCONSTANT("CONST_MKSA_FOOT", GSL_CONST_MKSA_FOOT), #endif #ifdef GSL_CONST_CGSM_DYNE MAKE_DCONSTANT("CONST_CGSM_DYNE", GSL_CONST_CGSM_DYNE), #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_PHOT MAKE_DCONSTANT("CONST_MKSA_PHOT", GSL_CONST_MKSA_PHOT), #endif #ifdef GSL_CONST_CGSM_PSI MAKE_DCONSTANT("CONST_CGSM_PSI", GSL_CONST_CGSM_PSI), #endif #ifdef GSL_CONST_CGSM_PHOT MAKE_DCONSTANT("CONST_CGSM_PHOT", GSL_CONST_CGSM_PHOT), #endif #ifdef GSL_CONST_CGSM_ANGSTROM MAKE_DCONSTANT("CONST_CGSM_ANGSTROM", GSL_CONST_CGSM_ANGSTROM), #endif #ifdef GSL_CONST_MKSA_POUND_MASS MAKE_DCONSTANT("CONST_MKSA_POUND_MASS", GSL_CONST_MKSA_POUND_MASS), #endif #ifdef GSL_CONST_CGSM_YARD MAKE_DCONSTANT("CONST_CGSM_YARD", GSL_CONST_CGSM_YARD), #endif #ifdef GSL_CONST_MKSA_ACRE MAKE_DCONSTANT("CONST_MKSA_ACRE", GSL_CONST_MKSA_ACRE), #endif #ifdef GSL_CONST_MKSA_BOHR_RADIUS MAKE_DCONSTANT("CONST_MKSA_BOHR_RADIUS", GSL_CONST_MKSA_BOHR_RADIUS), #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_DYNE MAKE_DCONSTANT("CONST_MKSA_DYNE", GSL_CONST_MKSA_DYNE), #endif #ifdef GSL_CONST_CGSM_FOOT MAKE_DCONSTANT("CONST_CGSM_FOOT", GSL_CONST_CGSM_FOOT), #endif #ifdef GSL_CONST_MKSA_LAMBERT MAKE_DCONSTANT("CONST_MKSA_LAMBERT", GSL_CONST_MKSA_LAMBERT), #endif #ifdef GSL_CONST_NUM_ZEPTO MAKE_DCONSTANT("CONST_NUM_ZEPTO", GSL_CONST_NUM_ZEPTO), #endif #ifdef GSL_CONST_CGSM_OUNCE_MASS MAKE_DCONSTANT("CONST_CGSM_OUNCE_MASS", GSL_CONST_CGSM_OUNCE_MASS), #endif #ifdef GSL_CONST_CGSM_CANADIAN_GALLON MAKE_DCONSTANT("CONST_CGSM_CANADIAN_GALLON", GSL_CONST_CGSM_CANADIAN_GALLON), #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_CGSM_PINT MAKE_DCONSTANT("CONST_CGSM_PINT", GSL_CONST_CGSM_PINT), #endif #ifdef GSL_CONST_MKSA_UK_TON MAKE_DCONSTANT("CONST_MKSA_UK_TON", GSL_CONST_MKSA_UK_TON), #endif #ifdef GSL_CONST_CGSM_UK_GALLON MAKE_DCONSTANT("CONST_CGSM_UK_GALLON", GSL_CONST_CGSM_UK_GALLON), #endif #ifdef GSL_CONST_NUM_PICO MAKE_DCONSTANT("CONST_NUM_PICO", GSL_CONST_NUM_PICO), #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_CGSM_CALORIE MAKE_DCONSTANT("CONST_CGSM_CALORIE", GSL_CONST_CGSM_CALORIE), #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_TROY_OUNCE MAKE_DCONSTANT("CONST_CGSM_TROY_OUNCE", GSL_CONST_CGSM_TROY_OUNCE), #endif #ifdef GSL_CONST_MKSA_KILOPOUND_FORCE MAKE_DCONSTANT("CONST_MKSA_KILOPOUND_FORCE", GSL_CONST_MKSA_KILOPOUND_FORCE), #endif #ifdef GSL_CONST_CGSM_WEEK MAKE_DCONSTANT("CONST_CGSM_WEEK", GSL_CONST_CGSM_WEEK), #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_NAUTICAL_MILE MAKE_DCONSTANT("CONST_MKSA_NAUTICAL_MILE", GSL_CONST_MKSA_NAUTICAL_MILE), #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_MASS_NEUTRON MAKE_DCONSTANT("CONST_CGSM_MASS_NEUTRON", GSL_CONST_CGSM_MASS_NEUTRON), #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_ELECTRON_VOLT MAKE_DCONSTANT("CONST_CGSM_ELECTRON_VOLT", GSL_CONST_CGSM_ELECTRON_VOLT), #endif #ifdef GSL_CONST_MKSA_VACUUM_PERMEABILITY MAKE_DCONSTANT("CONST_MKSA_VACUUM_PERMEABILITY", GSL_CONST_MKSA_VACUUM_PERMEABILITY), #endif #ifdef GSL_CONST_MKSA_GRAVITATIONAL_CONSTANT MAKE_DCONSTANT("CONST_MKSA_GRAVITATIONAL_CONSTANT", GSL_CONST_MKSA_GRAVITATIONAL_CONSTANT), #endif #ifdef GSL_CONST_CGSM_MINUTE MAKE_DCONSTANT("CONST_CGSM_MINUTE", GSL_CONST_CGSM_MINUTE), #endif #ifdef GSL_CONST_MKSA_MINUTE MAKE_DCONSTANT("CONST_MKSA_MINUTE", GSL_CONST_MKSA_MINUTE), #endif #ifdef GSL_CONST_CGSM_MASS_PROTON MAKE_DCONSTANT("CONST_CGSM_MASS_PROTON", GSL_CONST_CGSM_MASS_PROTON), #endif #ifdef GSL_CONST_MKSA_FARADAY MAKE_DCONSTANT("CONST_MKSA_FARADAY", GSL_CONST_MKSA_FARADAY), #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_MILES_PER_HOUR MAKE_DCONSTANT("CONST_MKSA_MILES_PER_HOUR", GSL_CONST_MKSA_MILES_PER_HOUR), #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_NUM_MEGA MAKE_DCONSTANT("CONST_NUM_MEGA", GSL_CONST_NUM_MEGA), #endif #ifdef GSL_CONST_MKSA_NUCLEAR_MAGNETON MAKE_DCONSTANT("CONST_MKSA_NUCLEAR_MAGNETON", GSL_CONST_MKSA_NUCLEAR_MAGNETON), #endif #ifdef GSL_CONST_MKSA_BARN MAKE_DCONSTANT("CONST_MKSA_BARN", GSL_CONST_MKSA_BARN), #endif #ifdef GSL_CONST_CGSM_FARADAY MAKE_DCONSTANT("CONST_CGSM_FARADAY", GSL_CONST_CGSM_FARADAY), #endif #ifdef GSL_CONST_NUM_TERA MAKE_DCONSTANT("CONST_NUM_TERA", GSL_CONST_NUM_TERA), #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_MKSA_INCH_OF_WATER MAKE_DCONSTANT("CONST_MKSA_INCH_OF_WATER", GSL_CONST_MKSA_INCH_OF_WATER), #endif #ifdef GSL_CONST_MKSA_GAUSS MAKE_DCONSTANT("CONST_MKSA_GAUSS", GSL_CONST_MKSA_GAUSS), #endif #ifdef GSL_CONST_MKSA_POISE MAKE_DCONSTANT("CONST_MKSA_POISE", GSL_CONST_MKSA_POISE), #endif #ifdef GSL_CONST_CGSM_MILE MAKE_DCONSTANT("CONST_CGSM_MILE", GSL_CONST_CGSM_MILE), #endif #ifdef GSL_CONST_CGSM_BOHR_RADIUS MAKE_DCONSTANT("CONST_CGSM_BOHR_RADIUS", GSL_CONST_CGSM_BOHR_RADIUS), #endif #ifdef GSL_CONST_CGSM_GRAM_FORCE MAKE_DCONSTANT("CONST_CGSM_GRAM_FORCE", GSL_CONST_CGSM_GRAM_FORCE), #endif #ifdef GSL_CONST_MKSA_THERM MAKE_DCONSTANT("CONST_MKSA_THERM", GSL_CONST_MKSA_THERM), #endif #ifdef GSL_CONST_MKSA_PINT MAKE_DCONSTANT("CONST_MKSA_PINT", GSL_CONST_MKSA_PINT), #endif #ifdef GSL_CONST_CGSM_HOUR MAKE_DCONSTANT("CONST_CGSM_HOUR", GSL_CONST_CGSM_HOUR), #endif #ifdef GSL_CONST_MKSA_INCH MAKE_DCONSTANT("CONST_MKSA_INCH", GSL_CONST_MKSA_INCH), #endif #ifdef GSL_CONST_CGSM_CARAT MAKE_DCONSTANT("CONST_CGSM_CARAT", GSL_CONST_CGSM_CARAT), #endif #ifdef GSL_CONST_CGSM_GRAVITATIONAL_CONSTANT MAKE_DCONSTANT("CONST_CGSM_GRAVITATIONAL_CONSTANT", GSL_CONST_CGSM_GRAVITATIONAL_CONSTANT), #endif #ifdef GSL_CONST_CGSM_THERM MAKE_DCONSTANT("CONST_CGSM_THERM", GSL_CONST_CGSM_THERM), #endif #ifdef GSL_CONST_MKSA_TEXPOINT MAKE_DCONSTANT("CONST_MKSA_TEXPOINT", GSL_CONST_MKSA_TEXPOINT), #endif #ifdef GSL_CONST_NUM_EXA MAKE_DCONSTANT("CONST_NUM_EXA", GSL_CONST_NUM_EXA), #endif #ifdef GSL_CONST_CGSM_MICRON MAKE_DCONSTANT("CONST_CGSM_MICRON", GSL_CONST_CGSM_MICRON), #endif #ifdef GSL_CONST_CGSM_ASTRONOMICAL_UNIT MAKE_DCONSTANT("CONST_CGSM_ASTRONOMICAL_UNIT", GSL_CONST_CGSM_ASTRONOMICAL_UNIT), #endif #ifdef GSL_CONST_CGSM_FATHOM MAKE_DCONSTANT("CONST_CGSM_FATHOM", GSL_CONST_CGSM_FATHOM), #endif #ifdef GSL_CONST_CGSM_RYDBERG MAKE_DCONSTANT("CONST_CGSM_RYDBERG", GSL_CONST_CGSM_RYDBERG), #endif #ifdef GSL_CONST_MKSA_STD_ATMOSPHERE MAKE_DCONSTANT("CONST_MKSA_STD_ATMOSPHERE", GSL_CONST_MKSA_STD_ATMOSPHERE), #endif #ifdef GSL_CONST_MKSA_KNOT MAKE_DCONSTANT("CONST_MKSA_KNOT", GSL_CONST_MKSA_KNOT), #endif #ifdef GSL_CONST_CGSM_MOLAR_GAS MAKE_DCONSTANT("CONST_CGSM_MOLAR_GAS", GSL_CONST_CGSM_MOLAR_GAS), #endif #ifdef GSL_CONST_MKSA_STILB MAKE_DCONSTANT("CONST_MKSA_STILB", GSL_CONST_MKSA_STILB), #endif #ifdef GSL_CONST_MKSA_TON MAKE_DCONSTANT("CONST_MKSA_TON", GSL_CONST_MKSA_TON), #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-0.7.0/src/gslfft.sl0000644002657400265740000000032410665603423014306 0ustar davisdavisrequire ("gslcore"); _gslcore_import_module ("gslfft", current_namespace()); define fft () { variable args = __pop_args (_NARGS); return _gsl_fft_complex (__push_args (__tmp(args))); } provide ("gslfft"); slgsl-0.7.0/src/gslinterp-module.c0000644002657400265740000004156410665603423016132 0ustar davisdavis/* -*- 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 (davis@space.mit.edu) */ #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-0.7.0/src/gslcore-module.c0000644002657400265740000006547710244674226015574 0ustar davisdavis/* -*- 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 (davis@space.mit.edu) */ #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 (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 */ 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 } 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; } /*}}}*/ /*{{{ 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); } /*}}}*/ 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-0.7.0/src/gslcdf-module.c0000644002657400265740000004422710665603423015364 0ustar davisdavis/* -*- mode: C; mode: fold; -*- */ /* This file was automatically generated. */ /* 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 (davis@space.mit.edu) */ #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 (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 (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 (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 (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); } #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); } /*}}}*/ D_FDDD(gsl_cdf_pareto_Qinv,"cdf_pareto_Qinv") D_FDDD(gsl_cdf_beta_P,"cdf_beta_P") D_FDDD(gsl_cdf_weibull_P,"cdf_weibull_P") D_FDDD(gsl_cdf_weibull_Pinv,"cdf_weibull_Pinv") D_FDDD(gsl_cdf_gumbel1_Q,"cdf_gumbel1_Q") D_FDDD(gsl_cdf_gumbel2_Q,"cdf_gumbel2_Q") D_FDDD(gsl_cdf_lognormal_P,"cdf_lognormal_P") D_FDDD(gsl_cdf_flat_P,"cdf_flat_P") D_FDDD(gsl_cdf_gamma_Pinv,"cdf_gamma_Pinv") D_FDDD(gsl_cdf_gumbel2_P,"cdf_gumbel2_P") D_FDDD(gsl_cdf_fdist_P,"cdf_fdist_P") D_FDDD(gsl_cdf_gumbel1_Pinv,"cdf_gumbel1_Pinv") D_FDDD(gsl_cdf_weibull_Qinv,"cdf_weibull_Qinv") D_FDDD(gsl_cdf_gamma_P,"cdf_gamma_P") D_FDDD(gsl_cdf_gamma_Qinv,"cdf_gamma_Qinv") D_FDDD(gsl_cdf_lognormal_Q,"cdf_lognormal_Q") D_FDDD(gsl_cdf_weibull_Q,"cdf_weibull_Q") D_FDDD(gsl_cdf_gumbel1_Qinv,"cdf_gumbel1_Qinv") D_FDDD(gsl_cdf_lognormal_Qinv,"cdf_lognormal_Qinv") D_FDDD(gsl_cdf_gumbel2_Pinv,"cdf_gumbel2_Pinv") D_FDDD(gsl_cdf_gamma_Q,"cdf_gamma_Q") D_FDDD(gsl_cdf_flat_Qinv,"cdf_flat_Qinv") D_FDDD(gsl_cdf_flat_Pinv,"cdf_flat_Pinv") D_FDDD(gsl_cdf_pareto_Q,"cdf_pareto_Q") D_FDDD(gsl_cdf_pareto_P,"cdf_pareto_P") D_FDDD(gsl_cdf_gumbel2_Qinv,"cdf_gumbel2_Qinv") D_FDDD(gsl_cdf_lognormal_Pinv,"cdf_lognormal_Pinv") D_FDDD(gsl_cdf_gumbel1_P,"cdf_gumbel1_P") D_FDDD(gsl_cdf_flat_Q,"cdf_flat_Q") D_FDDD(gsl_cdf_fdist_Q,"cdf_fdist_Q") D_FDDD(gsl_cdf_beta_Q,"cdf_beta_Q") D_FDDD(gsl_cdf_pareto_Pinv,"cdf_pareto_Pinv") D_FDD(gsl_cdf_laplace_P,"cdf_laplace_P") D_FDD(gsl_cdf_logistic_Qinv,"cdf_logistic_Qinv") D_FDD(gsl_cdf_tdist_Q,"cdf_tdist_Q") D_FDD(gsl_cdf_cauchy_Pinv,"cdf_cauchy_Pinv") D_FDD(gsl_cdf_rayleigh_Qinv,"cdf_rayleigh_Qinv") D_FDD(gsl_cdf_logistic_Q,"cdf_logistic_Q") D_FDD(gsl_cdf_gaussian_Pinv,"cdf_gaussian_Pinv") D_FDD(gsl_cdf_exponential_Pinv,"cdf_exponential_Pinv") D_FDD(gsl_cdf_rayleigh_P,"cdf_rayleigh_P") D_FDD(gsl_cdf_laplace_Qinv,"cdf_laplace_Qinv") D_FDD(gsl_cdf_rayleigh_Pinv,"cdf_rayleigh_Pinv") D_FDD(gsl_cdf_gaussian_Qinv,"cdf_gaussian_Qinv") D_FDD(gsl_cdf_chisq_P,"cdf_chisq_P") D_FDD(gsl_cdf_exponential_Qinv,"cdf_exponential_Qinv") D_FDD(gsl_cdf_chisq_Pinv,"cdf_chisq_Pinv") D_FDD(gsl_cdf_cauchy_P,"cdf_cauchy_P") D_FDD(gsl_cdf_exponential_P,"cdf_exponential_P") D_FDD(gsl_cdf_laplace_Q,"cdf_laplace_Q") D_FDD(gsl_cdf_laplace_Pinv,"cdf_laplace_Pinv") D_FDD(gsl_cdf_chisq_Q,"cdf_chisq_Q") D_FDD(gsl_cdf_exponential_Q,"cdf_exponential_Q") D_FDD(gsl_cdf_logistic_P,"cdf_logistic_P") D_FDD(gsl_cdf_cauchy_Q,"cdf_cauchy_Q") D_FDD(gsl_cdf_gaussian_P,"cdf_gaussian_P") D_FDD(gsl_cdf_tdist_Qinv,"cdf_tdist_Qinv") D_FDD(gsl_cdf_rayleigh_Q,"cdf_rayleigh_Q") D_FDD(gsl_cdf_gaussian_Q,"cdf_gaussian_Q") D_FDD(gsl_cdf_logistic_Pinv,"cdf_logistic_Pinv") D_FDD(gsl_cdf_tdist_Pinv,"cdf_tdist_Pinv") D_FDD(gsl_cdf_tdist_P,"cdf_tdist_P") D_FDD(gsl_cdf_cauchy_Qinv,"cdf_cauchy_Qinv") D_FDD(gsl_cdf_chisq_Qinv,"cdf_chisq_Qinv") D_FD(gsl_cdf_ugaussian_Qinv,"cdf_ugaussian_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") #if SLANG_VERSION < 20000 #endif /* SLANG_VERSION < 20000 */ #define V SLANG_VOID_TYPE static SLang_Intrin_Fun_Type Module_Intrinsics [] = { MAKE_INTRINSIC_0("cdf_pareto_Qinv", SLF(gsl_cdf_pareto_Qinv), V), MAKE_INTRINSIC_0("cdf_beta_P", SLF(gsl_cdf_beta_P), 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_gumbel1_Q", SLF(gsl_cdf_gumbel1_Q), V), MAKE_INTRINSIC_0("cdf_gumbel2_Q", SLF(gsl_cdf_gumbel2_Q), V), MAKE_INTRINSIC_0("cdf_lognormal_P", SLF(gsl_cdf_lognormal_P), V), MAKE_INTRINSIC_0("cdf_flat_P", SLF(gsl_cdf_flat_P), V), MAKE_INTRINSIC_0("cdf_gamma_Pinv", SLF(gsl_cdf_gamma_Pinv), V), MAKE_INTRINSIC_0("cdf_gumbel2_P", SLF(gsl_cdf_gumbel2_P), V), MAKE_INTRINSIC_0("cdf_fdist_P", SLF(gsl_cdf_fdist_P), V), MAKE_INTRINSIC_0("cdf_gumbel1_Pinv", SLF(gsl_cdf_gumbel1_Pinv), V), MAKE_INTRINSIC_0("cdf_weibull_Qinv", SLF(gsl_cdf_weibull_Qinv), V), MAKE_INTRINSIC_0("cdf_gamma_P", SLF(gsl_cdf_gamma_P), V), MAKE_INTRINSIC_0("cdf_gamma_Qinv", SLF(gsl_cdf_gamma_Qinv), V), MAKE_INTRINSIC_0("cdf_lognormal_Q", SLF(gsl_cdf_lognormal_Q), V), MAKE_INTRINSIC_0("cdf_weibull_Q", SLF(gsl_cdf_weibull_Q), V), MAKE_INTRINSIC_0("cdf_gumbel1_Qinv", SLF(gsl_cdf_gumbel1_Qinv), V), MAKE_INTRINSIC_0("cdf_lognormal_Qinv", SLF(gsl_cdf_lognormal_Qinv), V), MAKE_INTRINSIC_0("cdf_gumbel2_Pinv", SLF(gsl_cdf_gumbel2_Pinv), V), MAKE_INTRINSIC_0("cdf_gamma_Q", SLF(gsl_cdf_gamma_Q), V), MAKE_INTRINSIC_0("cdf_flat_Qinv", SLF(gsl_cdf_flat_Qinv), V), MAKE_INTRINSIC_0("cdf_flat_Pinv", SLF(gsl_cdf_flat_Pinv), V), MAKE_INTRINSIC_0("cdf_pareto_Q", SLF(gsl_cdf_pareto_Q), V), MAKE_INTRINSIC_0("cdf_pareto_P", SLF(gsl_cdf_pareto_P), V), MAKE_INTRINSIC_0("cdf_gumbel2_Qinv", SLF(gsl_cdf_gumbel2_Qinv), V), MAKE_INTRINSIC_0("cdf_lognormal_Pinv", SLF(gsl_cdf_lognormal_Pinv), V), MAKE_INTRINSIC_0("cdf_gumbel1_P", SLF(gsl_cdf_gumbel1_P), V), MAKE_INTRINSIC_0("cdf_flat_Q", SLF(gsl_cdf_flat_Q), V), MAKE_INTRINSIC_0("cdf_fdist_Q", SLF(gsl_cdf_fdist_Q), V), MAKE_INTRINSIC_0("cdf_beta_Q", SLF(gsl_cdf_beta_Q), V), MAKE_INTRINSIC_0("cdf_pareto_Pinv", SLF(gsl_cdf_pareto_Pinv), V), MAKE_INTRINSIC_0("cdf_laplace_P", SLF(gsl_cdf_laplace_P), V), MAKE_INTRINSIC_0("cdf_logistic_Qinv", SLF(gsl_cdf_logistic_Qinv), V), MAKE_INTRINSIC_0("cdf_tdist_Q", SLF(gsl_cdf_tdist_Q), V), MAKE_INTRINSIC_0("cdf_cauchy_Pinv", SLF(gsl_cdf_cauchy_Pinv), V), MAKE_INTRINSIC_0("cdf_rayleigh_Qinv", SLF(gsl_cdf_rayleigh_Qinv), V), MAKE_INTRINSIC_0("cdf_logistic_Q", SLF(gsl_cdf_logistic_Q), V), MAKE_INTRINSIC_0("cdf_gaussian_Pinv", SLF(gsl_cdf_gaussian_Pinv), V), MAKE_INTRINSIC_0("cdf_exponential_Pinv", SLF(gsl_cdf_exponential_Pinv), V), MAKE_INTRINSIC_0("cdf_rayleigh_P", SLF(gsl_cdf_rayleigh_P), V), MAKE_INTRINSIC_0("cdf_laplace_Qinv", SLF(gsl_cdf_laplace_Qinv), V), MAKE_INTRINSIC_0("cdf_rayleigh_Pinv", SLF(gsl_cdf_rayleigh_Pinv), V), MAKE_INTRINSIC_0("cdf_gaussian_Qinv", SLF(gsl_cdf_gaussian_Qinv), V), MAKE_INTRINSIC_0("cdf_chisq_P", SLF(gsl_cdf_chisq_P), V), MAKE_INTRINSIC_0("cdf_exponential_Qinv", SLF(gsl_cdf_exponential_Qinv), V), MAKE_INTRINSIC_0("cdf_chisq_Pinv", SLF(gsl_cdf_chisq_Pinv), V), MAKE_INTRINSIC_0("cdf_cauchy_P", SLF(gsl_cdf_cauchy_P), V), MAKE_INTRINSIC_0("cdf_exponential_P", SLF(gsl_cdf_exponential_P), V), MAKE_INTRINSIC_0("cdf_laplace_Q", SLF(gsl_cdf_laplace_Q), V), MAKE_INTRINSIC_0("cdf_laplace_Pinv", SLF(gsl_cdf_laplace_Pinv), V), MAKE_INTRINSIC_0("cdf_chisq_Q", SLF(gsl_cdf_chisq_Q), V), MAKE_INTRINSIC_0("cdf_exponential_Q", SLF(gsl_cdf_exponential_Q), V), MAKE_INTRINSIC_0("cdf_logistic_P", SLF(gsl_cdf_logistic_P), V), MAKE_INTRINSIC_0("cdf_cauchy_Q", SLF(gsl_cdf_cauchy_Q), V), MAKE_INTRINSIC_0("cdf_gaussian_P", SLF(gsl_cdf_gaussian_P), V), MAKE_INTRINSIC_0("cdf_tdist_Qinv", SLF(gsl_cdf_tdist_Qinv), V), MAKE_INTRINSIC_0("cdf_rayleigh_Q", SLF(gsl_cdf_rayleigh_Q), V), MAKE_INTRINSIC_0("cdf_gaussian_Q", SLF(gsl_cdf_gaussian_Q), V), MAKE_INTRINSIC_0("cdf_logistic_Pinv", SLF(gsl_cdf_logistic_Pinv), V), MAKE_INTRINSIC_0("cdf_tdist_Pinv", SLF(gsl_cdf_tdist_Pinv), V), MAKE_INTRINSIC_0("cdf_tdist_P", SLF(gsl_cdf_tdist_P), V), MAKE_INTRINSIC_0("cdf_cauchy_Qinv", SLF(gsl_cdf_cauchy_Qinv), V), MAKE_INTRINSIC_0("cdf_chisq_Qinv", SLF(gsl_cdf_chisq_Qinv), V), MAKE_INTRINSIC_0("cdf_ugaussian_Qinv", SLF(gsl_cdf_ugaussian_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), #if SLANG_VERSION < 20000 #endif /* SLANG_VERSION < 20000 */ #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-0.7.0/src/gslvers.c0000644002657400265740000000205310665214006014306 0ustar davisdavis#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-0.7.0/src/gslrand.sl0000644002657400265740000000014310665603423014452 0ustar davisdavisrequire ("gslcore"); _gslcore_import_module ("gslrand", current_namespace()); provide ("gslrand"); slgsl-0.7.0/src/gslconst.sl0000644002657400265740000000014510665603423014656 0ustar davisdavisrequire ("gslcore"); _gslcore_import_module ("gslconst", current_namespace()); provide ("gslconst"); slgsl-0.7.0/src/slgsl.h0000644002657400265740000000604110665603423013760 0ustar davisdavis#ifndef _SLGSL_MODULE_H_ #define _SLGSL_MODULE_H_ extern void slgsl_reset_errors (void); extern void slgsl_check_errors (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; extern int slgsl_create_d_array (SLGSL_Double_Array_Type *a, SLGSL_Double_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 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_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_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 (char *fun, double (*f)(double)); extern void slgsl_do_d_i_fun (char *fun, double (*f)(int)); extern void slgsl_do_d_dd_fun (char *fun, double (*f)(double, double)); extern void slgsl_do_d_ddd_fun (char *fun, double (*f)(double, double, double)); extern void slgsl_do_d_dddd_fun (char *fun, double (*f)(double, double, double,double)); extern void slgsl_do_d_id_fun (char *fun, double (*f)(int, double)); extern void slgsl_do_d_idd_fun (char *fun, double (*f)(int, double, double)); extern void slgsl_do_d_iid_fun (char *fun, double (*f)(int, int, double)); extern void slgsl_do_d_iidd_fun (char *fun, double (*f)(int, int, double, double)); extern void slgsl_do_i_d_fun (char *fun, int (*f)(double)); 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); #endif slgsl-0.7.0/src/version.h0000644002657400265740000000057510665603423014327 0ustar davisdavis#define MODULE_MAJOR_VERSION 0 #define MODULE_MINOR_VERSION 7 #define MODULE_PATCH_LEVEL 0 #define MKSTR1(x) #x #define MKSTR(x) MKSTR1(x) static char *Module_Version_String = MKSTR(MODULE_MAJOR_VERSION) "." \ MKSTR(MODULE_MINOR_VERSION) "." MKSTR(MODULE_PATCH_LEVEL); #define MODULE_VERSION_NUMBER \ (MODULE_MAJOR_VERSION*10000+MODULE_MINOR_VERSION*100+MODULE_PATCH_LEVEL) slgsl-0.7.0/src/gslcore.sl0000644002657400265740000000042710665603423014463 0ustar davisdavisdefine _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-0.7.0/src/gslmatrix-module.c0000644002657400265740000006631710665603423016140 0ustar davisdavis/* -*- 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 (davis@space.mit.edu) */ #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 typedef struct Matrix_Type { unsigned int size1, size2; union { gsl_matrix d; gsl_matrix_complex c; } m; void (*free_method)(struct Matrix_Type *); int (*push_method)(struct Matrix_Type *); SLang_Array_Type *at; } Matrix_Type; typedef struct Vector_Type { unsigned int size; union { gsl_vector d; gsl_vector_complex c; } v; void (*free_method)(struct Vector_Type *); int (*push_method)(struct Vector_Type *); SLang_Array_Type *at; } Vector_Type; 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_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; } static void free_double_matrix (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 (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 (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->free_method = free_double_matrix; matrix->push_method = push_double_matrix; return 0; } static void free_complex_matrix (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 (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 (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->free_method = free_complex_matrix; matrix->push_method = push_complex_matrix; return 0; } static void free_matrix (Matrix_Type *matrix) { if (matrix == NULL) return; (*matrix->free_method)(matrix); SLfree ((char *)matrix); } static Matrix_Type *new_matrix (SLtype type, unsigned int n0, unsigned int n1, int copy, SLang_Array_Type *at) { Matrix_Type *matrix; int status; if (NULL == (matrix = (Matrix_Type *)SLcalloc (1, sizeof (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; } static int push_matrix (Matrix_Type *matrix) { return (*matrix->push_method)(matrix); } static int pop_matrix (Matrix_Type **matrixp, SLtype type, int copy) { SLang_Array_Type *at; 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; } static int pop_square_matrix (Matrix_Type **matrixp, SLtype type, int copy) { 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 (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 (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 (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->free_method = free_double_vector; vector->push_method = push_double_vector; return 0; } static void free_complex_vector (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 (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 (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->free_method = free_complex_vector; vector->push_method = push_complex_vector; return 0; } static void free_vector (Vector_Type *vector) { if (vector == NULL) return; (*vector->free_method)(vector); SLfree ((char *)vector); } static Vector_Type *new_vector (SLtype type, unsigned int n, int copy, SLang_Array_Type *at) { Vector_Type *vector; int status; if (NULL == (vector = (Vector_Type *)SLcalloc (1, sizeof (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; } static int push_vector (Vector_Type *vector) { return (*vector->push_method)(vector); } static int assign_vector_to_ref (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; } static int pop_vector (Vector_Type **vectorp, SLtype type, int copy) { SLang_Array_Type *at; 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; } 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; 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; /* drop */ case 1: if (-1 == 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))) { 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 == 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); free_matrix (matrix); } static void linalg_LU_solve (void) { Matrix_Type *lu = NULL; Vector_Type *b = NULL; 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 == pop_vector (&b, type, 0)) || (-1 == pop_permutation (&p)) || (-1 == 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 = 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) push_vector (x); /* drop */ return_error: free_vector (x); free_matrix (lu); gsl_permutation_free (p); free_vector (b); } static void do_linalg_LU_det (int nargs, int do_log) { Matrix_Type *matrix; SLtype type; int signum; 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 == 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); 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) { Matrix_Type *lu = NULL; 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 == pop_square_matrix (&lu, type, 1))) goto return_error; if (NULL == (inv = 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) push_matrix (inv); /* drop */ return_error: free_matrix (inv); free_matrix (lu); gsl_permutation_free (p); } static void linalg_QR_decomp (void) { Matrix_Type *matrix; 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 == pop_matrix (&matrix, type, 1)) return; n = matrix->size1; if (matrix->size2 < n) n = matrix->size2; if (NULL == (tau = new_vector (SLANG_DOUBLE_TYPE, n, 0, NULL))) { free_matrix (matrix); return; } slgsl_reset_errors (); gsl_linalg_QR_decomp (&matrix->m.d, &tau->v.d); slgsl_check_errors ("linalg_LU_decomp"); (void) push_matrix (matrix); (void) push_vector (tau); free_vector (tau); free_matrix (matrix); } static void linalg_QR_solve (void) { Matrix_Type *qr = NULL; Vector_Type *b = NULL; Vector_Type *x = NULL; Vector_Type *tau = NULL; 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; /* drop */ case 3: if ((-1 == pop_vector (&b, type, 0)) || (-1 == pop_vector (&tau, type, 0)) || (-1 == 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 = new_vector (type, b->size, 0, NULL))) goto return_error; if ((ref != NULL) || (qr->size1 != qr->size2)) { if (NULL == (residual = 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) push_vector (x); if (ref != NULL) (void) assign_vector_to_ref (residual, ref); } /* drop */ return_error: free_vector (x); free_matrix (qr); free_vector (tau); free_vector (b); if (ref != NULL) SLang_free_ref (ref); if (residual != NULL) free_vector (residual); } static void linalg_SV_decomp (void) { Matrix_Type *a = NULL, *v = NULL; 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 == 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"); free_matrix (a); } if ((NULL == (s = new_vector (type, N, 0, NULL))) || (NULL == (v = 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) push_matrix (a); (void) push_vector (s); (void) push_matrix (v); } /* drop */ return_error: if (work != NULL) gsl_vector_free (work); free_matrix (v); free_vector (s); free_matrix (a); } static void linalg_SV_solve (void) { Matrix_Type *u = NULL, *v = NULL; 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 == pop_vector (&b, type, 0)) /* N */ || (-1 == pop_vector (&s, type, 0)) /* N */ || (-1 == pop_square_matrix (&v, type, 0)) /* N */ || (-1 == 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 = 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) push_vector (x); /* drop */ return_error: free_vector (x); free_vector (b); free_vector (s); free_matrix (v); free_matrix (u); } /* Eigenvalue Routines */ static void eigen_symmv (void) { Matrix_Type *matrix; SLtype type = SLANG_DOUBLE_TYPE; Vector_Type *eigvals = NULL; 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 == pop_square_matrix (&matrix, type, 1)) return; n = matrix->size1; if ((NULL == (eigvals = new_vector (SLANG_DOUBLE_TYPE, n, 0, NULL))) || (NULL == (eigvecs = 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) push_matrix (eigvecs); (void) push_vector (eigvals); } /* drop */ return_error: free_matrix (eigvecs); free_vector (eigvals); free_matrix (matrix); } #if GSL_VERSION_INT >= 10900 static void eigen_nonsymmv (void) { Matrix_Type *matrix; Vector_Type *eigvals = NULL; 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 == pop_square_matrix (&matrix, SLANG_DOUBLE_TYPE, 1)) return; n = matrix->size1; if ((NULL == (eigvals = new_vector (SLANG_COMPLEX_TYPE, n, 0, NULL))) || (NULL == (eigvecs = 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) push_matrix (eigvecs); (void) push_vector (eigvals); } /* drop */ return_error: gsl_eigen_nonsymmv_free (w); free_matrix (eigvecs); free_vector (eigvals); 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-0.7.0/configure0000755002657400265740000077624410665603423013626 0ustar davisdavis#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # Zsh 3.x and 4.x performs 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. 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 echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs 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_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # 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 } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file 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 -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # 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 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= 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='RPATH SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias build build_cpu build_vendor build_os host host_cpu host_vendor host_os RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE CONFIG_DIR CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GREP EGREP DYNAMIC_LINK_LIB ELF_CC ELF_CFLAGS ELF_LINK ELF_LINK_CMD ELF_DEP_LIBS DYNAMIC_LINK_FLAGS CC_SHARED ELFLIB ELFLIB_MAJOR ELFLIB_MAJOR_MINOR ELFLIB_MAJOR_MINOR_MICRO SLANG_LIB_FOR_MODULES DLL_IMPLIB_NAME INSTALL_MODULE INSTALL_ELFLIB_TARGET ELFLIB_BUILD_NAME SLANG_DLL_CFLAGS XMKMF X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS SLANG_LIB SLANG_INC GSL_LIB GSL_INC slang_version slang_major_version slang_minor_version slang_patchlevel_version MODULE_INSTALL_DIR SL_FILES_INSTALL_DIR LIBOBJS LTLIBOBJS' ac_subst_files='' 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 # 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' 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=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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 ;; -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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 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 .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } 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] --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 C/C++/Objective 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. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 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.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >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.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 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,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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_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 { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in autoconf \"$srcdir\"/autoconf" >&5 echo "$as_me: error: cannot find install-sh or install.sh in autoconf \"$srcdir\"/autoconf" >&2;} { (exit 1); exit 1; }; } 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 || { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; 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 { echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS 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 { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$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' { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&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 { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SET_MAKE= else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { { echo "$as_me:$LINENO: error: \"This software does not support configuring from another directory. See the INSTALL file\"" >&5 echo "$as_me: error: \"This software does not support configuring from another directory. See the INSTALL file\"" >&2;} { (exit 1); exit 1; }; } 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` { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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" { test -f "$ac_path_GREP" && $as_test_x "$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 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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" { test -f "$ac_path_EGREP" && $as_test_x "$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 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* 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" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac 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 { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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 { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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 if test $ac_cv_c_compiler_gnu = yes; then { echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6; } if test "${ac_cv_prog_gcc_traditional+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi { echo "$as_me:$LINENO: checking for library containing strerror" >&5 echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6; } if test "${ac_cv_search_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_strerror=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_strerror+set}" = set; then break fi done if test "${ac_cv_search_strerror+set}" = set; then : else ac_cv_search_strerror=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for AIX" >&5 echo $ECHO_N "checking for AIX... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef _AIX yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define _ALL_SOURCE 1 _ACEOF else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f conftest* cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef hpux yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then cat >>confdefs.h <<\_ACEOF #define _HPUX_SOURCE 1 _ACEOF if test "$CC" = cc; then CC="cc -Ae"; fi fi rm -f conftest* { echo "$as_me:$LINENO: checking C compiler that understands ANSI prototypes" >&5 echo $ECHO_N "checking C compiler that understands ANSI prototypes... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { extern int silly (int); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then { echo "$as_me:$LINENO: result: $CC looks ok. Good." >&5 echo "${ECHO_T}$CC looks ok. Good." >&6; } else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: $CC is not a good enough compiler" >&5 echo "${ECHO_T}$CC is not a good enough compiler" >&6; } { { echo "$as_me:$LINENO: error: Set env variable CC to your ANSI compiler and rerun configure." >&5 echo "$as_me: error: Set env variable CC to your ANSI compiler and rerun configure." >&2;} { (exit 1); exit 1; }; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF 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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done DYNAMIC_LINK_LIB="" if test "${ac_cv_header_dlfcn_h+set}" = set; then { echo "$as_me:$LINENO: checking for dlfcn.h" >&5 echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6; } if test "${ac_cv_header_dlfcn_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking dlfcn.h usability" >&5 echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking dlfcn.h presence" >&5 echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for dlfcn.h" >&5 echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6; } if test "${ac_cv_header_dlfcn_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dlfcn_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6; } fi if test $ac_cv_header_dlfcn_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DLFCN_H 1 _ACEOF { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then DYNAMIC_LINK_LIB="-ldl" cat >>confdefs.h <<\_ACEOF #define HAVE_DLOPEN 1 _ACEOF else { echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* 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 (); /* 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_dlopen || defined __stub___dlopen choke me #endif int main () { return dlopen (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } if test $ac_cv_func_dlopen = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DLOPEN 1 _ACEOF fi if test "$ac_cv_func_dlopen" != yes then { echo "$as_me:$LINENO: WARNING: cannot perform dynamic linking" >&5 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_DATA)" SLANG_DLL_CFLAGS="" case "$host_os" in *linux*|*gnu*|k*bsd*-gnu ) DYNAMIC_LINK_FLAGS="-Wl,-export-dynamic" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -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="\$(CC) \$(CFLAGS) -shared -fPIC" ;; *solaris* ) if test "$GCC" = yes then DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-ztext -Wl,-h,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED="\$(CC) \$(CFLAGS) -G -fPIC" else DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -K PIC" ELF_LINK="\$(CC) \$(LDFLAGS) -G -h\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED="\$(CC) \$(CFLAGS) -G -K PIC" 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) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-h,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED="\$(CC) \$(CFLAGS) -G -fPIC" else DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -K pic" # ELF_LINK="ld -G -z text -h#" ELF_LINK="\$(CC) \$(LDFLAGS) -G -z text -h\$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED="\$(CC) \$(CFLAGS) -G -K pic" 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) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-h,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED="\$(CC) \$(CFLAGS) -shared -fPIC" else DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS)" # default anyhow ELF_LINK="\$(CC) \$(LDFLAGS) -shared -o \$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED="\$(CC) \$(CFLAGS) -shared" fi ;; *darwin* ) DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -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="\$(CC) -bundle -flat_namespace -undefined suppress \$(CFLAGS) -fno-common" 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) -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="\$(CC) \$(CFLAGS) -shared -fPIC" ;; *cygwin* ) DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" SLANG_DLL_CFLAGS="-DSLANG_DLL=1" ELF_CFLAGS="\$(CFLAGS) -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="\$(CC) \$(CFLAGS) -shared -DSLANG_DLL=1" SLANG_LIB_FOR_MODULES="-L\$(ELFDIR) -lslang" INSTALL_MODULE="\$(INSTALL)" INSTALL_ELFLIB_TARGET="install-elf-cygwin" ELFLIB="lib\$(THIS_LIB).dll" ELFLIB_MAJOR="lib\$(THIS_LIB)\$(ELF_MAJOR_VERSION).dll" ELFLIB_MAJOR_MINOR="lib\$(THIS_LIB)\$(ELF_MAJOR_VERSION)_\$(ELF_MINOR_VERSION).dll" ELFLIB_MAJOR_MINOR_MICRO="lib\$(THIS_LIB)\$(ELF_MAJOR_VERSION)_\$(ELF_MINOR_VERSION)_\$(ELF_MICRO_VERSION).dll" ELFLIB_BUILD_NAME="\$(ELFLIB_MAJOR)" ;; * ) echo "Note: ELF compiler for host_os=$host_os may be wrong" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED="\$(CC) \$(CFLAGS) -shared -fPIC" 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 { echo "$as_me:$LINENO: checking for X" >&5 echo $ECHO_N "checking for X... $ECHO_C" >&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 #( *\'*) { { echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5 echo "$as_me: error: Cannot use X directory names containing '" >&2;} { (exit 1); exit 1; }; };; #( *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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; 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 | /lib) ;; *) 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/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # We can compile using X headers with no special include directory. ac_x_includes= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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.$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { XrmInitialize () ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS=$ac_save_LIBS for ac_dir in `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; 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_ipa8_conftest.oo \ 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 { echo "$as_me:$LINENO: result: $have_x" >&5 echo "${ECHO_T}$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'" { echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 echo "${ECHO_T}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. cat >>confdefs.h <<\_ACEOF #define X_DISPLAY_MISSING 1 _ACEOF 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 . . . . { echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS="$ac_xsave_LIBS -R $x_libraries" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: neither works" >&5 echo "${ECHO_T}neither works" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6; } if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dnet_dnet_ntoa=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dnet_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6; } if test $ac_cv_lib_dnet_dnet_ntoa = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then { echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6; } if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dnet_stub_dnet_ntoa=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dnet_stub_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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. { echo "$as_me:$LINENO: checking for gethostbyname" >&5 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6; } if test "${ac_cv_func_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define gethostbyname to an innocuous variant, in case declares gethostbyname. For example, HP-UX 11i declares gettimeofday. */ #define gethostbyname innocuous_gethostbyname /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef gethostbyname /* 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 (); /* 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_gethostbyname || defined __stub___gethostbyname choke me #endif int main () { return gethostbyname (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6; } if test $ac_cv_func_gethostbyname = no; then { echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6; } if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_nsl_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6; } if test $ac_cv_lib_nsl_gethostbyname = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then { echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6; } if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_bsd_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6; } if test $ac_cv_lib_bsd_gethostbyname = yes; 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. { echo "$as_me:$LINENO: checking for connect" >&5 echo $ECHO_N "checking for connect... $ECHO_C" >&6; } if test "${ac_cv_func_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define connect to an innocuous variant, in case declares connect. For example, HP-UX 11i declares gettimeofday. */ #define connect innocuous_connect /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef connect /* 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 (); /* 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_connect || defined __stub___connect choke me #endif int main () { return connect (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_connect=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 echo "${ECHO_T}$ac_cv_func_connect" >&6; } if test $ac_cv_func_connect = no; then { echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6; } if test "${ac_cv_lib_socket_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_socket_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_connect=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6; } if test $ac_cv_lib_socket_connect = yes; then X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. { echo "$as_me:$LINENO: checking for remove" >&5 echo $ECHO_N "checking for remove... $ECHO_C" >&6; } if test "${ac_cv_func_remove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define remove to an innocuous variant, in case declares remove. For example, HP-UX 11i declares gettimeofday. */ #define remove innocuous_remove /* System header to define __stub macros and hopefully few prototypes, which can conflict with char remove (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef remove /* 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 (); /* 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_remove || defined __stub___remove choke me #endif int main () { return remove (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_remove=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_remove=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5 echo "${ECHO_T}$ac_cv_func_remove" >&6; } if test $ac_cv_func_remove = no; then { echo "$as_me:$LINENO: checking for remove in -lposix" >&5 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6; } if test "${ac_cv_lib_posix_remove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_posix_remove=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_posix_remove=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6; } if test $ac_cv_lib_posix_remove = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. { echo "$as_me:$LINENO: checking for shmat" >&5 echo $ECHO_N "checking for shmat... $ECHO_C" >&6; } if test "${ac_cv_func_shmat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shmat to an innocuous variant, in case declares shmat. For example, HP-UX 11i declares gettimeofday. */ #define shmat innocuous_shmat /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shmat (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shmat /* 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 (); /* 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_shmat || defined __stub___shmat choke me #endif int main () { return shmat (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_shmat=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shmat=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5 echo "${ECHO_T}$ac_cv_func_shmat" >&6; } if test $ac_cv_func_shmat = no; then { echo "$as_me:$LINENO: checking for shmat in -lipc" >&5 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6; } if test "${ac_cv_lib_ipc_shmat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_ipc_shmat=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ipc_shmat=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6; } if test $ac_cv_lib_ipc_shmat = yes; 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 { echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6; } if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_ICE_IceConnectionNumber=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ICE_IceConnectionNumber=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6; } if test $ac_cv_lib_ICE_IceConnectionNumber = yes; 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 echo $ECHO_N "checking for the slang library and header files ... $ECHO_C" >&6; } jd_slang_include_dir="" jd_slang_library_dir="" jd_with_slang_library="" # Check whether --with-slang was given. if test "${with_slang+set}" = set; then withval=$with_slang; jd_with_slang_arg=$withval else jd_with_slang_arg=unspecified fi case "x$jd_with_slang_arg" in xno) jd_with_slang_library="no" ;; x) { { echo "$as_me:$LINENO: error: --with-slang requires a value-- try yes or no" >&5 echo "$as_me: error: --with-slang requires a value-- try yes or no" >&2;} { (exit 1); exit 1; }; } ;; xunspecified) ;; xyes) ;; *) jd_slang_include_dir="$jd_with_slang_arg"/include jd_slang_library_dir="$jd_with_slang_arg"/lib ;; esac # Check whether --with-slanglib was given. if test "${with_slanglib+set}" = set; then withval=$with_slanglib; jd_with_slanglib_arg=$withval else jd_with_slanglib_arg=unspecified fi case "x$jd_with_slanglib_arg" in xunspecified) ;; xno) ;; x) { { echo "$as_me:$LINENO: error: --with-slanglib requres a value" >&5 echo "$as_me: error: --with-slanglib requres a value" >&2;} { (exit 1); exit 1; }; } ;; *) jd_slang_library_dir="$jd_with_slanglib_arg" ;; esac # Check whether --with-slanginc was given. if test "${with_slanginc+set}" = set; then withval=$with_slanginc; jd_with_slanginc_arg=$withval else jd_with_slanginc_arg=unspecified fi case "x$jd_with_slanginc_arg" in x) { { echo "$as_me:$LINENO: error: --with-slanginc requres a value" >&5 echo "$as_me: error: --with-slanginc requres a value" >&2;} { (exit 1); exit 1; }; } ;; xunspecified) ;; xno) ;; *) jd_slang_include_dir="$jd_with_slanginc_arg" ;; esac if test X"$jd_with_slang_library" = X then jd_slang_inc_file= jd_with_slang_library="yes" 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 lib_include_dirs="\ $jd_prefix_incdir \ /usr/local/slang/include \ /usr/local/include/slang \ /usr/local/include \ /usr/include/slang \ /usr/slang/include \ /usr/include \ /opt/include/slang \ /opt/slang/include \ /opt/include" for X in $lib_include_dirs do if test -r "$X/$jd_slang_inc_file" then jd_slang_include_dir="$X" break fi done if test X"$jd_slang_include_dir" = X then jd_with_slang_library="no" fi fi if test X"$jd_slang_library_dir" = X then lib_library_dirs="\ $jd_prefix_libdir \ /usr/local/lib \ /usr/local/lib/slang \ /usr/local/slang/lib \ /usr/lib \ /usr/lib/slang \ /usr/slang/lib \ /opt/lib \ /opt/lib/slang \ /opt/slang/lib" case "$host_os" in *darwin* ) exts="dylib so a" ;; *cygwin* ) exts="dll.a so a" ;; * ) exts="so a" esac found=0 for X in $lib_library_dirs do for E in $exts do if test -r "$X/libslang.$E" then jd_slang_library_dir="$X" found=1 break fi done if test $found -eq 1 then break fi done if test X"$jd_slang_library_dir" = X then jd_with_slang_library="no" fi fi fi if test "$jd_with_slang_library" = "yes" then { echo "$as_me:$LINENO: result: yes: $jd_slang_library_dir and $jd_slang_include_dir" >&5 echo "${ECHO_T}yes: $jd_slang_library_dir and $jd_slang_include_dir" >&6; } SLANG_LIB=-L$jd_slang_library_dir if test "X$jd_slang_library_dir" = "X/usr/lib" 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*) 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 RPATH="$RPATH:$jd_slang_library_dir" fi fi fi SLANG_INC=-I$jd_slang_include_dir if test "X$jd_slang_include_dir" = "X/usr/include" then SLANG_INC="" fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } SLANG_INC="" SLANG_LIB="" fi if test "$jd_with_slang_library" = "no" then { { echo "$as_me:$LINENO: error: unable to find the slang library and header file $jd_slang_inc_file" >&5 echo "$as_me: error: unable to find the slang library and header file $jd_slang_inc_file" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: checking for the gsl library and header files gsl/gsl_const_cgsm.h" >&5 echo $ECHO_N "checking for the gsl library and header files gsl/gsl_const_cgsm.h... $ECHO_C" >&6; } jd_gsl_include_dir="" jd_gsl_library_dir="" jd_with_gsl_library="" # 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) { { echo "$as_me:$LINENO: error: --with-gsl requires a value-- try yes or no" >&5 echo "$as_me: error: --with-gsl requires a value-- try yes or no" >&2;} { (exit 1); exit 1; }; } ;; xunspecified) ;; xyes) ;; *) 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) { { echo "$as_me:$LINENO: error: --with-gsllib requres a value" >&5 echo "$as_me: error: --with-gsllib requres a value" >&2;} { (exit 1); exit 1; }; } ;; *) 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) { { echo "$as_me:$LINENO: error: --with-gslinc requres a value" >&5 echo "$as_me: error: --with-gslinc requres a value" >&2;} { (exit 1); exit 1; }; } ;; xunspecified) ;; xno) ;; *) jd_gsl_include_dir="$jd_with_gslinc_arg" ;; esac if test X"$jd_with_gsl_library" = X then jd_gsl_inc_file=gsl/gsl_const_cgsm.h jd_with_gsl_library="yes" 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 lib_include_dirs="\ $jd_prefix_incdir \ /usr/local/gsl/include \ /usr/local/include/gsl \ /usr/local/include \ /usr/include/gsl \ /usr/gsl/include \ /usr/include \ /opt/include/gsl \ /opt/gsl/include \ /opt/include" for X in $lib_include_dirs do if test -r "$X/$jd_gsl_inc_file" then jd_gsl_include_dir="$X" break fi done if test X"$jd_gsl_include_dir" = X then jd_with_gsl_library="no" fi fi if test X"$jd_gsl_library_dir" = X then lib_library_dirs="\ $jd_prefix_libdir \ /usr/local/lib \ /usr/local/lib/gsl \ /usr/local/gsl/lib \ /usr/lib \ /usr/lib/gsl \ /usr/gsl/lib \ /opt/lib \ /opt/lib/gsl \ /opt/gsl/lib" case "$host_os" in *darwin* ) exts="dylib so a" ;; *cygwin* ) exts="dll.a so a" ;; * ) exts="so a" esac found=0 for X in $lib_library_dirs do for E in $exts do if test -r "$X/libgsl.$E" then jd_gsl_library_dir="$X" found=1 break fi done if test $found -eq 1 then break fi done if test X"$jd_gsl_library_dir" = X then jd_with_gsl_library="no" fi fi fi if test "$jd_with_gsl_library" = "yes" then { echo "$as_me:$LINENO: result: yes: $jd_gsl_library_dir and $jd_gsl_include_dir" >&5 echo "${ECHO_T}yes: $jd_gsl_library_dir and $jd_gsl_include_dir" >&6; } GSL_LIB=-L$jd_gsl_library_dir if test "X$jd_gsl_library_dir" = "X/usr/lib" 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*) 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 RPATH="$RPATH:$jd_gsl_library_dir" fi fi fi GSL_INC=-I$jd_gsl_include_dir if test "X$jd_gsl_include_dir" = "X/usr/include" then GSL_INC="" fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } GSL_INC="" GSL_LIB="" fi if test "$jd_with_gsl_library" = "no" then { { echo "$as_me:$LINENO: error: unable to find the gsl library and header file $jd_gsl_inc_file" >&5 echo "$as_me: error: unable to find the gsl library and header file $jd_gsl_inc_file" >&2;} { (exit 1); exit 1; }; } fi slang_h=$jd_slang_include_dir/slang.h { echo "$as_me:$LINENO: checking SLANG_VERSION in $slang_h" >&5 echo $ECHO_N "checking SLANG_VERSION in $slang_h... $ECHO_C" >&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) }'` { echo "$as_me:$LINENO: result: $slang_major_version.$slang_minor_version.$slang_patchlevel_version" >&5 echo "${ECHO_T}$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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for short" >&5 echo $ECHO_N "checking for short... $ECHO_C" >&6; } if test "${ac_cv_type_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_short=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_short=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 echo "${ECHO_T}$ac_cv_type_short" >&6; } # 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. { echo "$as_me:$LINENO: checking size of short" >&5 echo $ECHO_N "checking size of short... $ECHO_C" >&6; } if test "${ac_cv_sizeof_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_short=$ac_lo;; '') if test "$ac_cv_type_short" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_short=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_short=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_short" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_short=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 echo "${ECHO_T}$ac_cv_sizeof_short" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SHORT $ac_cv_sizeof_short _ACEOF { echo "$as_me:$LINENO: checking for int" >&5 echo $ECHO_N "checking for int... $ECHO_C" >&6; } if test "${ac_cv_type_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_int=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 echo "${ECHO_T}$ac_cv_type_int" >&6; } # 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. { echo "$as_me:$LINENO: checking size of int" >&5 echo $ECHO_N "checking size of int... $ECHO_C" >&6; } if test "${ac_cv_sizeof_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_int=$ac_lo;; '') if test "$ac_cv_type_int" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_int=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_int=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_int" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_int=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 echo "${ECHO_T}$ac_cv_sizeof_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF { echo "$as_me:$LINENO: checking for long" >&5 echo $ECHO_N "checking for long... $ECHO_C" >&6; } if test "${ac_cv_type_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 echo "${ECHO_T}$ac_cv_type_long" >&6; } # 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. { echo "$as_me:$LINENO: checking size of long" >&5 echo $ECHO_N "checking size of long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; '') if test "$ac_cv_type_long" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_long=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_long=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF { echo "$as_me:$LINENO: checking for float" >&5 echo $ECHO_N "checking for float... $ECHO_C" >&6; } if test "${ac_cv_type_float+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef float ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_float=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_float=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_float" >&5 echo "${ECHO_T}$ac_cv_type_float" >&6; } # 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. { echo "$as_me:$LINENO: checking size of float" >&5 echo $ECHO_N "checking size of float... $ECHO_C" >&6; } if test "${ac_cv_sizeof_float+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef float ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef float ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef float ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef float ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef float ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_float=$ac_lo;; '') if test "$ac_cv_type_float" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (float) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (float) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_float=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef float ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_float=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_float" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (float) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (float) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_float=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_float" >&5 echo "${ECHO_T}$ac_cv_sizeof_float" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_FLOAT $ac_cv_sizeof_float _ACEOF { echo "$as_me:$LINENO: checking for double" >&5 echo $ECHO_N "checking for double... $ECHO_C" >&6; } if test "${ac_cv_type_double+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef double ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_double=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_double=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_double" >&5 echo "${ECHO_T}$ac_cv_type_double" >&6; } # 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. { echo "$as_me:$LINENO: checking size of double" >&5 echo $ECHO_N "checking size of double... $ECHO_C" >&6; } if test "${ac_cv_sizeof_double+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef double ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef double ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef double ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef double ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef double ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_double=$ac_lo;; '') if test "$ac_cv_type_double" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (double) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (double) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_double=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef double ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_double=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_double" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (double) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (double) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_double=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_double" >&5 echo "${ECHO_T}$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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # Zsh 3.x and 4.x performs 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. 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 echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # 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 } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file 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 -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # 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 # 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.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet 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 ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF RPATH!$RPATH$ac_delim SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim build!$build$ac_delim build_cpu!$build_cpu$ac_delim build_vendor!$build_vendor$ac_delim build_os!$build_os$ac_delim host!$host$ac_delim host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim RANLIB!$RANLIB$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim SET_MAKE!$SET_MAKE$ac_delim CONFIG_DIR!$CONFIG_DIR$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim DYNAMIC_LINK_LIB!$DYNAMIC_LINK_LIB$ac_delim ELF_CC!$ELF_CC$ac_delim ELF_CFLAGS!$ELF_CFLAGS$ac_delim ELF_LINK!$ELF_LINK$ac_delim ELF_LINK_CMD!$ELF_LINK_CMD$ac_delim ELF_DEP_LIBS!$ELF_DEP_LIBS$ac_delim DYNAMIC_LINK_FLAGS!$DYNAMIC_LINK_FLAGS$ac_delim CC_SHARED!$CC_SHARED$ac_delim ELFLIB!$ELFLIB$ac_delim ELFLIB_MAJOR!$ELFLIB_MAJOR$ac_delim ELFLIB_MAJOR_MINOR!$ELFLIB_MAJOR_MINOR$ac_delim ELFLIB_MAJOR_MINOR_MICRO!$ELFLIB_MAJOR_MINOR_MICRO$ac_delim SLANG_LIB_FOR_MODULES!$SLANG_LIB_FOR_MODULES$ac_delim DLL_IMPLIB_NAME!$DLL_IMPLIB_NAME$ac_delim INSTALL_MODULE!$INSTALL_MODULE$ac_delim INSTALL_ELFLIB_TARGET!$INSTALL_ELFLIB_TARGET$ac_delim ELFLIB_BUILD_NAME!$ELFLIB_BUILD_NAME$ac_delim SLANG_DLL_CFLAGS!$SLANG_DLL_CFLAGS$ac_delim XMKMF!$XMKMF$ac_delim X_CFLAGS!$X_CFLAGS$ac_delim X_PRE_LIBS!$X_PRE_LIBS$ac_delim X_LIBS!$X_LIBS$ac_delim X_EXTRA_LIBS!$X_EXTRA_LIBS$ac_delim SLANG_LIB!$SLANG_LIB$ac_delim SLANG_INC!$SLANG_INC$ac_delim GSL_LIB!$GSL_LIB$ac_delim GSL_INC!$GSL_INC$ac_delim slang_version!$slang_version$ac_delim slang_major_version!$slang_major_version$ac_delim slang_minor_version!$slang_minor_version$ac_delim slang_patchlevel_version!$slang_patchlevel_version$ac_delim MODULE_INSTALL_DIR!$MODULE_INSTALL_DIR$ac_delim SL_FILES_INSTALL_DIR!$SL_FILES_INSTALL_DIR$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[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="$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 || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed 's/|#_!!_#|//g' >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 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 "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then 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. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } 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-0.7.0/INSTALL.txt0000644002657400265740000001705110062071264013537 0ustar davisdavisBasic 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-0.7.0/gen/0000755002657400265740000000000010674311422012437 5ustar davisdavisslgsl-0.7.0/gen/template.c0000644002657400265740000002252510665603423014431 0ustar davisdavis/* -*- mode: C; mode: fold; -*- */ /* This file was automatically generated. */ /* Author: John E. Davis (davis@space.mit.edu) */ #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 (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 (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 (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 (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); } #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); } /*}}}*/ #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-0.7.0/gen/codegen0000755002657400265740000005472510244673067014017 0ustar davisdavis#!/usr/bin/env jed-script implements ("codegen"); _debug_info = 1; if (__argc < 3) { () = fprintf (stderr, "Usage: %s module-name files....\n", __argv[0]); exit (1); } private variable Module_Name = __argv[1]; % Customize Here static variable Func_RE = "gsl_[a-zA-Z_0-9]+"; static variable DConst_REs = ["GSL_CONST_[A-Z_0-9]+"]; static 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"; static variable Excluded_Functions = ["min", "max", "exp", "cos", "sin", "tan", "atanh", "asinh", "acosh", "log", "multiply"]; static variable Excluded_Functions_SLang2 = ["hypot"]; static variable Document_Sections = NULL; static 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), "."); } static define make_intrinsic_name (name) { 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; } static 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 static 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; } static 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"); } static 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; } } static 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; } static variable Documented_Constants = Assoc_Type[String_Type]; static 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"); } static 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); } static 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); } static 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); } static 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); } static 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); } static 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); } static 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); } static 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); } static 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); } static 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); } static 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); } static 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); } static 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); } static 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); } static 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); } static 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); } static 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); } static 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); } static 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); } static 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); } static 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); } static 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); } static 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); } % End Documentation Functions static variable Exclude_List = Assoc_Type[Int_Type,0]; foreach (Excluded_Functions) { $1 = (); Exclude_List[$1] = 1; } static variable Exclude_List_SLang2 = Assoc_Type[Int_Type,0]; foreach (Excluded_Functions_SLang2) { $1 = (); Exclude_List_SLang2[$1] = 1; } static variable Include_Files = Assoc_Type[Int_Type]; static 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; } static 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; } static variable Func_Regexps = NULL; static variable DConst_Regexps = NULL; static 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]); foreach (args) { variable arg = (); args_regexp += sprintf (", *\\<%s\\>[^,\\[\\]\\*)]*", arg); macro += Type_Map[arg]; } macro = strup (macro); args_regexp = args_regexp[[1:]]; variable re = sprintf ("%s +\\(\\<%s\\>\\) *(%s)", ret_type, Func_RE, args_regexp); variable s = struct { re, macro, matches, slang1_matches, prototypes, document_func, next }; s.re = re; s.macro = macro; s.matches = Assoc_Type[String_Type]; s.slang1_matches = Assoc_Type[String_Type]; s.prototypes = Assoc_Type[String_Type]; s.next = Func_Regexps; s.document_func = __get_reference ("codegen->doc_fun_" + strlow(macro)); if (s.document_func == NULL) vmessage ("Unable to find %s", "codegen->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"); static 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); } static 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; } } static define find_tag (tag) { bob (); !if (fsearch (tag)) verror ("Unable to find %s tag", tag); delete_line (); } static 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"); } static 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; variable r = Func_Regexps; while (r != NULL) { variable macro = r.macro; foreach (r.matches) using ("keys", "values") { (iname, fname) = (); vinsert ("%s(%s,\"%s\")\n", macro, fname, iname); has_intrinsics++; } r = r.next; } 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"); find_tag (""); r = Func_Regexps; while (r != NULL) { foreach (r.matches) using ("keys", "values") { (iname, fname) = (); vinsert (" MAKE_INTRINSIC_0(\"%s\", SLF(%s), V),\n", iname, fname); } r = r.next; } 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"); find_tag (""); % add code find_tag (""); % add code find_tag (""); r = DConst_Regexps; while (r != NULL) { foreach (r.matches) using ("keys", "values") { (iname, fname) = (); 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) { foreach (r.prototypes) using ("keys", "values") { variable prototype; (iname, prototype) = (); %vinsert ("%s: %s: %s\n", macro, iname, prototype); (@r.document_func)(iname, prototype); } r = r.next; } if (has_intrinsics) write_function_documentation (); if (has_dconstants) write_constants_documentation (); save_buffer (); } static define main () { variable module_name = Module_Name; foreach (__argv[[2:]]) { variable file = (); process_file (file); } dump_results (module_name); exit (0); } main (); slgsl-0.7.0/gen/Makefile0000644002657400265740000000126110674311065014102 0ustar davisdavisSRCDIR = ../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 all: $(AUTOGEN_SOURCES) gslsf-module.c: template.c codegen ./codegen gslsf $(PREFIX)/include/gsl/gsl_sf*.h gslconst-module.c: template.c codegen ./codegen gslconst $(PREFIX)/include/gsl/gsl_const*.h gslcdf-module.c: template.c codegen ./codegen gslcdf $(PREFIX)/include/gsl/gsl_cdf*.h # $(PREFIX)/include/gsl/gsl_randist.h install: $(AUTOGEN_SOURCES) mv $(AUTOGEN_SOURCES) $(SRCDIR) mv $(AUTOGEN_DOCS) $(DOCDIR) clean: /bin/rm -f *~ \#* $(AUTOGEN_SOURCES) slgsl-0.7.0/gen/README0000644002657400265740000000026410062071264013317 0ustar davisdavisThis 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-0.7.0/NEWS0000644002657400265740000000061510674311065012372 0ustar davisdavis-*-text-*- 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-0.7.0/ChangeLog0000644002657400265740000000404210665603423013445 0ustar davisdavis2007-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-0.7.0/COPYRIGHT0000644002657400265740000000261010674311065013163 0ustar davisdavis Copyright (c) 2003-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. slgsl-0.7.0/autoconf/0000755002657400265740000000000010674311422013504 5ustar davisdavisslgsl-0.7.0/autoconf/Makefile.in0000644002657400265740000000127610330241655015556 0ustar davisdavis# -*- 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 test: cd src; $(MAKE) test install: cd src; $(MAKE) install # # These targets are used by the maintainer # configure: autoconf/aclocal.m4 autoconf/configure.ac cd autoconf && autoconf && mv ./configure .. update: autoconf/config.sub autoconf/config.guess autoconf/config.guess: /usr/share/misc/config.guess /bin/cp -f /usr/share/misc/config.guess autoconf/config.guess autoconf/config.sub: /usr/share/misc/config.sub /bin/cp -f /usr/share/misc/config.sub autoconf/config.sub slgsl-0.7.0/autoconf/configure.ac0000644002657400265740000000226610665214006016000 0ustar davisdavisdnl -*- 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-0.7.0/autoconf/mkinsdir.sh0000755002657400265740000000113610062071264015662 0ustar davisdavis#! /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-0.7.0/autoconf/config.guess0000755002657400265740000012546610330241655016041 0ustar davisdavis#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. timestamp='2005-04-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 2 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # 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. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -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 (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 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 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # 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 -q "$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 ;' # 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 # 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 tupples: *-*-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=`(/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 ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null 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 # 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/[-_].*/\./'` ;; 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}" exit 0 ;; amd64:OpenBSD:*:*) echo x86_64-unknown-openbsd${UNAME_RELEASE} exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; cats:OpenBSD:*:*) echo arm-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; luna88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mips64-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit 0 ;; macppc:MirBSD:*:*) echo powerppc-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; 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'` exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit 0 ;; *:OS400:*:*) echo powerpc-ibm-os400 exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; 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 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit 0 ;; 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 0 ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; 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 0 ;; 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 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; 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 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; # 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 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; 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 \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; 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 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????: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 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; 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 0 ;; *: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 $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo rs6000-ibm-aix3.2.5 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 0 ;; *:AIX:*:[45]) 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/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 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 # avoid double evaluation of $set_cc_for_build test -n "$CC_FOR_BUILD" || eval $set_cc_for_build if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 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 && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; 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 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; 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 0 ;; 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 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x86:Interix*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; amd64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit 0 ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit 0 ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #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-gnu" && exit 0 ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #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-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; 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 ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; 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-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; 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 0 ;; 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 0 ;; 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 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V: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 0 ;; i*86:*:5:[78]*) 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 0 ;; 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 0 ;; 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 i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; 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 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit 0 ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit 0 ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 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 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *: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 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; 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 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in *86) UNAME_PROCESSOR=i686 ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *: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 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit 0 ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *: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 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit 0 ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms && exit 0 ;; I*) echo ia64-dec-vms && exit 0 ;; V*) echo vax-dec-vms && exit 0 ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp 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` /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-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: slgsl-0.7.0/autoconf/config.sub0000755002657400265740000007547010330241655015503 0ustar davisdavis#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. timestamp='2005-04-22' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # 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 2 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # 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. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # 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. # 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 $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -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 (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 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 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # 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 0;; * ) 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-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) 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) os= basic_machine=$1 ;; -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 ;; -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/'` ;; -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*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -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 \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # 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-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | msp430-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; # 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-unknown 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 ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; 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 ;; cr16c) basic_machine=cr16c-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 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; 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 ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? 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 ;; i386-vsta | 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 ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; 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 ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; 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 ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; 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 ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; 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) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) 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 | ppc64-le | powerpc64-little) 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 ;; 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 ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | 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 ;; 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 ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; 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 ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; 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 ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; 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. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First 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* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ | -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* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) # 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 | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -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 ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -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 ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -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 *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) 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 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; 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 ;; *-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 ;; *-next) os=-nextstep3 ;; *-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 ;; -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 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: slgsl-0.7.0/autoconf/aclocal.m40000644002657400265740000006162210665603423015360 0ustar davisdavisdnl# -*- mode: sh; mode: fold -*- 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. dnl# 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, [ --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" # 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) \$("$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) \$("$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_MSG_CHECKING(for Terminfo) MISC_TERMINFO_DIRS="$FINKPREFIX/share/terminfo" if test ! -d $MISC_TERMINFO_DIRS then MISC_TERMINFO_DIRS="" fi JD_Terminfo_Dirs="/usr/lib/terminfo \ /usr/share/terminfo \ /usr/share/lib/terminfo \ /usr/local/lib/terminfo \ $MISC_TERMINFO_DIRS" 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) fi AC_SUBST(TERMCAP)dnl AC_SUBST(MISC_TERMINFO_DIRS)dnl ]) dnl#}}} AC_DEFUN(JD_ANSI_CC, dnl#{{{ [ AC_PROG_CC AC_PROG_CPP AC_PROG_GCC_TRADITIONAL AC_ISC_POSIX AC_AIX 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) 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_TRY_COMPILE([ ],[ 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="" AC_CHECK_HEADER(dlfcn.h,[ AC_DEFINE(HAVE_DLFCN_H) AC_CHECK_LIB(dl,dlopen,[ DYNAMIC_LINK_LIB="-ldl" AC_DEFINE(HAVE_DLOPEN) ],[ AC_CHECK_FUNC(dlopen,AC_DEFINE(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_DATA)" SLANG_DLL_CFLAGS="" case "$host_os" in *linux*|*gnu*|k*bsd*-gnu ) DYNAMIC_LINK_FLAGS="-Wl,-export-dynamic" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -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="\$(CC) \$(CFLAGS) -shared -fPIC" ;; *solaris* ) if test "$GCC" = yes then DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-ztext -Wl,-h,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED="\$(CC) \$(CFLAGS) -G -fPIC" else DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -K PIC" ELF_LINK="\$(CC) \$(LDFLAGS) -G -h\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED="\$(CC) \$(CFLAGS) -G -K PIC" 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) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-h,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED="\$(CC) \$(CFLAGS) -G -fPIC" else DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -K pic" # ELF_LINK="ld -G -z text -h#" ELF_LINK="\$(CC) \$(LDFLAGS) -G -z text -h\$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED="\$(CC) \$(CFLAGS) -G -K pic" 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) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-h,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED="\$(CC) \$(CFLAGS) -shared -fPIC" else DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS)" # default anyhow ELF_LINK="\$(CC) \$(LDFLAGS) -shared -o \$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED="\$(CC) \$(CFLAGS) -shared" fi ;; *darwin* ) DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -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="\$(CC) -bundle -flat_namespace -undefined suppress \$(CFLAGS) -fno-common" 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) -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="\$(CC) \$(CFLAGS) -shared -fPIC" ;; *cygwin* ) DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" SLANG_DLL_CFLAGS="-DSLANG_DLL=1" ELF_CFLAGS="\$(CFLAGS) -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="\$(CC) \$(CFLAGS) -shared -DSLANG_DLL=1" 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="lib\$(THIS_LIB)\$(ELF_MAJOR_VERSION).dll" ELFLIB_MAJOR_MINOR="lib\$(THIS_LIB)\$(ELF_MAJOR_VERSION)_\$(ELF_MINOR_VERSION).dll" ELFLIB_MAJOR_MINOR_MICRO="lib\$(THIS_LIB)\$(ELF_MAJOR_VERSION)_\$(ELF_MINOR_VERSION)_\$(ELF_MICRO_VERSION).dll" ELFLIB_BUILD_NAME="\$(ELFLIB_MAJOR)" ;; * ) echo "Note: ELF compiler for host_os=$host_os may be wrong" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED="\$(CC) \$(CFLAGS) -shared -fPIC" 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) 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) ]) 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="" jd_with_$1_library="" 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) AC_MSG_ERROR(--with-$1 requires a value-- try yes or no) ;; xunspecified) ;; xyes) ;; *) 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_$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_$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 AC_DEFUN(JD_CHECK_FOR_LIBRARY, dnl#{{{ [ AC_REQUIRE([JD_EXPAND_PREFIX])dnl AC_MSG_CHECKING(for the $1 library and header files $2) dnl JD_UPPERCASE($1,JD_ARG1) JD_WITH_LIBRARY_PATHS($1) if test X"$jd_with_$1_library" = X then jd_$1_inc_file=$2 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 lib_include_dirs="\ $jd_prefix_incdir \ /usr/local/$1/include \ /usr/local/include/$1 \ /usr/local/include \ /usr/include/$1 \ /usr/$1/include \ /usr/include \ /opt/include/$1 \ /opt/$1/include \ /opt/include" for X in $lib_include_dirs do if test -r "$X/$jd_$1_inc_file" then jd_$1_include_dir="$X" break fi done if test X"$jd_$1_include_dir" = X then jd_with_$1_library="no" fi fi if test X"$jd_$1_library_dir" = X then lib_library_dirs="\ $jd_prefix_libdir \ /usr/local/lib \ /usr/local/lib/$1 \ /usr/local/$1/lib \ /usr/lib \ /usr/lib/$1 \ /usr/$1/lib \ /opt/lib \ /opt/lib/$1 \ /opt/$1/lib" case "$host_os" in *darwin* ) exts="dylib so a" ;; *cygwin* ) exts="dll.a so a" ;; * ) exts="so a" esac found=0 for X in $lib_library_dirs do for E in $exts do if test -r "$X/lib$1.$E" then jd_$1_library_dir="$X" found=1 break fi done if test $found -eq 1 then break fi done if test X"$jd_$1_library_dir" = X then jd_with_$1_library="no" fi fi fi if test "$jd_with_$1_library" = "yes" then AC_MSG_RESULT(yes: $jd_$1_library_dir and $jd_$1_include_dir) 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 if test "X$jd_$1_library_dir" = "X/usr/lib" then JD_ARG1[]_LIB="" else JD_SET_RPATH($jd_$1_library_dir) fi JD_ARG1[]_INC=-I$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_ARG1[]_INC="" JD_ARG1[]_LIB="" fi AC_SUBST(JD_ARG1[]_LIB) AC_SUBST(JD_ARG1[]_INC) ]) dnl#}}} AC_DEFUN(JD_WITH_LIBRARY, dnl#{{{ [ JD_CHECK_FOR_LIBRARY($1, $2) 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-0.7.0/autoconf/install-sh0000755002657400265740000001273610062071264015517 0ustar davisdavis#!/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-0.7.0/gsl.lis0000644002657400265740000000233610665603423013175 0ustar davisdavis@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-0.7.0/README0000644002657400265740000000515110674311065012553 0ustar davisdavisThe 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 1.4 of the GSL library. Unfortunately, version 1.4 is _NOT_ backwards compatible with earlier versions of GSL. 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/modules/ (slang-1) $prefix/lib/slang/v2/modules/ (slang-2) 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.