diff --git a/cpp/core/math/constrained_least_squares.h b/cpp/core/math/constrained_least_squares.h index 3524bc68a8..2c642e1aa9 100644 --- a/cpp/core/math/constrained_least_squares.h +++ b/cpp/core/math/constrained_least_squares.h @@ -237,7 +237,9 @@ template class Solver { lambda_prev.setZero(); // set active set empty: active.setZero(); - active.tail(num_ineq).setOnes(); + if (num_eq > 0) { + active.tail(num_eq).setOnes(); + } // initial estimate of constraint values: c = c_u;