[kernel] fix bug in assesing memory after merge and indenting style
@@ -85,16 +85,17 @@ double D1MinusLinearOSI::computeResiduHalfExplicitAccelerationLevel()
accFree.zero();
// get left state from memory
- // (copy because computeForces takes non-const pointer)
- SiconosVector qold = d->qMemory().getSiconosVector(0);
- SiconosVector vold = d->velocityMemory().getSiconosVector(0); // right limit
-
+ const SiconosVector& qold = d->qMemory().getSiconosVector(0);
+ const SiconosVector& vold = d->velocityMemory().getSiconosVector(0); // right limit
+ std11::shared_ptr<SiconosVector> pqold(&*(SiconosVector*)&qold, null_deleter);
+ std11::shared_ptr<SiconosVector> pvold(&*(SiconosVector*)&vold, null_deleter);
DEBUG_EXPR(accFree.display());
DEBUG_EXPR(qold->display());
DEBUG_EXPR(vold->display());
/* compute the force and store in accFree */
- d->computeForces(told, qold.shared_from_this(), vold.shared_from_this());
+ d->computeForces(told, pqold, pvold);
+
DEBUG_EXPR(d->forces()->display());
accFree += *(d->forces());
