- For the input directory, see vector.
Vec (short for "vector") is Arachne's implementation of a dynamic array. It is very similar to the C++ vector class, and includes all of the same functionality, but it is more adapted to Arachne and is recommended for use over the C++ version. The Vec class is central to the Arachne code package: specific vec types include the Basevector and Qualvector, and several macros also implement it.
Functions in the Vec module (but not in the C++ vector) include:
- operator<<: Easy stream output of vecs of primitive types, i.e., cout << vec<int> << endl;. Writes a newline between elements. The first line is n, the number of elements in the vec.
- UniqueSort: Sorts a Vec and removes all duplicate entries. Syntax is UniqueSort(v) on a vector v.
- SizeSum: The SizeSum of a vec<vec<type> > is the sum of all the sizes of its constituent Vecs.
The general description of all Vec routines is in Vec.h. To use Vecs in independent modules, #include "Vec.h".