Skip to content

Commit

Permalink
[Solver.tpp] add warning message to updateHessianMatrix and updateLin…
Browse files Browse the repository at this point in the history
…earConstraintsMatrix for RowMajor
  • Loading branch information
Naoki-Hiraoka committed Sep 26, 2020
1 parent bba25ca commit 651bdf2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions include/OsqpEigen/Solver.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ bool OsqpEigen::Solver::updateHessianMatrix(const Eigen::SparseCompressedBase<De
return false;
}

if(hessianMatrix.IsRowMajor){
std::cerr << "[OsqpEigen::Solver::updateLinearConstraintsMatrix] The hessian matrix has to be ColMajor"
<< std::endl;
return false;
}

// evaluate the triplets from old and new hessian sparse matrices
if(!OsqpEigen::SparseMatrixHelper::osqpSparseMatrixToTriplets(m_workspace->data->P,
Expand Down Expand Up @@ -127,6 +132,12 @@ bool OsqpEigen::Solver::updateLinearConstraintsMatrix(const Eigen::SparseCompres
return false;
}

if(linearConstraintsMatrix.IsRowMajor){
std::cerr << "[OsqpEigen::Solver::updateLinearConstraintsMatrix] The constraints matrix has to be ColMajor"
<< std::endl;
return false;
}

// evaluate the triplets from old and new hessian sparse matrices

if(!OsqpEigen::SparseMatrixHelper::osqpSparseMatrixToTriplets(m_workspace->data->A,
Expand Down

0 comments on commit 651bdf2

Please sign in to comment.