genmodel 0.0.48 → 0.0.49

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.
@@ -417,55 +417,68 @@ long GenModelCplex::CreateModel(string filename, int type, string dn)
417
417
  return 0;
418
418
  }
419
419
 
420
- long GenModelCplex::ChangeBulkBounds(int count, int * ind, char * type, double * vals)
420
+ long GenModelCplex::ChangeBulkBounds(size_t count, vector<int>& ind, vector<char>& type, vector<double>& vals)
421
421
  {
422
- if(!bcreated)
423
- return ThrowError("ChangeBulkBounds not available : Problem not created yet");
424
- CplexData* d = (CplexData*)solverdata;
422
+ //if(!bcreated)
423
+ // return ThrowError("ChangeBulkBounds not available : Problem not created yet");
424
+ //CplexData* d = (CplexData*)solverdata;
425
425
 
426
- for(long i = 0; i < count; i++)
426
+ for(size_t i = 0; i < count; i++)
427
427
  {
428
+ if(size_t(ind[i]) >= vars.n)
429
+ ThrowError("ChangeBulkBounds() : Index out of bound");
428
430
  if (type[i] == 'L' || type[i] == 'B')
429
431
  {
430
- vars.lb[i] = vals[i];
432
+ vars.lb[ind[i]] = vals[i];
431
433
  }
432
434
  if (type[i] == 'U' || type[i] == 'B')
433
435
  {
434
- vars.ub[i] = vals[i];
436
+ vars.ub[ind[i]] = vals[i];
435
437
  }
436
438
  }
437
439
 
438
- CPXXchgbds(d->env, d->lp, count, ind, type, vals);
439
-
440
+ if(bcreated)
441
+ {
442
+ CplexData* d = (CplexData*)solverdata;
443
+ CPXXchgbds(d->env, d->lp, count, &(ind[0]), &(type[0]), &(vals[0]));
444
+ }
440
445
  return 0;
441
446
  }
442
447
 
443
- long GenModelCplex::ChangeBulkObjectives(int count, int * ind, double * vals)
448
+ long GenModelCplex::ChangeBulkObjectives(size_t count, vector<int>& ind, vector<double>& vals)
444
449
  {
445
- if(!bcreated)
446
- return ThrowError("ChangeBulkObjectives() not available : Problem not created yet");
447
- CplexData* d = (CplexData*)solverdata;
450
+ //if(!bcreated)
451
+ // return ThrowError("ChangeBulkObjectives() not available : Problem not created yet");
452
+ //CplexData* d = (CplexData*)solverdata;
448
453
 
449
- for(long i = 0; i < count; i++)
454
+ for(size_t i = 0; i < count; i++)
450
455
  {
451
- vars.obj[i] = vals[i];
456
+ if(size_t(ind[i]) >= vars.n)
457
+ ThrowError("ChangeBulkObjectives() : Index out of bound");
458
+ vars.obj[ind[i]] = vals[i];
452
459
  }
453
460
 
454
- CPXXchgobj(d->env, d->lp, count, ind, vals);
461
+ if(bcreated)
462
+ {
463
+ CplexData* d = (CplexData*)solverdata;
464
+ CPXXchgobj(d->env, d->lp, count, &(ind[0]), &(vals[0]));
465
+ }
455
466
 
456
467
  return 0;
457
468
  }
458
469
 
459
- long GenModelCplex::ChangeBulkNz(int count, int* rind, int* cind, double * vals)
470
+ long GenModelCplex::ChangeBulkNz(size_t count, vector<int>& rind, vector<int>& cind, vector<double>& vals)
460
471
  {
461
- if(!bcreated)
462
- return ThrowError("ChangeBulkNz() not available : Problem not created yet");
463
- CplexData* d = (CplexData*)solverdata;
472
+ //if(!bcreated)
473
+ // return ThrowError("ChangeBulkNz() not available : Problem not created yet");
474
+ //CplexData* d = (CplexData*)solverdata;
464
475
 
465
- for(long i = 0; i < count; i++)
476
+ for(size_t i = 0; i < count; i++)
466
477
  {
478
+ if(size_t(cind[i]) >= vars.n || size_t(rind[i]) >= consts.size())
479
+ ThrowError("ChangeBulkObjectives() : Index out of bound");
467
480
  bool found = false;
468
- for(long j = 0; j < int(consts[rind[i]].cols.size()); j++)
481
+ for(size_t j = 0; j < consts[rind[i]].cols.size(); j++)
469
482
  {
470
483
  if(consts[rind[i]].cols[j] == cind[i])
471
484
  {
@@ -477,8 +490,11 @@ long GenModelCplex::ChangeBulkNz(int count, int* rind, int* cind, double * vals)
477
490
  if(!found)
478
491
  consts[rind[i]].AddNz(cind[i], vals[i]);
479
492
  }
480
-
481
- CPXXchgcoeflist(d->env, d->lp, count, rind, cind, vals);
493
+ if(bcreated)
494
+ {
495
+ CplexData* d = (CplexData*)solverdata;
496
+ CPXXchgcoeflist(d->env, d->lp, count, &(rind[0]), &(cind[0]), &(vals[0]));
497
+ }
482
498
 
483
499
  return 0;
484
500
  }
@@ -699,6 +715,8 @@ int mip_cb(CPXCENVptr env, void *cbdata, int wherefrom, void *cbhandle)
699
715
  d->solver_info.nb_lazy_cuts += nb_lazy_cuts;
700
716
  d->solver_info.nb_soln_pool_cuts += nb_soln_pool_cuts;
701
717
 
718
+ if(wherefrom == CPX_CALLBACK_MIP_INCUMBENT_NODESOLN || wherefrom == CPX_CALLBACK_MIP_INCUMBENT_HEURSOLN || wherefrom == CPX_CALLBACK_MIP_INCUMBENT_USERSOLN)
719
+ d->solver_info.nb_solutions += 1;
702
720
  //d->solver_info.nb_solutions += CPXXgetsolnpoolnumsolns(d->env, d->lp);
703
721
 
704
722
  if(d->stop_solver)
@@ -22,6 +22,7 @@
22
22
  #include <ilcplex/cplexx.h>
23
23
  #else
24
24
  typedef void* CPXENVptr;
25
+ typedef void* CPXCENVptr;
25
26
  typedef void* CPXLPptr;
26
27
  typedef void* CPXFILEptr;
27
28
  #endif
@@ -125,9 +126,9 @@ public:
125
126
  long AddSolverRow(vector<int>& ind, vector<double>& val, double rhs, char sense, string name);
126
127
  long AddCol(int* newi, double* newcol, int nz, double obj, double lb, double ub, const char* name, char type = 'C');
127
128
  long AddCut(int* cols, double* vals, int nz, double rhs, char sense, const char* name);
128
- long ChangeBulkBounds(int count, int * ind, char * type, double * vals);
129
- long ChangeBulkObjectives(int count, int * ind, double * vals);
130
- long ChangeBulkNz(int count, int* rind, int* cind, double* vals);
129
+ long ChangeBulkBounds(size_t count, vector<int>& ind, vector<char>& type, vector<double>& vals);
130
+ long ChangeBulkObjectives(size_t count, vector<int>& ind, vector<double>& vals);
131
+ long ChangeBulkNz(size_t count, vector<int>& rind, vector<int>& cind, vector<double>& vals);
131
132
  long WriteProblemToLpFile(string filename);
132
133
  long WriteSolutionToFile(string filename);
133
134
  long SwitchToMip();
@@ -34266,11 +34266,10 @@ fail:
34266
34266
  SWIGINTERN VALUE
34267
34267
  _wrap_ModConsts_name_set(int argc, VALUE *argv, VALUE self) {
34268
34268
  ModConsts *arg1 = (ModConsts *) 0 ;
34269
- string arg2 ;
34269
+ std::string *arg2 = 0 ;
34270
34270
  void *argp1 = 0 ;
34271
34271
  int res1 = 0 ;
34272
- void *argp2 ;
34273
- int res2 = 0 ;
34272
+ int res2 = SWIG_OLDOBJ ;
34274
34273
 
34275
34274
  if ((argc < 1) || (argc > 1)) {
34276
34275
  rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
@@ -34281,19 +34280,21 @@ _wrap_ModConsts_name_set(int argc, VALUE *argv, VALUE self) {
34281
34280
  }
34282
34281
  arg1 = reinterpret_cast< ModConsts * >(argp1);
34283
34282
  {
34284
- res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_string, 0 );
34283
+ std::string *ptr = (std::string *)0;
34284
+ res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
34285
34285
  if (!SWIG_IsOK(res2)) {
34286
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "string","name", 2, argv[0] ));
34287
- }
34288
- if (!argp2) {
34289
- SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "string","name", 2, argv[0]));
34290
- } else {
34291
- arg2 = *(reinterpret_cast< string * >(argp2));
34286
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","name", 2, argv[0] ));
34292
34287
  }
