Code Monkey home page Code Monkey logo

csipopt's People

Contributors

anders9ustafsson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

csipopt's Issues

Returning data

Recently I'd begin using IPOPT (c++), run an example and everything works good.
I'd tried to make the same excersise in C# and use CSIOPT, everything works good until I cannot found the C# implementation of finalize_solution (the one thta populate all the results in arrays) calling (set_solver_status, set_objective_value, set_primal_solution and set_dual_solution).
On my understand in c++ this is done automatically when solve it,

/** This method is called when the algorithm is complete so the TNLP can
* store/write the solution */
virtual void finalize_solution(SolverReturn status, Index n,
const Number *x, const Number *z_L,
const Number *z_U, Index m, const Number *g,
const Number *lambda, Number obj_value,
const IpoptData *ip_data,
IpoptCalculatedQuantities *ip_cq);

How can achive this? there is another method, the only result was the .out file with the IPOPT outputs

Thanks

loadLib error

Hello
I am using the precompile IPOPT libraries and when I want to change my solver from "mumps" to "ma57" I get this error:
image
I have built the libhsl.dll library and I have also add its directory to system PATH, but I still get this error....

any Idea on how to fix it ?

Refactoring of Ipopt class

Rename Ipopt instance partial class to IpoptProblem and removed sealed directive.
Implement additional IpoptProblem constructor that takes native delegates as arguments.
Make Dispose(bool) method virtual protected to facilitate subclassing.
Have problem classes like HS071 inherit IpoptProblem.
Move static interop methods and delegates to static class IpoptAdapter.
Remove SetIntermediateCallback method from IpoptProblem; have inheriting classes setting m_intermediate in the constructor instead.
Consider making SetScaling method a Scaling property with a setter instead.

SolveProblem_ExactHessian_NumberOfIterationsLessThanOrEqualToHessianApprox unit test failing in Debug/x86 mode

System.AccessViolationException : Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at Cureos.Numerics.IpoptAdapter.IpoptSolve(IntPtr ipopt_problem, Double[] x, Double[] g, ref Double obj_val, Double[] mult_g, Double[] mult_x_L, Double[] mult_x_U, IntPtr user_data)
at Cureos.Numerics.IpoptProblem.SolveProblem(Double[] x, ref Double obj_val, Double[] g, Double[] mult_g, Double[] mult_x_L, Double[] mult_x_U) in IpoptProblem.cs: line 574
at Cureos.Numerics.HS040NativeTests.SolveProblem_ExactHessian_NumberOfIterationsLessThanOrEqualToHessianApprox() in HS040NativeTests.cs: line 94

Memory Corruption Issue on Multiple Calls

I am having a memory corruption issue while using CSIPOPT in my code. I've boiled it down into a project that demonstrates the issue. It is a simple optimization problem. The issue occurs when I run it over and over in a loop. If there is some way to transfer the example problem, I'll be more than happy to do that. I linked against the pre-built 1.0.0 binaries. The stack trace is as follows:

at Cureos.Numerics.IpoptAdapter.FreeIpoptProblem(IntPtr ipopt_problem)
at Cureos.Numerics.IpoptProblem.Dispose(Boolean disposing) in C:\Users\anders.CUREOS\Documents\Visual Studio 2010\Projects\csipopt\src\IpoptProblem.cs:line 658

Any help would be appreciated.

Thanks!
John

Running example with Mono yields NullReferenceException

It is not sufficient to use the "classic" csipopt API with Mono any more. In the first call to a function delegate, the following exception is thrown:

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object at string.memcpy4 (byte*,byte*,int) <0x00018> at string.memcpy (byte*,byte*,int) <0x000b7> at (wrapper native-to-managed) Cureos.Numerics.IpoptProblem/JacobianEvaluator.Ev aluate (int,intptr,Cureos.Numerics.IpoptBoolType,int,int,intptr,intptr,intptr,in tptr) <0x00087> at (wrapper managed-to-native) Cureos.Numerics.IpoptAdapter.IpoptSolve (intptr,d ouble[],double[],double&,double[],double[],double[],intptr) <0x00003> at Cureos.Numerics.IpoptProblem.SolveProblem (double[],double&,double[],double[] ,double[],double[]) <0x0004f> at hs071_cs.Program.Main (string[]) <0x002af>

This happens regardless of which executable is being run with the Mono runtime, mcs or Visual C# compiled.
On the other hand, when running an mcs compiled executable using the regular .NET runtime, the optimization problem is successfully solved.

Build problem

Excerpt from e-mail:

I am trying to test it with visual studio 2015 but I get an error when I am trying to build the cureos.numerics VS solution. I guess that there is a path problem since I did not find where to link the header files coming from the precompiled IPOPT library (from the version Ipopt-3.11.0-Win32-Win64-dll, the one you recommend). The only thing I did until now was to copy the dll in files

C:...\Ipopt-3.11.0-Win32-Win64-dll\lib\x64\ReleaseMKL\

to

C:...\csipopt-master\csipopt-master\Cureos.Numerics

The error message I get when trying to build the project is

Error occurred while restoring NuGet packages: An error occurred while reading file 'C:\IPOPTDDL\csipopt-master\csipopt-master\Cureos.Numerics\Tests.Cureos.Numerics\packages.config': There are duplicate packages: NUnit
1>------ Rebuild All started: Project: Cureos.Numerics, Configuration: Debug Any CPU ------
1>CSC : warning CS1668: Invalid search path 'C:\Program Files\Artelys\Knitro 10.1.1\lib' specified in 'LIB environment variable' -- 'directory does not exist'
1> Cureos.Numerics -> C:\IPOPTDDL\csipopt-master\csipopt-master\Cureos.Numerics\Cureos.Numerics\bin\Debug\Cureos.Numerics.dll
2>------ Rebuild All started: Project: Tests.Cureos.Numerics, Configuration: Debug x64 ------
2> All packages listed in packages.config are already installed.
2>CSC : warning CS1668: Invalid search path 'C:\Program Files\Artelys\Knitro 10.1.1\lib' specified in 'LIB environment variable' -- 'directory does not exist'
2> Tests.Cureos.Numerics -> C:\IPOPTDDL\csipopt-master\csipopt-master\Cureos.Numerics\Tests.Cureos.Numerics\bin\x64\Debug\Tests.Cureos.Numerics.dll
2> File not found - .dll
2> 0 File(s) copied
2>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4713,5): error MSB3073: The command "xcopy /y /q /r /k "C:\IPOPTDDL\csipopt-master\csipopt-master\Cureos.Numerics....\Ipopt\Lib\x64\ReleaseMKL*.dll" "C:\IPOPTDDL\csipopt-master\csipopt-master\Cureos.Numerics\Tests.Cureos.Numerics\bin\x64\Debug*.
"" exited with code 4.
========== Rebuild All: 1 succeeded, 1 failed, 0 skipped ==========

Could you help me to solve this error?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.