Aris Soria
Aris Soria

Reputation: 1

How to call Lingo with Visual Studio?

I have to solve two problems, the first one is linear but the second one is not. I usually solve the linear problems using cplex optimizer with visual studio.

However the second problem can not be solved by cplex and I had been told that lingo can solved this kind of non-linear problems, so what I can do is to solve the first problem in visual studio and then make another code to solve the second problem with lingo. But it is very tedious because I have to do that multiple times.

So what I want to ask is: there is a way to have only one code and call lingo from visual studio to solve the second problem (as I can call cplex)?

Upvotes: 0

Views: 267

Answers (1)

mka
mka

Reputation: 53

You can call Lingo's optimizers from within Visual Studio. There are programming samples under LINGO\64_17\Programming Samples folder. This is assuming that you have Lingo 17/Win64 installed. For example, if you are coding in VC++, the sample I would try first would be VC++\Simple2. Follow these steps,

  1. Open *VC++\Simple2\Simple2.sln project
  2. The project is programmed to read from "Transparse.lng"
  3. Modify Transparse.lng to accommodate your original model.
  4. Modify Simple.c accordingly.
  5. Build and run.

You can have two separate models in Transparse.lng, which would allow you to solve two or models with one code. You will need to have [SUBMODEL] blocks in your Lingo model.

Upvotes: 1

Related Questions