Changeset 376


Ignore:
Timestamp:
Dec 14, 2012 6:22:56 AM (7 years ago)
Author:
kulshres
Message:

use the option --enable-advanced-branching for new comparison operations

the configure option --enable-advanced-branching sets ADOLC_ADVANCED_BRANCHING
and this is unset by default. The new comparison operators that can
handle branching in conjunction with condassign and advectors will only
be compiled if this option is used.

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

Location:
trunk/ADOL-C
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/ADOL-C/include/adolc/adouble.h

    r360 r376  
    136136    /*--------------------------------------------------------------------------*/
    137137    /* Comparison (friends) */
     138#if defined(ADOLC_ADVANCED_BRANCHING)
    138139    friend ADOLC_DLL_EXPORT adub operator != ( const badouble&, const badouble& );
    139     //inline friend int operator != ( const badouble&, const badouble& );
     140    friend ADOLC_DLL_EXPORT adub operator == ( const badouble&, const badouble& );
     141    friend ADOLC_DLL_EXPORT adub operator <= ( const badouble&, const badouble& );
     142    friend ADOLC_DLL_EXPORT adub operator >= ( const badouble&, const badouble& );
     143    friend ADOLC_DLL_EXPORT adub operator >  ( const badouble&, const badouble& );
     144    friend ADOLC_DLL_EXPORT adub operator <  ( const badouble&, const badouble& );
     145#else
     146    inline friend int operator != ( const badouble&, const badouble& );
     147    inline friend int operator == ( const badouble&, const badouble& );
     148    inline friend int operator <= ( const badouble&, const badouble& );
     149    inline friend int operator >= ( const badouble&, const badouble& );
     150    inline friend int operator >  ( const badouble&, const badouble& );
     151    inline friend int operator <  ( const badouble&, const badouble& );
     152#endif
    140153    inline friend int operator != ( double, const badouble& );
    141154    friend ADOLC_DLL_EXPORT int operator != ( const badouble&, double );
    142     friend ADOLC_DLL_EXPORT adub operator == ( const badouble&, const badouble& );
    143     //inline friend int operator == ( const badouble&, const badouble& );
    144155    inline friend int operator == ( double, const badouble& );
    145156    friend ADOLC_DLL_EXPORT int operator == ( const badouble&, double );
    146     friend ADOLC_DLL_EXPORT adub operator <= ( const badouble&, const badouble& );
    147     //inline friend int operator <= ( const badouble&, const badouble& );
    148157    inline friend int operator <= ( double, const badouble& );
    149158    friend ADOLC_DLL_EXPORT int operator <= ( const badouble&, double );
    150     friend ADOLC_DLL_EXPORT adub operator >= ( const badouble&, const badouble& );
    151     //inline friend int operator >= ( const badouble&, const badouble& );
    152159    inline friend int operator >= ( double, const badouble& );
    153160    friend ADOLC_DLL_EXPORT int operator >= ( const badouble&, double );
    154     friend ADOLC_DLL_EXPORT adub operator >  ( const badouble&, const badouble& );
    155     //inline friend int operator >  ( const badouble&, const badouble& );
    156161    inline friend int operator >  ( double, const badouble& );
    157162    friend ADOLC_DLL_EXPORT int operator >  ( const badouble&, double );
    158     friend ADOLC_DLL_EXPORT adub operator <  ( const badouble&, const badouble& );
    159     //inline friend int operator <  ( const badouble&, const badouble& );
    160163    inline friend int operator <  ( double, const badouble& );
    161164    friend ADOLC_DLL_EXPORT int operator <  ( const badouble&, double );
     
    393396/*--------------------------------------------------------------------------*/
    394397/* Comparison */
    395 /*
     398
     399#if !defined(ADOLC_ADVANCED_BRANCHING)
    396400inline int operator != ( const badouble& u, const badouble& v ) {
    397401    return (u-v != 0);
    398402}
    399 */
     403
     404inline int operator == ( const badouble& u, const badouble& v ) {
     405    return (u-v == 0);
     406}
     407
     408inline int operator <= ( const badouble& u, const badouble& v ) {
     409    return (u-v <= 0);
     410}
     411
     412inline int operator >= ( const badouble& u, const badouble& v ) {
     413    return (u-v >= 0);
     414}
     415
     416inline int operator > ( const badouble& u, const badouble& v ) {
     417    return (u-v > 0);
     418}
     419
     420inline int operator < ( const badouble& u, const badouble& v ) {
     421    return (u-v < 0);
     422}
     423#endif
    400424
    401425inline int operator != ( double coval, const badouble& v) {
     
    406430}
    407431
    408 /*
    409 inline int operator == ( const badouble& u, const badouble& v ) {
    410     return (u-v == 0);
    411 }
    412 */
    413 
    414432inline int operator == ( double coval, const badouble& v) {
    415433    if (coval)
     
    419437}
    420438
    421 /*
    422 inline int operator <= ( const badouble& u, const badouble& v ) {
    423     return (u-v <= 0);
    424 }
    425 */
    426 
    427439inline int operator <= ( double coval, const badouble& v ) {
    428440    if (coval)
     
    432444}
    433445
    434 /*
    435 inline int operator >= ( const badouble& u, const badouble& v ) {
    436     return (u-v >= 0);
    437 }
    438 */
    439 
    440446inline int operator >= ( double coval, const badouble& v ) {
    441447    if (coval)
     
    445451}
    446452
    447 /*
    448 inline int operator > ( const badouble& u, const badouble& v ) {
    449     return (u-v > 0);
    450 }
    451 */
    452 
    453453inline int operator > ( double coval, const badouble& v ) {
    454454    if (coval)
     
    457457        return (v < 0);
    458458}
    459 
    460 /*
    461 inline int operator < ( const badouble& u, const badouble& v ) {
    462     return (u-v < 0);
    463 }
    464 */
    465459
    466460inline int operator < ( double coval, const badouble& v ) {
  • trunk/ADOL-C/src/adouble.cpp

    r360 r376  
    17511751/*                                                             CONDITIONALS */
    17521752/*--------------------------------------------------------------------------*/
     1753#if defined(ADOLC_ADVANCED_BRANCHING)
    17531754adub operator != (const badouble& x, const badouble& y) {
    17541755    ADOLC_OPENMP_THREAD_NUMBER;
     
    18821883    return locat;
    18831884}
     1885#endif
    18841886/*--------------------------------------------------------------------------*/
    18851887/*--------------------------------------------------------------------------*/
  • trunk/ADOL-C/src/fo_rev.c

    r370 r376  
    16691669                /* NEW CONDITIONALS */
    16701670                /*--------------------------------------------------------------------------*/
     1671#if defined(ADOLC_ADVANCED_BRANCHING)
    16711672            case neq_a_a:
    16721673            case eq_a_a:
     
    16951696
    16961697                break;
     1698#endif
    16971699                /*--------------------------------------------------------------------------*/
    16981700            case subscript:
  • trunk/ADOL-C/src/ho_rev.c

    r360 r376  
    20432043                /* NEW CONDITIONALS */
    20442044                /*--------------------------------------------------------------------------*/
     2045#if defined(ADOLC_ADVANCED_BRANCHING)
    20452046            case neq_a_a:
    20462047            case eq_a_a:
     
    20602061                GET_TAYL(res,k,p)
    20612062                break;
     2063#endif
    20622064
    20632065                /*--------------------------------------------------------------------------*/
  • trunk/ADOL-C/src/uni5_for.c

    r372 r376  
    39843984                /* NEW CONDITIONALS */
    39853985                /*--------------------------------------------------------------------------*/
     3986#if defined(ADOLC_ADVANCED_BRANCHING)
    39863987            case neq_a_a:
    39873988            case eq_a_a:
     
    40524053
    40534054                break;
     4055#endif /* ADVANCED_BRANCHING */
    40544056
    40554057                /*--------------------------------------------------------------------------*/
Note: See TracChangeset for help on using the changeset viewer.