34288
+ if (!ptr) {
34289
+ SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","name", 2, argv[0]));
34290
+ }
34291
+ arg2 = ptr;
34293
34292
  }
34294
- if (arg1) (arg1)->name = arg2;
34293
+ if (arg1) (arg1)->name = *arg2;
34294
+ if (SWIG_IsNewObj(res2)) delete arg2;
34295
34295
  return Qnil;
34296
34296
  fail:
34297
+ if (SWIG_IsNewObj(res2)) delete arg2;
34297
34298
  return Qnil;
34298
34299
  }
34299
34300
 
@@ -34303,7 +34304,7 @@ _wrap_ModConsts_name_get(int argc, VALUE *argv, VALUE self) {
34303
34304
  ModConsts *arg1 = (ModConsts *) 0 ;
34304
34305
  void *argp1 = 0 ;
34305
34306
  int res1 = 0 ;
34306
- string result;
34307
+ std::string *result = 0 ;
34307
34308
  VALUE vresult = Qnil;
34308
34309
 
34309
34310
  if ((argc < 0) || (argc > 0)) {
@@ -34314,8 +34315,8 @@ _wrap_ModConsts_name_get(int argc, VALUE *argv, VALUE self) {
34314
34315
  SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ModConsts *","name", 1, self ));
34315
34316
  }
34316
34317
  arg1 = reinterpret_cast< ModConsts * >(argp1);
34317
- result = ((arg1)->name);
34318
- vresult = SWIG_NewPointerObj((new string(static_cast< const string& >(result))), SWIGTYPE_p_string, SWIG_POINTER_OWN | 0 );
34318
+ result = (std::string *) & ((arg1)->name);
34319
+ vresult = SWIG_From_std_string(static_cast< std::string >(*result));
34319
34320
  return vresult;
34320
34321
  fail:
34321
34322
  return Qnil;
@@ -36505,21 +36506,14 @@ fail:
36505
36506
  SWIGINTERN VALUE
36506
36507
  _wrap_GenModel_ChangeBulkBounds(int argc, VALUE *argv, VALUE self) {
36507
36508
  GenModel *arg1 = (GenModel *) 0 ;
36508
- int arg2 ;
36509
- int *arg3 = (int *) 0 ;
36510
- char *arg4 = (char *) 0 ;
36511
- double *arg5 = (double *) 0 ;
36509
+ size_t arg2 ;
36510
+ std::vector< int,std::allocator< int > > arg3 ;
36511
+ std::vector< char,std::allocator< char > > arg4 ;
36512
+ std::vector< double,std::allocator< double > > arg5 ;
36512
36513
  void *argp1 = 0 ;
36513
36514
  int res1 = 0 ;
36514
- int val2 ;
36515
+ size_t val2 ;
36515
36516
  int ecode2 = 0 ;
36516
- void *argp3 = 0 ;
36517
- int res3 = 0 ;
36518
- int res4 ;
36519
- char *buf4 = 0 ;
36520
- int alloc4 = 0 ;
36521
- void *argp5 = 0 ;
36522
- int res5 = 0 ;
36523
36517
  long result;
36524
36518
  VALUE vresult = Qnil;
36525
36519
 
@@ -36531,26 +36525,38 @@ _wrap_GenModel_ChangeBulkBounds(int argc, VALUE *argv, VALUE self) {
36531
36525
  SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "GenModel *","ChangeBulkBounds", 1, self ));
36532
36526
  }
36533
36527
  arg1 = reinterpret_cast< GenModel * >(argp1);
36534
- ecode2 = SWIG_AsVal_int(argv[0], &val2);
36528
+ ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
36535
36529
  if (!SWIG_IsOK(ecode2)) {
36536
- SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","ChangeBulkBounds", 2, argv[0] ));
36530
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","ChangeBulkBounds", 2, argv[0] ));
36537
36531
  }
36538
- arg2 = static_cast< int >(val2);
36539
- res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_int, 0 | 0 );
36540
- if (!SWIG_IsOK(res3)) {
36541
- SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "int *","ChangeBulkBounds", 3, argv[1] ));
36532
+ arg2 = static_cast< size_t >(val2);
36533
+ {
36534
+ std::vector<int,std::allocator< int > > *ptr = (std::vector<int,std::allocator< int > > *)0;
36535
+ int res = swig::asptr(argv[1], &ptr);
36536
+ if (!SWIG_IsOK(res) || !ptr) {
36537
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::vector< int,std::allocator< int > >","ChangeBulkBounds", 3, argv[1] ));
36538
+ }
36539
+ arg3 = *ptr;
36540
+ if (SWIG_IsNewObj(res)) delete ptr;
36542
36541
  }
36543
- arg3 = reinterpret_cast< int * >(argp3);
36544
- res4 = SWIG_AsCharPtrAndSize(argv[2], &buf4, NULL, &alloc4);
36545
- if (!SWIG_IsOK(res4)) {
36546
- SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char *","ChangeBulkBounds", 4, argv[2] ));
36542
+ {
36543
+ std::vector<char,std::allocator< char > > *ptr = (std::vector<char,std::allocator< char > > *)0;
36544
+ int res = swig::asptr(argv[2], &ptr);
36545
+ if (!SWIG_IsOK(res) || !ptr) {
36546
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::vector< char,std::allocator< char > >","ChangeBulkBounds", 4, argv[2] ));
36547
+ }
36548
+ arg4 = *ptr;
36549
+ if (SWIG_IsNewObj(res)) delete ptr;
36547
36550
  }
36548
- arg4 = reinterpret_cast< char * >(buf4);
36549
- res5 = SWIG_ConvertPtr(argv[3], &argp5,SWIGTYPE_p_double, 0 | 0 );
36550
- if (!SWIG_IsOK(res5)) {
36551
- SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "double *","ChangeBulkBounds", 5, argv[3] ));
36551
+ {
36552
+ std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
36553
+ int res = swig::asptr(argv[3], &ptr);
36554
+ if (!SWIG_IsOK(res) || !ptr) {
36555
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::vector< double,std::allocator< double > >","ChangeBulkBounds", 5, argv[3] ));
36556
+ }
36557
+ arg5 = *ptr;
36558
+ if (SWIG_IsNewObj(res)) delete ptr;
36552
36559
  }
