Changeset 518


Ignore:
Timestamp:
Jun 27, 2014 6:37:20 AM (6 years ago)
Author:
kulshres
Message:

merge changes from branch 'master' of 'gitclone'

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>
The following changes were merged:

commit 7e0794d952ba619c8e607a3791c09a3a41a63dd2
Author: Max Sagebaum <sagebaum@…>
Date: Thu Jun 5 15:59:09 2014 +0200

Fixed: Keep taylor statement was outside of tracing statment.

commit 4f7263488212ba908ef2416bb358a93975226c02
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Wed Jun 25 12:52:31 2014 +0200

reimplement adubp_from_adub using the isInit flag

I didn't want to use a const_cast<> but there seems to be no way around.
This implementation simply steals the location from the adub argument
and sets it as the location of the adub* result. The isInit=false flag tells
the ~adub destructor not to free the location.
This fixes the problems where multiple locations are allocated and used
for results, like in sin/cos etc.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ADOL-C/src/adouble.cpp

    r498 r518  
    8888        put_op(assign_d_zero);
    8989        ADOLC_PUT_LOCINT(location);   // = res
     90
     91        ++ADOLC_CURRENT_TAPE_INFOS.numTays_Tape;
     92        if (ADOLC_CURRENT_TAPE_INFOS.keepTaylors)
     93            ADOLC_WRITE_SCAYLOR(ADOLC_GLOBAL_TAPE_VARS.store[location]);
    9094    }
    9195   
    92     ++ADOLC_CURRENT_TAPE_INFOS.numTays_Tape;
    93     if (ADOLC_CURRENT_TAPE_INFOS.keepTaylors)
    94         ADOLC_WRITE_SCAYLOR(ADOLC_GLOBAL_TAPE_VARS.store[location]);
    9596   
    9697    ADOLC_GLOBAL_TAPE_VARS.store[location] = 0.;
     
    191192
    192193adub* adubp_from_adub(const adub& a) {
    193     locint locat = next_loc();
     194    locint locat = a.loc();
     195    const_cast<adub&>(a).isInit = false;
    194196    adub *retp = new adub(locat);
    195     (*retp).badouble::operator=(a);
    196197    return retp;
    197198}
Note: See TracChangeset for help on using the changeset viewer.