src/Maths/Algebra/Matrix.php
public function nextXY()
    {
        if (($this->keyY()+1)<=$this->countY()) {
            $this->seekY($this->keyY()+1);
        } else {
            if (($this->keyX()+1)<=$this->countX()) {
                $this->rewindY();
                $this->seekX($this->keyX()+1);
            } else {
                $this->x = null;
                $this->y = null;
            }
        }
        return $this;
    }
public function nextXY()
    {
        if (($this->keyY()+1)<=$this->countY()) {
            $this->seekY($this->keyY()+1);
        } else {
            if (($this->keyX()+1)<=$this->countX()) {
                $this->rewindY();
                $this->seekX($this->keyX()+1);
            } else {
                $this->x = null;
                $this->y = null;
            }
        }
        return $this;
    }
Go to next cell

@return  $this