diff --git a/cppad_ipopt/example/ode_run.hpp b/cppad_ipopt/example/ode_run.hpp index 15b08a70b..e11f3da12 100644 --- a/cppad_ipopt/example/ode_run.hpp +++ b/cppad_ipopt/example/ode_run.hpp @@ -1,7 +1,7 @@ # ifndef CPPAD_CPPAD_IPOPT_EXAMPLE_ODE_RUN_HPP # define CPPAD_CPPAD_IPOPT_EXAMPLE_ODE_RUN_HPP /* -------------------------------------------------------------------------- -CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-20 Bradley M. Bell +CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-21 Bradley M. Bell CppAD is distributed under the terms of the Eclipse Public License Version 2.0. @@ -36,7 +36,7 @@ void ipopt_ode_case( bool retape , const SizeVector& N , NumberVector& x ) -{ bool ok = true; +{ size_t i, j; // compute the partial sums of the number of grid points @@ -103,13 +103,22 @@ void ipopt_ode_case( app->Options()-> SetStringValue( "derivative_test", "second-order"); app->Options()-> SetNumericValue( "point_perturbation_radius", 0.); +# ifndef NDEBUG + bool ok = true; + // // Initialize the application and process the options Ipopt::ApplicationReturnStatus status = app->Initialize(); ok &= status == Ipopt::Solve_Succeeded; - + // // Run the application status = app->OptimizeTNLP(cppad_nlp); ok &= status == Ipopt::Solve_Succeeded; + // + assert(ok); +# else + app->Initialize(); + app->OptimizeTNLP(cppad_nlp); +# endif // return the solution x.resize( solution.x.size() ); diff --git a/include/cppad/core/graph/from_graph.hpp b/include/cppad/core/graph/from_graph.hpp index 9066db15d..1735cf767 100644 --- a/include/cppad/core/graph/from_graph.hpp +++ b/include/cppad/core/graph/from_graph.hpp @@ -156,10 +156,10 @@ void CppAD::ADFun::from_graph( } // // Start of node indices +# ifndef NDEBUG size_t start_dynamic_ind = 1; size_t start_independent = start_dynamic_ind + n_dynamic_ind; size_t start_constant = start_independent + n_variable_ind; -# ifndef NDEBUG size_t start_operator = start_constant + n_constant; # endif //