Changeset 445


Ignore:
Timestamp:
Jan 11, 2014 11:41:44 AM (7 years ago)
Author:
kulshres
Message:

make sure to overwrite the second output in {a,}{sin,cos}{,h}

in a very small toy example the number of intermediates may
be too small to overwrite the second output of sin/cos and other such
functions before the end of tape. Then this value is never saved onto
the taylor buffer especially if all adoubles allocated by the user are
deleted before calling trace_off() in user code.

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

File:
1 edited

Legend:

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

    r441 r445  
    12611261    ADOLC_GLOBAL_TAPE_VARS.store[y.loc()] =
    12621262        ADOLC_MATH_NSP::cos(ADOLC_GLOBAL_TAPE_VARS.store[x.loc()]);
     1263    y = 0;
    12631264    ADOLC_OPENMP_RESTORE_THREAD_NUMBER;
    12641265    return locat;
     
    12911292    ADOLC_GLOBAL_TAPE_VARS.store[y.loc()] =
    12921293        ADOLC_MATH_NSP::sin(ADOLC_GLOBAL_TAPE_VARS.store[x.loc()]);
     1294    y = 0;
    12931295    ADOLC_OPENMP_RESTORE_THREAD_NUMBER;
    12941296    return locat;
     
    13231325    ADOLC_GLOBAL_TAPE_VARS.store[locat] =
    13241326        ADOLC_MATH_NSP::asin(ADOLC_GLOBAL_TAPE_VARS.store[x.loc()]);
     1327    y = 0;
    13251328    ADOLC_OPENMP_RESTORE_THREAD_NUMBER;
    13261329    return locat;
     
    13491352    ADOLC_GLOBAL_TAPE_VARS.store[locat] =
    13501353        ADOLC_MATH_NSP::acos(ADOLC_GLOBAL_TAPE_VARS.store[x.loc()]);
     1354    y = 0;
    13511355    ADOLC_OPENMP_RESTORE_THREAD_NUMBER;
    13521356    return locat;
     
    13751379    ADOLC_GLOBAL_TAPE_VARS.store[locat] =
    13761380        ADOLC_MATH_NSP::atan(ADOLC_GLOBAL_TAPE_VARS.store[x.loc()]);
     1381    y = 0;
    13771382    ADOLC_OPENMP_RESTORE_THREAD_NUMBER;
    13781383    return locat;
     
    15671572    ADOLC_GLOBAL_TAPE_VARS.store[locat] =
    15681573        ADOLC_MATH_NSP_ERF::asinh(ADOLC_GLOBAL_TAPE_VARS.store[x.loc()]);
     1574    y = 0;
    15691575    ADOLC_OPENMP_RESTORE_THREAD_NUMBER;
    15701576    return locat;
     
    15931599    ADOLC_GLOBAL_TAPE_VARS.store[locat] =
    15941600        ADOLC_MATH_NSP_ERF::acosh(ADOLC_GLOBAL_TAPE_VARS.store[x.loc()]);
     1601    y = 0;
    15951602    ADOLC_OPENMP_RESTORE_THREAD_NUMBER;
    15961603    return locat;
     
    16191626    ADOLC_GLOBAL_TAPE_VARS.store[locat] =
    16201627        ADOLC_MATH_NSP_ERF::atanh(ADOLC_GLOBAL_TAPE_VARS.store[x.loc()]);
     1628    y = 0;
    16211629    ADOLC_OPENMP_RESTORE_THREAD_NUMBER;
    16221630    return locat;
     
    16461654    ADOLC_GLOBAL_TAPE_VARS.store[locat] =
    16471655        ADOLC_MATH_NSP_ERF::erf(ADOLC_GLOBAL_TAPE_VARS.store[x.loc()]);
     1656    y = 0;
    16481657    ADOLC_OPENMP_RESTORE_THREAD_NUMBER;
    16491658    return locat;
Note: See TracChangeset for help on using the changeset viewer.