@@ -1991,7 +1991,7 @@ void testDualRayTwice() {
19911991 void * highs = Highs_create ();
19921992 Highs_setBoolOptionValue (highs , "output_flag" , dev_run );
19931993 int ret ;
1994- double INF = Highs_getInfinity (highs );
1994+ double inf = Highs_getInfinity (highs );
19951995 ret = Highs_changeObjectiveOffset (highs , 0.0 );
19961996 assert (ret == 0 );
19971997 ret = Highs_setStringOptionValue (highs , "presolve" , "off" );
@@ -2000,9 +2000,9 @@ void testDualRayTwice() {
20002000 assert (ret == 0 );
20012001 ret = Highs_addCol (highs , 0.0 , 0.0 , 0.0 , 0 , NULL , NULL );
20022002 assert (ret == 0 );
2003- ret = Highs_addCol (highs , -1.0 , 0.0 , INF , 0 , NULL , NULL );
2003+ ret = Highs_addCol (highs , -1.0 , 0.0 , inf , 0 , NULL , NULL );
20042004 assert (ret == 0 );
2005- ret = Highs_addCol (highs , -1.0 , 0.0 , INF , 0 , NULL , NULL );
2005+ ret = Highs_addCol (highs , -1.0 , 0.0 , inf , 0 , NULL , NULL );
20062006 assert (ret == 0 );
20072007 HighsInt index [2 ] = {2 , 3 };
20082008 double value [2 ] = {1.0 , -1.0 };
@@ -2012,19 +2012,19 @@ void testDualRayTwice() {
20122012 index [1 ] = 3 ;
20132013 value [0 ] = 1.0 ;
20142014 value [1 ] = 1.0 ;
2015- ret = Highs_addRow (highs , 1.0 , INF , 2 , index , value );
2015+ ret = Highs_addRow (highs , 1.0 , inf , 2 , index , value );
20162016 assert (ret == 0 );
20172017 index [0 ] = 0 ;
20182018 index [1 ] = 2 ;
20192019 value [0 ] = -2.0 ;
20202020 value [1 ] = 1.0 ;
2021- ret = Highs_addRow (highs , - INF , 0.0 , 2 , index , value );
2021+ ret = Highs_addRow (highs , - inf , 0.0 , 2 , index , value );
20222022 assert (ret == 0 );
20232023 index [0 ] = 1 ;
20242024 index [1 ] = 3 ;
20252025 value [0 ] = -3.0 ;
20262026 value [1 ] = 1.0 ;
2027- ret = Highs_addRow (highs , - INF , 0.0 , 2 , index , value );
2027+ ret = Highs_addRow (highs , - inf , 0.0 , 2 , index , value );
20282028 assert (ret == 0 );
20292029 ret = Highs_run (highs );
20302030 assert (ret == 0 );
@@ -2105,16 +2105,16 @@ void testDeleteRowResolveWithBasis() {
21052105 void * highs = Highs_create ();
21062106 Highs_setBoolOptionValue (highs , "output_flag" , dev_run );
21072107 HighsInt ret ;
2108- double INF = Highs_getInfinity (highs );
2108+ double inf = Highs_getInfinity (highs );
21092109 ret = Highs_addCol (highs , 0.0 , 2.0 , 2.0 , 0 , NULL , NULL );
2110- ret = Highs_addCol (highs , 0.0 , - INF , INF , 0 , NULL , NULL );
2111- ret = Highs_addCol (highs , 0.0 , - INF , INF , 0 , NULL , NULL );
2110+ ret = Highs_addCol (highs , 0.0 , - inf , inf , 0 , NULL , NULL );
2111+ ret = Highs_addCol (highs , 0.0 , - inf , inf , 0 , NULL , NULL );
21122112 HighsInt index_1 [2 ] = {0 , 2 };
21132113 double value_1 [2 ] = {2.0 , -1.0 };
21142114 ret = Highs_addRow (highs , 0.0 , 0.0 , 2 , index_1 , value_1 );
21152115 HighsInt index_2 [1 ] = {1 };
21162116 double value_2 [1 ] = {6.0 };
2117- ret = Highs_addRow (highs , 10.0 , INF , 1 , index_2 , value_2 );
2117+ ret = Highs_addRow (highs , 10.0 , inf , 1 , index_2 , value_2 );
21182118 Highs_run (highs );
21192119 double col_value [3 ] = {0.0 , 0.0 , 0.0 };
21202120 Highs_getSolution (highs , col_value , NULL , NULL , NULL );
@@ -2131,6 +2131,54 @@ void testDeleteRowResolveWithBasis() {
21312131
21322132void testIis () {
21332133 void * highs = Highs_create ();
2134+ // Highs_setBoolOptionValue(highs, "output_flag", dev_run);
2135+ HighsInt ret ;
2136+ double inf = Highs_getInfinity (highs );
2137+ ret = Highs_addCol (highs , 0.0 , 0.0 , 1.0 , 0 , NULL , NULL );
2138+ assert (ret == 0 );
2139+ ret = Highs_addCol (highs , 0.0 , 0.0 , 1.0 , 0 , NULL , NULL );
2140+ assert (ret == 0 );
2141+ ret = Highs_addCol (highs , 0.0 , 0.0 , 1.0 , 0 , NULL , NULL );
2142+ assert (ret == 0 );
2143+ HighsInt index [3 ] = {0 , 1 , 2 };
2144+ double value_1 [3 ] = {1 , 1 , -1 };
2145+ double value_2 [3 ] = {1 , 1 , 1 };
2146+ double value_3 [3 ] = {1 , 2 , 1 };
2147+ ret = Highs_addRow (highs , 2.0 , inf , 3 , index , value_1 );
2148+ assert (ret == 0 );
2149+ ret = Highs_addRow (highs , - inf , 5.0 , 3 , index , value_2 );
2150+ assert (ret == 0 );
2151+ ret = Highs_addRow (highs , - inf , 1.0 , 3 , index , value_3 );
2152+ assert (ret == 0 );
2153+
2154+ HighsInt iis_num_col ;
2155+ HighsInt iis_num_row ;
2156+ ret = Highs_getIis (highs ,
2157+ & iis_num_col , & iis_num_row ,
2158+ NULL , NULL ,
2159+ NULL , NULL ,
2160+ NULL , NULL );
2161+ assert (ret == 0 );
2162+
2163+ HighsInt * col_index = (HighsInt * )malloc (sizeof (HighsInt ) * iis_num_col );
2164+ HighsInt * row_index = (HighsInt * )malloc (sizeof (HighsInt ) * iis_num_row );
2165+ HighsInt * col_bound = (HighsInt * )malloc (sizeof (HighsInt ) * iis_num_col );
2166+ HighsInt * row_bound = (HighsInt * )malloc (sizeof (HighsInt ) * iis_num_row );
2167+
2168+ HighsInt num_col ;
2169+ HighsInt num_row ;
2170+ HighsInt num_nz ;
2171+ HighsInt sense ;
2172+ double offset ;
2173+ ret = Highs_getLp (highs , kHighsMatrixFormatRowwise ,
2174+ & num_col , & num_row , & num_nz ,
2175+ & sense , & offset ,
2176+ NULL , NULL , NULL ,
2177+ NULL , NULL ,
2178+ NULL , NULL , NULL ,
2179+ NULL );
2180+ Highs_run (highs );
2181+
21342182 Highs_destroy (highs );
21352183}
21362184
0 commit comments