Skip to content

Commit

Permalink
fix reference to stringstream used in error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
bradbell committed Nov 14, 2015
1 parent 3f7008b commit dc4d800
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
9 changes: 7 additions & 2 deletions cppad/local/forward.hpp
Expand Up @@ -205,13 +205,18 @@ VectorBase ADFun<Base>::Forward(
"to binary a file.\n"
"vector_size = " << n << "\n" <<
"file_name = " << file_name << "\n";
const char* msg = ss.str().c_str();
// ss.str() returns a string object with a copy of the current
// contents in the stream buffer.
std::string msg_str = ss.str();
// msg_str.c_str() returns a pointer to the c-string
// representation of the string object's value.
const char* msg_char_star = msg_str.c_str();
ErrorHandler::Call(
true,
__LINE__,
__FILE__,
"! CppAD::isnan( yq[ (q+1) * i + 0 ] )",
msg
msg_char_star
);
}
CPPAD_ASSERT_KNOWN(ok,
Expand Down
8 changes: 7 additions & 1 deletion cppad/local/fun_construct.hpp
Expand Up @@ -488,9 +488,15 @@ ADFun<Base>::ADFun(const VectorAD &x, const VectorAD &y)
<< "Difference = "
<< y[i].value_ - taylor_[dep_taddr_[i]] << endl
;
// buf.str() returns a string object with a copy of the current
// contents in the stream buffer.
std::string msg_str = buf.str();
// msg_str.c_str() returns a pointer to the c-string
// representation of the string object's value.
const char* msg_char_star = msg_str.c_str();
CPPAD_ASSERT_KNOWN(
0,
buf.str().c_str()
msg_char_star
);
}
# endif
Expand Down
8 changes: 7 additions & 1 deletion cppad/thread_alloc.hpp
Expand Up @@ -1018,7 +1018,13 @@ that $icode v_ptr$$ is in the list.
oss << "capacity = " << capacity << endl;
oss << "See CPPAD_TRACE_THREAD & CPPAD_TRACE_CAPACITY in";
oss << endl << "# include <cppad/thread_alloc.hpp>" << endl;
CPPAD_ASSERT_KNOWN(false, oss.str().c_str() );
// oss.str() returns a string object with a copy of the current
// contents in the stream buffer.
std::string msg_str = oss.str();
// msg_str.c_str() returns a pointer to the c-string
// representation of the string object's value.
const char* msg_char_star = msg_str.c_str();
CPPAD_ASSERT_KNOWN(false, msg_char_star );
}

// trace option
Expand Down
8 changes: 8 additions & 0 deletions omh/whats_new/whats_new_15.omh
Expand Up @@ -75,6 +75,14 @@ This section contains a list of the changes to CppAD during 2015
The purpose of this section is to
assist you in learning about changes between various versions of CppAD.

$head 11-14$$
There was a bug in the new
$cref/get_check_for_nan/check_for_nan/get_check_for_nan/$$
feature that writes independent variable values to a temporary file;
see $cref/11-06/whats_new_15/11-06/$$ below.
This has been fixed.


$head 11-08$$
$list number$$
Fixed a bug in the $cref RevSparseJac$$ routine.
Expand Down

0 comments on commit dc4d800

Please sign in to comment.