void initMatrix (M &m) { mt.init (42); for (unsigned d = 0; d < m.getDimension(); ++d) { for (unsigned r = 0; r < m.getM(); ++ r) { for (unsigned b = 0; b < m.getTotalPrec(); ++b) { m.setDigit (d, r, b, mt (m.getBase())); } } } }
bool verifyMatrix (M &m) { mt.init (42); for (unsigned d = 0; d < m.getDimension(); ++d) { for (unsigned r = 0; r < m.getM(); ++ r) { for (unsigned b = 0; b < m.getTotalPrec(); ++b) { if (int (m.getDigit (d, r, b)) != mt (m.getBase())) { return false; } } } } return true; }