Comments (13)
You have a function y = f(x) and some of the components of y are nan, perhaps you are not using these components (for a particular case). You can disable this check with
https://cppad.readthedocs.io/en/latest/check_for_nan.html
from cppad.
My usage of CppAD is via the IPopt wrapper, and the error comes as a results of a call to solve within IPOPT. I wouldn't really therefore know where to put this?
Would you have any views on the NDEBUG type questions that brought this to my attention?
from cppad.
Now I understand.
We would have to add a true/false check_for_nan option to ipopt_solve (similar to the reteape opotion); see options on
https://cppad.readthedocs.io/en/latest/ipopt_solve.html#options
and
https://github.com/coin-or/CppAD/blob/master/include/cppad/ipopt/solve.hpp
Then we would use this option value to set check_for_nan at line 242 beginning of the solve_callback constructor;
adfun_.check_for_nan( check_for_nan )
see
https://github.com/coin-or/CppAD/blob/master/include/cppad/ipopt/solve_callback.hpp
I am currently busy with other things, and would appreciate it if you would give this a try and see if it solves your problem.
from cppad.
Ok, I'll give it ago thanks for your help.
If you have a minute just to consider whether the behaviour that I've found with NDEBUG is expected in terms of using a release-compiled version of CppAD in another project that is also compiled in release-mode, that would be most helpful. My expectation would be that debug checks are not trigger from a release build of CppAD - which they are with my current cmake-usage above.
from cppad.
If you have a minute just to consider whether the behaviour that I've found with NDEBUG is expected in terms of using a release-compiled version of CppAD in another project that is also compiled in release-mode, that would be most helpful.
If you look at
https://github.com/coin-or/CppAD/blob/master/include/cppad/core/forward/forward.hpp
and search for check_for_nan, you will see that the error message in question is inside a
# ifndef NDEBUG
...
# endif
block. So I do not know how it is getting printed if the CppAD code is being built with NDEBUG defined ? Please inform me if you figure this out.
from cppad.
So I do not know how it is getting printed if the CppAD code is being built with NDEBUG defined ? Please inform me if you figure this out.
-- Like I say above, that's kind of my whole point, I've no idea how it's getting in there, but it does...
from cppad.
Are you using the cmake_build_type option to configure CppAD ?; see
https://cppad.readthedocs.io/en/latest/cmake.html#cmake-build-type
It may also help to check the value of CMAKE_BUILD_TYPE output by the cmake command; i.e., it should be
-- CMAKE_BUILD_TYPE = Release
from cppad.
yep, that's the one I use. As far as I can work out the problem is that on make install the include files put into the include dir of the install location still have these # ifndef NDEBUG within them. When you then include CppAD in your own project as I tried to explain above using PkgConfig, NDEBUG is not defined since it's nothing to do with my project. So these parts get triggered. I think that's what's happening.
from cppad.
This is just a side issue that may be relevant to you. If you are building a library that may use both debug and release CppAD code, you need to define CPPAD_DEBUG_AND_RELEASE
https://cppad.readthedocs.io/en/latest/preprocessor.html#cppad-debug-and-release
from cppad.
Ok thanks. Good to know. At the moment it's just release CppAD and release my own code base that includes and links to CppAD.
from cppad.
Related Issues (20)
- Computing the Jacobian of an ODE HOT 2
- CPPAD_DISCRETE_FUNCTION does not work through base2ad HOT 2
- Eigen::NumTraits does not define infinity() or quiet_NaN() HOT 3
- How to add self defined functions to AD<Base>? HOT 8
- Using C++ conditional operators HOT 5
- AD<double> not working in Eigen with some complex function HOT 4
- Computing Derivatives of solutions of optimization Problems HOT 9
- Working with CppAD::ipopt::solve and CppADCodeGen HOT 4
- Leppov case missing in local/optimize/get_op_usage.hpp HOT 3
- Discrete coefficient sets for polynomial vary as a function of dependent variable HOT 16
- How to write the `.lp` file of a Ipopt model? HOT 6
- Linking error "undefined reference to `CppAD::local::temp_file()'" HOT 4
- solution vector is empty HOT 10
- Undefined reference to temp_file HOT 2
- ipopt and cppad tests HOT 11
- Problem to Link with CppAD and Ipopt HOT 16
- CppAD::cg::CGException: what(): GreaterThanZero cannot be called for non-parameters HOT 5
- Compiler warnings from use of bitwise '|' and '&' for bool arguments HOT 5
- Static library for non-windows builds HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cppad.