Changeset 2971


Ignore:
Timestamp:
Oct 19, 2013 1:20:45 AM (6 years ago)
Author:
bradbell
Message:

Add a demonstration and test of optimizing conditional expressions.

Location:
branches/opt_cond_exp
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • branches/opt_cond_exp/cppad/local/ad_fun.hpp

    r2968 r2971  
    431431        /// set number of coefficients currently allocated (per variable)
    432432        void capacity_taylor(size_t per_var);   
     433
     434        /// number of variables in conditional expressions that can be skipped
     435        size_t number_skip(void);   
    433436
    434437        /// number of independent variables
  • branches/opt_cond_exp/cppad/local/dependent.hpp

    r2968 r2971  
    273273        cskip_var_.clear();
    274274        cskip_var_.resize(total_num_var_);
     275        for(i = 0; i < total_num_var_; i++)
     276                cskip_var_[i] = false;
    275277
    276278        // now that each dependent variable has a place in the tape,
  • branches/opt_cond_exp/cppad/local/forward.hpp

    r2970 r2971  
    2222        omh/forward.omh%
    2323        cppad/local/cap_taylor.hpp%
     24        cppad/local/num_skip.hpp%
    2425        example/forward.cpp%
    2526        example/forward_mul.cpp
     
    3233// documened after Forward but included here so easy to see
    3334# include <cppad/local/cap_taylor.hpp>
     35# include <cppad/local/num_skip.hpp>
    3436
    3537namespace CppAD { // BEGIN_CPPAD_NAMESPACE
  • branches/opt_cond_exp/example/CMakeLists.txt

    r2892 r2971  
    150150        near_equal_ext.cpp
    151151        not_complex_ad.cpp
     152        number_skip.cpp
    152153        numeric_type.cpp
    153154        ode_err_control.cpp
  • branches/opt_cond_exp/example/example.cpp

    r2892 r2971  
    122122extern bool NearEqualExt(void);
    123123extern bool not_complex_ad(void);
     124extern bool number_skip(void);
    124125extern bool NumericType(void);
    125126extern bool OdeErrControl(void);
     
    276277        ok &= Run( NearEqualExt,      "NearEqualExt"     );
    277278        ok &= Run( not_complex_ad,    "not_complex_ad"   );
     279        ok &= Run( number_skip,       "number_skip"      );
    278280        ok &= Run( NumericType,       "NumericType"      );
    279281        ok &= Run( OdeErrControl,     "OdeErrControl"    );
  • branches/opt_cond_exp/example/makefile.am

    r2940 r2971  
    145145        near_equal_ext.cpp \
    146146        not_complex_ad.cpp \
     147        number_skip.cpp \
    147148        numeric_type.cpp \
    148149        ode_err_control.cpp \
  • branches/opt_cond_exp/makefile.am

    r2963 r2971  
    201201        cppad/local/mul_op.hpp \
    202202        cppad/local/near_equal_ext.hpp \
     203        cppad/local/num_skip.hpp \
    203204        cppad/local/omp_max_thread.hpp \
    204205        cppad/local/op_code.hpp \
  • branches/opt_cond_exp/omh/example_list.omh

    r2897 r2971  
    181181$rref near_equal_ext.cpp$$
    182182$rref not_complex_ad.cpp$$
     183$rref number_skip.cpp$$
    183184$rref numeric_type.cpp$$
    184185$rref ode_err_control.cpp$$
Note: See TracChangeset for help on using the changeset viewer.