Replies: 6 comments 6 replies
-
It seems like you want to be able to change a coefficient in the definition of the FG_eval operator() function. You could make this coefficients a member variable in the FG_eval class that is set by the constructor. I am not sure if this would do what you want ? |
Beta Was this translation helpful? Give feedback.
-
Each time you call ipopt::solve, it will call the operator() function. |
Beta Was this translation helpful? Give feedback.
-
The function fg_eval is used to 'record' the function x -> fg(x). The optimizer makes callbacks to ipopt::solve to evaluate fg(x) , and its derivatives, at different values of x. The recording takes a significant amount of time relative to evaluating the evaluations. The retape option handles the case where the recording is different from the function; e.g., if there is an if - then block in the function. See the discussion below operation on |
Beta Was this translation helpful? Give feedback.
-
The operator function can be any function you define that satisfies the requirements for fg_eval on: |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Do you know the location / name of the disk files that ate taking up the space ? I suspect they are in /temp or somthing like that. |
Beta Was this translation helpful? Give feedback.
-
I am exploring the ipopt example file https://github.com/coin-or/CppAD/blob/master/example/ipopt_solve/get_started.cpp when I want to solve the problem again with only the coeffient changes in the objective function. I wonder if there is a fast way to accomplish this.
Currently, as written in the example file, the objective is written by the
operator()
function in theFG_eval
class. Is it possible, by passing the new coefficients to the previous FG_eval, to change thefg[0]
without changingfg[1]
andfg[2]
or rewritingfg[1], fg[2]
?Thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions