Commit 02ad5467 authored by Mike Kremer's avatar Mike Kremer
Browse files

Lowered retaping threshold.

git-svn-id: http://www.openflipper.org/svnrepo/CoMISo/trunk@205 1355f012-dd97-4b2f-ae87-10fa9f823a57
parent 2f4c6e49
......@@ -160,10 +160,12 @@ public:
int ec = gradient(tape_, n_unknowns_, _x, grad_p.get());
if(ec <= 0) {
if(ec < 0) {
// Retape function if return code indicates discontinuity
function_evaluated_ = false;
#ifdef ADOLC_RET_CODES
std::cout << __FUNCTION__ << " invokes retaping of function due to discontinuity! Return code: " << ec << std::endl;
#endif
eval_constraint(_x);
ec = gradient(tape_, n_unknowns_, _x, grad_p.get());
}
......@@ -201,10 +203,12 @@ public:
double* val = NULL;
int ec = sparse_hess(tape_, n_unknowns_, 0, _x, &nz, &r_ind, &c_ind, &val, opt);
if(ec <= 0) {
if(ec < 0) {
// Retape function if return code indicates discontinuity
function_evaluated_ = false;
#ifdef ADOLC_RET_CODES
std::cout << __FUNCTION__ << " invokes retaping of function due to discontinuity! Return code: " << ec << std::endl;
#endif
eval_constraint(_x);
ec = sparse_hess(tape_, n_unknowns_, 0, _x, &nz, &r_ind, &c_ind, &val, opt);
}
......@@ -238,10 +242,12 @@ public:
int ec = hessian(tape_, n_unknowns_, const_cast<double*>(_x), h_ptr);
if(ec <= 0) {
if(ec < 0) {
// Retape function if return code indicates discontinuity
function_evaluated_ = false;
#ifdef ADOLC_RET_CODES
std::cout << __FUNCTION__ << " invokes retaping of function due to discontinuity! Return code: " << ec << std::endl;
#endif
eval_constraint(_x);
ec = hessian(tape_, n_unknowns_, const_cast<double*>(_x), h_ptr);
}
......
......@@ -183,10 +183,12 @@ public:
int ec = gradient(tape_, n_unknowns_, _x, _g);
if(ec <= 0) {
if(ec < 0) {
// Retape function if return code indicates discontinuity
function_evaluated_ = false;
#ifdef ADOLC_RET_CODES
std::cout << __FUNCTION__ << " invokes retaping of function due to discontinuity! Return code: " << ec << std::endl;
#endif
eval_f(_x);
ec = gradient(tape_, n_unknowns_, _x, _g);
}
......@@ -217,10 +219,12 @@ public:
int ec = sparse_hess(tape_, n_unknowns_, 0, _x, &nz, &r_ind_p, &c_ind_p, &val_p, opt);
if(ec <= 0) {
if(ec < 0) {
// Retape function if return code indicates discontinuity
function_evaluated_ = false;
#ifdef ADOLC_RET_CODES
std::cout << __FUNCTION__ << " invokes retaping of function due to discontinuity! Return code: " << ec << std::endl;
#endif
eval_f(_x);
ec = sparse_hess(tape_, n_unknowns_, 0, _x, &nz, &r_ind_p, &c_ind_p, &val_p, opt);
}
......@@ -250,10 +254,12 @@ public:
int ec = hessian(tape_, n_unknowns_, const_cast<double*>(_x), h_ptr);
if(ec <= 0) {
if(ec < 0) {
// Retape function if return code indicates discontinuity
function_evaluated_ = false;
#ifdef ADOLC_RET_CODES
std::cout << __FUNCTION__ << " invokes retaping of function due to discontinuity! Return code: " << ec << std::endl;
#endif
eval_f(_x);
ec = hessian(tape_, n_unknowns_, const_cast<double*>(_x), h_ptr);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment