On this page:
vector
vector?
vector-map
vector-ref
vector-set!
vector-length
vector-copy
vector-append
vector->list
7.1

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 ...)

Like vector, but not a procedure?, and constructs a separately profiled instance of a Perflinty vector.

Note that currently Racket vectors and Perflinty vectors are incompatible.

vector does not affect scores.

procedure

(vector? v?)  boolean?

  v? : any/c
Like vector?, but only returns #t when v? is a Perflinty vector?.

vector? does not affect scores.

procedure

(vector-map proc? v)  vector?

  proc? : procedure?
  v : vector?
Like vector-map, but for Perflinty vectorss.

vector-map adds 1 to the list score.

procedure

(vector-ref v pos)  any/c

  v : vector?
  pos : exact-nonnegative-integer?
Like vector-ref, but for Perflinty vectors.

vector-ref adds 1 to the vector score.

procedure

(vector-set! vec pos v)  void?

  vec : vector?
  pos : exact-nonnegative-integer?
  v : any/c
Like vector-set!, but for Perflinty vectors.

vector-set! adds 1 to the vector score.

procedure

(vector-length v)  exact-nonnegative-integer?

  v : vector?
Like vector-length, but for Perflinty vectors.

vector-length adds 1 to the vector score.

procedure

(vector-copy v)  vector?

  v : vector?
Like vector-copy, but for Perflinty vectors.

vector-copy adds 1 to the list score.

procedure

(vector-append vec1 vec2)  vector?

  vec1 : vector?
  vec2 : vector?
Like vector-append, but for Perflinty vectors.

vector-append adds 1 to the list score.

procedure

(vector->list vec)  list?

  vec : vector?
Like vector->list, but for Perflinty vectors.

vector->list adds 1 to the list score.