/** * Randomize the matrix based on an array, modify the array. * Previous values * may be used, or they may be discarded, depending on the randomizer. * * @param * Matrix m * A matrix to randomize. */ public function randomizeMatrix(Matrix &$m) { $d = $m->getData(); for ($r = 0; $r < $m->getRows(); ++$r) { for ($c = 0; $c < $m->getCols(); ++$c) { $d[$r][$c] = $this->randomizeDouble($d[$r][$c]); } } $m->setData($d); }