public function rows()
    {
        foreach ($this->grid as $i => $row) {
            yield $i + 1 => ($this->columns == 1)
                ? $row[0]
                : new static([$row]);
        }
    }
public function rows()
    {
        foreach ($this->grid as $i => $row) {
            yield $i + 1 => ($this->columns == 1)
                ? $row[0]
                : new static([$row]);
        }
    }
public function rows ( ) { foreach ( $ this -> grid as $ i => $ row ) { yield $ i + 1 => ( $ this -> columns == 1 ) ? $ row [ 0 ] : new static ( [ $ row ] ) ; } }
Returns a Generator that will yield each row of the matrix in turn as a vector matrix
or the value of each cell if the matrix is a vector

@return \Generator|Matrix[]|mixed[]
Returns a Generator that will yield each row of the matrix in turn as a vector matrix or the value of each cell if the matrix is a vector