From 54bcc1fc1e0f9676cb10f627f412eeeea34b5d2c Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Wed, 24 Feb 2010 13:23:42 +0000 Subject: created package hmatrix-special --- packages/special/lib/Numeric/GSL/Special/Log.hs | 64 +++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 packages/special/lib/Numeric/GSL/Special/Log.hs (limited to 'packages/special/lib/Numeric/GSL/Special/Log.hs') diff --git a/packages/special/lib/Numeric/GSL/Special/Log.hs b/packages/special/lib/Numeric/GSL/Special/Log.hs new file mode 100644 index 0000000..a57b67a --- /dev/null +++ b/packages/special/lib/Numeric/GSL/Special/Log.hs @@ -0,0 +1,64 @@ +------------------------------------------------------------ +-- | +-- Module : Numeric.GSL.Special.Log +-- Copyright : (c) Alberto Ruiz 2006 +-- License : GPL +-- Maintainer : Alberto Ruiz (aruiz at um dot es) +-- Stability : provisional +-- Portability : uses ffi +-- +-- Wrappers for selected functions described at: +-- +-- +------------------------------------------------------------ + +module Numeric.GSL.Special.Log( + log_e +, Numeric.GSL.Special.Log.log +, log_abs_e +, log_abs +, log_1plusx_e +, log_1plusx +, log_1plusx_mx_e +, log_1plusx_mx +) where + +import Foreign(Ptr) +import Foreign.C.Types(CInt) +import Numeric.GSL.Special.Internal + +log_e :: Double -> (Double,Double) +log_e x = createSFR "log_e" $ gsl_sf_log_e x +foreign import ccall SAFE_CHEAP "gsl_sf_log_e" gsl_sf_log_e :: Double -> Ptr () -> IO CInt + +log :: Double -> Double +log = gsl_sf_log +foreign import ccall SAFE_CHEAP "gsl_sf_log" gsl_sf_log :: Double -> Double + +log_abs_e :: Double -> (Double,Double) +log_abs_e x = createSFR "log_abs_e" $ gsl_sf_log_abs_e x +foreign import ccall SAFE_CHEAP "gsl_sf_log_abs_e" gsl_sf_log_abs_e :: Double -> Ptr () -> IO CInt + +log_abs :: Double -> Double +log_abs = gsl_sf_log_abs +foreign import ccall SAFE_CHEAP "gsl_sf_log_abs" gsl_sf_log_abs :: Double -> Double + +complex_log_e :: Double -> Double -> Ptr () -> (Double,Double) +complex_log_e zr zi lnr = createSFR "complex_log_e" $ gsl_sf_complex_log_e zr zi lnr +foreign import ccall SAFE_CHEAP "gsl_sf_complex_log_e" gsl_sf_complex_log_e :: Double -> Double -> Ptr () -> Ptr () -> IO CInt + +log_1plusx_e :: Double -> (Double,Double) +log_1plusx_e x = createSFR "log_1plusx_e" $ gsl_sf_log_1plusx_e x +foreign import ccall SAFE_CHEAP "gsl_sf_log_1plusx_e" gsl_sf_log_1plusx_e :: Double -> Ptr () -> IO CInt + +log_1plusx :: Double -> Double +log_1plusx = gsl_sf_log_1plusx +foreign import ccall SAFE_CHEAP "gsl_sf_log_1plusx" gsl_sf_log_1plusx :: Double -> Double + +log_1plusx_mx_e :: Double -> (Double,Double) +log_1plusx_mx_e x = createSFR "log_1plusx_mx_e" $ gsl_sf_log_1plusx_mx_e x +foreign import ccall SAFE_CHEAP "gsl_sf_log_1plusx_mx_e" gsl_sf_log_1plusx_mx_e :: Double -> Ptr () -> IO CInt + +log_1plusx_mx :: Double -> Double +log_1plusx_mx = gsl_sf_log_1plusx_mx +foreign import ccall SAFE_CHEAP "gsl_sf_log_1plusx_mx" gsl_sf_log_1plusx_mx :: Double -> Double -- cgit v1.2.3