-
Notifications
You must be signed in to change notification settings - Fork 0
/
doc
124 lines (89 loc) · 4.74 KB
/
doc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
[[tags: egg]]
== chunk-vector
[[toc:]]
=== Description
A dyn-vector like library capable of storing other srfi-4 vectors inside a dense array.
=== Author
Richard van Roy (pluizer)
=== Requirements
none
=== Documentation
==== Procedures
<procedure>(make-f32chunk-vector size [size-hint])</procedure><br/>
<procedure>(make-f64chunk-vector size [size-hint])</procedure><br/>
<procedure>(make-s8chunk-vector size [size-hint])</procedure><br/>
<procedure>(make-s16chunk-vector size [size-hint])</procedure><br/>
<procedure>(make-s32chunk-vector size [size-hint])</procedure><br/>
<procedure>(make-u8chunk-vector size [size-hint])</procedure><br/>
<procedure>(make-u16chunk-vector size [size-hint])</procedure><br/>
<procedure>(make-u32chunk-vector size [size-hint])</procedure><br/>
Create a new chunk vector with a chunk-size of ''size''.
<procedure>(f32chunk-vector-remove! vector index)</procedure><br/>
<procedure>(f64chunk-vector-remove! vector index)</procedure><br/>
<procedure>(s8chunk-vector-remove! vector index)</procedure><br/>
<procedure>(s16chunk-vector-remove! vector index)</procedure><br/>
<procedure>(s32chunk-vector-remove! vector index)</procedure><br/>
<procedure>(u8chunk-vector-remove! vector index)</procedure><br/>
<procedure>(u16chunk-vector-remove! vector index)</procedure><br/>
<procedure>(u32chunk-vector-remove! vector index)</procedure><br/>
Removes a chunk from the vector using its ''index''.
<procedure>(f32chunk-vector-set! vectror index value)</procedure><br/>
<procedure>(f64chunk-vector-set! vectror index value)</procedure><br/>
<procedure>(s8chunk-vector-set! vectror index value)</procedure><br/>
<procedure>(s16chunk-vector-set! vectror index value)</procedure><br/>
<procedure>(s32chunk-vector-set! vectror index value)</procedure><br/>
<procedure>(u8chunk-vector-set! vectror index value)</procedure><br/>
<procedure>(u16chunk-vector-set! vectror index value)</procedure><br/>
<procedure>(u32chunk-vector-set! vectror index value)</procedure><br/>
Changed the value of a chunk using its ''index''.
<procedure>(f32chunk-vector-push! vector value)</procedure><br/>
<procedure>(f64chunk-vector-push! vector value)</procedure><br/>
<procedure>(s8chunk-vector-push! vector value)</procedure><br/>
<procedure>(s16chunk-vector-push! vector value)</procedure><br/>
<procedure>(s32chunk-vector-push! vector value)</procedure><br/>
<procedure>(u8chunk-vector-push! vector value)</procedure><br/>
<procedure>(u16chunk-vector-push! vector value)</procedure><br/>
<procedure>(u32chunk-vector-push! vector value)</procedure><br/>
Pushes a new chunk to the vector.
<procedure>(f32chunk-vector-ref vector index)</procedure><br/>
<procedure>(f64chunk-vector-ref vector index)</procedure><br/>
<procedure>(s8chunk-vector-ref vector index)</procedure><br/>
<procedure>(s16chunk-vector-ref vector index)</procedure><br/>
<procedure>(s32chunk-vector-ref vector index)</procedure><br/>
<procedure>(u8chunk-vector-ref vector index)</procedure><br/>
<procedure>(u16chunk-vector-ref vector index)</procedure><br/>
<procedure>(u32chunk-vector-ref vector index)</procedure><br/>
Returns the data at ''index''.
<procedure>(f32chunk-vector-length vector)</procedure><br/>
<procedure>(f64chunk-vector-length vector)</procedure><br/>
<procedure>(s8chunk-vector-length vector)</procedure><br/>
<procedure>(s16chunk-vector-length vector)</procedure><br/>
<procedure>(s32chunk-vector-length vector)</procedure><br/>
<procedure>(u8chunk-vector-length vector)</procedure><br/>
<procedure>(u16chunk-vector-length vector)</procedure><br/>
<procedure>(u32chunk-vector-length vector)</procedure><br/>
Returns the number of chunks in the vector.
<procedure>(f32chunk-vector->pointer vector)</procedure><br/>
<procedure>(f64chunk-vector->pointer vector)</procedure><br/>
<procedure>(s8chunk-vector->pointer vector)</procedure><br/>
<procedure>(s16chunk-vector->pointer vector)</procedure><br/>
<procedure>(s32chunk-vector->pointer vector)</procedure><br/>
<procedure>(u8chunk-vector->pointer vector)</procedure><br/>
<procedure>(u16chunk-vector->pointer vector)</procedure><br/>
<procedure>(u32chunk-vector->pointer vector)</procedure><br/>
Returns a pointer to the dense foreign array where the data
is stored.
==== Example
<enscript highlight="scheme">
(use chunk-vector)
;; Create a chunk-vector that holds f32vectors with the size of 2.
(define v (make-f32chunk-vector 2))
(define index-a (f32chunk-vector-push! v (f32vector 1 2)))
(define index-b (f32chunk-vector-push! v (f32vector 3 4)))
(define index-c (f32chunk-vector-push! v (f32vector 7 8)))
(f32chunk-vector-remove! v index-c)
(f32chunk-vector-set! v index-b (f32vector 0 0))
(print (f32chunk-vector-ref v index-a)) ; => #f32(1.0 2.0)
(print (f32chunk-vector-ref v index-b)) ; => #f32(0.0 0.0)
(print (f32chunk-vector-ref v index-c)) ; undefined
</enscript>