[Ipopt] Use previously allocated memory with Ipopt

Stefan Vigerske stefan at math.hu-berlin.de
Mon Oct 22 12:34:10 EDT 2018


Hi,

On 10/20/18 9:06 PM, R zu wrote:
> Hi.
> 
> Q1: If I have already allocated some memory, can use that for holding
> Jacobian etc for Ipopt by providing the pointers to Ipopt? Alternatively,

No. Ipopt likes to allocate its own memory.

> can I get the pointer to the chunk of memory used by ipopt to hold the
> Jacobian, Hessian, objective, and variables?

That's what you will get in the eval_jac and eval_h calls.

> Use case: I am using the Eigen 3 library (SIMD linear algebra library). It
> has some convenient methods for indexing the array, which makes building
> the Jacobian/Hessian easier. However, some methods requires the underlying
> memory has simd memory alignment. I want to use Eigen 3 to build/update the
> Jacobian etc and use Ipopt to do the optimization.

I would just copy over the arrays and then later check whether this is 
actually a bottleneck.

> Q2: Can I use float instead of double for ipopt? When I look at the
> definition of Ipopt::Number, it is double instead of float.

Currently one should not change the definition of Ipopt::Number, as, 
e.g., interface to linear solvers expect a Number to be a double.

Stefan

> 
> Thanks.
> 
> 
> _______________________________________________
> Ipopt mailing list
> Ipopt at list.coin-or.org
> https://list.coin-or.org/mailman/listinfo/ipopt
> 



More information about the Ipopt mailing list