@@ -532,22 +532,19 @@ computeControlLaw( dynamicgraph::Vector& control,const int& iterTime )
532
532
sotDEBUG (2 ) <<" Recompute inverse." <<endl;
533
533
534
534
/* --- FIRST ALLOCS --- */
535
- dynamicgraph::Vector &S = mem->S ;
536
-
537
535
sotDEBUG (1 ) << " Size = "
538
- << S. size ( ) + mem->Jff .cols ()*mem->Jff .rows ()
536
+ << std::min (nJ, mJ ) + mem->Jff .cols ()*mem->Jff .rows ()
539
537
+ mem->Jact .cols ()*mem->Jact .rows () << std::endl;
540
538
541
539
sotDEBUG (1 ) << std::endl;
542
- S.resize ( std::min (nJ,mJ ) );
543
540
sotDEBUG (1 ) << " nJ=" << nJ << " " << " Jac.cols()=" << Jac.cols ()
544
541
<<" " << " mJ=" << mJ <<std::endl;
545
542
mem->Jff .resize ( nJ,Jac.cols ()-mJ ); // number dofs, number constraints
546
543
sotDEBUG (1 ) << std::endl;
547
544
mem->Jact .resize ( nJ,mJ );
548
545
sotDEBUG (1 ) << std::endl;
549
546
sotDEBUG (1 ) << " Size = "
550
- << S. size ( ) + mem->Jff .cols ()*mem->Jff .rows ()
547
+ << std::min (nJ, mJ ) + mem->Jff .cols ()*mem->Jff .rows ()
551
548
+ mem->Jact .cols ()*mem->Jact .rows () << std::endl;
552
549
553
550
/* **/ sotCOUNTER (1 ,2 ); // first allocs
@@ -568,9 +565,6 @@ computeControlLaw( dynamicgraph::Vector& control,const int& iterTime )
568
565
svd.compute (Jt);
569
566
Eigen::dampedInverse (svd, Jp, th);
570
567
V.noalias () = svd.matrixV ();
571
- // TODO I think variable S could be removed as it is not used when
572
- // not recomputing the pseudo inverse.
573
- S.noalias () = svd.singularValues ();
574
568
/* **/ sotCOUNTER (5 ,6 ); // PINV
575
569
sotDEBUG (2 ) << " V after dampedInverse." << V <<endl;
576
570
/* --- RANK --- */
@@ -589,7 +583,7 @@ computeControlLaw( dynamicgraph::Vector& control,const int& iterTime )
589
583
sotDEBUG (15 ) << " e" <<iterTask<<" = " <<err<<endl;
590
584
sotDEBUG (45 ) << " JJp" <<iterTask<<" = " << JK*Jp <<endl;
591
585
// sotDEBUG(45) << "U"<<iterTask<<" = "<< U<<endl;
592
- sotDEBUG (45 ) << " S" <<iterTask<<" = " << S <<endl;
586
+ sotDEBUG (45 ) << " S" <<iterTask<<" = " << svd. singularValues () <<endl;
593
587
sotDEBUG (45 ) << " V" <<iterTask<<" = " << V<<endl;
594
588
sotDEBUG (45 ) << " U" <<iterTask<<" = " << svd.matrixU ()<<endl;
595
589
0 commit comments