public function transpose() : self
    {
        if ($this->m > 1) {
            $b = array_map(null, ...$this->a);
        } else {
            $b = [];

            for ($i = 0; $i < $this->n; $i++) {
                $b[] = array_column($this->a, $i);
            }
        }

        return self::quick($b);
    }
public function transpose() : self
    {
        if ($this->m > 1) {
            $b = array_map(null, ...$this->a);
        } else {
            $b = [];

            for ($i = 0; $i < $this->n; $i++) {
                $b[] = array_column($this->a, $i);
            }
        }

        return self::quick($b);
    }
public function transpose ( ) : self { if ( $ this -> m > 1 ) { $ b = array_map ( null , ... $ this -> a ) ; } else { $ b = [ ] ; for ( $ i = 0 ; $ i < $ this -> n ; $ i ++ ) { $ b [ ] = array_column ( $ this -> a , $ i ) ; } } return self :: quick ( $ b ) ; }
Transpose the matrix i.e row become columns and columns
become rows.

@return self
Transpose the matrix i . e row become columns and columns become rows .