src/Maths/Algebra/Matrix.php
public function seekInt($index)
    {
        if (!is_integer($index)) {
            throw new InvalidArgumentException(
                sprintf("Cell index of a matrix for integer access must be an integer (%s given)", gettype($index))
            );
        }
        $line = $this->keyX();
        $cell = $this->keyY();
        $_index = $index + 1;
        if ($_index==1) {
            $line = 1;
            $cell = 1;
        } elseif ($_index==$this->countXY()) {
            $line = $this->countX();
            $cell = $this->countY();
        } elseif ($_index>0 && $_index<$this->countXY()) {
            if ($_index>$this->countX()) {
                $line = round(($index / $this->countX()), 0, PHP_ROUND_HALF_EVEN);
            } else {
                $line = 1;
            }
            $cell = $_index - (($line - 1) * $this->countY());
            if ($cell==($this->countY()+1)) {
                $line++;
                $cell = 1;
            }
        } else {
            throw new OutOfRangeException(
                "Index '{$index}' (as integer) is out of range of available data"
            );
        }
        $this->seekXY($line.self::XY_SEPARATOR.$cell);
        return $this;
    }
public function seekInt($index)
    {
        if (!is_integer($index)) {
            throw new InvalidArgumentException(
                sprintf("Cell index of a matrix for integer access must be an integer (%s given)", gettype($index))
            );
        }
        $line = $this->keyX();
        $cell = $this->keyY();
        $_index = $index + 1;
        if ($_index==1) {
            $line = 1;
            $cell = 1;
        } elseif ($_index==$this->countXY()) {
            $line = $this->countX();
            $cell = $this->countY();
        } elseif ($_index>0 && $_index<$this->countXY()) {
            if ($_index>$this->countX()) {
                $line = round(($index / $this->countX()), 0, PHP_ROUND_HALF_EVEN);
            } else {
                $line = 1;
            }
            $cell = $_index - (($line - 1) * $this->countY());
            if ($cell==($this->countY()+1)) {
                $line++;
                $cell = 1;
            }
        } else {
            throw new OutOfRangeException(
                "Index '{$index}' (as integer) is out of range of available data"
            );
        }
        $this->seekXY($line.self::XY_SEPARATOR.$cell);
        return $this;
    }
Go to index `x,y` represented as an integer (0 based)

@param   int     $index
@return  $this
@throws  InvalidArgumentException if the argument is not an integer
@throws  OutOfRangeException if the integer is out of matrix's range