2017-08-27

(sph uniform-vector)

helpers for srfi-4 and compatible vectors

part of sph-lib

import name

(sph uniform-vector)

exports

bytevector-append

procedure

signature

a ... ->

bytevector ... -> bytevector

bytevector-contains?

procedure

signature

a search-bv ->

bytevector bytevector -> boolean

description

true if bytevector "a" contains bytevector "search-bv"

f32vector-copy

procedure

signature

a ->

xvector -> xvector

f32vector-copy*

procedure

signature

a c ->

f32vector-copy-empty

procedure

signature

a ->

f32vector-copy-empty*

procedure

signature

a c ->

f32vector-create

procedure

signature

length f ->

integer {index -> float} -> xvector

description

make and initialise an xvector with the results of calling f as (f index)

f32vector-each-index

procedure

signature

f a ->

procedure:{integer integer:a-length -> unspecified} xvector -> unspecified

description

call f for each element in "a" with the index of the current element in "a" and the size of "a"

f32vector-map

procedure

signature

f a b ... ->

procedure:{any:element ... -> any} xvector ... -> xvector

description

call f for each element of each vector. (f a-element b-element ...)

can easily build processors like xvector-sum: (xvector-map + a b c)

f32vector-map!

procedure

signature

f a b ... ->

procedure:{any:element ... -> any} xvector ... -> unspecified

description

like uv-map but modifies "a"

f32vector-map-with

procedure

signature

f variable a ... ->

procedure:{any:variable any:element ... -> any} any:variable xvector -> xvector

description

like xvector-map but passes the given variable as an additional first argument to each call of f.

example call: (xvector-map-with * 2 a)

f32vector-map-with!

procedure

signature

f variable a ... ->

procedure:{any:variable any:element ... -> any} any:variable xvector -> unspecified

description

like xvector-map but passes the given variable as an additional first argument on each call to f.

example call: (vector-map-with! * 2 a)

f32vector-range-map

procedure

signature

f start end a b ... ->

procedure:{any ... -> any} integer integer xvector ... -> xvector

description

like xvector-range-map but does not modify input

f32vector-range-map!

procedure

signature

result f start end a b ... ->

procedure:{any ... -> any} integer integer xvector xvector:source ... -> unspecified

description

set result to the map results of calling f for each element between start and end of one or multiple xvectors.

f is called (f a-element b-element ...).

all vectors must be of sufficient size

f32vector-range-map-with

procedure

signature

f variable start end a b ... ->

f32vector-range-map-with!

procedure

signature

result f variable start end a b ... ->

f32vector-range-set

procedure

signature

a f start end ->

f32vector-range-set!

procedure

signature

a f start end ->

f64vector-copy

procedure

signature

a ->

xvector -> xvector

f64vector-copy*

procedure

signature

a c ->

f64vector-copy-empty

procedure

signature

a ->

f64vector-copy-empty*

procedure

signature

a c ->

f64vector-create

procedure

signature

length f ->

integer {index -> float} -> xvector

description

make and initialise an xvector with the results of calling f as (f index)

f64vector-each-index

procedure

signature

f a ->

procedure:{integer integer:a-length -> unspecified} xvector -> unspecified

description

call f for each element in "a" with the index of the current element in "a" and the size of "a"

f64vector-map

procedure

signature

f a b ... ->

procedure:{any:element ... -> any} xvector ... -> xvector

description

call f for each element of each vector. (f a-element b-element ...)

can easily build processors like xvector-sum: (xvector-map + a b c)

f64vector-map!

procedure

signature

f a b ... ->

procedure:{any:element ... -> any} xvector ... -> unspecified

description

like uv-map but modifies "a"

f64vector-map-with

procedure

signature

f variable a ... ->

procedure:{any:variable any:element ... -> any} any:variable xvector -> xvector

description

like xvector-map but passes the given variable as an additional first argument to each call of f.

example call: (xvector-map-with * 2 a)

f64vector-map-with!

procedure

signature

f variable a ... ->

procedure:{any:variable any:element ... -> any} any:variable xvector -> unspecified

description

like xvector-map but passes the given variable as an additional first argument on each call to f.

example call: (vector-map-with! * 2 a)

f64vector-range-map

procedure

signature

f start end a b ... ->

procedure:{any ... -> any} integer integer xvector ... -> xvector

description

like xvector-range-map but does not modify input

f64vector-range-map!

procedure

signature

result f start end a b ... ->

procedure:{any ... -> any} integer integer xvector xvector:source ... -> unspecified

description

set result to the map results of calling f for each element between start and end of one or multiple xvectors.

f is called (f a-element b-element ...).

all vectors must be of sufficient size

f64vector-range-map-with

procedure

signature

f variable start end a b ... ->

f64vector-range-map-with!

procedure

signature

result f variable start end a b ... ->

f64vector-range-set

procedure

signature

a f start end ->

f64vector-range-set!

procedure

signature

a f start end ->

integer->bytevector

procedure

signature

a ->

integer:signed-integer -> bytevector

description

create a bytevector of minimum size storing the given signed integer

sph-uniform-vector-description

variable

tags: programming guile documentation library scheme sph-lib bindings uniform-vector sph-uniform-vector