genmodel 0.0.52 → 0.0.53
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 +8 -8
- data/ext/Genmodel/GenModel.h +1 -0
- data/ext/Genmodel/GenModelBase.cpp +3 -2
- data/ext/Genmodel/Genmodel.cpp +62 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MmQwYzYwN2ZiYTJlYzJkN2YxZTdiOTg3NDc4MWJkMWU3YTVmNGI5NQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzBkYmYxOTdhNTQ4NjQ1OTg4N2JhZTFkYWU4NGQwMjgzMjU3ZTExYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzAxNDYwZDMzZTAxODM2NWRkY2M1OGRlNmVmYTM4YjQwMjg0OWU3ZDQ1NThk
|
10
|
+
ZWM3YmFhOWQ2ZGY5ODJmNWQ0NTM5ZWEwMWRiOGU1ZTMzZjE0YmIwYjhiZDZi
|
11
|
+
OGI0NWY3MDUzMWE3NGI5NGI3NDc1OWI3MTBhYzBlOTJjYzM4ZjQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZDg1YWRmOGQwY2JkYWRlZjIxMjcwNjgwMTMzMjQ1YjdjY2JkYjgwZjY4OTIx
|
14
|
+
MjdkMjc0YmExZTNjMTg5MTU4YTQwZWNlYTE1M2RhNjkxYzkwY2I4NDI4YmI1
|
15
|
+
MjA0OTkxYTE3NWFmMDczYzFmMGMxOTVmNTI5YjM1Nzc5N2M4NmQ=
|
data/ext/Genmodel/GenModel.h
CHANGED
@@ -366,6 +366,7 @@ long GenModel::PrintRowInfo(long row)
|
|
366
366
|
SolverUnfeasability::SolverUnfeasability(size_t _row_id, GenModel* pgm)
|
367
367
|
{
|
368
368
|
row_id = _row_id;
|
369
|
+
row_name = pgm->consts[_row_id].name;
|
369
370
|
for(size_t i = 0; i < pgm->consts[_row_id].nz; ++i)
|
370
371
|
{
|
371
372
|
long var_id = pgm->consts[_row_id].cols[i];
|
@@ -438,7 +439,7 @@ long GenModel::MakeConstraintFeasible(long row)
|
|
438
439
|
{
|
439
440
|
if(analyze)
|
440
441
|
{
|
441
|
-
if(max < consts[row].lrhs
|
442
|
+
if(max < consts[row].lrhs-1e-7)
|
442
443
|
problems.push_back(SolverUnfeasability(row,this));
|
443
444
|
}
|
444
445
|
else
|
@@ -458,7 +459,7 @@ long GenModel::MakeConstraintFeasible(long row)
|
|
458
459
|
{
|
459
460
|
if(analyze)
|
460
461
|
{
|
461
|
-
if(max < consts[row].lrhs
|
462
|
+
if(max < consts[row].lrhs-1e-7)
|
462
463
|
problems.push_back(SolverUnfeasability(row,this));
|
463
464
|
}
|
464
465
|
else
|
data/ext/Genmodel/Genmodel.cpp
CHANGED
@@ -37948,6 +37948,66 @@ fail:
|
|
37948
37948
|
}
|
37949
37949
|
|
37950
37950
|
|
37951
|
+
SWIGINTERN VALUE
|
37952
|
+
_wrap_SolverUnfeasability_row_name_set(int argc, VALUE *argv, VALUE self) {
|
37953
|
+
SolverUnfeasability *arg1 = (SolverUnfeasability *) 0 ;
|
37954
|
+
std::string *arg2 = 0 ;
|
37955
|
+
void *argp1 = 0 ;
|
37956
|
+
int res1 = 0 ;
|
37957
|
+
int res2 = SWIG_OLDOBJ ;
|
37958
|
+
|
37959
|
+
if ((argc < 1) || (argc > 1)) {
|
37960
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
37961
|
+
}
|
37962
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SolverUnfeasability, 0 | 0 );
|
37963
|
+
if (!SWIG_IsOK(res1)) {
|
37964
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SolverUnfeasability *","row_name", 1, self ));
|
37965
|
+
}
|
37966
|
+
arg1 = reinterpret_cast< SolverUnfeasability * >(argp1);
|
37967
|
+
{
|
37968
|
+
std::string *ptr = (std::string *)0;
|
37969
|
+
res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
|
37970
|
+
if (!SWIG_IsOK(res2)) {
|
37971
|
+
SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","row_name", 2, argv[0] ));
|
37972
|
+
}
|
37973
|
+
if (!ptr) {
|
37974
|
+
SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","row_name", 2, argv[0]));
|
37975
|
+
}
|
37976
|
+
arg2 = ptr;
|
37977
|
+
}
|
37978
|
+
if (arg1) (arg1)->row_name = *arg2;
|
37979
|
+
if (SWIG_IsNewObj(res2)) delete arg2;
|
37980
|
+
return Qnil;
|
37981
|
+
fail:
|
37982
|
+
if (SWIG_IsNewObj(res2)) delete arg2;
|
37983
|
+
return Qnil;
|
37984
|
+
}
|
37985
|
+
|
37986
|
+
|
37987
|
+
SWIGINTERN VALUE
|
37988
|
+
_wrap_SolverUnfeasability_row_name_get(int argc, VALUE *argv, VALUE self) {
|
37989
|
+
SolverUnfeasability *arg1 = (SolverUnfeasability *) 0 ;
|
37990
|
+
void *argp1 = 0 ;
|
37991
|
+
int res1 = 0 ;
|
37992
|
+
std::string *result = 0 ;
|
37993
|
+
VALUE vresult = Qnil;
|
37994
|
+
|
37995
|
+
if ((argc < 0) || (argc > 0)) {
|
37996
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
37997
|
+
}
|
37998
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SolverUnfeasability, 0 | 0 );
|
37999
|
+
if (!SWIG_IsOK(res1)) {
|
38000
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SolverUnfeasability *","row_name", 1, self ));
|
38001
|
+
}
|
38002
|
+
arg1 = reinterpret_cast< SolverUnfeasability * >(argp1);
|
38003
|
+
result = (std::string *) & ((arg1)->row_name);
|
38004
|
+
vresult = SWIG_From_std_string(static_cast< std::string >(*result));
|
38005
|
+
return vresult;
|
38006
|
+
fail:
|
38007
|
+
return Qnil;
|
38008
|
+
}
|
38009
|
+
|
38010
|
+
|
37951
38011
|
SWIGINTERN VALUE
|
37952
38012
|
_wrap_SolverUnfeasability_variable_ids_set(int argc, VALUE *argv, VALUE self) {
|
37953
38013
|
SolverUnfeasability *arg1 = (SolverUnfeasability *) 0 ;
|
@@ -54082,6 +54142,8 @@ SWIGEXPORT void Init_Genmodel(void) {
|
|
54082
54142
|
rb_define_method(SwigClassSolverUnfeasability.klass, "get_variable_ids", VALUEFUNC(_wrap_SolverUnfeasability_get_variable_ids), -1);
|
54083
54143
|
rb_define_method(SwigClassSolverUnfeasability.klass, "row_id=", VALUEFUNC(_wrap_SolverUnfeasability_row_id_set), -1);
|
54084
54144
|
rb_define_method(SwigClassSolverUnfeasability.klass, "row_id", VALUEFUNC(_wrap_SolverUnfeasability_row_id_get), -1);
|
54145
|
+
rb_define_method(SwigClassSolverUnfeasability.klass, "row_name=", VALUEFUNC(_wrap_SolverUnfeasability_row_name_set), -1);
|
54146
|
+
rb_define_method(SwigClassSolverUnfeasability.klass, "row_name", VALUEFUNC(_wrap_SolverUnfeasability_row_name_get), -1);
|
54085
54147
|
rb_define_method(SwigClassSolverUnfeasability.klass, "variable_ids=", VALUEFUNC(_wrap_SolverUnfeasability_variable_ids_set), -1);
|
54086
54148
|
rb_define_method(SwigClassSolverUnfeasability.klass, "variable_ids", VALUEFUNC(_wrap_SolverUnfeasability_variable_ids_get), -1);
|
54087
54149
|
SwigClassSolverUnfeasability.mark = 0;
|