(html (head (title "sph-lib (sph vector)") (link (@ (rel "stylesheet") (type "text/css") (href "/css/sph.css"))) (meta (@ (name "viewport") (content "width=device-width,initial-scale=1"))) #f) (body () (div (@ (class top)) (nav (a (@ (href "/")) "start") ", " (a (@ (href "/feed.xml")) "feed")) "") (div (@ (class "middle")) (div (@ (class mtime) (title "last modification time of the current page")) "2023-04-05") (section (h1 "(sph vector)") (div (p "vector processing") (p "part of " (a (@ (href "../../sph-lib.html")) "sph-lib")) (#f (section (@ (class "library-name")) (h1 "module name") (p "(sph vector)")) (section (@ (class "library-exports")) (h1 "exported bindings") (div (div (@ (class "doc-bindings")) (div (@ (id "doc-b-" "alist-values->vector") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "alist-values->vector") " " (span (@ (class "first-sig")) "alist ->")) "" (div (@ (class "description")) (("create a vector of alist values")))) (div (@ (id "doc-b-" "any->vector") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "any->vector") " " (span (@ (class "first-sig")) "a ->")) "" "") (div (@ (id "doc-b-" "sph-vector-description") (class "doc-b")) (div (span (@ (class "type")) "variable") ": " (span (@ (class "name")) "sph-vector-description")) "" "") (div (@ (id "doc-b-" "vector->index-alist") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "vector->index-alist") " " (span (@ (class "first-sig")) "a ->")) (div (@ (class "rest-sig")) (div "#(any ...) -> ((integer:index . any) ...)")) "") (div (@ (id "doc-b-" "vector-accessor") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "vector-accessor") " " (span (@ (class "first-sig")) "index ->")) (div (@ (class "rest-sig")) (div "integer -> procedure:{vector -> any}")) (div (@ (class "description")) (("return a procedure that when called with a vector returns the value at index")))) (div (@ (id "doc-b-" "vector-append") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "vector-append") " " (span (@ (class "first-sig")) "a b ->")) "" (div (@ (class "description")) (("concatenate \\\"b\\\" at the end of \\\"a\\\"." (br) "#(1 2) #(3 4) -> #(1 2 3 4)" (br) "create a new bigger vector and copy all elements of \\\"a\\\" and \\\"b\\\" to it")))) (div (@ (id "doc-b-" "vector-copy*") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "vector-copy*") " " (span (@ (class "first-sig")) "a f ->")) "" (div (@ (class "description")) (("call f with a copy of vector and after f finishes return it")))) (div (@ (id "doc-b-" "vector-delete-duplicates") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "vector-delete-duplicates") " " (span (@ (class "first-sig")) "a [equal?] ->")) (div (@ (class "rest-sig")) (div "vector [procedure] -> vector")) (div (@ (class "description")) (("creates a new vector with duplicate elements removed")))) (div (@ (id "doc-b-" "vector-deselect") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "vector-deselect") " " (span (@ (class "first-sig")) "a indices ->")) (div (@ (class "rest-sig")) (div "vector (integer ...) -> vector")) (div (@ (class "description")) (("return a new, possibly smaller, vector consisting of values not at specified indices")))) (div (@ (id "doc-b-" "vector-each") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "vector-each") " " (span (@ (class "first-sig")) "f v ->")) (div (@ (class "rest-sig")) (div "(vector-for-each f vec1 vec2 ...) -> unspecified")) (div (@ (class "description")) (("Call @code{(f (vector-ref vec1 i) (vector-ref vec2 i) ...)} for each index" (br) "in the provided vectors, which have to be of equal length. The iteration" (br) "is strictly left-to-right.")))) (div (@ (id "doc-b-" "vector-each-with-index") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "vector-each-with-index") " " (span (@ (class "first-sig")) "f v ->")) (div (@ (class "rest-sig")) (div "(vector-for-each f vec1 vec2 ...) -> unspecified")) (div (@ (class "description")) (("Call (F i VEC1[i] VEC2[i] ...) for each index i less than the length" (br) "The iteration is strictly" (br) "left-to-right.")))) (div (@ (id "doc-b-" "vector-extend") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "vector-extend") " " (span (@ (class "first-sig")) "a add-size ->")) (div (@ (class "rest-sig")) (div "vector integer -> vector")) (div (@ (class "description")) (("increase size of vector." (br) "new slots are appended to vector")))) (div (@ (id "doc-b-" "vector-first") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "vector-first") " " (span (@ (class "first-sig")) "a ->")) "" "") (div (@ (id "doc-b-" "vector-from-index-alist") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "vector-from-index-alist") " " (span (@ (class "first-sig")) "size a ->")) (div (@ (class "rest-sig")) (div "((integer:index . any) ...) -> #(any ...)")) "") (div (@ (id "doc-b-" "vector-index-value") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "vector-index-value") " " (span (@ (class "first-sig")) "a value [equal-f] ->")) (div (@ (class "rest-sig")) (div "vector any [procedure] -> integer/falso")) (div (@ (class "description")) (("find the index in vector at which value occurs or return false")))) (div (@ (id "doc-b-" "vector-map") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "vector-map") " " (span (@ (class "first-sig")) "f v ->")) (div (@ (class "rest-sig")) (div "(vector-map f vec2 vec2 ...) -> vector")) (div (@ (class "description")) (("Return a new vector of the size of the vector arguments, which must be" (br) "The dynamic order of application of" (br) "@var{f} is unspecified.")))) (div (@ (id "doc-b-" "vector-map-with-index") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "vector-map-with-index") " " (span (@ (class "first-sig")) "f a ... ->")) (div (@ (class "rest-sig")) (div "procedure:{integer:index any -> any} vector ... -> vector")) (div (@ (class "description")) (("map each vector element suppliing its index to the" (br) "mapping procedure and result in a new vector")))) (div (@ (id "doc-b-" "vector-object") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "vector-object") " " (span (@ (class "first-sig")) "a ->")) (div (@ (class "rest-sig")) (div "vector -> procedure:{integer -> any}")) (div (@ (class "description")) (("returns a procedure that when called with an index returns the value at index")))) (div (@ (id "doc-b-" "vector-range") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "vector-range") " " (span (@ (class "first-sig")) "a start [end] ->")) (div (@ (class "rest-sig")) (div "vector [integer integer] -> vector")) (div (@ (class "description")) (("get a sub-vector." (br) "start and end are inclusive")))) (div (@ (id "doc-b-" "vector-relative-change-index/value") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "vector-relative-change-index/value") " " (span (@ (class "first-sig")) "a b ->")) (div (@ (class "rest-sig")) (div "#(number ...) #(number ...) -> number")) (div (@ (class "description")) (("return a number that describes the amount of change between" (br) "two numeric vectors based on value and index shifts." (br) "it sorts values by magnitude and compares relative changes." (br) "the result is a change factor with small values meaning little change." (br) "all vectors must be of equal length")))) (div (@ (id "doc-b-" "vector-second") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "vector-second") " " (span (@ (class "first-sig")) "a ->")) "" "") (div (@ (id "doc-b-" "vector-select") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "vector-select") " " (span (@ (class "first-sig")) "a indices ->")) (div (@ (class "rest-sig")) (div "vector (integer ...) -> vector")) (div (@ (class "description")) (("return a new vector consisting of values at indices specified by vector indices")))) (div (@ (id "doc-b-" "vector-setter") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "vector-setter") " " (span (@ (class "first-sig")) "index ->")) (div (@ (class "rest-sig")) (div "integer -> procedure:{vector value -> unspecified}")) (div (@ (class "description")) (("return a procedure that when called with a vector and a value sets index to value")))) (div (@ (id "doc-b-" "vector-third") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "vector-third") " " (span (@ (class "first-sig")) "a ->")) "" "") (div (@ (id "doc-b-" "vector-update") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "vector-update") " " (span (@ (class "first-sig")) "a index/value ... ->")) (div (@ (class "rest-sig")) (div "vector [integer any] ... -> vector")) (div (@ (class "description")) (("create a copy of the given vector with values at indices set to new values." (br) "index and value are given alternatingly." (br) "example: (vector-update myvector 1 #\\a 4 #\\b)"))))))))))) ()))