pike.git / lib / modules / Array.pmod

version» Context lines:

pike.git/lib/modules/Array.pmod:1:   #pike __REAL_VERSION__      #pragma strict_types      constant diff = __builtin.diff;   constant diff_longest_sequence = __builtin.diff_longest_sequence;   constant diff_compare_table = __builtin.diff_compare_table;   constant longest_ordered_sequence = __builtin.longest_ordered_sequence;   constant interleave_array = __builtin.interleave_array;    + constant diff_dyn_longest_sequence = __builtin.diff_dyn_longest_sequence; +    constant sort = predef::sort;   constant everynth = __builtin.everynth;   constant splice = __builtin.splice;   constant transpose = __builtin.transpose;   constant uniq = __builtin.uniq_array;      constant filter=predef::filter;   constant map=predef::map;   constant permute = __builtin.permute;   constant enumerate = predef::enumerate;
pike.git/lib/modules/Array.pmod:202:    while(start < length) bar[start]=foo[start++];       tmp=foo;    foo=bar;    bar=tmp;    }       return foo;   }    - array columns(array x, array ind) + //! Get multiple columns from an array. + //! + //! This function is equvivalent to + //! @pre{ + //! map(ind, lambda(mixed i) { return column(x, i); }) + //! @} + //! + //! @seealso + //! @[column()] + array(array) columns(array x, array ind)   {    array ret=allocate(sizeof(ind));    for(int e=0;e<sizeof(ind);e++) ret[e]=column(x,ind[e]);    return ret;   }      array transpose_old(array(array|string) x)   {    if (!sizeof(x)) return x;    array ret=allocate(sizeof([array|string]x[0]));    for(int e=0;e<sizeof([array|string]x[0]);e++) ret[e]=column(x,e);    return ret;   }      // diff3, complement to diff    -  + //! Return the three-way difference between the arrays. + //! + //! @seealso + //! @[Array.diff()], @[Array.diff_longest_sequence()]   array(array(array)) diff3 (array a, array b, array c)   {    // This does not necessarily produce the optimal sequence between    // all three arrays. A diff_longest_sequence() that takes any number    // of arrays would be nice.    array(int) seq_ab = diff_longest_sequence (a, b);    array(int) seq_bc = diff_longest_sequence (b, c);    array(int) seq_ca = diff_longest_sequence (c, a);       array(int) aeq = allocate (sizeof (a) + 1);