protected function doTransform(Matrix $mA, $extra = null)
    {
        $this->assertMatrixIsComplete($mA);

        if ($mA->is('empty')) {
            return new Matrix(array());
        }

        if (!is_callable($extra)) {
            throw new MatrixException('Function parameter is not callable');
        }

        $data = array();
        $mAData = $mA->toArray();
        $rows = $mA->rows();
        $cols = $mA->columns();
        for ($row=0; $row<$rows; $row++) {
            for ($col=0; $col<$cols; $col++) {
                $data[$row][$col] = $extra($row+1, $col+1, $mAData[$row][$col]);
            }
        }

        return new Matrix($data);
    }