Giter Site home page Giter Site logo

geoffleyland / rima Goto Github PK

View Code? Open in Web Editor NEW
19.0 19.0 3.0 1.41 MB

Rima is a tool for formulating mathematical models

Home Page: http://rima.incremental.co.nz/

License: MIT License

C++ 10.64% C 0.31% Lua 63.62% Shell 0.09% CSS 2.64% Makefile 0.79% TeX 21.91%

rima's People

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

rima's Issues

Memory Leak/Corruption?

Hi Geoff,
I got your repository and integrated it into luajit and I must tell you this is a wonderful work.
Doing some tests I found something that is related to a possible memory leak/issue that broke my luajit integrated stuff.
This actually happened only using ipopt and the core dump happened when the GC entered into action.
I think I have fixed it but I don't want to mess your stuff in Github :)
So I'm simply telling you what I did in the file rima_ipopt_core.cpp:

  1. commented out the destructor ~rima_ipopt_problem (lines 45 and 137-140)
  2. changed the function rima_delete like this:

static int rima_delete(lua_State L)
{
rima_ipopt_problem *model = (rima_ipopt_problem
)luaL_checkudata(L, 1, metatable_name);
model->ReleaseRef((Ipopt::Referencer*)L);
//model->~rima_ipopt_problem();
luaL_unref(L, LUA_REGISTRYINDEX, model->model_index_);
return 0;
}

basically putting the unref directly in the delete and not using the cached L_ state.
In this way this is not crashing and is not leaking.
Hope this helps and thanks for the work you shared.

Mauro
;)

lp_solve bug with add_constraintex

As noticed by Kevin:

I also noticed an lp_solve bug. When using add_constraintex, you should initially have 0 rows, because the add functions create a new row. Hence you are ending up with double the number of rows. This is easily fixed by doing make_lp(0, cols); resize_lp(rows, cols); as resize_lp doesn't add the rows, just allocates the memory.

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.