(index ("make-storage-class" 0) ("storage-class?" 754) ("storage-class-short-id" 947) ("storage-class-constructor" 1182) ("storage-class-accessor" 1739) ("storage-class-mutator" 2107) ("storage-class-sizer" 2554) ("storage-class-predicate" 2867) ("storage-class-default-fill" 3189) ("make-storage-object" 3488) ("storage-object-ref" 3794) ("storage-object-set!" 4052) ("storage-object-length" 4345) ("vector-storage-class" 4535) ("u8vector-storage-class" 4535) ("s8vector-storage-class" 4535) ("u16vector-storage-class" 4535) ("s16vector-storage-class" 4535) ("u32vector-storage-class" 4535) ("s32vector-storage-class" 4535) ("f32vector-storage-class" 4535) ("f64vector-storage-class" 4535) ("c64vector-storage-class" 4535) ("c128vector-storage-class" 4535) ("make-array" 5823) ("array-tabulate" 6168) ("array-broadcast" 6591) ("array?" 6792) ("array-mutable?" 6945) ("array-storage-class" 7089) ("array-storage-object" 7230) ("array-rank" 7447) ("array-shape" 7563) ("array-stride" 7728) ("array-offset" 7832) ("array-index->storage-index" 7936) ("array-ref" 8102) ("array-recursive-ref" 8358) ("array-for-each" 8739) ("array-for-each-index" 9027) ("array-set!" 9251) ("array-tabulate!" 9522) ("array-map" 9853) ("array-map!" 10333) ("array-fold" 10776) ("array-reduce" 11287) ("array-cumulate" 11721) ("array-count" 12042) ("array-index" 12203) ("array-find" 12397) ("array-compress" 12578) ("array-expand" 13003) ("array-rearrange" 13611) ("array-transform" 14049) ("array-reshape" 14330) ("array-diagonal" 14625) ("array-reverse" 14842) ("array-transpose" 15038) ("array-rearrange-axes" 15302) ("array-slice" 15679) ("array-squeeze" 16168) ("array-unsqueeze" 16425) ("array-copy" 16674) ("array-copy!" 16966) ("array-append" 17305) ("array-repeat" 17841) ("array-reclassify" 18021) ("array->nested-vector" 18230) ("array->nested-list" 18230) ("nested-vector->array" 18835) ("nested-list->array" 18835) ("array-read" 19377) ("array-write" 19812))
(def (sig (procedure "(make-storage-class short-id constructor accessor mutator sizer predicate default-fill) " (id make-storage-class))) (p "Returns a storage class with the specified short-id, constructor, accessor, mutator, sizer, predicate, and default fill argument. An example might be as follows:") (pre "   (define vector-storage-class (make-storage-class 'v\n                                                    make-vector\n                                                    vector-ref\n                                                    vector-set!\n                                                    vector-length\n                                                    vector?\n                                                    (void)))"))
(def (sig (procedure "(storage-class? object)" (id storage-class?))) (p "Returns " (tt "#t") " iff the object passed into the procedure is a storage class. Otherwise, returns " (tt "#f") "."))
(def (sig (procedure "(storage-class-short-id storage-class)" (id storage-class-short-id))) (p "Returns the symbol representing the storage-class' short ID (e.g. " (tt "u32vector-storage-class") " has a short ID of " (tt "u32") ")."))
(def (sig (procedure "(storage-class-constructor storage-class)" (id storage-class-constructor))) (p "Returns the constructor of storage-class. This procedure returns a storage object belonging to the storage class, and can be called with one or two arguments: the first is an exact non-negative integer specifying the size of the object. If objects of the class do not have a fixed size, the size must be specified as #f. The second is a value to fill all the elements with. If the second argument is omitted, the elements will have arbitrary contents."))
(def (sig (procedure "(storage-class-accessor storage-class)" (id storage-class-accessor))) (p "Returns the accessor of storage-class as a procedure. This procedure takes two arguments, a storage object and an exact non-negative integer, and returns the value of the element indexed by the integer. It is an error if the index is greater than or equal to the size."))
(def (sig (procedure "(storage-class-mutator storage-class)" (id storage-class-mutator))) (p "Returns the mutator of storage-class as a procedure. This procedure takes three arguments, a storage object, an exact non-negative integer, and a value. It mutates the element of the object specified by the index to be the value. It is an error if the index is greater than or equal to the size, or if the object is not capable of storing the value."))
(def (sig (procedure "(storage-class-sizer storage-class)" (id storage-class-sizer))) (p "Returns the sizer of storage-class as a procedure. This procedure takes one argument, a storage object. It returns the size of the object specified when the object was created. This may be an exact non-negative integer."))
(def (sig (procedure "(storage-class-predicate storage-class)" (id storage-class-predicate))) (p "Returns the predicate for testing a storage class' storage object. This procedure takes one argument, a storage object. It evaluates #t if a storage object is of the type described by the storage class, and #f otherwise."))
(def (sig (procedure "(storage-class-default-fill storage-class)" (id storage-class-default-fill))) (p "Returns the default fill value of a storage-class as a value. This procedure takes one argument a storage object. It returns the default fill value for the storage object when it was created."))
(def (sig (procedure "(make-storage-object storage-class n [fill])" (id make-storage-object))) (p "Returns a newly allocated storage object with class storage-class and length n, filled with value fill, if specified. If fill is not specified, then the default fill value for the storage object is used."))
(def (sig (procedure "(storage-object-ref storage-class storage-object n)" (id storage-object-ref))) (p "Returns the nth element of storage-object as seen through the lens of storage-class. It is an error if n is not less than the size of storage-object."))
(def (sig (procedure "(storage-object-set! storage-class storage-object n value)" (id storage-object-set!))) (p "Mutates the nth element of storage-object as seen through the lens of storage-class so that its value is value. It is an error if n is not less than the size of storage-object."))
(def (sig (procedure "(storage-object-length storage-class storage-object)" (id storage-object-length))) (p "Returns the size of storage-object as seen through the lens of storage-class."))
(def (sig (constant "vector-storage-class" (id vector-storage-class)) (constant "u8vector-storage-class" (id u8vector-storage-class)) (constant "s8vector-storage-class" (id s8vector-storage-class)) (constant "u16vector-storage-class" (id u16vector-storage-class)) (constant "s16vector-storage-class" (id s16vector-storage-class)) (constant "u32vector-storage-class" (id u32vector-storage-class)) (constant "s32vector-storage-class" (id s32vector-storage-class)) (constant "f32vector-storage-class" (id f32vector-storage-class)) (constant "f64vector-storage-class" (id f64vector-storage-class)) (constant "c64vector-storage-class" (id c64vector-storage-class)) (constant "c128vector-storage-class" (id c128vector-storage-class))) (p "Standard set of storage classes provided for convenience. Note that because CHICKEN does not provide " (tt "u64") " and " (tt "s64") " vectors in SRFI-4, these are not provided here. Further, 64 and 128-bit complex numbers are implemented as " (tt "f32") " and " (tt "f64") " vectors respectively. This is done for BLAS and LAPACK compatibility, as this is how they would need to be passed in for BLAS compatibility. Consideration has been taken so that these details are not leaked, however when using " (tt "array-storage-object") " this is exposed."))
(def (sig (procedure "(make-array storage-class shape [fill])" (id make-array))) (p "Returns a newly allocated mutable array (with a newly allocated storage object of the specified storage-class) that has the specified bounds. The values of the elements default to the default fill value of the storage class if the fill argument is omitted."))
(def (sig (procedure "(array-tabulate storage-class proc shape [(mutable? #t)])" (id array-tabulate))) (p "Returns a newly allocated array (with a newly allocated storage object of the specified storage-class) that has the specified bounds. The values of the elements are computed by calling proc on every possible index of the array in lexicographic order. If mutable? is true, the array can mutate its storage object."))
(def (sig (procedure "(array-broadcast array obj)" (id array-broadcast))) (p "Returns a newly allocated array whose bounds and storage class are the same as array and all of whose elements are obj."))
(def (sig (procedure "(array? object)" (id array?))) (p "Returns " (tt "#t") " iff the object passed in is an array. Otherwise returns " (tt "#f") "."))
(def (sig (procedure "(array-mutable? array)" (id array-mutable?))) (p "Returns #t if array can mutate its storage object, and #f otherwise."))
(def (sig (procedure "(array-storage-class array)" (id array-storage-class))) (p "Returns the storage class with which array was created."))
(def (sig (procedure "(array-storage-object array)" (id array-storage-object))) (p "Returns the storage object underlying this array. Note that this can be #f in the case of storage classes without actual storage."))
(def (sig (procedure "(array-rank array)" (id array-rank))) (p "Return the rank (number of dimensions) of array."))
(def (sig (procedure "(array-shape array)" (id array-shape))) (p "Returns a rank-sized vector where each element is the extent of each of the axes, respectively."))
(def (sig (procedure "(array-stride array)" (id array-stride))) (p "Returns the stride of the array."))
(def (sig (procedure "(array-offset array)" (id array-offset))) (p "Returns the offset of the array."))
(def (sig (procedure "(array-index->storage-index array index)" (id array-index->storage-index))) (p "Converts the index of array to the equivalent storage index."))
(def (sig (procedure "(array-ref array index)" (id array-ref))) (p "Returns the value of the element of array specified by index. Note that this is different from the array-ref of most Lisp systems, which specifies the index as a sequence of arguments."))
(def (sig (procedure "(array-recursive-ref array index #!rest indices)" (id array-recursive-ref))) (p "Applies array-ref to the array using the first index. If there are more arguments, apply array-ref to the result using the next index. Repeat until there are no more indexes, returning the last result. It is an error if any intermediate result is not an array. (APL enlist.)"))
(def (sig (procedure "(array-for-each proc array)" (id array-for-each))) (p "Iterates over the elements of array in lexicographic order, and calling proc on each element. Each invocation of proc receives the value of the element at that index. The value returned by proc is discarded."))
(def (sig (procedure "(array-for-each-index proc array)" (id array-for-each-index))) (p "Iterates over the indexes of array in lexicographic order, and calling proc on each index. The value returned by proc is discarded."))
(def (sig (procedure "(array-set! array index value)" (id array-set!))) (p "Sets the value of the element of array specified by index to value. Note that this is different from the array-set! of most Lisp systems, which specifies the index as a sequence of arguments."))
(def (sig (procedure "(array-tabulate! proc array)" (id array-tabulate!))) (p "Iterates over the indexes of array in lexicographical order starting at the index start and ending at the index end (start inclusive, end exclusive), and calling proc on each index. Whatever proc returns becomes the value of the array at the index."))
(def (sig (procedure "(array-map storage-class proc array #!rest arrays)" (id array-map))) (p "Returns a newly allocated array with the same bounds as the arrays; it is an error if they do not all have the same bounds. For each valid index value, proc is invoked, passing each corresponding element of the arrays. Whatever proc returns becomes the value of the storage element corresponding to that index in the result array. The order of invocations of proc is not specified."))
(def (sig (procedure "(array-map! proc array #!rest arrays)" (id array-map!))) (p "It is an error if the arrays do not all have the same bounds. For each valid index value, proc is invoked, passing each corresponding element of the arrays. Whatever proc returns becomes the value of the storage element corresponding to that index in the first specified array. The order of invocations of proc is not specified. Returns an undefined value."))
(def (sig (procedure "(array-fold proc seed array #!rest arrays)" (id array-fold))) (p "Returns a newly allocated array with the same bounds as the arrays; it is an error if they do not all have the same bounds. For each valid index value, proc is invoked in lexicographic order, passing each corresponding element of the arrays and a seed, whose initial value is seed. Proc returns two values, the value of the storage element corresponding to that index in the result array, and the new value of the seed."))
(def (sig (procedure "(array-reduce proc seed array axis)" (id array-reduce))) (p "Returns a newly allocated array whose rank is one less than the rank of array, by combining all the groups of elements of length n (where the default is the extent of axis) along axis using proc, a two-argument procedure. The order and number of invocations of proc is unspecified. If there is only one such element, it is unchanged. (APL reduce.)"))
(def (sig (procedure "(array-cumulate proc seed array axis)" (id array-cumulate))) (p "Returns a newly allocated array whose bounds are the same as the bounds of array. Each element along axis is constructed by reducing (as if by array-reduce) successive prefixes of the elements of array along that axis. (APL scan.)"))
(def (sig (procedure "(array-count pred array)" (id array-count))) (p "Returns an exact integer containing the number of elements in array that satisfy pred."))
(def (sig (procedure "(array-index pred array)" (id array-index))) (p "Returns the index of the first element of array in lexicographic order that satisfies pred, or #f if no index is found."))
(def (sig (procedure "(array-find pred array)" (id array-find))) (p "Returns the first element of array in lexicographic order that satisfies pred, or #f if no element is found."))
(def (sig (procedure "(array-compress array booleans axis)" (id array-compress))) (p "Returns an array with the same bounds as array except possibly along the axis dimension. The array is sliced along axis and the elements of booleans (a vector of boolean values) are used to decide which slices to incorporate into the result: if the corresponding boolean is #t, the slice is incorporated, otherwise not. (APL compress.)"))
(def (sig (procedure "(array-expand array booleans nil axis)" (id array-expand))) (p "Returns an array with the same bounds as array except possibly along the axis dimension. Array is sliced along axis and the elements of booleans (a vector of boolean values) are used to decide where, if anywhere, nil is to be interpolated: if the corresponding boolean is #t, nil is interpolated, otherwise the next slice is incorporated. It is an error if the size of booleans is not to the extent of the axis dimension in the result. It is also an error if nil does not have the same bounds as a slice. (APL expand.)"))
(def (sig (procedure "(array-rearrange array order axis)" (id array-rearrange))) (p "Returns an array with the same bounds as array. Array is sliced along the axis dimension, and the slices are reassembled in the order given by vector. The slice whose number appears in the first element of vector appears first in the result, and so on. It is an error if vector is not a vector of exact integers. (Generalized version of APL rotate.)"))
(def (sig (procedure "(array-transform proc shape array)" (id array-transform))) (p "The procedure proc specifies an affine function that returns an index of array when given an index of the returned array. The array does not retain a dependency on proc. (SRFI 25 share-array.)"))
(def (sig (procedure "(array-reshape array shape)" (id array-reshape))) (p "Returns an array with the specified bounds whose elements in lexicographic order are the same as the elements of array in lexicographic order. It is an error if there are too many or too few elements. (APL reshape.)"))
(def (sig (procedure "(array-diagonal array)" (id array-diagonal))) (p "Returns a one-dimensional array which contains the diagonal elements of array (that is, the elements whose indices are all the same integer)."))
(def (sig (procedure "(array-reverse array axis)" (id array-reverse))) (p "Returns an array with the same bounds as array, but whose elements on the specified axis are reversed. (APL reverse.)"))
(def (sig (procedure "(array-transpose array)" (id array-transpose))) (p "Returns an array whose axes appear in the reverse order of the axes of array. This implies that the upper and lower bound are the reverse of the bounds of array. (APL monadic transpose.)"))
(def (sig (procedure "(array-rearrange-axes array order)" (id array-rearrange-axes))) (p "Returns an array whose axes are an arbitrary permutation of the axes of array. Vec specifies how to do the permutation: the axis whose number appears in the first element of vector appears as the first axis of the result, and so on. (APL dyadic transpose with integer-valued vector.)"))
(def (sig (procedure "(array-slice array start end [step])" (id array-slice))) (p "Returns a smaller array with the same rank as array whose elements begin at the \"lower left\" corner specified by start and end at the \"upper right\" corner specified by end. The optional step parameter describes how many elements to move along each axis (default a vector of " (b "rank") " length of all ones). Unlike array-copy, the result shares its storage object with array. (APL take and drop.)"))
(def (sig (procedure "(array-squeeze array [axes])" (id array-squeeze))) (p "Returns an array with the ranks specified by the elements of vector removed from array. It is an error if the extents of the specified ranks are not equal to 1. (NumPy squeeze)"))
(def (sig (procedure "(array-unsqueeze array rank)" (id array-unsqueeze))) (p "Returns an array whose rank is one greater than the rank of array. This is accomplished by inserting a new axis numbered 'axis' whose extent is (0:1). (NumPy expand.)"))
(def (sig (procedure "(array-copy array [(mutable? #t)])" (id array-copy))) (p "Returns an array containing the elements of array. The stride and offset are implementation-defined. The resulting array is mutable if mutable? is true. The returned array has the same storage class as array."))
(def (sig (procedure "(array-copy! from to)" (id array-copy!))) (p "Copies the elements of array from the \"to\" argument to the \"from\" argument starting at element \"at\". It is an error if there are not enough elements in \"to\" to make this possible. The storage objects of from and to need not belong to the same storage classes."))
(def (sig (procedure "(array-append axis array #!rest arrays)" (id array-append))) (p "Returns a newly allocated array consisting of the arrays concatenated along axis. It is an error unless the storage classes of the arrays are the same, and the result has the same storage class. It is also an error unless the bounds of all the arrays are the same, with the possible exception of axis. The axisth element of the lower bound of the result is 0; the corresponding element of the upper bound is the sum of the extents of the arrays."))
(def (sig (procedure "(array-repeat array axis repeat)" (id array-repeat))) (p "Append repeat copies of array along axis axis, as if by array-append. (Variant of NumPy repeat.)"))
(def (sig (procedure "(array-reclassify array storage-class)" (id array-reclassify))) (p "Returns an array with the same bounds and elements as array, but whose storage class is specified by storage-class."))
(def (sig (procedure "(array->nested-vector array)" (id array->nested-vector)) (procedure "(array->nested-list array)" (id array->nested-list))) (p "Returns a newly allocated vector/list whose elements are also newly constructed vectors/lists, and so on as far down as necessary to cover every axis of the array. Bottom-level Scheme vectors/lists contain the elements of array. Thus, if array has rank 1, the result is a vector/list; if the array has rank 2, the result is a vector/list whose elements are vectors/lists, and so on. As a special case, if array has rank 0, the sole element is returned."))
(def (sig (procedure "(nested-vector->array nested-vector storage-class rank)" (id nested-vector->array)) (procedure "(nested-list->array nested-list storage-class rank)" (id nested-list->array))) (p "Returns a newly allocated array of the storage-class with rank rank whose elements are initialized from the vector nested-vector or list nested-list. It is an error if this argument is not rectangular. As a special case, if rank is 0, the sole element is nested-vector or nested-list, which in that case need not be a Scheme vector/list."))
(def (sig (procedure "(array-read [(input-port (current-input-port))])" (id array-read))) (p "Reads the external representation of an array from input-port (the current input port if input-port is not specified) and returns the corresponding array. If the coded representation of the storage class is not recognized, vector-storage-class is used; this permits the addition of new coded storage classes in a backward compatible way."))
(def (sig (procedure "(array-write array [(output-port (current-output-port))])" (id array-write))) (p "Writes the external representation of array from output-port (the current output port if output-port is not specified) and returns an unspecified value."))
