genmodel 0.0.22 → 0.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 63fd67c6fedfd3146bb75b3658ef7e196f849490
4
- data.tar.gz: c4509f1524d449e0d2ed46c8880e5669987133ac
3
+ metadata.gz: 35e04c4fdf5fad8bd345e78e8607905eb95da223
4
+ data.tar.gz: e6a4738ccd7e7d040df741d66c91a5f7cdc6c2c1
5
5
  SHA512:
6
- metadata.gz: 50e1e8ec93c96d7c20d1bd214fbc1ebbfddd3c602958f10a3de4e3cd1374a419e63a3550807211317bf060ccaf7545c300dc0a9fa0ed6e4d88e248780e58bd8e
7
- data.tar.gz: 7da1a6a902a76ef156fc144fc0c85efbc9f0fc53b64beb2a0cc0dabe75c8137fbab18d09fa48b5e5a5b946d1f2a4a6aef21754a8d48e1d81f3b8671a2af62f09
6
+ metadata.gz: 45dc5c464e59fb22fcdbf15628449868b5779a143f80f24d83f48b959fa86b5df95cea0a3fe255baf3428eac8b90696224ffd0c49d852d5f329c25800a483b0f
7
+ data.tar.gz: e3e7c40a7b49a4fd6e2381c55d233863928f93dfeedd8b713a26268f9c5e4e81ea6bd3f286f0bef4de6431027a48ee8518c7c0a11322e2c1ff56b3a56e11a8b6
@@ -46,6 +46,10 @@ public:
46
46
  ModVars() {n=0; defub=DBL_MAX; deflb=-DBL_MAX;}
47
47
  long AddVar(string nn, double o, double l, double u, char t);
48
48
  long AddVars(string nn, long size, double o, double l, double u, char t);
49
+
50
+ vector<double> GetSolution();
51
+ double GetSolutionFromIndex(unsigned long index);
52
+
49
53
  long SetQpCoef(long i, long j, double val);
50
54
  long Print();
51
55
  vector<string> name;
@@ -5,7 +5,7 @@
5
5
 
6
6
  GenModel::GenModel()
7
7
  {
8
- version = "genmodel-0.0.21 build 0001";
8
+ version = "genmodel-0.0.23 build 0001";
9
9
  hassolution = false;
10
10
  bcreated = false;
11
11
  binit = false;
@@ -308,6 +308,23 @@ long ModVars::AddVars(string nn, long size, double o, double l, double u, char t
308
308
  return 0;
309
309
  }
310
310
 
311
+ vector<double> ModVars::GetSolution()
312
+ {
313
+ if(sol.size() != n)
314
+ sol.resize(n,0);
315
+ return sol;
316
+ }
317
+
318
+ double ModVars::GetSolutionFromIndex(unsigned long index)
319
+ {
320
+ if(sol.size() != n)
321
+ sol.resize(n,0);
322
+ if(index >= n)
323
+ throw string("Genmodel : Index out of bound");
324
+ return sol[index];
325
+ }
326
+
327
+
311
328
  long ModVars::SetQpCoef(long i, long j, double val)
312
329
  {
313
330
  qi.push_back(i);