Commit bc7c2970 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Fix unit test of SubMatrix

parent f468344e
......@@ -499,8 +499,8 @@ namespace soth
sotDEBUG(15) << "Mi: "<< rowDistrib.sum() << " " <<(MATLAB)rowDistrib << std::endl;
sotDEBUG(15) << "Ri: "<< rankDistrib.sum() << " " << (MATLAB)rankDistrib << std::endl;
rankDistrib = rankDistrib.unaryExpr(&round);
rowDistrib = rowDistrib.unaryExpr(&round);
rankDistrib = rankDistrib.unaryExpr(std::ptr_fun<double,double>(round));
rowDistrib = rowDistrib.unaryExpr(std::ptr_fun<double,double>(round));
VectorXd selfdefDistrib(nbStage); soth::MatrixRnd::randomize( selfdefDistrib,0,1 );
double vsd = selfdefDistrib.cwiseProduct(rowDistrib-rankDistrib).sum();
......@@ -521,7 +521,7 @@ namespace soth
sotDEBUG(15) << "Si: "<< selfdefDistrib.sum() << " " << (MATLAB)selfdefDistrib << std::endl;
selfdefDistrib = selfdefDistrib.unaryExpr(&round);
selfdefDistrib = selfdefDistrib.unaryExpr(std::ptr_fun<double,double>(round));
sotDEBUG(5) << "Mi: "<< rowDistrib.sum() << " " <<(MATLAB)rowDistrib << std::endl;
sotDEBUG(5) << "Ri: "<< rankDistrib.sum() << " " << (MATLAB)rankDistrib << std::endl;
sotDEBUG(5) << "Si: "<< selfdefDistrib.sum() << " " << (MATLAB)selfdefDistrib << std::endl;
......
......@@ -281,10 +281,10 @@ void testStack()
/* --- */
typedef SubMatrix<MatrixXi,RowPermutation> SubMatrixXi;
Matrix<SubMatrixXi::Index,Dynamic,1> row1(3); row1 << 2,3,0;
Matrix<MatrixXi::Index,Dynamic,1> row1(3); row1 << 2,3,0;
SubMatrixXi m1i( m1,row1 );
std::cout << "m1i = " << m1i << std::endl;
Matrix<SubMatrixXi::Index,Dynamic,1> row2(1); row2 << 0;
Matrix<MatrixXi::Index,Dynamic,1> row2(1); row2 << 0;
SubMatrixXi m2i( m2,row2 );
std::cout << "m2i = " << m2i << std::endl;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment