Skip to content

Commit

Permalink
remove setting the value
Browse files Browse the repository at this point in the history
  • Loading branch information
alxbilger committed Jun 5, 2024
1 parent 4f81fc6 commit 5b8d36c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ void SlidingLagrangianConstraint<DataTypes>::buildConstraintMatrix(const core::C
m_dirOrtho = cross(m_dirProj, m_dirAxe);
m_dirOrtho.normalize();

auto constraintIndex = sofa::helper::getWriteAccessor(this->m_constraintIndex);
constraintIndex.wref() = cIndex;
auto constraintIndex = sofa::helper::getReadAccessor(this->m_constraintIndex);
cIndex += 2;

MatrixDerivRowIterator c1_it = c1.writeLine(constraintIndex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ void StopperLagrangianConstraint<DataTypes>::init()
template<class DataTypes>
void StopperLagrangianConstraint<DataTypes>::buildConstraintMatrix(const core::ConstraintParams* /*cParams*/, DataMatrixDeriv &c_d, unsigned int &cIndex, const DataVecCoord &/*x*/)
{
auto constraintIndex = sofa::helper::getWriteAccessor(this->m_constraintIndex);
constraintIndex.wref() = cIndex;
auto constraintIndex = sofa::helper::getReadAccessor(this->m_constraintIndex);

MatrixDeriv& c = *c_d.beginEdit();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ void UniformLagrangianConstraint<DataTypes>::buildConstraintMatrix(const sofa::c
auto& jacobian = sofa::helper::getWriteAccessor(c).wref();
auto xVec = sofa::helper::getReadAccessor(x);

auto constraintIndex = sofa::helper::getWriteAccessor(this->m_constraintIndex);
constraintIndex.wref() = cIndex;
auto constraintIndex = sofa::helper::getReadAccessor(this->m_constraintIndex);

for (std::size_t i = 0; i < xVec.size(); ++i)
{
Expand Down

0 comments on commit 5b8d36c

Please sign in to comment.