Sets the value at the given index.
@param array the array you are setting the value to.
@param value the new value.
763232
public static void atIndex( final int[] array, int index, int value ) {
        final int i = calculateIndex( array, index );

        array[ i ] = value;
    }
318244
public void set(int i, int value)
  {
    if (_size <= i)
      throw new IndexOutOfBoundsException(i + " >= " + _size);

    _data[i] = value;
  }
987173
public void setValues(java.util.Collection<Value> values) {
        if (values == null) {
            this.values = null;
            return;
        }

        this.values = new java.util.ArrayList<Value>(values);
    }
1213207
protected void set(double values[][])
    {
        this.nRows  = values.length;
        this.nCols  = values[0].length;
        this.values = values;

        for (int r = 1; r < nRows; ++r) {
            nCols = Math.min(nCols, values[r].length);
        }
    }
37213
@Override
    public void setValues(String[] values) {
        if (values == null) {
            this.valuesArray = null;
            this.values = null;
            this.nullValues = true;
        } else if (this.values == null) {
            this.values = new ArrayList<>(Arrays.asList(values));
            this.nullValues = false;
            this.valuesArray = values.clone();
        } else {
            this.nullValues = false;
            this.values.clear();
            for (final String value : values) {
                if (value == null) {
                    this.values.add(NULL_MARKER);
                } else {
                    this.values.add(NullSafeStringColumnMapper.NOT_NULL_PREFIX + value);
                }
            }
            this.valuesArray = values.clone();
        }
    }
862529
public function setValues(array $values)
    {

        foreach ($values as & $value) {
            if (PHP_INT_SIZE == 4 && is_double($value)) {
                //TODO: 32bit - handle this specially?
                $value = $this->castValueToSimpleType('integer', $value);
            }

            $this->checkType('integer', $value, true);
        }

        parent::setValues($values);
    }
154802
public function offsetSet($offset, $value)
	 {
		 if (is_null ($offset))
		 {
			 $index = array_push ($this->data, $value) - 1;
			 $this->trigger ('add', $value, $index);
		 }
		 else
		 {
			$this->data[$offset] = $value;

			 if (isset ($this->data[$offset]))
			 {
				 $this->trigger ('add', $value, $offset);
			 }
			 else {
				 $this->trigger ('set', $value, $offset);
			 }
		 }
	 }
825885
public function setValue($value, $index = null)
    {
        if ($index === null) {
            $this->value = Arr::cast($value);
        }
        else {
            $this->value[$index] = $value;
        }
        return $this;
    }
1304671
public static function setValue(&$array, $key, $value)
    {
        if (is_string($key)) {
            // Iterate path
            $keys = explode('.', $key);
            foreach ($keys as $key) {
                if (!isset($array[$key]) || !is_array($array[$key])) {
                    $array[$key] = [];
                }
                $array = &$array[$key];
            }
            // Set value to path
            $array = $value;
        } elseif (is_array($key)) {
            // Iterate array of paths and values
            foreach ($key as $k => $v) {
                self::setValue($array, $k, $v);
            }
        }
    }
88877
public function set(string $key, $value)
    {
        if (!is_array($value)) {
            $value = [$value];
        }
        $this->data[$key] = $value;
    }
1298405
public void set( int index , double value ) {
        if( mat.getType() == MatrixType.DDRM ) {
            ((DMatrixRMaj) mat).set(index, value);
        } else if( mat.getType() == MatrixType.FDRM ) {
            ((FMatrixRMaj) mat).set(index, (float)value);
        } else {
            throw new RuntimeException("Not supported yet for this matrix type");
        }
    }
1158585
private function setValueByReference(array &$array, array $path, $value)
    {
        while (count($path) > 1) {
            $key = array_shift($path);
            $array = &$array[$key];
        }

        $key = reset($path);
        $array[$key] = $value;
    }
1074067
public static function set(array & $array, $key, $value)
    {
        if (strpos($key, '.') !== false) {
            $keys = explode('.', $key);
            $topKey = array_shift($keys);

            if (!isset($array[$topKey]) || !is_array($array[$topKey])) {
                $array[$topKey] = [];
            }

            static::set($array[$topKey], implode('.', $keys), $value);
        } else {
            $array[$key] = $value;
        }
    }
750490
@Override
    public void setArray(INDArray arr) {
        if (this.arr.get() == null)
            this.arr.set(arr);
    }
1283996
public function setData( array $array ) {
        foreach( $array as $name=>$value ) {
            if( !isset( $this->nameHash[$name] ) ) {
                continue;
            }

            $element = $this->nameHash[$name];

            $element->setAttribute( 'value', (string)$value );
        }
    }
1108296
public void setValue(char[] chars, int offset, int len) {
		Validate.notNull(chars);
		if (offset < 0 || len < 0 || offset > chars.length - len) {
			throw new IndexOutOfBoundsException();
		}

		ensureSize(len);
		System.arraycopy(chars, offset, this.value, 0, len);
		this.len = len;
		this.hashCode = 0;
	}
162596
public void set(int i, byte value) {
        if (i < 0 || i >= size) {
            throw new IndexOutOfBoundsException();
        }
        elements[i] = value;
    }