Skip to content

Commit

Permalink
Avoid an assertion to fire if nreq == 0 or nrineq == 0
Browse files Browse the repository at this point in the history
Bump version to 1.0.1
  • Loading branch information
gergondet committed Jan 2, 2020
1 parent d4328ff commit c26489f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set(PROJECT_NAME eigen-quadprog)
set(PROJECT_DESCRIPTION "QuadProg QP solver through Eigen3 library.")
set(PROJECT_URL "https://github.com/jrl-umi3218/eigen-quadprog")
set(PROJECT_DEBUG_POSTFIX "_d")
set(PROJECT_VERSION 1.0.0)
set(PROJECT_VERSION 1.0.1)
set(PROJECT_USE_CMAKE_EXPORT TRUE)

set(DOXYGEN_USE_MATHJAX "YES")
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
eigen-quadprog (1.0.1-1ubuntu1) unstable; urgency=medium

* Fix a bug if nreq == 0 or nrineq == 0

-- Pierre Gergondet <[email protected]> Thu, 02 Jan 2020 19:14:33 +0800

eigen-quadprog (1.0.0-1ubuntu1) unstable; urgency=medium

* Initial release
Expand Down
10 changes: 8 additions & 2 deletions src/QuadProg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,14 @@ bool QuadProgDense::solve(const MatrixXd& Q, const VectorXd& C,

fillQCBf(nreq, nrineq, Q, C, Beq, Bineq, isDecomp);

A_.block(0, 0, nrvar, nreq) = Aeq.transpose();
A_.block(0, nreq, nrvar, nrineq) = -Aineq.transpose();
if(nreq != 0)
{
A_.block(0, 0, nrvar, nreq) = Aeq.transpose();
}
if(nrineq != 0)
{
A_.block(0, nreq, nrvar, nrineq) = -Aineq.transpose();
}

qpgen2_(Q_.data(), C_.data(), &fddmat, &n, X_.data(), &crval,
A_.data(), B_.data(), &fdamat, &q, &meq, iact_.data(), &nact,
Expand Down

0 comments on commit c26489f

Please sign in to comment.