@@ -629,6 +629,8 @@ polish(const Settings<T>& qpsettings,
629
629
const HessianType hessian_type)
630
630
{
631
631
632
+ std::cout << " check 01" << std::endl;
633
+
632
634
// Find the upper and lower active constraints
633
635
qpwork.active_set_up_eq .array () = (qpresults.y .array () > 0 );
634
636
qpwork.active_set_low_eq .array () = (qpresults.y .array () < 0 );
@@ -638,6 +640,8 @@ polish(const Settings<T>& qpsettings,
638
640
isize numactive_constraints_eq_up = qpwork.active_set_up_eq .count ();
639
641
isize numactive_constraints_eq_low = qpwork.active_set_low_eq .count ();
640
642
643
+ std::cout << " check 02" << std::endl;
644
+
641
645
qpwork.active_set_up_ineq = qpwork.active_set_up ;
642
646
qpwork.active_set_low_ineq = qpwork.active_set_low ;
643
647
qpwork.active_constraints_ineq =
@@ -646,6 +650,8 @@ polish(const Settings<T>& qpsettings,
646
650
isize numactive_constraints_ineq_up = qpwork.active_set_up_ineq .count ();
647
651
isize numactive_constraints_ineq_low = qpwork.active_set_low_ineq .count ();
648
652
653
+ std::cout << " check 03" << std::endl;
654
+
649
655
isize numactive_constraints =
650
656
numactive_constraints_eq + numactive_constraints_ineq;
651
657
@@ -682,6 +688,8 @@ polish(const Settings<T>& qpsettings,
682
688
}
683
689
}
684
690
691
+ std::cout << " check 04" << std::endl;
692
+
685
693
Mat<T> A_low (numactive_constraints_eq_low, qpmodel.dim );
686
694
Mat<T> A_up (numactive_constraints_eq_up, qpmodel.dim );
687
695
@@ -698,6 +706,8 @@ polish(const Settings<T>& qpsettings,
698
706
}
699
707
}
700
708
709
+ std::cout << " check 05" << std::endl;
710
+
701
711
// Construction and factorization of K + Delta_K
702
712
isize row;
703
713
isize column;
@@ -706,12 +716,17 @@ polish(const Settings<T>& qpsettings,
706
716
proxsuite::linalg::veg::from_slice_mut, qpwork.ldl_stack .as_mut ()
707
717
};
708
718
719
+ std::cout << " check 06" << std::endl;
720
+
709
721
switch (dense_backend) {
710
722
case DenseBackend::PrimalDualLDLT:
711
723
712
724
// Top left corner of K for H
713
725
qpwork.k_polish .resize (qpmodel.dim + numactive_constraints,
714
726
qpmodel.dim + numactive_constraints);
727
+
728
+ std::cout << " check 07" << std::endl;
729
+
715
730
switch (hessian_type) {
716
731
case HessianType::Dense:
717
732
qpwork.k_polish .topLeftCorner (qpmodel.dim , qpmodel.dim ) =
@@ -726,55 +741,72 @@ polish(const Settings<T>& qpsettings,
726
741
break ;
727
742
}
728
743
744
+ std::cout << " check 08" << std::endl;
745
+
729
746
// Add the rows/columns for the constraints
730
747
row = qpmodel.dim ;
748
+ std::cout << " check 081" << std::endl;
731
749
column = qpmodel.dim ;
750
+ std::cout << " check 082" << std::endl;
732
751
qpwork.k_polish .block (
733
752
0 , column, qpmodel.dim , numactive_constraints_eq_low) =
734
753
A_low.transpose ();
754
+ std::cout << " check 083" << std::endl;
735
755
column += numactive_constraints_eq_low;
736
756
qpwork.k_polish .block (
737
757
0 , column, qpmodel.dim , numactive_constraints_ineq_low) =
738
758
C_low.transpose ();
759
+ std::cout << " check 084" << std::endl;
739
760
column += numactive_constraints_ineq_low;
740
761
qpwork.k_polish .block (
741
762
0 , column, qpmodel.dim , numactive_constraints_eq_up) = A_up.transpose ();
742
763
column += numactive_constraints_eq_up;
764
+ std::cout << " check 085" << std::endl;
743
765
qpwork.k_polish .block (
744
766
0 , column, qpmodel.dim , numactive_constraints_ineq_up) =
745
767
C_up.transpose ();
746
768
qpwork.k_polish .block (row, 0 , numactive_constraints_eq_low, qpmodel.dim ) =
747
769
A_low;
770
+ std::cout << " check 086" << std::endl;
748
771
row += numactive_constraints_eq_low;
749
772
qpwork.k_polish .block (
750
773
row, 0 , numactive_constraints_ineq_low, qpmodel.dim ) = C_low;
751
774
row += numactive_constraints_ineq_low;
775
+ std::cout << " check 087" << std::endl;
752
776
qpwork.k_polish .block (row, 0 , numactive_constraints_eq_up, qpmodel.dim ) =
753
777
A_up;
754
778
row += numactive_constraints_eq_up;
779
+ // std::cout << "check 088" << std::endl;
755
780
qpwork.k_polish .block (
756
781
row, 0 , numactive_constraints_ineq_up, qpmodel.dim ) = C_up;
782
+ // std::cout << "check 089" << std::endl;
757
783
qpwork.k_polish
758
784
.bottomRightCorner (numactive_constraints, numactive_constraints)
759
785
.setZero ();
760
786
761
- std::cout << " check 1" << std::endl;
762
- std::cout << " checkout 1" << std::endl;
787
+ std::cout << " check 09" << std::endl;
788
+
789
+ // std::cout << "check 1" << std::endl;
790
+ // std::cout << "checkout 1" << std::endl;
763
791
// Construction and factorization of K + Delta_K
764
792
qpwork.k_plus_delta_k_polish =
765
793
qpwork.k_polish ; // error: malloc(): invalid size (unsorted), malloc():
766
794
// unaligned tcache chunk detected
767
795
// errors here in test cvxpy, but also maros meszaros for some problems
768
- std::cout << " check 2" << std::endl;
769
- std::cout << " checkout 2" << std::endl;
796
+ // std::cout << "check 2" << std::endl;
797
+ // std::cout << "checkout 2" << std::endl;
798
+ std::cout << " check 091" << std::endl;
770
799
qpwork.k_plus_delta_k_polish .topLeftCorner (qpmodel.dim , qpmodel.dim )
771
800
.diagonal ()
772
801
.array () += qpsettings.delta_osqp ;
802
+ std::cout << " check 092" << std::endl;
773
803
qpwork.k_plus_delta_k_polish
774
804
.bottomRightCorner (numactive_constraints, numactive_constraints)
775
805
.diagonal ()
776
806
.array () -= qpsettings.delta_osqp ;
777
807
808
+ std::cout << " check 010" << std::endl;
809
+
778
810
qpwork.ldl .factorize (qpwork.k_plus_delta_k_polish .transpose (), stack);
779
811
780
812
break ;
@@ -807,6 +839,8 @@ polish(const Settings<T>& qpsettings,
807
839
break ;
808
840
}
809
841
842
+ std::cout << " check 011" << std::endl;
843
+
810
844
// Construction of the l_low, u_up, etc to build the rhs for the linear
811
845
// systems (iterative refinement)
812
846
isize l_low_index = 0 ;
@@ -832,6 +866,8 @@ polish(const Settings<T>& qpsettings,
832
866
}
833
867
}
834
868
869
+ std::cout << " check 012" << std::endl;
870
+
835
871
isize b_low_index = 0 ;
836
872
isize b_up_index = 0 ;
837
873
Vec<T> b_low (numactive_constraints_eq_low);
@@ -847,6 +883,8 @@ polish(const Settings<T>& qpsettings,
847
883
}
848
884
}
849
885
886
+ std::cout << " check 013" << std::endl;
887
+
850
888
// Iterative refinement
851
889
Vec<T> g_polish_rhs;
852
890
isize line;
@@ -867,6 +905,8 @@ polish(const Settings<T>& qpsettings,
867
905
Vec<T> hat_y_up;
868
906
Vec<T> hat_z_up;
869
907
908
+ std::cout << " check 014" << std::endl;
909
+
870
910
switch (dense_backend) {
871
911
case DenseBackend::PrimalDualLDLT:
872
912
@@ -884,11 +924,13 @@ polish(const Settings<T>& qpsettings,
884
924
885
925
inner_pb_dim = qpmodel.dim + numactive_constraints;
886
926
887
- std::cout << " check 3" << std::endl;
927
+ // std::cout << "check 3" << std::endl;
928
+ std::cout << " check 015" << std::endl;
888
929
hat_t = g_polish_rhs; // 2 times Fatal glibc error: malloc.c:4376
889
930
// (_int_malloc): assertion failed: (unsigned long)
890
931
// (size) >= (unsigned long) (nb)
891
- std::cout << " check 4" << std::endl;
932
+ // std::cout << "check 4" << std::endl;
933
+ std::cout << " check 016" << std::endl;
892
934
893
935
solve_linear_system (hat_t ,
894
936
qpmodel,
@@ -900,6 +942,8 @@ polish(const Settings<T>& qpsettings,
900
942
inner_pb_dim,
901
943
stack);
902
944
945
+ std::cout << " check 017" << std::endl;
946
+
903
947
// Iterative refinement
904
948
for (i64 iter = 0 ; iter < qpsettings.nb_polish_iter ; ++iter) {
905
949
rhs_polish = g_polish_rhs - qpwork.k_polish * hat_t ;
@@ -916,6 +960,8 @@ polish(const Settings<T>& qpsettings,
916
960
hat_t = hat_t + delta_hat_t ;
917
961
}
918
962
963
+ std::cout << " check 018" << std::endl;
964
+
919
965
break ;
920
966
case DenseBackend::PrimalLDLT:
921
967
@@ -1002,6 +1048,7 @@ polish(const Settings<T>& qpsettings,
1002
1048
1003
1049
// Update of the primal and dual variables
1004
1050
qpresults.x = hat_t .head (qpmodel.dim );
1051
+ std::cout << " check 019" << std::endl;
1005
1052
1006
1053
y_low_index = 0 ;
1007
1054
z_low_index = 0 ;
@@ -1019,6 +1066,8 @@ polish(const Settings<T>& qpsettings,
1019
1066
}
1020
1067
}
1021
1068
1069
+ std::cout << " check 020" << std::endl;
1070
+
1022
1071
for (isize i = 0 ; i < n_constraints; ++i) {
1023
1072
if (qpwork.active_set_low_ineq (i)) {
1024
1073
qpresults.z (i) =
@@ -1032,6 +1081,8 @@ polish(const Settings<T>& qpsettings,
1032
1081
++z_up_index;
1033
1082
}
1034
1083
}
1084
+
1085
+ std::cout << " check 021" << std::endl;
1035
1086
}
1036
1087
/* !
1037
1088
* Executes the OSQP algorithm.
0 commit comments