sferrera
unread,Dec 9, 2010, 10:57:21 AM12/9/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to csipopt
Dear Anders,
I have a problem with the minimization.
Like I said in one of the mails, I am using vector_double (GSLDLL)
instead double[] that's because the primary calculation engine of my
project uses that type of data.
So, I created a new constructor:
public Ipopt(int n, vector_double x_L, vector_double x_U, int m,
vector_double g_L, vector_double g_U, int nele_jac, int nele_hess,
EvaluateObjectiveDelegate eval_f, EvaluateConstraintsDelegate eval_g,
EvaluateObjectiveGradientDelegate eval_grad_f,
EvaluateJacobianDelegate eval_jac_g, EvaluateHessianDelegate eval_h)
and I have a function that transform the vector_double into double[]:
dbl_x_L = ConvertType(x_L);
etc..
once that operation is done I continue with the regular steps:
unsafe
{
fixed (double* p_x_L = dbl_x_L, p_x_U = dbl_x_U, p_g_L = dbl_g_L,
p_g_U = dbl_g_U)
{
m_eval_f = new ObjectiveEvaluator(eval_f).Evaluate;
m_eval_g = new ConstraintsEvaluator(eval_g).Evaluate;
m_eval_grad_f = new
ObjectiveGradientEvaluator(eval_grad_f).Evaluate;
m_eval_jac_g = new JacobianEvaluator(eval_jac_g).Evaluate;
m_eval_h = new HessianEvaluator(eval_h).Evaluate;
m_problem = CreateIpoptProblem(n, p_x_L, p_x_U, m, p_g_L,
p_g_U, nele_jac, nele_hess, 0,
m_eval_f, m_eval_g, m_eval_grad_f,
m_eval_jac_g, m_eval_h);
if (m_problem == IntPtr.Zero)
{
throw new ArgumentException("Failed to initialize IPOPT
problem");
}
}
}
m_disposed = false;
somehow, with the same values of your example, exactly the same, the
result on m_problem is diferent and I assume that changes the final
result of the minimization because when I ran the program with
double[] dbl_x = { 1.0, 5.0, 5.0, 1.0 } the minimization result is
diferent than vector_double = { 1.0, 5.0, 5.0, 1.0 }
Am I do something wrong?
PS: the others functions also have the ConvertType, I check this
function and passes the values ok.