Create an empty BigVector with a given capacity, the default is 0
.
The constructor of the underlying backing BigTypedArray type.
Optional
initialCapacity: numberThe initial capacity of the BigVector. Defaults to 0
.
You can also customize more options, by using VectorOptions in the second argument.
The constructor of the underlying backing BigTypedArray type.
Initial options
Current the current length of the backing BigTypedArray. This is the maximum number of elements this BigVector can hold before it will be resized.
Get the current length of the BigVector, will always been less-than-or-equal to BigVector.capacity.
Set the value at the given index.
The index of the element to set.
The value of the element.
Error if the index is out of range.
Retrieves the element at the given index.
The index of the element to get.
Error if the index is out of range.
Push elements onto the end of the BigVector, resizing if needed.
Rest
...args: bigint[]The values to push to the end of the vector.
The new length of the vector.
Push multiple elements onto the end of the BigVector, resizing multiple-times if needed.
Manually trigger the BigVector to grow in size, using the growth behavior.
Reallocate the underlying BigTypedArray.
If the capacity is less-than the current length, then the extra values are discarded.
Clear all entries from the BigVector
Iterate through the vector from the tail-end, consuming each entry. Essentially, the same as running BigVector.pop in a loop until BigVector.length is zero.
Static
fromThe constructor of the underlying backing BigTypedArray type.
Optional
initialCapacity: numberThe initial capacity of the constructed BigVector
The constructor of the underlying backing BigTypedArray type.
The options of constructed BigVector
The BigVector is a resizable data-structure for storing
int64
anduint64
entries.Example: 64-bit integer vectors.
Then, you can
push()
andpop()
entries from the BigVector.