public function constructWithCopy($A)
    {
        $this->m = count($A);
        $this->n = count($A[0]);
        $X = new Matrix($this->m, $this->n);
        for ($i = 0; $i < $this->m; $i++) {
            if (count($A[$i]) != $this->n) {
                trigger_error(RowLengthException, ERROR);
            }
            for ($j = 0; $j < $this->n; $j++) {
                $X->A[$i][$j] = $A[$i][$j];
            }
        }
        return $X;
    }