@@ -238,7 +238,7 @@ void assertLogical(const char* name, const HighsInt is) {
238238 }
239239}
240240
241- void version_api () {
241+ void versionApi () {
242242 if (dev_run ) {
243243 printf ("HiGHS version %s\n" , Highs_version ());
244244 printf ("HiGHS version major %" HIGHSINT_FORMAT "\n" , Highs_versionMajor ());
@@ -250,7 +250,7 @@ void version_api() {
250250 }
251251}
252252
253- void minimal_api_lp () {
253+ void minimalApiLp () {
254254 // This illustrates the use of Highs_call, the simple C interface to
255255 // HiGHS. It's designed to solve the general LP problem
256256 //
@@ -375,7 +375,7 @@ void minimal_api_lp() {
375375 free (row_basis_status );
376376}
377377
378- void minimal_api_mip () {
378+ void minimalApiMip () {
379379 // The use of Highs_mipCall is illustrated for the MIP
380380 //
381381 // Min f = -3x_0 - 2x_1 - x_2
@@ -455,7 +455,7 @@ void minimal_api_mip() {
455455 free (row_value );
456456}
457457
458- void minimal_api_qp () {
458+ void minimalApiQp () {
459459 // Test solving the problem qjh
460460 //
461461 // minimize -x_2 - 3x_3 + (1/2)(2x_1^2 - 2x_1x_3 + 0.2x_2^2 + 2x_3^2)
@@ -503,7 +503,7 @@ void minimal_api_qp() {
503503 free (col_value );
504504}
505505
506- void minimal_api_illegal_lp () {
506+ void minimalApiIllegalLp () {
507507 const double inf = 1e30 ;
508508 HighsInt num_col = 2 ;
509509 HighsInt num_row = 1 ;
@@ -530,7 +530,7 @@ void minimal_api_illegal_lp() {
530530 assert (model_status == kHighsModelStatusNotset );
531531}
532532
533- void full_api () {
533+ void fullApi () {
534534 void * highs = Highs_create ();
535535
536536 if (!dev_run ) Highs_setBoolOptionValue (highs , "output_flag" , 0 );
@@ -698,7 +698,7 @@ void full_api() {
698698 Highs_destroy (highs );
699699}
700700
701- void full_api_options () {
701+ void fullApiOptions () {
702702 void * highs ;
703703
704704 highs = Highs_create ();
@@ -841,7 +841,7 @@ void full_api_options() {
841841 Highs_destroy (highs );
842842}
843843
844- void full_api_lp () {
844+ void fullApiLp () {
845845 // Form and solve the LP
846846 // Min f = 2x_0 + 3x_1
847847 // s.t. x_1 <= 6
@@ -1059,7 +1059,7 @@ void full_api_lp() {
10591059 Highs_destroy (highs );
10601060}
10611061
1062- void full_api_mip () {
1062+ void fullApiMip () {
10631063 // The use of the full HiGHS API is illustrated for the MIP
10641064 //
10651065 // Min f = -3x_0 - 2x_1 - x_2
@@ -1138,7 +1138,7 @@ void full_api_mip() {
11381138 free (row_value );
11391139}
11401140
1141- void full_api_qp () {
1141+ void fullApiQp () {
11421142 double required_objective_function_value ;
11431143 double required_x0 ;
11441144 double required_x1 ;
@@ -1324,7 +1324,7 @@ void full_api_qp() {
13241324 free (col_solution );
13251325}
13261326
1327- void pass_presolve_get_lp () {
1327+ void passPresolveGetLp () {
13281328 // Form and solve the LP
13291329 // Min f = 2x_0 + 3x_1
13301330 // s.t. x_1 <= 6
@@ -1474,7 +1474,7 @@ void options() {
14741474 Highs_destroy (highs );
14751475}
14761476
1477- void test_getColsByRange () {
1477+ void testGetColsByRange () {
14781478 void * highs = Highs_create ();
14791479 if (!dev_run ) Highs_setBoolOptionValue (highs , "output_flag" , 0 );
14801480 HighsInt return_status ;
@@ -1510,7 +1510,7 @@ void test_getColsByRange() {
15101510 Highs_destroy (highs );
15111511}
15121512
1513- void test_passHessian () {
1513+ void testPassHessian () {
15141514 void * highs = Highs_create ();
15151515 if (!dev_run ) Highs_setBoolOptionValue (highs , "output_flag" , 0 );
15161516 Highs_addCol (highs , 2.0 , 0.0 , 2.0 , 0 , NULL , NULL );
@@ -1540,7 +1540,7 @@ void test_passHessian() {
15401540 Highs_destroy (highs );
15411541}
15421542
1543- void test_ranging () {
1543+ void testRanging () {
15441544 void * highs = Highs_create ();
15451545 if (!dev_run ) Highs_setBoolOptionValue (highs , "output_flag" , 0 );
15461546 //
@@ -1678,7 +1678,7 @@ void test_ranging() {
16781678 Highs_destroy (highs );
16791679}
16801680
1681- void test_feasibilityRelaxation () {
1681+ void testFeasibilityRelaxation () {
16821682 void * highs ;
16831683 highs = Highs_create ();
16841684 const double kHighsInf = Highs_getInfinity (highs );
@@ -1728,7 +1728,7 @@ void test_feasibilityRelaxation() {
17281728 Highs_destroy (highs );
17291729}
17301730
1731- void test_callback () {
1731+ void testCallback () {
17321732 HighsInt num_col = 7 ;
17331733 HighsInt num_row = 1 ;
17341734 HighsInt num_nz = num_col ;
@@ -1783,7 +1783,7 @@ void test_callback() {
17831783 Highs_destroy (highs );
17841784}
17851785
1786- void test_getModel () {
1786+ void testGetModel () {
17871787 void * highs ;
17881788 highs = Highs_create ();
17891789 Highs_setBoolOptionValue (highs , "output_flag" , dev_run );
@@ -1855,7 +1855,7 @@ void test_getModel() {
18551855 Highs_destroy (highs );
18561856}
18571857
1858- void test_multiObjective () {
1858+ void testMultiObjective () {
18591859 void * highs ;
18601860 highs = Highs_create ();
18611861 const double inf = Highs_getInfinity (highs );
@@ -1967,11 +1967,31 @@ void test_multiObjective() {
19671967 free (col_value );
19681968}
19691969
1970+ void testQpIndefiniteFailure () {
1971+ void * highs = Highs_create ();
1972+ Highs_setBoolOptionValue (highs , "output_flag" , dev_run );
1973+ HighsInt ret ;
1974+ const double inf = Highs_getInfinity (highs );
1975+ ret = Highs_addCol (highs , 0.0 , 1.0 , inf , 0 , NULL , NULL );
1976+ assert (ret == 0 );
1977+ ret = Highs_addCol (highs , 0.0 , 1.0 , 1.0 , 0 , NULL , NULL );
1978+ HighsInt start [2 ] = {0 , 1 };
1979+ HighsInt index [1 ] = {1 };
1980+ double value [1 ] = {1.0 };
1981+ ret = Highs_passHessian (highs , 2 , 1 , kHighsHessianFormatTriangular , start , index , value );
1982+ assert (ret == 0 );
1983+ HighsInt run_status = Highs_run (highs );
1984+ HighsInt model_status = Highs_getModelStatus (highs );
1985+ assert (run_status == kHighsStatusError );
1986+ assert (model_status == kHighsModelStatusSolveError );
1987+ Highs_destroy (highs );
1988+ }
1989+
19701990/*
19711991The horrible C in this causes problems in some of the CI tests,
19721992so suppress thius test until the C has been improved
19731993
1974- void test_setSolution () {
1994+ void testSetSolution () {
19751995 void* highs = Highs_create();
19761996 // Perform in C the equivalent of std::string model_file =
19771997 // std::string(HIGHS_DIR) + "/check/instances/shell.mps";
@@ -2013,25 +2033,26 @@ iteration_count1); assertLogical("Dual", logic);
20132033}
20142034*/
20152035int main () {
2016- minimal_api_illegal_lp ();
2017- test_callback ();
2018- version_api ();
2019- full_api ();
2020- minimal_api_lp ();
2021- minimal_api_mip ();
2022- minimal_api_qp ();
2023- full_api_options ();
2024- full_api_lp ();
2025- full_api_mip ();
2026- full_api_qp ();
2027- pass_presolve_get_lp ();
2036+ minimalApiIllegalLp ();
2037+ testCallback ();
2038+ versionApi ();
2039+ fullApi ();
2040+ minimalApiLp ();
2041+ minimalApiMip ();
2042+ minimalApiQp ();
2043+ fullApiOptions ();
2044+ fullApiLp ();
2045+ fullApiMip ();
2046+ fullApiQp ();
2047+ passPresolveGetLp ();
20282048 options ();
2029- test_getColsByRange ();
2030- test_passHessian ();
2031- test_ranging ();
2032- test_feasibilityRelaxation ();
2033- test_getModel ();
2034- test_multiObjective ();
2049+ testGetColsByRange ();
2050+ testPassHessian ();
2051+ testRanging ();
2052+ testFeasibilityRelaxation ();
2053+ testGetModel ();
2054+ testMultiObjective ();
2055+ testQpIndefiniteFailure ();
20352056 return 0 ;
20362057}
2037- // test_setSolution ();
2058+ // testSetSolution ();
0 commit comments