Skip to content

Commit

Permalink
fix linear constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
jmmuller committed Feb 21, 2024
1 parent c2335ba commit b05281e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions MMVII/src/Matrix/cLinearConstraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,11 +361,11 @@ template <class Type> void cOneLinearConstraint<Type>::SubstituteInOutRSNL(tIO_
bool FirstDerNN = true; // Used to check that we do only once the extension of indexe
for (size_t aKEq=0 ; aKEq<aIO.mVals.size() ; aKEq++)
{
Type & aDerI = aIO.mDers.at(aKEq).at(aKSubst);
Type aDerI = aIO.mDers.at(aKEq).at(aKSubst);
if (aDerI !=0 )
{
aIO.mVals[aKEq] += aDerI * mCste;
if (mLP.size() != 1)
if (mLP.size() != 0)
{
// [A] Compute the constant and put the linear part in buf (to be indexable)
for (const auto & aPair : mLP.IV())
Expand Down Expand Up @@ -402,7 +402,7 @@ template <class Type> void cOneLinearConstraint<Type>::SubstituteInOutRSNL(tIO_
// [D] finish purge
aBuf.mSet.mVIndOcc.clear();
}
aDerI = 0; // now supress the derivate of substituted variable
aIO.mDers.at(aKEq).at(aKSubst) = 0; // now supress the derivate of substituted variable
FirstDerNN= false; // No longer first Non Null derivate
}
}
Expand Down

0 comments on commit b05281e

Please sign in to comment.