2 Perflinty Vectors
(require perflinty/vector) | package: rackpgmp |
This section describes a vector library that is like the perflinty/list library, but for vectors. This library warns the user when operations that are asymptotically fast on lists are being called on instances of a vector more often than operations that are asymptotically fast on vectors.
syntax
(vector v ...)
Note that currently Racket vectors and Perflinty vectors are incompatible.
vector does not affect scores.
procedure
(vector? v?) → boolean?
v? : any/c
vector? does not affect scores.
procedure
(vector-map proc? v) → vector?
proc? : procedure? v : vector?
vector-map adds 1 to the list score.
procedure
(vector-ref v pos) → any/c
v : vector? pos : exact-nonnegative-integer?
vector-ref adds 1 to the vector score.
procedure
(vector-set! vec pos v) → void?
vec : vector? pos : exact-nonnegative-integer? v : any/c
vector-set! adds 1 to the vector score.
procedure
(vector-length v) → exact-nonnegative-integer?
v : vector?
vector-length adds 1 to the vector score.
procedure
(vector-copy v) → vector?
v : vector?
vector-copy adds 1 to the list score.
procedure
(vector-append vec1 vec2) → vector?
vec1 : vector? vec2 : vector?
vector-append adds 1 to the list score.
procedure
(vector->list vec) → list?
vec : vector?
vector->list adds 1 to the list score.