Skip to content

Commit c937b85

Browse files
committed
Have to retain dedicated triangularToSquareHessian for QPASM solver
1 parent 0f29be3 commit c937b85

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

highs/lp_data/Highs.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3960,8 +3960,9 @@ HighsStatus Highs::callSolveLp(HighsLp& lp, const string message) {
39603960
HighsStatus Highs::callSolveQp() {
39613961
// Check that the model is column-wise
39623962
HighsLp& lp = model_.lp_;
3963-
HighsHessian& hessian = model_.hessian_;
39643963
assert(model_.lp_.a_matrix_.isColwise());
3964+
HighsHessian& hessian = model_.hessian_;
3965+
assert(hessian.format_ == HessianFormat::kTriangular);
39653966
if (hessian.dim_ > lp.num_col_) {
39663967
highsLogDev(
39673968
options_.log_options, HighsLogType::kError,

highs/model/HighsHessianUtils.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,15 @@ void triangularToSquareHessian(const HighsHessian& hessian,
260260
return;
261261
}
262262
assert(hessian.format_ == HessianFormat::kTriangular);
263+
// Cannot use the following, since it puts the diagonal entry first
264+
// in each column and, strangely, the active set QP solver seems to
265+
// need the entries column-by-column in row order
266+
/*
267+
HighsHessian square_hessian = hessian.toSquare();
268+
std::vector<HighsInt> nw_start = square_hessian.start_;
269+
std::vector<HighsInt> nw_index = square_hessian.index_;
270+
std::vector<double> nw_value = square_hessian.value_;
271+
*/
263272
const HighsInt nnz = hessian.start_[dim];
264273
const HighsInt square_nnz = nnz + (nnz - dim);
265274
start.resize(dim + 1);

0 commit comments

Comments
 (0)