@@ -1386,8 +1386,8 @@ int nlcp_multiGrid(int dim, SReal *dfree, SReal**W, SReal *f, SReal mu, SReal to
13861386 free (d_coarse);
13871387
13881388 free (d);
1389- for (int i = 0 ; i < numContacts; i ++)
1390- delete W33[i ];
1389+ for (int c = 0 ; c < numContacts; c ++)
1390+ delete W33[c ];
13911391 free (W33);
13921392
13931393 return 0 ;
@@ -1525,10 +1525,10 @@ int nlcp_multiGrid(int dim, SReal *dfree, SReal**W, SReal *f, SReal mu, SReal to
15251525
15261526 if (verbose)
15271527 {
1528- std::stringstream tmp ;
1529- tmp << " Result at the COARSE LEVEL: " << msgendl;
1530- resultToString (tmp , F_coarse,num_group*3 );
1531- dmsg_info (" LCPcalc" ) << tmp .str () ;
1528+ std::stringstream ss ;
1529+ ss << " Result at the COARSE LEVEL: " << msgendl;
1530+ resultToString (ss , F_coarse,num_group*3 );
1531+ dmsg_info (" LCPcalc" ) << ss .str () ;
15321532 }
15331533
15341534
@@ -1551,10 +1551,10 @@ int nlcp_multiGrid(int dim, SReal *dfree, SReal**W, SReal *f, SReal mu, SReal to
15511551
15521552 if (verbose)
15531553 {
1554- std::stringstream tmp ;
1555- tmp << " projection at the finer LEVEL: " << msgendl ;
1556- resultToString (tmp , f,dim);
1557- dmsg_info (" LCPcalc" ) << tmp .str () ;
1554+ std::stringstream ss ;
1555+ ss << " projection at the finer LEVEL: " << msgendl ;
1556+ resultToString (ss , f,dim);
1557+ dmsg_info (" LCPcalc" ) << ss .str () ;
15581558 }
15591559
15601560
@@ -1564,10 +1564,10 @@ int nlcp_multiGrid(int dim, SReal *dfree, SReal**W, SReal *f, SReal mu, SReal to
15641564
15651565 if (verbose)
15661566 {
1567- std::stringstream tmp ;
1568- tmp << " after 10 iteration at the finer LEVEL: " << msgendl ;
1569- resultToString (tmp , f,dim);
1570- dmsg_info (" LCPcalc" ) << tmp .str ();
1567+ std::stringstream ss ;
1568+ ss << " after 10 iteration at the finer LEVEL: " << msgendl ;
1569+ resultToString (ss , f,dim);
1570+ dmsg_info (" LCPcalc" ) << ss .str ();
15711571 }
15721572
15731573 free (d_free_coarse);
@@ -1576,8 +1576,8 @@ int nlcp_multiGrid(int dim, SReal *dfree, SReal**W, SReal *f, SReal mu, SReal to
15761576 free (d_coarse);
15771577
15781578 free (d);
1579- for (int i = 0 ; i < numContacts; i ++)
1580- delete W33[i ];
1579+ for (int c = 0 ; c < numContacts; c ++)
1580+ delete W33[c ];
15811581 free (W33);
15821582
15831583 return result;
@@ -1679,9 +1679,9 @@ int nlcp_gaussseidel(int dim, SReal *dfree, SReal**W, SReal *f, SReal mu, SReal
16791679 for (int c=0 ; c<numContacts ; c++)
16801680 {
16811681 dn = dfree[3 *c];
1682- for (int i= 0 ; i< dim; i ++)
1682+ for (int k = 0 ; k < dim; k ++)
16831683 {
1684- dn += W[3 *c ][i]*f[i ];
1684+ dn += W[3 * c][k] * f[k ];
16851685 }
16861686 if (dn < 0 )
16871687 sum_d += -dn;
@@ -1711,8 +1711,8 @@ int nlcp_gaussseidel(int dim, SReal *dfree, SReal**W, SReal *f, SReal mu, SReal
17111711 }
17121712
17131713 free (d);
1714- for (int i = 0 ; i < numContacts; i ++)
1715- delete W33[i ];
1714+ for (int c = 0 ; c < numContacts; c ++)
1715+ delete W33[c ];
17161716 free (W33);
17171717
17181718 if (verbose){
@@ -1725,8 +1725,8 @@ int nlcp_gaussseidel(int dim, SReal *dfree, SReal**W, SReal *f, SReal mu, SReal
17251725 sofa::helper::AdvancedTimer::valSet (" GS iterations" , it);
17261726
17271727 free (d);
1728- for (int i = 0 ; i < numContacts; i ++)
1729- delete W33[i ];
1728+ for (int c = 0 ; c < numContacts; c ++)
1729+ delete W33[c ];
17301730 free (W33);
17311731
17321732 if (verbose)
@@ -1820,8 +1820,8 @@ int nlcp_gaussseidelTimed(int dim, SReal *dfree, SReal**W, SReal*f, SReal mu, SR
18201820 if ((t1-t0) > tdiff)
18211821 {
18221822 free (d);
1823- for (int i = 0 ; i < numContacts; i ++)
1824- delete W33[i ];
1823+ for (int c = 0 ; c < numContacts; c ++)
1824+ delete W33[c ];
18251825 free (W33);
18261826 return 1 ;
18271827 }
@@ -1830,17 +1830,17 @@ int nlcp_gaussseidelTimed(int dim, SReal *dfree, SReal**W, SReal*f, SReal mu, SR
18301830 if (error < tol)
18311831 {
18321832 free (d);
1833- for (int i = 0 ; i < numContacts; i ++)
1834- delete W33[i ];
1833+ for (int c = 0 ; c < numContacts; c ++)
1834+ delete W33[c ];
18351835 free (W33);
18361836 sofa::helper::AdvancedTimer::valSet (" GS iterations" , it+1 );
18371837 return 1 ;
18381838 }
18391839 }
18401840 sofa::helper::AdvancedTimer::valSet (" GS iterations" , it);
18411841 free (d);
1842- for (int i = 0 ; i < numContacts; i ++)
1843- delete W33[i ];
1842+ for (int c = 0 ; c < numContacts; c ++)
1843+ delete W33[c ];
18441844 free (W33);
18451845
18461846 if (verbose)
0 commit comments