36553
- arg5 = reinterpret_cast< double * >(argp5);
36554
36560
  {
36555
36561
  try {
36556
36562
  result = (long)(arg1)->ChangeBulkBounds(arg2,arg3,arg4,arg5);
@@ -36563,10 +36569,8 @@ _wrap_GenModel_ChangeBulkBounds(int argc, VALUE *argv, VALUE self) {
36563
36569
  }
36564
36570
  }
36565
36571
  vresult = SWIG_From_long(static_cast< long >(result));
36566
- if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
36567
36572
  return vresult;
36568
36573
  fail:
36569
- if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
36570
36574
  return Qnil;
36571
36575
  }
36572
36576
 
@@ -36662,17 +36666,13 @@ fail:
36662
36666
  SWIGINTERN VALUE
36663
36667
  _wrap_GenModel_ChangeBulkObjectives(int argc, VALUE *argv, VALUE self) {
36664
36668
  GenModel *arg1 = (GenModel *) 0 ;
36665
- int arg2 ;
36666
- int *arg3 = (int *) 0 ;
36667
- double *arg4 = (double *) 0 ;
36669
+ size_t arg2 ;
36670
+ std::vector< int,std::allocator< int > > arg3 ;
36671
+ std::vector< double,std::allocator< double > > arg4 ;
36668
36672
  void *argp1 = 0 ;
36669
36673
  int res1 = 0 ;
36670
- int val2 ;
36674
+ size_t val2 ;
36671
36675
  int ecode2 = 0 ;
36672
- void *argp3 = 0 ;
36673
- int res3 = 0 ;
36674
- void *argp4 = 0 ;
36675
- int res4 = 0 ;
36676
36676
  long result;
36677
36677
  VALUE vresult = Qnil;
36678
36678
 
@@ -36684,21 +36684,29 @@ _wrap_GenModel_ChangeBulkObjectives(int argc, VALUE *argv, VALUE self) {
36684
36684
  SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "GenModel *","ChangeBulkObjectives", 1, self ));
36685
36685
  }
36686
36686
  arg1 = reinterpret_cast< GenModel * >(argp1);
36687
- ecode2 = SWIG_AsVal_int(argv[0], &val2);
36687
+ ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
36688
36688
  if (!SWIG_IsOK(ecode2)) {
36689
- SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","ChangeBulkObjectives", 2, argv[0] ));
36689
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","ChangeBulkObjectives", 2, argv[0] ));
36690
36690
  }
36691
- arg2 = static_cast< int >(val2);
36692
- res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_int, 0 | 0 );
36693
- if (!SWIG_IsOK(res3)) {
36694
- SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "int *","ChangeBulkObjectives", 3, argv[1] ));
36691
+ arg2 = static_cast< size_t >(val2);
36692
+ {
36693
+ std::vector<int,std::allocator< int > > *ptr = (std::vector<int,std::allocator< int > > *)0;
36694
+ int res = swig::asptr(argv[1], &ptr);
36695
+ if (!SWIG_IsOK(res) || !ptr) {
36696
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::vector< int,std::allocator< int > >","ChangeBulkObjectives", 3, argv[1] ));
36697
+ }
36698
+ arg3 = *ptr;
36699
+ if (SWIG_IsNewObj(res)) delete ptr;
36695
36700
  }
36696
- arg3 = reinterpret_cast< int * >(argp3);
36697
- res4 = SWIG_ConvertPtr(argv[2], &argp4,SWIGTYPE_p_double, 0 | 0 );
36698
- if (!SWIG_IsOK(res4)) {
36699
- SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "double *","ChangeBulkObjectives", 4, argv[2] ));
36701
+ {
36702
+ std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
36703
+ int res = swig::asptr(argv[2], &ptr);
36704
+ if (!SWIG_IsOK(res) || !ptr) {
36705
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::vector< double,std::allocator< double > >","ChangeBulkObjectives", 4, argv[2] ));
36706
+ }
36707
+ arg4 = *ptr;
36708
+ if (SWIG_IsNewObj(res)) delete ptr;
36700
36709
  }
36701
- arg4 = reinterpret_cast< double * >(argp4);
36702
36710
  {
36703
36711
  try {
36704
36712
  result = (long)(arg1)->ChangeBulkObjectives(arg2,arg3,arg4);
@@ -36717,6 +36725,78 @@ fail:
36717
36725
  }
36718
36726
 
36719
36727
 
36728
+ SWIGINTERN VALUE
36729
+ _wrap_GenModel_ChangeBulkNz(int argc, VALUE *argv, VALUE self) {
36730
+ GenModel *arg1 = (GenModel *) 0 ;
36731
+ size_t arg2 ;
36732
+ std::vector< int,std::allocator< int > > arg3 ;
36733
+ std::vector< int,std::allocator< int > > arg4 ;
36734
+ std::vector< double,std::allocator< double > > arg5 ;
36735
+ void *argp1 = 0 ;
36736
+ int res1 = 0 ;
36737
+ size_t val2 ;
36738
+ int ecode2 = 0 ;
36739
+ long result;
36740
+ VALUE vresult = Qnil;
36741
+
36742
+ if ((argc < 4) || (argc > 4)) {
36743
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
36744
+ }
36745
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_GenModel, 0 | 0 );
36746
+ if (!SWIG_IsOK(res1)) {
36747
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "GenModel *","ChangeBulkNz", 1, self ));
36748
+ }
36749
+ arg1 = reinterpret_cast< GenModel * >(argp1);
36750
+ ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
36751
+ if (!SWIG_IsOK(ecode2)) {
36752
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","ChangeBulkNz", 2, argv[0] ));
36753
+ }
36754
+ arg2 = static_cast< size_t >(val2);
36755
+ {
36756
+ std::vector<int,std::allocator< int > > *ptr = (std::vector<int,std::allocator< int > > *)0;
36757
+ int res = swig::asptr(argv[1], &ptr);
36758
+ if (!SWIG_IsOK(res) || !ptr) {
36759
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::vector< int,std::allocator< int > >","ChangeBulkNz", 3, argv[1] ));
36760
+ }
36761
+ arg3 = *ptr;
36762
+ if (SWIG_IsNewObj(res)) delete ptr;
36763
+ }
36764
+ {
36765
+ std::vector<int,std::allocator< int > > *ptr = (std::vector<int,std::allocator< int > > *)0;
36766
+ int res = swig::asptr(argv[2], &ptr);
36767
+ if (!SWIG_IsOK(res) || !ptr) {
36768
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::vector< int,std::allocator< int > >","ChangeBulkNz", 4, argv[2] ));
36769
+ }
36770
+ arg4 = *ptr;
36771
+ if (SWIG_IsNewObj(res)) delete ptr;
36772
+ }
36773
+ {
36774
+ std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
36775
+ int res = swig::asptr(argv[3], &ptr);
36776
+ if (!SWIG_IsOK(res) || !ptr) {
36777
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::vector< double,std::allocator< double > >","ChangeBulkNz", 5, argv[3] ));
36778
+ }
36779
+ arg5 = *ptr;
36780
+ if (SWIG_IsNewObj(res)) delete ptr;
36781
+ }
36782
+ {
36783
+ try {
36784
+ result = (long)(arg1)->ChangeBulkNz(arg2,arg3,arg4,arg5);
36785
+ }
36786
+ catch(string str) {
36787
+ SWIG_exception(SWIG_RuntimeError,str.c_str());
36788
+ }
36789
+ catch(...) {
36790
+ SWIG_exception(SWIG_RuntimeError,"Unknown exception");
36791
+ }
36792
+ }
36793
+ vresult = SWIG_From_long(static_cast< long >(result));
36794
+ return vresult;
36795
+ fail:
36796
+ return Qnil;
36797
+ }
36798
+
36799
+
36720
36800
  SWIGINTERN VALUE
