Ignore:
Timestamp:
Sep 19, 2014 8:22:05 AM (6 years ago)
Author:
bradbell
Message:
  1. Zero order forward mode trace is correct, but results not getteing back

to function object; i.e. y and y_cache different.

  1. Change numvar to num_var in reverse mode sweep functions.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/cache/cppad/local/op_code.hpp

    r3341 r3342  
    601601(must have NumArg(op) elements).
    602602
     603\param num_var
     604is the number of variables in the tape.
     605
    603606\param cache2var
    604607If this vector has size zero, there is no cache and the argument indices
    605608are the variable indices.
    606609Otherwise, there is a cache and if arg[i_arg] is a variable
    607         cache2var[ arg[i_arg] - play->num_var_rec() ]
     610        cache2var[ arg[i_arg] - num_var
    608611is the corresponding varialbe index. Note that this is a sort of kludge
    609 becasue the cache comes after the varialbes and uses the same taylor vector.
     612becasue the cache comes after the variables and uses the same taylor vector.
    610613*/
    611614template <class Base>
     
    617620        OpCode                       op        ,
    618621        const addr_t*                arg       ,
     622        size_t                       num_var   ,
    619623        const CppAD::vector<addr_t>& cache2var )
    620624{       size_t i;
     
    631635        {       for(i = 0; i < n_arg; i++)
    632636                        if( arg_is_variable(op, arg, i) )
    633                                 ind[i] = cache2var[ arg[i] ];
     637                        {       CPPAD_ASSERT_UNKNOWN( size_t(arg[i]) >= num_var );
     638                                ind[i] = cache2var[ size_t(arg[i]) - num_var ];
     639                        }
    634640        }
    635641        //
Note: See TracChangeset for help on using the changeset viewer.