}
}
}
private void checkNaive(int m, int n) {
SimpleMatrix A = SimpleMatrix.wrap(RandomMatrices.createRandom(m,n,rand));
BidiagonalDecompositionRow decomp = new BidiagonalDecompositionRow();
BidiagonalDecompositionNaive naive = new BidiagonalDecompositionNaive();
assertTrue(decomp.decompose(A.getMatrix().copy()));
assertTrue(naive.decompose(A.getMatrix()));
SimpleMatrix U = SimpleMatrix.wrap(decomp.getU(null,false,false));
SimpleMatrix B = SimpleMatrix.wrap(decomp.getB(null,false));
SimpleMatrix V = SimpleMatrix.wrap(decomp.getV(null,false,false));
// U.print();
// B.print();
// naive.getB().print();
// V.print();
// naive.getV().print();
// naive.getVTran().print();
assertTrue(naive.getB().isIdentical(B,1e-8));
assertTrue(naive.getU().isIdentical(U,1e-8));
assertTrue(naive.getV().isIdentical(V,1e-8));
// check the decomposition
DenseMatrix64F foundA = U.mult(B).mult(V.transpose()).getMatrix();
// A.print();
// foundA.print();
assertTrue(MatrixFeatures.isIdentical(A.getMatrix(),foundA,1e-8));