36721
36801
  _wrap_GenModel_DeleteMipStarts(int argc, VALUE *argv, VALUE self) {
36722
36802
  GenModel *arg1 = (GenModel *) 0 ;
@@ -37163,7 +37243,7 @@ _wrap_GenModel_GetStatusString(int argc, VALUE *argv, VALUE self) {
37163
37243
  GenModel *arg1 = (GenModel *) 0 ;
37164
37244
  void *argp1 = 0 ;
37165
37245
  int res1 = 0 ;
37166
- string result;
37246
+ std::string result;
37167
37247
  VALUE vresult = Qnil;
37168
37248
 
37169
37249
  if ((argc < 0) || (argc > 0)) {
@@ -37185,7 +37265,85 @@ _wrap_GenModel_GetStatusString(int argc, VALUE *argv, VALUE self) {
37185
37265
  SWIG_exception(SWIG_RuntimeError,"Unknown exception");
37186
37266
  }
37187
37267
  }
37188
- vresult = SWIG_NewPointerObj((new string(static_cast< const string& >(result))), SWIGTYPE_p_string, SWIG_POINTER_OWN | 0 );
37268
+ vresult = SWIG_From_std_string(static_cast< std::string >(result));
37269
+ return vresult;
37270
+ fail:
37271
+ return Qnil;
37272
+ }
37273
+
37274
+
37275
+ SWIGINTERN VALUE
37276
+ _wrap_GenModel_Serialize(int argc, VALUE *argv, VALUE self) {
37277
+ GenModel *arg1 = (GenModel *) 0 ;
37278
+ void *argp1 = 0 ;
37279
+ int res1 = 0 ;
37280
+ std::string result;
37281
+ VALUE vresult = Qnil;
37282
+
37283
+ if ((argc < 0) || (argc > 0)) {
37284
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
37285
+ }
37286
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_GenModel, 0 | 0 );
37287
+ if (!SWIG_IsOK(res1)) {
37288
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "GenModel *","Serialize", 1, self ));
37289
+ }
37290
+ arg1 = reinterpret_cast< GenModel * >(argp1);
37291
+ {
37292
+ try {
37293
+ result = (arg1)->Serialize();
37294
+ }
37295
+ catch(string str) {
37296
+ SWIG_exception(SWIG_RuntimeError,str.c_str());
37297
+ }
37298
+ catch(...) {
37299
+ SWIG_exception(SWIG_RuntimeError,"Unknown exception");
37300
+ }
37301
+ }
37302
+ vresult = SWIG_From_std_string(static_cast< std::string >(result));
37303
+ return vresult;
37304
+ fail:
37305
+ return Qnil;
37306
+ }
37307
+
37308
+
37309
+ SWIGINTERN VALUE
37310
+ _wrap_GenModel_Deserialize(int argc, VALUE *argv, VALUE self) {
37311
+ GenModel *arg1 = (GenModel *) 0 ;
37312
+ std::string arg2 ;
37313
+ void *argp1 = 0 ;
37314
+ int res1 = 0 ;
37315
+ long result;
37316
+ VALUE vresult = Qnil;
37317
+
37318
+ if ((argc < 1) || (argc > 1)) {
37319
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
37320
+ }
37321
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_GenModel, 0 | 0 );
37322
+ if (!SWIG_IsOK(res1)) {
37323
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "GenModel *","Deserialize", 1, self ));
37324
+ }
37325
+ arg1 = reinterpret_cast< GenModel * >(argp1);
37326
+ {
37327
+ std::string *ptr = (std::string *)0;
37328
+ int res = SWIG_AsPtr_std_string(argv[0], &ptr);
37329
+ if (!SWIG_IsOK(res) || !ptr) {
37330
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::string","Deserialize", 2, argv[0] ));
37331
+ }
37332
+ arg2 = *ptr;
37333
+ if (SWIG_IsNewObj(res)) delete ptr;
37334
+ }
37335
+ {
37336
+ try {
37337
+ result = (long)(arg1)->Deserialize(arg2);
37338
+ }
37339
+ catch(string str) {
37340
+ SWIG_exception(SWIG_RuntimeError,str.c_str());
37341
+ }
37342
+ catch(...) {
37343
+ SWIG_exception(SWIG_RuntimeError,"Unknown exception");
37344
+ }
37345
+ }
37346
+ vresult = SWIG_From_long(static_cast< long >(result));
37189
37347
  return vresult;
37190
37348
  fail:
37191
37349
  return Qnil;
@@ -38751,8 +38909,8 @@ fail:
38751
38909
  SWIGINTERN VALUE
38752
38910
  _wrap_GenModelCplex_AddSolverCol__SWIG_0(int argc, VALUE *argv, VALUE self) {
38753
38911
  GenModelCplex *arg1 = (GenModelCplex *) 0 ;
38754
- std::vector< int,std::allocator< int > > *arg2 = 0 ;
38755
- std::vector< double,std::allocator< double > > *arg3 = 0 ;
38912
+ std::vector< int,std::allocator< int > > arg2 ;
38913
+ std::vector< double,std::allocator< double > > arg3 ;
38756
38914
  double arg4 ;
38757
38915
  double arg5 ;
38758
38916
  double arg6 ;
@@ -38760,10 +38918,6 @@ _wrap_GenModelCplex_AddSolverCol__SWIG_0(int argc, VALUE *argv, VALUE self) {
38760
38918
  char arg8 ;
38761
38919
  void *argp1 = 0 ;
38762
38920
  int res1 = 0 ;
38763
- void *argp2 = 0 ;
38764
- int res2 = 0 ;
38765
- void *argp3 = 0 ;
38766
- int res3 = 0 ;
38767
38921
  double val4 ;
38768
38922
  int ecode4 = 0 ;
38769
38923
  double val5 ;
@@ -38783,22 +38937,24 @@ _wrap_GenModelCplex_AddSolverCol__SWIG_0(int argc, VALUE *argv, VALUE self) {
38783
38937
  SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "GenModelCplex *","AddSolverCol", 1, self ));
38784
38938
  }
38785
38939
  arg1 = reinterpret_cast< GenModelCplex * >(argp1);
