public function reshape(int $m, int $n) : Matrix
    {
        if (($m * $n) !== $this->n) {
            throw new DimensionalityMismatchException("($m * $n) elements"
                . " are needed but vector has $this->n.");
        }

        $k = 0;

        $b = [];

        for ($i = 0; $i < $m; $i++) {
            $temp = [];

            for ($j = 0; $j < $n; $j++) {
                $temp[] = $this->a[$k++];
            }

            $b[] = $temp;
        }

        return Matrix::quick($b);
    }