Skip to content

Commit

Permalink
USe data accessor instead
Browse files Browse the repository at this point in the history
  • Loading branch information
bakpaul committed Dec 5, 2024
1 parent 55653e7 commit 3805cd1
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void BaseContactLagrangianConstraint<DataTypes, ContactParams>::buildConstraintM

if (this->mstate1 == this->mstate2)
{
MatrixDeriv& c1 = *c1_d.beginEdit();
helper::WriteAccessor<DataMatrixDeriv> c1 = c1_d;

for (unsigned int i = 0; i < contacts.size(); i++)
{
Expand All @@ -132,12 +132,11 @@ void BaseContactLagrangianConstraint<DataTypes, ContactParams>::buildConstraintM
}
}

c1_d.endEdit();
}
else
{
MatrixDeriv& c1 = *c1_d.beginEdit();
MatrixDeriv& c2 = *c2_d.beginEdit();
helper::WriteAccessor<DataMatrixDeriv> c1 = c1_d;
helper::WriteAccessor<DataMatrixDeriv> c2 = c2_d;

for (unsigned int i = 0; i < contacts.size(); i++)
{
Expand Down Expand Up @@ -169,8 +168,6 @@ void BaseContactLagrangianConstraint<DataTypes, ContactParams>::buildConstraintM
}
}

c1_d.endEdit();
c2_d.endEdit();
}
}

Expand Down

0 comments on commit 3805cd1

Please sign in to comment.