[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] [Fwd: Solving pure IP by calling MIP solver gives wrong
From: |
Robbie Morrison |
Subject: |
Re: [Help-glpk] [Fwd: Solving pure IP by calling MIP solver gives wrong status] |
Date: |
Wed, 5 Jun 2013 04:41:04 +1200 |
User-agent: |
SquirrelMail/1.4.22 |
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 <address@hidden>
Subject: Solving pure IP by calling MIP solver gives wrong status
From: Sergey Kuznetsov <address@hidden>
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) : address@hidden
Webmail (preferred) : address@hidden
[from Webmail client]
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Help-glpk] [Fwd: Solving pure IP by calling MIP solver gives wrong status],
Robbie Morrison <=