Hi Sergey First up, you need to join the [help-glpk] list if you wish to engage further:
http://www.gnu.org/software/glpk/#lists ------------------------------------------------------------ To: GLPK help <[email protected]> Subject: Solving pure IP by calling MIP solver gives wrong status From: Sergey Kuznetsov <[email protected]> Date: Mon, 3 Jun 2013 13:03:32 -0400 ------------------------------------------------------------ > int *ia = new int[ne+1]; > int *ja = new int[ne+1]; > double *ar = new double[ne+1]; > > // lots of code > > delete [] ia; > delete [] ja; > delete [] ar; If you want to write more idiomatic C++, take a look at these pages: http://en.wikibooks.org/wiki/GLPK/Third-party_API_wrappers#Using_C.2B.2B_vectors http://en.wikibooks.org/wiki/GLPK/IAJAAR.H_project The new C++11 smart pointers are great too: http://en.wikipedia.org/wiki/Smart_pointer#C.2B.2B_smart_pointers The one to use is 'shared_ptr'. The suggestions above are not important if you have simple (and perhaps linear) flow of control, but they can be great when writing more complex applications. cheers, Robbie --- Robbie Morrison PhD student -- policy-oriented energy system simulation Technical University of Berlin (TU-Berlin), Germany University email (redirected) : [email protected] Webmail (preferred) : [email protected] [from Webmail client] _______________________________________________ Help-glpk mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-glpk
