Comments (10)
As I mentioned, but perhaps was not clear about, all the derivatives of the Value(Var2Par(y)) are zero, even it the derivatives of y are not zero. It you need to track the dependency (derivatives) you need to use an AD type. So the real question is why are you using double
and not AD<double>
?
from cppad.
If the source for the transformation is not to large, convert it to a function where double is replaced by a template parameter so that you can use the source code with both double
and AD<double>
.
Also, it sounds like (but I am not sure) you are interpolating values, so you may want to look at
https://coin-or.github.io/CppAD/doc/interp_onetape.cpp.htm
https://coin-or.github.io/CppAD/doc/interp_retape.cpp.htm
from cppad.
I found the way. There is a function in CppAd::Value(AD<>) will give the value.
Is that right?
from cppad.
While I was getting my code Compiled. Its showing error while Runtime. Kindly help me with this. The error is
cppad-20160000.1 error from a known source:
Value: argument is a variable (not a parameter)
Error detected by false result for
Parameter(x)
from cppad.
You can only extract the value for a parameter (a parameter does not depend on the independent variables). This is because the value of an AD object has type Base which does not track dependency on AD independent variables. If you really want the value with out the dependency, use Var2Par;
https://coin-or.github.io/CppAD/doc/var2par.htm
from cppad.
Dear BradBel. Exactly solved the issue..nice
But I got stuck with one more issue. When I'm converting the variable using Var2Par in cost functions, the optimiser is not recognising the cost.. Its not even considering the cost even though the values are high and appropriate . Can you help?
I know this explanation makes no meaning. But I figured it out in that way.
from cppad.
Why are you using the Value function ?
from cppad.
Actually there are certain implementations where I'm using "double" datatype. Which is causing a typecasting issue. Hence I'm using CppAD::Value to get it to its base type and feed them.
from cppad.
One good example I can give you.
The points getting optimised are in global frame. I'm having a common.hpp file where there is a transformation function using double. I need to use that function to transform points in local frame. Hence typecasting..
But from your answer I get to know we must use Ad. to track. Is tat ryt?
from cppad.
Dear BradBel. Thanks a lot for your kind help. I will dig into the links u have shared.
from cppad.
Related Issues (20)
- How to convert from an AD<double> to a double ? HOT 3
- Tried to set Option: xx. It is not a valid option. Please check the list of available options HOT 2
- 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
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.