Results of 1 - 10 of about 128 for Vector (0.001 sec.)
- The Vector class | PHP 8.3 9144
- The Vector class (PECL ds >= 1.0.0) はじめに A Vector is a sequence of values in a contiguous buffer that grows and shrinks automatically. It's the most efficient sequential structure because a value's index is a direct mapping to its index
... () , push() , pop() are all O(1). Weaknesses shift() , unshift() , insert() and remove() are all O(n). クラス概要 class Ds\Vector implements Ds\Sequence , ArrayAccess { /* 定数 */ const int MIN_CAPACITY = 8 ; /* メソッド */ public function allocate ( i ... ity (): int public function clear (): void public function contains ( mixed ...$values ): bool public function copy (): Ds\Vector public function filter ( callable $callback = ? ): Ds\Vector public function find ( mixed $value ): mixed public function ... c function join ( string $glue = ? ): string public function last (): mixed public function map ( callable $callback ): Ds\Vector public function merge ( mixed $values ): Ds\Vector public function pop (): mixed public function push ( mixed ...$values ) ...
-
https://man.mtool.work/php/8.3/class.ds-vector.html
- Ds\Vector::slice — Returns a sub-vector of a given range | PHP 8.3 8582
- Ds\Vector::slice (PECL ds >= 1.0.0) Ds\Vector::slice — Returns a sub-vector of a given range 説明 public function Ds\Vector::slice ( int $index , int $length = ? ): Ds\Vector Creates a sub-vector of a given range. パラメータ index The index
... at which the sub-vector starts. If positive, the vector will start at that index in the vector. If negative, the vector will start that far from t ... he end. length If a length is given and is positive, the resulting vector will have up to that many values in it. If the length results in an overflow, only values up to the end of the vector will ... be included. If a length is given and is negative, the vector will stop that many values from the end. If a length is not provided, the resulting vector will contain all values between ...
-
https://man.mtool.work/php/8.3/ds-vector.slice.html
- Data Structures | PHP 8.3 8192
- Data Structures はじめに Efficient data structures for PHP 7, provided as an alternative to the array . See » this blog post for benchmarks, discussion and frequently asked questions. インストール/設定 要件 インストール手順 例 Ds\Collection
... ce::sum — Returns the sum of all values in the sequence Ds\Sequence::unshift — Adds values to the front of the sequence Ds\Vector — The Vector class Ds\Vector::allocate — Allocates enough memory for a required capacity Ds\Vector::apply — Updates all va ... lues by applying a callback function to each value Ds\Vector::capacity — Returns the current capacity Ds\Vector::clear — Removes all values Ds\Vector::__construct — Creates a new inst ... ance Ds\Vector::contains — Determines if the vector contains given values Ds\Vector::copy — Returns a shallow copy of the vector Ds\Vecto ...
-
https://man.mtool.work/php/8.3/book.ds.html
- Ds\Vector::rotate — Rotates the vector by a given number of rotations | PHP 8.3 8192
- Ds\Vector::rotate (PECL ds >= 1.0.0) Ds\Vector::rotate — Rotates the vector by a given number of rotations 説明 public function Ds\Vector::rotate ( int $rotations ): void Rotates the vector by a given number of rotations, which is equivalen
... t to successively calling $vector->push($vector->shift()) if the number of rotations is positive, or $vector->unshift($vector->pop()) if negative. パラメータ ... rotations The number of times the vector should be rotated. 戻り値 値を返しません。. The vector of the current instance will be rotated. 例 例1 Ds\Vector::rotate() ... example <?php $vector = new \Ds\Vector ([ "a" , "b" , "c" , "d" ]); $vector -> rotate ( 1 ); // "a" is shifted, then pushed. print_r ( $vector ) ...
-
https://man.mtool.work/php/8.3/ds-vector.rotate.html
- Ds\Vector::contains — Determines if the vector contains given values | PHP 8.3 7996
- Ds\Vector::contains (PECL ds >= 1.0.0) Ds\Vector::contains — Determines if the vector contains given values 説明 public function Ds\Vector::contains ( mixed ...$values ): bool Determines if the vector contains all values. パラメータ values
... Values to check. 戻り値 false if any of the provided values are not in the vector, true otherwise. 例 例1 Ds\Vector::contains() example <?php $vector = new \Ds\Vector ([ 'a' , 'b' , 'c' , 1 , 2 , 3 ]); va ... r_dump ( $vector -> contains ( 'a' )); // true var_dump ( $vector -> contains ( 'a' , 'b' )); // true var_dump ( $vector -> contains ( 'c' ... , 'd' )); // false var_dump ( $vector -> contains (...[ 'c' , 'b' , 'a' ])); // true // Always strict var_dump ( $vector -> contains ( 1 )); // true var_dump ( ...
-
https://man.mtool.work/php/8.3/ds-vector.contains.html
- Ds\Vector::filter — Creates a new vector using a callable | PHP 8.3 7972
- Ds\Vector::filter (PECL ds >= 1.0.0) Ds\Vector::filter — Creates a new vector using a callable to determine which values to include 説明 public function Ds\Vector::filter ( callable $callback = ? ): Ds\Vector Creates a new vector using a ca
... ise. If a callback is not provided, only values which are true (see converting to boolean ) will be included. 戻り値 A new vector containing all the values for which either the callback returned true , or all values that convert to true if a callback w ... as not provided. 例 例1 Ds\Vector::filter() example using callback function <?php $vector = new \Ds\Vector ([ 1 , 2 , 3 , 4 , 5 ]); var_dump ( $vector -> fi ... lter (function( $value ) { return $value % 2 == 0 ; })); ?> 上の例の出力は、 たとえば以下のようになります。 object(Ds\Vector)#3 (2) { [0]=> int(2) [1]=> int(4) } 例2 Ds\Vector::filter() example without a callback function <?php $vector = new \Ds\V ...
-
https://man.mtool.work/php/8.3/ds-vector.filter.html
- Ds\Vector::map — Returns the result of applying a callback to each value | PHP ... 7972
- Ds\Vector::map (PECL ds >= 1.0.0) Ds\Vector::map — Returns the result of applying a callback to each value 説明 public function Ds\Vector::map ( callable $callback ): Ds\Vector Returns the result of applying a callback function to each valu
... e in the vector. パラメータ callback function callback ( mixed $value ): mixed A callable to apply to each value in the vector. The callab ... le should return what the new value will be in the new vector. 戻り値 The result of applying a callback to each value in the vector. 注意 : The values of the current instance won't be ... affected. 例 例1 Ds\Vector::map() example <?php $vector = new \Ds\Vector ([ 1 , 2 , 3 ]); print_r ( $vector -> map (function( $value ) { return $valu ...
-
https://man.mtool.work/php/8.3/ds-vector.map.html
- Ds\Vector::push — Adds values to the end of the vector | PHP 8.3 7972
- Ds\Vector::push (PECL ds >= 1.0.0) Ds\Vector::push — Adds values to the end of the vector 説明 public function Ds\Vector::push ( mixed ...$values ): void Adds values to the end of the vector. パラメータ values The values to add. 戻り値 値を
... 返しません。 例 例1 Ds\Vector::push() example <?php $vector = new \Ds\Vector (); $vector -> push ( "a" ); $vector -> push ( "b" ); $vector -> push ( "c" ... , "d" ); $vector -> push (...[ "e" , "f" ]); print_r ( $vector ); ?> 上の例の出力は、 たとえば以下のようになります。 Ds\Vector Object ( [0] ... => a [1] => b [2] => c [3] => d [4] => e [5] => f ) 他のマニュアルの関連ページ DuckDB Execution Format DuckDB Vector Similarity Search Extension Linux JM envz(3) Linux JM envz_add(3) Docker docker-compose push Linux JM argz_delete(3) ...
-
https://man.mtool.work/php/8.3/ds-vector.push.html
- Ds\Vector::sum — Returns the sum of all values in the vector | PHP 8.3 7972
- Ds\Vector::sum (PECL ds >= 1.0.0) Ds\Vector::sum — Returns the sum of all values in the vector 説明 public function Ds\Vector::sum (): int | float Returns the sum of all values in the vector. 注意 : Arrays and objects are considered equal t
... o zero when calculating the sum. パラメータ この関数にはパラメータはありません。 戻り値 The sum of all the values in the vector as either a float or int depending on the values in the vector. 例 例1 Ds\Vector::sum() integer example <?php $vector = ne ... w \Ds\Vector ([ 1 , 2 , 3 ]); var_dump ( $vector -> sum ()); ?> 上の例の出力は、 たとえば以下のようになります。 int(6) 例2 Ds\Vector::s ... um() float example <?php $vector = new \Ds\Vector ([ 1 , 2.5 , 3 ]); var_dump ( $vector -> sum ()); ?> 上の例の出力は、 たとえば以下のようになります。 floa ...
-
https://man.mtool.work/php/8.3/ds-vector.sum.html
- Ds\Vector::set — Updates a value at a given index | PHP 8.3 7923
- Ds\Vector::set (PECL ds >= 1.0.0) Ds\Vector::set — Updates a value at a given index 説明 public function Ds\Vector::set ( int $index , mixed $value ): void Updates a value at a given index. パラメータ index The index of the value to update.
... value The new value. 戻り値 値を返しません。 エラー / 例外 OutOfRangeException if the index is not valid. 例 例1 Ds\Vector::set() example <?php $vector = new \Ds\Vector ([ "a" , "b" , "c" ]); $vector -> set ( 1 , "_" ); print_r ( $vector ); ?> 上 ... の例の出力は、 たとえば以下のようになります。 Ds\Vector Object ( [0] => a [1] => _ [2] => c ) 例2 Ds\Vector::set() example using array syntax <?php $vector = new \Ds\Vector ([ "a ... " , "b" , "c" ]); $vector [ 1 ] = "_" ; print_r ( $vector ); ?> 上の例の出力は、 たとえば以下のようになります。 Ds\Vector Object ( [0] => a [1] => _ ...
-
https://man.mtool.work/php/8.3/ds-vector.set.html