Skip to content

Commit

Permalink
master: fux sine more compiler warnings,
Browse files Browse the repository at this point in the history
  • Loading branch information
bradbell committed Dec 11, 2021
1 parent d7bd475 commit 073be38
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions 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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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() );
Expand Down
2 changes: 1 addition & 1 deletion include/cppad/core/graph/from_graph.hpp
Expand Up @@ -156,10 +156,10 @@ void CppAD::ADFun<Base,RecBase>::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
//
Expand Down

0 comments on commit 073be38

Please sign in to comment.