Computes the index within the data matrix.

@param array $indices An array of all value indices

@return int
485497
public function index($indices)
    {
        $this->assertIndexMultipliers();

        $index = 0;
        for ($i = 0, $length = count($this->indexMultipliers); $i < $length; ++$i) {
            $index += $indices[$i] * $this->indexMultipliers[$i];
        }

        return $index;
    }
705147
public function readArray($index) {
        return isset ($_SESSION [$index]) && is_array($_SESSION [$index]) ? $_SESSION [$index] : [];
    }
180273
protected function getLoadValueFromIndex($index)
    {
        $loadValue = $this->getLoadValue();
        if (!is_array($loadValue)) {
            $loadValue = [];
        }

        return array_get($loadValue, $index, []);
    }
193571
public function scalar($index = 0)
    {
        $stmt = $this->execute();

        if ($stmt) {
            return $stmt->fetchColumn($index);
        } else {
            return false;
        }
    }
266018
public static function add(array ...$arrays): array
    {
        self::checkArrayLengths($arrays);

        $number_of_arrays = count($arrays);
        $length_of_arrays = count($arrays[0]);
        $sums             = array_fill(0, $length_of_arrays, 0);

        for ($i = 0; $i < $length_of_arrays; $i++) {
            for ($j = 0; $j < $number_of_arrays; $j++) {
                $sums[$i] += $arrays[$j][$i];
            }
        }

        return $sums;
    }
497784
protected function getEndIndex(array $tokens, int $index): int
    {
        $startIndex = $index;
        while (!empty($tokens[$index + 1]) && $tokens[$index + 1]['code'] !== T_DOC_COMMENT_CLOSE_TAG && $tokens[$index + 1]['code'] !== T_DOC_COMMENT_TAG) {
            $index++;
        }

        // Jump to the previous line
        $currentLine = $tokens[$index]['line'];
        while ($tokens[$index]['line'] === $currentLine) {
            $index--;
        }
        // Fix for single line doc blocks
        $index = max($index, $startIndex);

        return $this->getLastTokenOfLine($tokens, $index);
    }
641388
public function removeByIndex($indices)
    {
        if (!is_array($indices)) {
            $indices = array($indices);
        }

        $indices = array_unique($indices);

        $allItems = $this->getAll();
        foreach ($indices as $index) {
            unset($allItems[$index]);
        }

        $this->setAll(array_values($allItems));
    }
1305043
public static function Remove( array $array, int $index ) : array
   {

      if ( $index < 0 || $index >= \count( $array ) )
      {
         return $array;
      }

      if ( $index == 0 )
      {
         return \array_slice( $array, 1 );
      }

      if ( $index + 1 == \count( $array ) )
      {
         return \array_slice( $array, 0, -1 );
      }

      $neu = \array_slice( $array, 0, $index );

      return \array_merge( $neu, \array_slice( $array, $index + 1 ) );

   }
265578
public static function delete($names): int
    {
        if (!is_array($names)) {
            $names = [$names];
        }
        return self::handle()->delete(...$names);
    }
1076872
public function sort($index)
    {
        $this->sort_order = $index->get_parameters('ORDER');

        if (empty($this->raw_data)) {
            return;
        }

        // when sorting search result it's good to make the index smaller
        if ($index->count() != $this->count_messages()) {
            $index->filter($this->get());
        }

        $result  = array_fill_keys($index->get(), null);
        $datalen = strlen($this->raw_data);
        $start   = 0;

        // Here we're parsing raw_data twice, we want only one big array
        // in memory at a time

        // Assign roots
        while (($pos = @strpos($this->raw_data, self::SEPARATOR_ELEMENT, $start))
            || ($start < $datalen && ($pos = $datalen))
        ) {
            $len   = $pos - $start;
            $elem  = substr($this->raw_data, $start, $len);
            $start = $pos + 1;

            $items = explode(self::SEPARATOR_ITEM, $elem);
            $root  = (int) array_shift($items);

            if ($root) {
                $result[$root] = $root;
                foreach ($items as $item) {
                    list($lv, $id) = explode(self::SEPARATOR_LEVEL, $item);
                    $result[$id] = $root;
                }
            }
        }

        // get only unique roots
        $result = array_filter($result); // make sure there are no nulls
        $result = array_unique($result);

        // Re-sort raw data
        $result = array_fill_keys($result, null);
        $start = 0;

        while (($pos = @strpos($this->raw_data, self::SEPARATOR_ELEMENT, $start))
            || ($start < $datalen && ($pos = $datalen))
        ) {
            $len   = $pos - $start;
            $elem  = substr($this->raw_data, $start, $len);
            $start = $pos + 1;

            $npos = strpos($elem, self::SEPARATOR_ITEM);
            $root = (int) ($npos ? substr($elem, 0, $npos) : $elem);

            $result[$root] = $elem;
        }

        $this->raw_data = implode(self::SEPARATOR_ELEMENT, $result);
    }
1152930
def p_array_indices(self, p):
        ''''''
        if len(p) == 2:
            p[0] = p[1],
        else:
            p[0] = (p[1],) + p[3]
374176
public function setIndex($index)
    {
        if ($index instanceof Index) {
            $index = $index->getName();
        }

        return $this->setParam('_index', $index);
    }
263223
protected function getLastTokenOfLine(array $tokens, int $index): int
    {
        $line = $tokens[$index]['line'];

        $currentIndex = $index;
        while ($tokens[$currentIndex + 1]['line'] === $line) {
            $currentIndex++;
        }

        return $currentIndex;
    }
519681
public void renumberRowIndex(List<Integer> indices) {
    this.rowNr = this.rowNr != null ? Long.valueOf(indices.get(toIntExact(this.rowNr - 1))) : null;
  }
1235670
public function columnType(int $index) : int
    {
        if (empty($this->samples)) {
            throw new RuntimeException('Cannot determine data type'
                . ' of an empty data frame.');
        }

        $sample = reset($this->samples);

        if (!isset($sample[$index])) {
            throw new InvalidArgumentException("Column $index does"
             . ' not exist.');
        }

        return DataType::determine($sample[$index]);
    }
44985
def get_value_index(self, indices):
        
        size = self['size'] if self.get('size') else self['dimension']['size']
        ndims = len(size)
        mult = 1
        num = 0
        for idx, dim in enumerate(size):
            mult *= size[ndims - idx] if (idx > 0) else 1
            num += mult * indices[ndims - idx - 1]
        return num
1094880
public function setArrays(array $arrays)
    {
        $this->data = (isset($arrays[0]) && is_array($arrays[0])) ?
            $arrays :
            [$arrays];
    }