@@ -993,6 +993,54 @@ static char *test_fix_col_inf()
993993 return 0 ;
994994}
995995
996+ /* Parallel-column dual postsolve: z_k = ratio * z_j is an exact identity.
997+
998+ min. [1 2 0.1] x
999+ s.t. -20 <= [1 2 1] x <= 20
1000+ -40 <= [3 6 1] x <= 40
1001+ x1 in [0, 3], x2 in [0, 5], x3 in [-10, 10] */
1002+ static char * test_parallel_col_dual_identity ()
1003+ {
1004+ double Ax [] = {1 , 2 , 1 , 3 , 6 , 1 };
1005+ int Ai [] = {0 , 1 , 2 , 0 , 1 , 2 };
1006+ int Ap [] = {0 , 3 , 6 };
1007+ int nnz = 6 ;
1008+ int n_rows = 2 ;
1009+ int n_cols = 3 ;
1010+
1011+ double lhs [] = {-20 , -40 };
1012+ double rhs [] = {20 , 40 };
1013+ double lbs [] = {0 , 0 , -10 };
1014+ double ubs [] = {3 , 5 , 10 };
1015+ double c [] = {1 , 2 , 0.1 };
1016+
1017+ Settings * stgs = default_settings ();
1018+ set_settings_false (stgs );
1019+ stgs -> parallel_cols = true;
1020+ Presolver * presolver =
1021+ new_presolver (Ax , Ai , Ap , n_rows , n_cols , nnz , lhs , rhs , lbs , ubs , c , stgs );
1022+
1023+ run_presolver (presolver );
1024+
1025+ // reduced problem: the merged column (box [0, 13]) and x3
1026+ double x [] = {7 , 10 };
1027+ double y [] = {0.3 , 0.1 };
1028+ double z [] = {0.4 , -0.3 };
1029+ postsolve (presolver , x , y , z );
1030+
1031+ double correct_x [] = {0 , 3.5 , 10 };
1032+ double correct_y [] = {0.3 , 0.1 };
1033+ double correct_z [] = {0.4 , 0.8 , -0.3 };
1034+
1035+ mu_assert ("parallel col dual identity error" ,
1036+ is_solution_correct (presolver -> sol -> x , correct_x , presolver -> sol -> y ,
1037+ correct_y , presolver -> sol -> z , correct_z , n_rows ,
1038+ n_cols , POSTSOLVE_TOL_FEAS ));
1039+ PS_FREE (stgs );
1040+ free_presolver (presolver );
1041+ return 0 ;
1042+ }
1043+
9961044static const char * all_tests_postsolve ()
9971045{
9981046 mu_run_test (test_0_postsolve , counter_postsolve );
@@ -1017,6 +1065,7 @@ static const char *all_tests_postsolve()
10171065 mu_run_test (test_pathological_ston_one , counter_postsolve );
10181066 mu_run_test (test_pathological_ston_two , counter_postsolve );
10191067 mu_run_test (test_fix_col_inf , counter_postsolve );
1068+ mu_run_test (test_parallel_col_dual_identity , counter_postsolve );
10201069 // all tests above pass
10211070
10221071 return 0 ;
0 commit comments