38786
- res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 );
38787
- if (!SWIG_IsOK(res2)) {
38788
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< int,std::allocator< int > > &","AddSolverCol", 2, argv[0] ));
38789
- }
38790
- if (!argp2) {
38791
- SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< int,std::allocator< int > > &","AddSolverCol", 2, argv[0]));
38792
- }
38793
- arg2 = reinterpret_cast< std::vector< int,std::allocator< int > > * >(argp2);
38794
- res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 );
38795
- if (!SWIG_IsOK(res3)) {
38796
- SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::vector< double,std::allocator< double > > &","AddSolverCol", 3, argv[1] ));
38940
+ {
38941
+ std::vector<int,std::allocator< int > > *ptr = (std::vector<int,std::allocator< int > > *)0;
38942
+ int res = swig::asptr(argv[0], &ptr);
38943
+ if (!SWIG_IsOK(res) || !ptr) {
38944
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::vector< int,std::allocator< int > >","AddSolverCol", 2, argv[0] ));
38945
+ }
38946
+ arg2 = *ptr;
38947
+ if (SWIG_IsNewObj(res)) delete ptr;
38797
38948
  }
38798
- if (!argp3) {
38799
- SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< double,std::allocator< double > > &","AddSolverCol", 3, argv[1]));
38949
+ {
38950
+ std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
38951
+ int res = swig::asptr(argv[1], &ptr);
38952
+ if (!SWIG_IsOK(res) || !ptr) {
38953
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::vector< double,std::allocator< double > >","AddSolverCol", 3, argv[1] ));
38954
+ }
38955
+ arg3 = *ptr;
38956
+ if (SWIG_IsNewObj(res)) delete ptr;
38800
38957
  }
38801
- arg3 = reinterpret_cast< std::vector< double,std::allocator< double > > * >(argp3);
38802
38958
  ecode4 = SWIG_AsVal_double(argv[2], &val4);
38803
38959
  if (!SWIG_IsOK(ecode4)) {
38804
38960
  SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","AddSolverCol", 4, argv[2] ));
@@ -38830,7 +38986,7 @@ _wrap_GenModelCplex_AddSolverCol__SWIG_0(int argc, VALUE *argv, VALUE self) {
38830
38986
  arg8 = static_cast< char >(val8);
38831
38987
  {
38832
38988
  try {
38833
- result = (long)(arg1)->AddSolverCol(*arg2,*arg3,arg4,arg5,arg6,arg7,arg8);
38989
+ result = (long)(arg1)->AddSolverCol(arg2,arg3,arg4,arg5,arg6,arg7,arg8);
38834
38990
  }
38835
38991
  catch(string str) {
38836
38992
  SWIG_exception(SWIG_RuntimeError,str.c_str());
@@ -38849,18 +39005,14 @@ fail:
38849
39005
  SWIGINTERN VALUE
38850
39006
  _wrap_GenModelCplex_AddSolverCol__SWIG_1(int argc, VALUE *argv, VALUE self) {
38851
39007
  GenModelCplex *arg1 = (GenModelCplex *) 0 ;
38852
- std::vector< int,std::allocator< int > > *arg2 = 0 ;
38853
- std::vector< double,std::allocator< double > > *arg3 = 0 ;
39008
+ std::vector< int,std::allocator< int > > arg2 ;
39009
+ std::vector< double,std::allocator< double > > arg3 ;
38854
39010
  double arg4 ;
38855
39011
  double arg5 ;
38856
39012
  double arg6 ;
38857
39013
  std::string arg7 ;
38858
39014
  void *argp1 = 0 ;
38859
39015
  int res1 = 0 ;
38860
- void *argp2 = 0 ;
38861
- int res2 = 0 ;
38862
- void *argp3 = 0 ;
38863
- int res3 = 0 ;
38864
39016
  double val4 ;
38865
39017
  int ecode4 = 0 ;
38866
39018
  double val5 ;
@@ -38878,22 +39030,24 @@ _wrap_GenModelCplex_AddSolverCol__SWIG_1(int argc, VALUE *argv, VALUE self) {
38878
39030
  SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "GenModelCplex *","AddSolverCol", 1, self ));
38879
39031
  }
38880
39032
  arg1 = reinterpret_cast< GenModelCplex * >(argp1);
38881
- res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 );
38882
- if (!SWIG_IsOK(res2)) {
38883
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< int,std::allocator< int > > &","AddSolverCol", 2, argv[0] ));
38884
- }
38885
- if (!argp2) {
38886
- SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< int,std::allocator< int > > &","AddSolverCol", 2, argv[0]));
38887
- }
38888
- arg2 = reinterpret_cast< std::vector< int,std::allocator< int > > * >(argp2);
38889
- res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 );
38890
- if (!SWIG_IsOK(res3)) {
38891
- SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::vector< double,std::allocator< double > > &","AddSolverCol", 3, argv[1] ));
39033
+ {
39034
+ std::vector<int,std::allocator< int > > *ptr = (std::vector<int,std::allocator< int > > *)0;
39035
+ int res = swig::asptr(argv[0], &ptr);
39036
+ if (!SWIG_IsOK(res) || !ptr) {
39037
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::vector< int,std::allocator< int > >","AddSolverCol", 2, argv[0] ));
39038
+ }
39039
+ arg2 = *ptr;
39040
+ if (SWIG_IsNewObj(res)) delete ptr;
38892
39041
  }
38893
- if (!argp3) {
38894
- SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< double,std::allocator< double > > &","AddSolverCol", 3, argv[1]));
39042
+ {
39043
+ std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
39044
+ int res = swig::asptr(argv[1], &ptr);
39045
+ if (!SWIG_IsOK(res) || !ptr) {
39046
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::vector< double,std::allocator< double > >","AddSolverCol", 3, argv[1] ));
39047
+ }
39048
+ arg3 = *ptr;
39049
+ if (SWIG_IsNewObj(res)) delete ptr;
38895
39050
  }
38896
- arg3 = reinterpret_cast< std::vector< double,std::allocator< double > > * >(argp3);
38897
39051
  ecode4 = SWIG_AsVal_double(argv[2], &val4);
38898
39052
  if (!SWIG_IsOK(ecode4)) {
38899
39053
  SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","AddSolverCol", 4, argv[2] ));
@@ -38920,7 +39074,7 @@ _wrap_GenModelCplex_AddSolverCol__SWIG_1(int argc, VALUE *argv, VALUE self) {
38920
39074
  }
38921
39075
  {
38922
39076
  try {
38923
- result = (long)(arg1)->AddSolverCol(*arg2,*arg3,arg4,arg5,arg6,arg7);
39077
+ result = (long)(arg1)->AddSolverCol(arg2,arg3,arg4,arg5,arg6,arg7);
38924
39078
  }
38925
39079
  catch(string str) {
38926
39080
  SWIG_exception(SWIG_RuntimeError,str.c_str());
@@ -38953,12 +39107,10 @@ SWIGINTERN VALUE _wrap_GenModelCplex_AddSolverCol(int nargs, VALUE *args, VALUE
38953
39107
  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_GenModelCplex, 0);
38954
39108
  _v = SWIG_CheckState(res);
38955
39109
  if (_v) {
38956
- void *vptr = 0;
38957
- int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0);
39110
+ int res = swig::asptr(argv[1], (std::vector<int,std::allocator< int > >**)(0));
38958
39111
  _v = SWIG_CheckState(res);
38959
39112
  if (_v) {
38960
- void *vptr = 0;
38961
- int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0);
39113
+ int res = swig::asptr(argv[2], (std::vector<double,std::allocator< double > >**)(0));
38962
39114
  _v = SWIG_CheckState(res);
38963
39115
  if (_v) {
38964
39116
  {
@@ -38994,12 +39146,10 @@ SWIGINTERN VALUE _wrap_GenModelCplex_AddSolverCol(int nargs, VALUE *args, VALUE
38994
39146
  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_GenModelCplex, 0);
38995
39147
  _v = SWIG_CheckState(res);
38996
39148
  if (_v) {
38997
- void *vptr = 0;
38998
- int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0);
39149
+ int res = swig::asptr(argv[1], (std::vector<int,std::allocator< int > >**)(0));
38999
39150
  _v = SWIG_CheckState(res);
39000
39151
  if (_v) {
39001
- void *vptr = 0;
39002
- int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0);
39152
+ int res = swig::asptr(argv[2], (std::vector<double,std::allocator< double > >**)(0));
39003
39153
  _v = SWIG_CheckState(res);
39004
39154
  if (_v) {
39005
39155
  {
@@ -39038,8 +39188,8 @@ SWIGINTERN VALUE _wrap_GenModelCplex_AddSolverCol(int nargs, VALUE *args, VALUE
39038
39188
 
39039
39189
  fail:
39040
39190
  Ruby_Format_OverloadedError( argc, 9, "GenModelCplex.AddSolverCol",
39041
- " long GenModelCplex.AddSolverCol(std::vector< int,std::allocator< int > > &ind, std::vector< double,std::allocator< double > > &val, double obj, double lb, double ub, std::string name, char type)\n"
39042
- " long GenModelCplex.AddSolverCol(std::vector< int,std::allocator< int > > &ind, std::vector< double,std::allocator< double > > &val, double obj, double lb, double ub, std::string name)\n");
39191
+ " long GenModelCplex.AddSolverCol(std::vector< int,std::allocator< int > > ind, std::vector< double,std::allocator< double > > val, double obj, double lb, double ub, std::string name, char type)\n"
39192
+ " long GenModelCplex.AddSolverCol(std::vector< int,std::allocator< int > > ind, std::vector< double,std::allocator< double > > val, double obj, double lb, double ub, std::string name)\n");
39043
39193
 
39044
39194
  return Qnil;
39045
39195
  }
@@ -39048,17 +39198,13 @@ fail:
39048
39198
  SWIGINTERN VALUE
39049
39199
  _wrap_GenModelCplex_AddSolverRow(int argc, VALUE *argv, VALUE self) {
39050
39200
  GenModelCplex *arg1 = (GenModelCplex *) 0 ;
39051
- std::vector< int,std::allocator< int > > *arg2 = 0 ;
39052
- std::vector< double,std::allocator< double > > *arg3 = 0 ;
39201
+ std::vector< int,std::allocator< int > > arg2 ;
39202
+ std::vector< double,std::allocator< double > > arg3 ;
39053
39203
  double arg4 ;
39054
39204
  char arg5 ;
39055
39205
  std::string arg6 ;
39056
39206
  void *argp1 = 0 ;
39057
39207
  int res1 = 0 ;
39058
- void *argp2 = 0 ;
39059
- int res2 = 0 ;
39060
- void *argp3 = 0 ;
39061
- int res3 = 0 ;
39062
39208
  double val4 ;
39063
39209
  int ecode4 = 0 ;
39064
39210
  char val5 ;
@@ -39074,22 +39220,24 @@ _wrap_GenModelCplex_AddSolverRow(int argc, VALUE *argv, VALUE self) {
39074
39220
  SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "GenModelCplex *","AddSolverRow", 1, self ));
39075
39221
  }
39076
39222
  arg1 = reinterpret_cast< GenModelCplex * >(argp1);
39077
- res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 );
39078
- if (!SWIG_IsOK(res2)) {
39079
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< int,std::allocator< int > > &","AddSolverRow", 2, argv[0] ));
39080
- }
39081
- if (!argp2) {
39082
- SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< int,std::allocator< int > > &","AddSolverRow", 2, argv[0]));
39083
- }
39084
- arg2 = reinterpret_cast< std::vector< int,std::allocator< int > > * >(argp2);
39085
- res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 );
39086
- if (!SWIG_IsOK(res3)) {
39087
- SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::vector< double,std::allocator< double > > &","AddSolverRow", 3, argv[1] ));
39223
+ {
39224
+ std::vector<int,std::allocator< int > > *ptr = (std::vector<int,std::allocator< int > > *)0;
39225
+ int res = swig::asptr(argv[0], &ptr);
39226
+ if (!SWIG_IsOK(res) || !ptr) {
39227
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::vector< int,std::allocator< int > >","AddSolverRow", 2, argv[0] ));
39228
+ }
39229
+ arg2 = *ptr;
39230
+ if (SWIG_IsNewObj(res)) delete ptr;
39088
39231
  }
39089
- if (!argp3) {
39090
- SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< double,std::allocator< double > > &","AddSolverRow", 3, argv[1]));
39232
+ {
39233
+ std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
39234
+ int res = swig::asptr(argv[1], &ptr);
39235
+ if (!SWIG_IsOK(res) || !ptr) {
39236
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::vector< double,std::allocator< double > >","AddSolverRow", 3, argv[1] ));
39237
+ }
39238
+ arg3 = *ptr;
39239
+ if (SWIG_IsNewObj(res)) delete ptr;
39091
39240
  }
39092
- arg3 = reinterpret_cast< std::vector< double,std::allocator< double > > * >(argp3);
39093
39241
  ecode4 = SWIG_AsVal_double(argv[2], &val4);
39094
39242
  if (!SWIG_IsOK(ecode4)) {
39095
39243
  SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","AddSolverRow", 4, argv[2] ));
@@ -39111,7 +39259,7 @@ _wrap_GenModelCplex_AddSolverRow(int argc, VALUE *argv, VALUE self) {
39111
39259
  }
39112
39260
  {
39113
39261
  try {
39114
- result = (long)(arg1)->AddSolverRow(*arg2,*arg3,arg4,arg5,arg6);
39262
+ result = (long)(arg1)->AddSolverRow(arg2,arg3,arg4,arg5,arg6);
39115
39263
  }
39116
39264
  catch(string str) {
39117
39265
  SWIG_exception(SWIG_RuntimeError,str.c_str());
@@ -39530,21 +39678,14 @@ fail:
39530
39678
  SWIGINTERN VALUE
39531
39679
  _wrap_GenModelCplex_ChangeBulkBounds(int argc, VALUE *argv, VALUE self) {
39532
39680
  GenModelCplex *arg1 = (GenModelCplex *) 0 ;
39533
- int arg2 ;
39534
- int *arg3 = (int *) 0 ;
39535
- char *arg4 = (char *) 0 ;
39536
- double *arg5 = (double *) 0 ;
39681
+ size_t arg2 ;
39682
+ std::vector< int,std::allocator< int > > arg3 ;
39683
+ std::vector< char,std::allocator< char > > arg4 ;
39684
+ std::vector< double,std::allocator< double > > arg5 ;
39537
39685
  void *argp1 = 0 ;
39538
39686
  int res1 = 0 ;
39539
- int val2 ;
39687
+ size_t val2 ;
39540
39688
  int ecode2 = 0 ;
39541
- void *argp3 = 0 ;
39542
- int res3 = 0 ;
39543
- int res4 ;
39544
- char *buf4 = 0 ;
39545
- int alloc4 = 0 ;
39546
- void *argp5 = 0 ;
39547
- int res5 = 0 ;
39548
39689
  long result;
39549
39690
  VALUE vresult = Qnil;
39550
39691
 
@@ -39556,26 +39697,38 @@ _wrap_GenModelCplex_ChangeBulkBounds(int argc, VALUE *argv, VALUE self) {
39556
39697
  SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "GenModelCplex *","ChangeBulkBounds", 1, self ));
39557
39698
  }
39558
39699
  arg1 = reinterpret_cast< GenModelCplex * >(argp1);
39559
- ecode2 = SWIG_AsVal_int(argv[0], &val2);
39700
+ ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
39560
39701
  if (!SWIG_IsOK(ecode2)) {
39561
- SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","ChangeBulkBounds", 2, argv[0] ));
39702
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","ChangeBulkBounds", 2, argv[0] ));
39562
39703
  }
39563
- arg2 = static_cast< int >(val2);
39564
- res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_int, 0 | 0 );
39565
- if (!SWIG_IsOK(res3)) {
39566
- SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "int *","ChangeBulkBounds", 3, argv[1] ));
39704
+ arg2 = static_cast< size_t >(val2);
39705
+ {
39706
+ std::vector<int,std::allocator< int > > *ptr = (std::vector<int,std::allocator< int > > *)0;
39707
+ int res = swig::asptr(argv[1], &ptr);
39708
+ if (!SWIG_IsOK(res) || !ptr) {
39709
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::vector< int,std::allocator< int > >","ChangeBulkBounds", 3, argv[1] ));
39710
+ }
39711
+ arg3 = *ptr;
39712
+ if (SWIG_IsNewObj(res)) delete ptr;
39567
39713
  }
39568
- arg3 = reinterpret_cast< int * >(argp3);
39569
- res4 = SWIG_AsCharPtrAndSize(argv[2], &buf4, NULL, &alloc4);
39570
- if (!SWIG_IsOK(res4)) {
39571
- SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char *","ChangeBulkBounds", 4, argv[2] ));
39714
+ {
39715
+ std::vector<char,std::allocator< char > > *ptr = (std::vector<char,std::allocator< char > > *)0;
39716
+ int res = swig::asptr(argv[2], &ptr);
39717
+ if (!SWIG_IsOK(res) || !ptr) {
39718
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::vector< char,std::allocator< char > >","ChangeBulkBounds", 4, argv[2] ));
39719
+ }
39720
+ arg4 = *ptr;
39721
+ if (SWIG_IsNewObj(res)) delete ptr;
39572
39722
  }
39573
- arg4 = reinterpret_cast< char * >(buf4);
39574
- res5 = SWIG_ConvertPtr(argv[3], &argp5,SWIGTYPE_p_double, 0 | 0 );
39575
- if (!SWIG_IsOK(res5)) {
39576
- SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "double *","ChangeBulkBounds", 5, argv[3] ));
39723
+ {
39724
+ std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
39725
+ int res = swig::asptr(argv[3], &ptr);
39726
+ if (!SWIG_IsOK(res) || !ptr) {
39727
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::vector< double,std::allocator< double > >","ChangeBulkBounds", 5, argv[3] ));
39728
+ }
39729
+ arg5 = *ptr;
39730
+ if (SWIG_IsNewObj(res)) delete ptr;
39577
39731
  }
39578
- arg5 = reinterpret_cast< double * >(argp5);
39579
39732
  {
39580
39733
  try {
39581
39734
  result = (long)(arg1)->ChangeBulkBounds(arg2,arg3,arg4,arg5);
@@ -39588,10 +39741,8 @@ _wrap_GenModelCplex_ChangeBulkBounds(int argc, VALUE *argv, VALUE self) {
39588
39741
  }
39589
39742
  }
39590
39743
  vresult = SWIG_From_long(static_cast< long >(result));
39591
- if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
39592
39744
  return vresult;
39593
39745
  fail:
39594
- if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
39595
39746
  return Qnil;
39596
39747
  }
39597
39748
 
@@ -39599,17 +39750,13 @@ fail:
39599
39750
  SWIGINTERN VALUE
39600
39751
  _wrap_GenModelCplex_ChangeBulkObjectives(int argc, VALUE *argv, VALUE self) {
39601
39752
  GenModelCplex *arg1 = (GenModelCplex *) 0 ;
39602
- int arg2 ;
39603
- int *arg3 = (int *) 0 ;
39604
- double *arg4 = (double *) 0 ;
39753
+ size_t arg2 ;
39754
+ std::vector< int,std::allocator< int > > arg3 ;
39755
+ std::vector< double,std::allocator< double > > arg4 ;
39605
39756
  void *argp1 = 0 ;
39606
39757
  int res1 = 0 ;
39607
- int val2 ;
39758
+ size_t val2 ;
39608
39759
  int ecode2 = 0 ;
39609
- void *argp3 = 0 ;
39610
- int res3 = 0 ;
39611
- void *argp4 = 0 ;
39612
- int res4 = 0 ;
39613
39760
  long result;
39614
39761
  VALUE vresult = Qnil;
39615
39762
 
@@ -39621,21 +39768,29 @@ _wrap_GenModelCplex_ChangeBulkObjectives(int argc, VALUE *argv, VALUE self) {
39621
39768
  SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "GenModelCplex *","ChangeBulkObjectives", 1, self ));
39622
39769
  }
39623
39770
  arg1 = reinterpret_cast< GenModelCplex * >(argp1);
39624
- ecode2 = SWIG_AsVal_int(argv[0], &val2);
39771
+ ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
39625
39772
  if (!SWIG_IsOK(ecode2)) {
39626
- SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","ChangeBulkObjectives", 2, argv[0] ));
39773
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","ChangeBulkObjectives", 2, argv[0] ));
39627
39774
  }
39628
- arg2 = static_cast< int >(val2);
39629
- res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_int, 0 | 0 );
39630
- if (!SWIG_IsOK(res3)) {
39631
- SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "int *","ChangeBulkObjectives", 3, argv[1] ));
39775
+ arg2 = static_cast< size_t >(val2);
39776
+ {
39777
+ std::vector<int,std::allocator< int > > *ptr = (std::vector<int,std::allocator< int > > *)0;
39778
+ int res = swig::asptr(argv[1], &ptr);
39779
+ if (!SWIG_IsOK(res) || !ptr) {
39780
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::vector< int,std::allocator< int > >","ChangeBulkObjectives", 3, argv[1] ));
39781
+ }
39782
+ arg3 = *ptr;
39783
+ if (SWIG_IsNewObj(res)) delete ptr;
39632
39784
  }
39633
- arg3 = reinterpret_cast< int * >(argp3);
39634
- res4 = SWIG_ConvertPtr(argv[2], &argp4,SWIGTYPE_p_double, 0 | 0 );
39635
- if (!SWIG_IsOK(res4)) {
39636
- SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "double *","ChangeBulkObjectives", 4, argv[2] ));
39785
+ {
39786
+ std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
39787
+ int res = swig::asptr(argv[2], &ptr);
39788
+ if (!SWIG_IsOK(res) || !ptr) {
39789
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::vector< double,std::allocator< double > >","ChangeBulkObjectives", 4, argv[2] ));
39790
+ }
39791
+ arg4 = *ptr;
39792
+ if (SWIG_IsNewObj(res)) delete ptr;
39637
39793
  }
39638
- arg4 = reinterpret_cast< double * >(argp4);
39639
39794
  {
39640
39795
  try {
39641
39796
  result = (long)(arg1)->ChangeBulkObjectives(arg2,arg3,arg4);
@@ -39657,20 +39812,14 @@ fail:
39657
39812
  SWIGINTERN VALUE
39658
39813
  _wrap_GenModelCplex_ChangeBulkNz(int argc, VALUE *argv, VALUE self) {
39659
39814
  GenModelCplex *arg1 = (GenModelCplex *) 0 ;
39660
- int arg2 ;
39661
- int *arg3 = (int *) 0 ;
39662
- int *arg4 = (int *) 0 ;
39663
- double *arg5 = (double *) 0 ;
39815
+ size_t arg2 ;
39816
+ std::vector< int,std::allocator< int > > arg3 ;
39817
+ std::vector< int,std::allocator< int > > arg4 ;
39818
+ std::vector< double,std::allocator< double > > arg5 ;
39664
39819
  void *argp1 = 0 ;
39665
39820
  int res1 = 0 ;
39666
- int val2 ;
39821
+ size_t val2 ;
39667
39822
  int ecode2 = 0 ;
39668
- void *argp3 = 0 ;
39669
- int res3 = 0 ;
39670
- void *argp4 = 0 ;
39671
- int res4 = 0 ;
39672
- void *argp5 = 0 ;
39673
- int res5 = 0 ;
39674
39823
  long result;
39675
39824
  VALUE vresult = Qnil;
39676
39825
 
@@ -39682,26 +39831,38 @@ _wrap_GenModelCplex_ChangeBulkNz(int argc, VALUE *argv, VALUE self) {
39682
39831
  SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "GenModelCplex *","ChangeBulkNz", 1, self ));
39683
39832
  }
39684
39833
  arg1 = reinterpret_cast< GenModelCplex * >(argp1);
39685
- ecode2 = SWIG_AsVal_int(argv[0], &val2);
39834
+ ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
39686
39835
  if (!SWIG_IsOK(ecode2)) {
39687
- SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","ChangeBulkNz", 2, argv[0] ));
39836
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","ChangeBulkNz", 2, argv[0] ));
39688
39837
  }
39689
- arg2 = static_cast< int >(val2);
39690
- res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_int, 0 | 0 );
39691
- if (!SWIG_IsOK(res3)) {
39692
- SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "int *","ChangeBulkNz", 3, argv[1] ));
39838
+ arg2 = static_cast< size_t >(val2);
39839
+ {
39840
+ std::vector<int,std::allocator< int > > *ptr = (std::vector<int,std::allocator< int > > *)0;
39841
+ int res = swig::asptr(argv[1], &ptr);
39842
+ if (!SWIG_IsOK(res) || !ptr) {
39843
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::vector< int,std::allocator< int > >","ChangeBulkNz", 3, argv[1] ));
39844
+ }
39845
+ arg3 = *ptr;
39846
+ if (SWIG_IsNewObj(res)) delete ptr;
39693
39847
  }
39694
- arg3 = reinterpret_cast< int * >(argp3);
39695
- res4 = SWIG_ConvertPtr(argv[2], &argp4,SWIGTYPE_p_int, 0 | 0 );
39696
- if (!SWIG_IsOK(res4)) {
39697
- SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "int *","ChangeBulkNz", 4, argv[2] ));
39848
+ {
39849
+ std::vector<int,std::allocator< int > > *ptr = (std::vector<int,std::allocator< int > > *)0;
39850
+ int res = swig::asptr(argv[2], &ptr);
39851
+ if (!SWIG_IsOK(res) || !ptr) {
39852
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::vector< int,std::allocator< int > >","ChangeBulkNz", 4, argv[2] ));
39853
+ }
39854
+ arg4 = *ptr;
39855
+ if (SWIG_IsNewObj(res)) delete ptr;
39698
39856
  }
39699
- arg4 = reinterpret_cast< int * >(argp4);
39700
- res5 = SWIG_ConvertPtr(argv[3], &argp5,SWIGTYPE_p_double, 0 | 0 );
39701
- if (!SWIG_IsOK(res5)) {
39702
- SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "double *","ChangeBulkNz", 5, argv[3] ));
39857
+ {
39858
+ std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
39859
+ int res = swig::asptr(argv[3], &ptr);
39860
+ if (!SWIG_IsOK(res) || !ptr) {
39861
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::vector< double,std::allocator< double > >","ChangeBulkNz", 5, argv[3] ));
39862
+ }
39863
+ arg5 = *ptr;
39864
+ if (SWIG_IsNewObj(res)) delete ptr;
39703
39865
  }
39704
- arg5 = reinterpret_cast< double * >(argp5);
39705
39866
  {
39706
39867
  try {
39707
39868
  result = (long)(arg1)->ChangeBulkNz(arg2,arg3,arg4,arg5);
@@ -50547,6 +50708,7 @@ SWIGEXPORT void Init_Genmodel(void) {
50547
50708
  rb_define_method(SwigClassGenModel.klass, "WriteProblemToLpFile", VALUEFUNC(_wrap_GenModel_WriteProblemToLpFile), -1);
50548
50709
  rb_define_method(SwigClassGenModel.klass, "WriteSolutionToFile", VALUEFUNC(_wrap_GenModel_WriteSolutionToFile), -1);
50549
50710
  rb_define_method(SwigClassGenModel.klass, "ChangeBulkObjectives", VALUEFUNC(_wrap_GenModel_ChangeBulkObjectives), -1);
50711
+ rb_define_method(SwigClassGenModel.klass, "ChangeBulkNz", VALUEFUNC(_wrap_GenModel_ChangeBulkNz), -1);
50550
50712
  rb_define_method(SwigClassGenModel.klass, "DeleteMipStarts", VALUEFUNC(_wrap_GenModel_DeleteMipStarts), -1);
50551
50713
  rb_define_method(SwigClassGenModel.klass, "GetMIPRelativeGap", VALUEFUNC(_wrap_GenModel_GetMIPRelativeGap), -1);
50552
50714
  rb_define_method(SwigClassGenModel.klass, "FindConstraintMaxLhs", VALUEFUNC(_wrap_GenModel_FindConstraintMaxLhs), -1);
@@ -50557,6 +50719,8 @@ SWIGEXPORT void Init_Genmodel(void) {
50557
50719
  rb_define_method(SwigClassGenModel.klass, "MakeAllConstraintFeasible", VALUEFUNC(_wrap_GenModel_MakeAllConstraintFeasible), -1);
50558
50720
  rb_define_method(SwigClassGenModel.klass, "PrintRowInfo", VALUEFUNC(_wrap_GenModel_PrintRowInfo), -1);
50559
50721
  rb_define_method(SwigClassGenModel.klass, "GetStatusString", VALUEFUNC(_wrap_GenModel_GetStatusString), -1);
50722
+ rb_define_method(SwigClassGenModel.klass, "Serialize", VALUEFUNC(_wrap_GenModel_Serialize), -1);
50723
+ rb_define_method(SwigClassGenModel.klass, "Deserialize", VALUEFUNC(_wrap_GenModel_Deserialize), -1);
50560
50724
  rb_define_method(SwigClassGenModel.klass, "binit=", VALUEFUNC(_wrap_GenModel_binit_set), -1);
50561
50725
  rb_define_method(SwigClassGenModel.klass, "binit", VALUEFUNC(_wrap_GenModel_binit_get), -1);
50562
50726
  rb_define_method(SwigClassGenModel.klass, "bcreated=", VALUEFUNC(_wrap_GenModel_bcreated_set), -1);