![]() |
| home | graph lib | utility lib | custom lib | auxiliary lib | tutorials | |
|
zeArrayUse .new("int",...) to create the object for handling large number of data. It supports C data types of char, unsignen char, short, unsigned short, int, unsigned int, float, and double whose corresponding names for the new() function are "char", "uchar", "short", "ushort", "int", "uint", "float", and "double", respectively. Functions include fill, range, add, sub, mul, div, eq, ne, le, lt, ge, gt, count, find, getarr, setarr, getele, setele, getidx, setidx, getblc, setblc, getptr, setptr, insert, delete, sample, flip, swap, shift, transpose, concat, min, max, reshape, resize, size, sort, unique, parse, print. v - a number. Fills all array elements with the number. s - a number for the first element.d - a number for the increment or decrement between elements. n - number of elements. The function resizes an array to n by 1 and fills its elements with the first equals to s; the second equals to s+d; and so on. v- a constant or a zeArray object of the same type. Element-wise addition by the constant or array. The size of the array must be the same as the calling array. v - a constant or a zeArray object of the same type. Element-wise subtraction by the constant or array. The size of the array must be the same as the calling array. v - a constant or a zeArray object of the same type. Element-wise multiplication by the constant or array. The size of the array must be the same as the calling array. v - a constant or a zeArray object of the same type. Element-wise division by the constant or array. The size of the array must be the same as the calling array. v - a constant or a zeArray object of the same type.idx - a zeArray object of character. Element-wise equal-to comparison with the constant or array. The size of the array must the same as the calling array. Sets the index elements or 1 for those elements in v that satisfy the condition and to 0 for the rest of v. v - a constant or a zeArray object of the same type.idx - a zeArray object of character. Element-wise not-equal comparison with the contant or array. The size of the array must be the same as the calling array. Sets the index elements or 1 for those elements in v that satisfy the condition and to 0 for the rest of v. v - a constant or a zeArray object of the same type. idx - a zeArray object of character. Element-wise less-then comparison with the constant or array. The size of the array must be the same as the calling array. Sets the index elements or 1 for those elements in v that satisfy the condition and to 0 for the rest of v. v - a constant or a zeArray object of the same type. idx - a zeArray object of character. Element-wise less-than-or-equal-to comparison with the contant or array. The size of the array must be the same as the calling array. Sets the index elements or 1 for those elements in v that satisfy the condition and to 0 for the rest of v. v - a constant or a zeArray object of the same type. idx - a zeArray object of character. Element-wise greater-than comparison with the constant or array. The size of the array must be the same as the calling array. Sets the index elements or 1 for those elements in v that satisfy the condition and to 0 for the rest of v. v - a constant or a zeArray object of the same type. idx - a zeArray object of character. Element-wise greater-than-or-equal-to comparison with the contant or array. The size of the arrar must be the same as the calling array. Sets the index elements or 1 for those elements in v that satisfy the condition and to 0 for the rest of v. Counts the non-zero elements. idx - a zeArray object of unsigned integer.Resizes idx to the number of non-zero elements and sets idx of their indices. j - a number to specify vector position.arr - a zeArray of the same type. flag - a string to specify operation on record ("r") or vector (default). Gets the jth vector or record of the array to arr. The function resizes arr. j - a number to specify vector ro record, position.arr - a constant or zeArray of the same type. flag - a string to specify operation on record ("r") or vector (default). Sets arr to the jth vector or record of the array. If arr is a zeArray, its number of elements must equal to the number of elements of the vector for vector operation, or equal to the number of vectors in the array for record operation. i - a number to specify vector position.j - a number to specify record position. Returns the specified element. i - a number to specify vector position.j - a number to specify record position. v - a number. Sets v to the specified element idx - a zeArray object of character.arr - a zeArray object of the same type. Resizes arr to the number of non-zero elements of idx and set arr elements at the index of non-zero idx to those of the caller. idx - a zeArray object of character.arr - a constsnt or zeArray object of the same type. Sets array elements at the index of non-zero idx to those of arr, i.e., if idx[i] != 0 then me.data[i] = arr.data[i]. If arr is a zeArray, its size must be the same as the calling array. i, m, j, n - numbers to specify index position and size.arr - a zeArray of the same type. Gets a block of elements to arr. The function resizes arr. i, j - numbers to specify start position.arr - a zeArray of the same type. Replace a block of elements with those of arr starting at index i and j. Returns the pointer to the data in the array, data type, and the size of a element. ptr - a pointer (Lua lightuserdata).type - a number to specify data type of ptr. n - the number of data to transfer to the array. Transfers data in ptr to the array. The function will resize the array. j - a number to specify vector or record position.arr - a constant or zeArray of the same type. flag - a string to specify operation on record ("r") or vector (default). Inserts arr before the jth vector or record. If arr is a zeArray, its number of elements must equal to the number of elements of a vector in the array for vector operation, or equal to the number of vectors in the array for record operation. j - a number to specify vector or record position.flag - a string to specify operation on record ("r") or vector (default). Deletes the jth vector or record. idx - a zeArray of unsigned integer type.arr - a zeArray of the same type as the caller. flag - a string to specify operation on record ("r") or vector (default). Sampling vectors or records to arr according to idx that indicates which vector or record to take. flag - a string to specify operation on record ("r") or vector (default). Flips array vectors or records. i, j - numbers to specify record positions.flag - a string to specify operation on record ("r") or vector (default). Swaps the ith and the jth vectors or records. n - a number to specify shift offset.flag - a string to specify operation on record ("r") or vector (default). Shifts vectors or record of array by n offset. If n > 0 and flag is not "r", shifts to the left; otherwise to the rights. If n > 0 and flag is "r", shifts up; otherwise down. Transpose the array. arr - a zeArray of the same type. Concatenates the array with arr by cross multiplication. The numer of records of arr must equal to the number of vectors of the calling array. Retuns the minimum of all elements. Returns the maximum of all elements. m - the number of elements in each vector.n - the number of vectors in the array. Reshapes the array to m by n. m times n must be equal to the total elements of the original array. m - the number of elements in each vector.n - the number of vectors in the array. Resets the array size to m by n. Returns the number of records and the number of vector of the array. n - a number to specify the major vector.flag - a number indicating ascending to descending sort. Sorts the specified vector in the array in ascending (flag > 0) or descending (flag <= 0) order and rearranges other vectors according to the major vector so that all records have have the same numbers after position change. flag - a number indicating ascending to descending sort. Sorts the array and remove duplicated items. i - record number.s - a string containing data separated by space or tab. Parses the string and set resulted data to the ith record. :print([sace, delimiter, file]) space - a string for space before the firt output in a row.delimiter - a string for separating elements in output. file - a string to specify the file name to save data. Prints array data to the screen if no argument given; otherwise to the file. |