Changeset 61


Ignore:
Timestamp:
Dec 7, 2009 9:49:34 AM (10 years ago)
Author:
awalther
Message:

inclusion of error function for gcc compiler

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/ADOL-C/src/Makefile.am

    r42 r61  
    4545lib_LTLIBRARIES      = libadolc.la
    4646
    47 libadolc_la_LDFLAGS  = -version-info 0:0:0
     47libadolc_la_LDFLAGS  = -version-info 2:1:1
    4848
    4949if SPARSE
  • trunk/ADOL-C/src/Makefile.in

    r40 r61  
    186186lib_LTLIBRARIES = libadolc.la
    187187
    188 libadolc_la_LDFLAGS = -version-info 0:0:0
     188libadolc_la_LDFLAGS = -version-info 2:1:1
    189189
    190190@SPARSE_TRUE@libadolc_la_SOURCES = adalloc.c malloc.c adouble.cpp \
  • trunk/ADOL-C/src/adouble.cpp

    r42 r61  
    2525#include <taping_p.h>
    2626
     27using namespace std;
     28
    2729/****************************************************************************/
    2830/*                                                        HELPFUL FUNCTIONS */
     
    15521554
    15531555    ADOLC_GLOBAL_TAPE_VARS.store[locat] =
    1554         ADOLC_MATH_NSP::asinh(ADOLC_GLOBAL_TAPE_VARS.store[x.location]);
     1556        ADOLC_MATH_NSP_ERF::asinh(ADOLC_GLOBAL_TAPE_VARS.store[x.location]);
    15551557    ADOLC_OPENMP_RESTORE_THREAD_NUMBER;
    15561558    return locat;
     
    15781580
    15791581    ADOLC_GLOBAL_TAPE_VARS.store[locat] =
    1580         ADOLC_MATH_NSP::acosh(ADOLC_GLOBAL_TAPE_VARS.store[x.location]);
     1582        ADOLC_MATH_NSP_ERF::acosh(ADOLC_GLOBAL_TAPE_VARS.store[x.location]);
    15811583    ADOLC_OPENMP_RESTORE_THREAD_NUMBER;
    15821584    return locat;
     
    16041606
    16051607    ADOLC_GLOBAL_TAPE_VARS.store[locat] =
    1606         ADOLC_MATH_NSP::atanh(ADOLC_GLOBAL_TAPE_VARS.store[x.location]);
     1608        ADOLC_MATH_NSP_ERF::atanh(ADOLC_GLOBAL_TAPE_VARS.store[x.location]);
    16071609    ADOLC_OPENMP_RESTORE_THREAD_NUMBER;
    16081610    return locat;
     
    16161618    locint locat = next_loc();
    16171619
    1618     adouble y = exp(-x*x);
     1620    adouble y = 2.0 /
     1621        ADOLC_MATH_NSP_ERF::sqrt(ADOLC_MATH_NSP::acos(-1.0))*exp(-x*x);
    16191622
    16201623    if (ADOLC_CURRENT_TAPE_INFOS.traceFlag) { // old: write_quad(erf_op,locat,x.location,y.location);
     
    16301633
    16311634    ADOLC_GLOBAL_TAPE_VARS.store[locat] =
    1632         ADOLC_MATH_NSP::erf(ADOLC_GLOBAL_TAPE_VARS.store[x.location]);
     1635        ADOLC_MATH_NSP_ERF::erf(ADOLC_GLOBAL_TAPE_VARS.store[x.location]);
    16331636    ADOLC_OPENMP_RESTORE_THREAD_NUMBER;
    16341637    return locat;
  • trunk/ADOL-C/src/adouble.h

    r42 r61  
    3434using std::ostream;
    3535using std::istream;
     36#ifdef ATRIG_ERF
     37#if defined(AD_ERR_FUN)
     38#include <tr1/cmath>
     39#endif
     40#endif
    3641
    3742#include <common.h>
     
    10111016adouble asinh (const adouble &a) {
    10121017    adouble tmp;
    1013     tmp.val=ADOLC_MATH_NSP::asinh(a.val);
     1018    tmp.val=ADOLC_MATH_NSP_ERF::asinh(a.val);
    10141019    double tmp2=ADOLC_MATH_NSP::sqrt(a.val*a.val+1);
    10151020    FOR_I_EQ_0_LT_NUMDIR
     
    10201025adouble acosh (const adouble &a) {
    10211026    adouble tmp;
    1022     tmp.val=ADOLC_MATH_NSP::acosh(a.val);
     1027    tmp.val=ADOLC_MATH_NSP_ERF::acosh(a.val);
    10231028    double tmp2=ADOLC_MATH_NSP::sqrt(a.val*a.val-1);
    10241029    FOR_I_EQ_0_LT_NUMDIR
     
    10291034adouble atanh (const adouble &a) {
    10301035    adouble tmp;
    1031     tmp.val=ADOLC_MATH_NSP::atanh(a.val);
     1036    tmp.val=ADOLC_MATH_NSP_ERF::atanh(a.val);
    10321037    double tmp2=1-a.val*a.val;
    10331038    FOR_I_EQ_0_LT_NUMDIR
     
    12291234adouble erf (const adouble &a) {
    12301235    adouble tmp;
    1231     tmp.val=ADOLC_MATH_NSP::erf(a.val);
     1236    tmp.val=ADOLC_MATH_NSP_ERF::erf(a.val);
    12321237    double tmp2 = 2.0 /
    1233         ADOLC_MATH_NSP::sqrt(ADOLC_MATH_NSP::acos(-1.0)) *
    1234         ADOLC_MATH_NSP::exp(-a.val*a.val);
     1238        ADOLC_MATH_NSP_ERF::sqrt(ADOLC_MATH_NSP::acos(-1.0)) *
     1239        ADOLC_MATH_NSP_ERF::exp(-a.val*a.val);
    12351240    FOR_I_EQ_0_LT_NUMDIR
    12361241    tmp.ADVAL_I=tmp2*a.ADVAL_I;
  • trunk/ADOL-C/src/drivers/drivers.c

    r42 r61  
    4545int gradient(short tag,
    4646             int n,
    47              double* argument,
     47             const double* argument,
    4848             double* result) {
    4949    int rc= -1;
  • trunk/ADOL-C/src/drivers/drivers.h

    r42 r61  
    3434/*                                                                 gradient */
    3535/* gradient(tag, n, x[n], g[n])                                             */
    36 ADOLC_DLL_EXPORT int gradient(short,int,double*,double*);
     36ADOLC_DLL_EXPORT int gradient(short,int,const double*,double*);
    3737ADOLC_DLL_EXPORT fint gradient_(fint*,fint*,fdouble*,fdouble*);
    3838
  • trunk/ADOL-C/src/dvlparms.h

    r42 r61  
    2929/* Tells ADOL-C which name space offers the mathematical functions          */
    3030#define ADOLC_MATH_NSP std
     31/* For error function with gcc compiler                                     */
     32#define ADOLC_MATH_NSP_ERF std::tr1
    3133
    3234/*--------------------------------------------------------------------------*/
  • trunk/configure

    r58 r61  
    2202222022             fi
    2202322023             ac_adolc_cflags="$ac_adolc_cflags $ac_adolc_openmpflag"
     22024             if test "$GCC" = yes; then
     22025                ac_adolc_cflags="$ac_adolc_cflags -DAD_ERR_FUN=1"
     22026             fi
     22027
    2202422028
    2202522029             { echo "$as_me:$LINENO: result: $ac_adolc_cflags" >&5
     
    2205322057             fi
    2205422058             ac_adolc_cxxflags="$ac_adolc_cxxflags $ac_adolc_openmpflag"
     22059             if test "$GCC" = yes; then
     22060                ac_adolc_cxxflags="$ac_adolc_cxxflags -DAD_ERR_FUN=1"
     22061             fi
    2205522062
    2205622063             { echo "$as_me:$LINENO: result: $ac_adolc_cxxflags" >&5
     
    2356823575  esac
    2356923576
    23570 
    2357123577# echo configuration
    2357223578echo \
  • trunk/configure.ac

    r57 r61  
    202202             fi
    203203             ac_adolc_cflags="$ac_adolc_cflags $ac_adolc_openmpflag"
     204             if test "$GCC" = yes; then
     205                ac_adolc_cflags="$ac_adolc_cflags -DAD_ERR_FUN=1"
     206             fi
     207
    204208             AC_SUBST(ac_adolc_cflags)
    205209             AC_MSG_RESULT($ac_adolc_cflags)])
     
    227231             fi
    228232             ac_adolc_cxxflags="$ac_adolc_cxxflags $ac_adolc_openmpflag"
     233             if test "$GCC" = yes; then
     234                ac_adolc_cxxflags="$ac_adolc_cxxflags -DAD_ERR_FUN=1"
     235             fi
    229236             AC_SUBST(ac_adolc_cxxflags)
    230237             AC_MSG_RESULT($ac_adolc_cxxflags)])
     
    306313AC_COIN_PATCH_LIBTOOL_CYGWIN
    307314
    308 
    309315# echo configuration
    310316echo \
Note: See TracChangeset for help on using the changeset viewer.