Changeset 2985
 Timestamp:
 Oct 21, 2013 10:04:10 AM (6 years ago)
 Location:
 branches/opt_cond_exp
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

branches/opt_cond_exp/cppad/local/forward_sweep.hpp
r2979 r2985 338 338 339 339 case CSkipOp: 340 // CSumOp has a variable number of arguments and 341 // next_forward thinks it one has one argument. 342 // we must inform next_forward of this special case. 343 Rec>forward_cskip(op, arg, i_op, i_var); 340 344 if( q == 0 ) 341 { // CSumOp has a variable number of arguments and 342 // next_forward thinks it one has one argument. 343 // we must inform next_forward of this special case. 344 Rec>forward_cskip(op, arg, i_op, i_var); 345 forward_cskip_op_0( 345 { forward_cskip_op_0( 346 346 i_var, arg, num_par, parameter, J, Taylor, cskip_op 347 347 ); 
branches/opt_cond_exp/test_more/optimize.cpp
r2983 r2985 54 54 f.Dependent(ax, ay); 55 55 56 // use zero order to evaluate f(3,4)57 CppAD::vector<double> x( f.Domain());58 CppAD::vector<double> y( f.Range());56 // use zero order to evaluate when condition is true 57 CppAD::vector<double> x(2), dx(2); 58 CppAD::vector<double> y(1), dy(1); 59 59 x[0] = 3.; 60 60 x[1] = 4.; … … 68 68 f.optimize(); 69 69 70 // optimized zero order forward 70 // optimized zero order forward when condition is false 71 71 x[0] = 4.; 72 72 x[1] = 3.; … … 76 76 // after optimize can skip either call to g or call to h 77 77 ok &= f.number_skip() == 1; 78 79 // optimized first order forward 80 dx[0] = 2.; 81 dx[1] = 1.; 82 dy = f.Forward(1, dx); 83 ok &= dy[0] == dx[0]  dx[1]; 78 84 79 85 return ok; … … 129 135 return ok; 130 136 } 131 132 137 bool atomic_arguments(void) 133 138 { bool ok = true;
Note: See TracChangeset
for help on using the changeset viewer.