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;
    }
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;
    }
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 ; }
Construct a matrix from a copy of a 2-D array.
@param float A[][]  Two-dimensional array of doubles.
@exception  IllegalArgumentException All rows must have the same length
Construct a matrix from a copy of a 2 - D array .