• Kirill Smelkov's avatar
    bigarray: Support resizing in-place · ca064f75
    Kirill Smelkov authored
    In NumPy, ndarray has .resize() but actually it does a whole array
    copy into newly allocated larger segment which makes e.g. appending O(n).
    
    For BigArray, we don't have that internal constraint NumPy has - to
    keep the array itself contiguously _stored_ (compare to contiguously
    _presented_ in memory). So we can have O(1) resize for big arrays.
    
    NOTE having O(1) resize, here is how O(δ) append can be done:
    
        A                               # ZBigArray e.g. of shape   (N, 3)
        n = len(A)                      # lengh of A's major index  =N
        A.resize((n+δ, A.shape[1:]))    # add δ new entries ; now len(A) =N+δ
        A[-δ:] = <new-data>             # set data for last new δ entries
    
    /cc @klaus
    ca064f75
Name
Last commit
Last update
3rdparty Loading commit data...
bigarray Loading commit data...
bigfile Loading commit data...
demo Loading commit data...
include/wendelin Loading commit data...
lib Loading commit data...
t Loading commit data...
.gitignore Loading commit data...
.gitmodules Loading commit data...
COPYING Loading commit data...
Makefile Loading commit data...
setup.py Loading commit data...
tox.ini Loading commit data...
wendelin.py Loading commit data...