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

        if ($mA->is('empty')) {
            return new Matrix(array());
        }
        $transposed = array();
        $data = $mA->toArray();
        foreach ($data as $rowKey => $row) {
            if (is_array($row) && !empty($row)) { //check to see if there is a second dimension
                foreach ($row as $columnKey => $element) {
                    $transposed[$columnKey][$rowKey] = $element;
                }
            }
        }

        return new Matrix($transposed);
    }