Changeset 360 for trunk/ADOL-C/include


Ignore:
Timestamp:
Oct 19, 2012 5:22:43 AM (7 years ago)
Author:
kulshres
Message:

implement traced logical operators for condassign and advector

this will help to handle code branching as long as condassign or
advector based generalized conditional assignment is used.

These operators are only used if both operands are badoubles. If the
old behaviour is required then at least one of the two operands must
be a double.

For if-then-else branches the old behaviour should continue and we can do
nothing.

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

File:
1 edited

Legend:

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

    r354 r360  
    136136    /*--------------------------------------------------------------------------*/
    137137    /* Comparison (friends) */
    138     inline friend int operator != ( const badouble&, const badouble& );
     138    friend ADOLC_DLL_EXPORT adub operator != ( const badouble&, const badouble& );
     139    //inline friend int operator != ( const badouble&, const badouble& );
    139140    inline friend int operator != ( double, const badouble& );
    140141    friend ADOLC_DLL_EXPORT int operator != ( const badouble&, double );
    141     inline friend int operator == ( const badouble&, const badouble& );
     142    friend ADOLC_DLL_EXPORT adub operator == ( const badouble&, const badouble& );
     143    //inline friend int operator == ( const badouble&, const badouble& );
    142144    inline friend int operator == ( double, const badouble& );
    143145    friend ADOLC_DLL_EXPORT int operator == ( const badouble&, double );
    144     inline friend int operator <= ( const badouble&, const badouble& );
     146    friend ADOLC_DLL_EXPORT adub operator <= ( const badouble&, const badouble& );
     147    //inline friend int operator <= ( const badouble&, const badouble& );
    145148    inline friend int operator <= ( double, const badouble& );
    146149    friend ADOLC_DLL_EXPORT int operator <= ( const badouble&, double );
    147     inline friend int operator >= ( const badouble&, const badouble& );
     150    friend ADOLC_DLL_EXPORT adub operator >= ( const badouble&, const badouble& );
     151    //inline friend int operator >= ( const badouble&, const badouble& );
    148152    inline friend int operator >= ( double, const badouble& );
    149153    friend ADOLC_DLL_EXPORT int operator >= ( const badouble&, double );
    150     inline friend int operator >  ( const badouble&, const badouble& );
     154    friend ADOLC_DLL_EXPORT adub operator >  ( const badouble&, const badouble& );
     155    //inline friend int operator >  ( const badouble&, const badouble& );
    151156    inline friend int operator >  ( double, const badouble& );
    152157    friend ADOLC_DLL_EXPORT int operator >  ( const badouble&, double );
    153     inline friend int operator <  ( const badouble&, const badouble& );
     158    friend ADOLC_DLL_EXPORT adub operator <  ( const badouble&, const badouble& );
     159    //inline friend int operator <  ( const badouble&, const badouble& );
    154160    inline friend int operator <  ( double, const badouble& );
    155161    friend ADOLC_DLL_EXPORT int operator <  ( const badouble&, double );
     
    269275public:
    270276
     277    /*--------------------------------------------------------------------------*/
     278    /* Comparison (friends) */
     279    friend ADOLC_DLL_EXPORT adub operator != ( const badouble&, const badouble& );
     280    friend ADOLC_DLL_EXPORT adub operator == ( const badouble&, const badouble& );
     281    friend ADOLC_DLL_EXPORT adub operator <= ( const badouble&, const badouble& );
     282    friend ADOLC_DLL_EXPORT adub operator >= ( const badouble&, const badouble& );
     283    friend ADOLC_DLL_EXPORT adub operator < ( const badouble&, const badouble& );
     284    friend ADOLC_DLL_EXPORT adub operator > ( const badouble&, const badouble& );
    271285    /*--------------------------------------------------------------------------*/
    272286    /* sign operators (friends) */
     
    379393/*--------------------------------------------------------------------------*/
    380394/* Comparison */
     395/*
    381396inline int operator != ( const badouble& u, const badouble& v ) {
    382397    return (u-v != 0);
    383398}
     399*/
    384400
    385401inline int operator != ( double coval, const badouble& v) {
     
    390406}
    391407
     408/*
    392409inline int operator == ( const badouble& u, const badouble& v ) {
    393410    return (u-v == 0);
    394411}
     412*/
    395413
    396414inline int operator == ( double coval, const badouble& v) {
     
    401419}
    402420
     421/*
    403422inline int operator <= ( const badouble& u, const badouble& v ) {
    404423    return (u-v <= 0);
    405424}
     425*/
    406426
    407427inline int operator <= ( double coval, const badouble& v ) {
     
    412432}
    413433
     434/*
    414435inline int operator >= ( const badouble& u, const badouble& v ) {
    415436    return (u-v >= 0);
    416437}
     438*/
    417439
    418440inline int operator >= ( double coval, const badouble& v ) {
     
    423445}
    424446
     447/*
    425448inline int operator > ( const badouble& u, const badouble& v ) {
    426449    return (u-v > 0);
    427450}
     451*/
    428452
    429453inline int operator > ( double coval, const badouble& v ) {
     
    434458}
    435459
     460/*
    436461inline int operator < ( const badouble& u, const badouble& v ) {
    437462    return (u-v < 0);
    438463}
     464*/
    439465
    440466inline int operator < ( double coval, const badouble& v ) {
Note: See TracChangeset for help on using the changeset viewer.