There are currently four containers or data-structures in the BTL, these
are Matrix, Vector, and Graph and GraphWithEdges.
Container | Description | Class of
Iterator Provided |
Properties |
Matrix | A mathematical
matrix class |
random
access |
1. Random access in O(1)
2. Arithmetic operations with Vectors, Matrix's, and real numbers 3. A solution to the Single Value Decomposition problem and other functions |
Vector | A mathematical
vector of any dimension |
random
access |
1. Random access in O(1)
2. Arithmetic operations with Vectors, Matrix's, and real numbers |
Graph | A graph with
pointers between vertices |
bi-
directional |
1. Insertion of vertices in O(1) and removal of vertices
in O(nlog m)
2. Addition and removal of links between vertices in O(log n) |
GraphWith
Edges |
A graph with
edges between vertices |
bi-
directional |
1. Insertion of vertices in O(1) and removal of vertices
in O(nlog m)
2. Addition and removal of edges in O(log n) |
The Matrix and Vector classes are similar to many other such classes
found in other libraries. They are not template classes and only represent
matrices and vectors of real numbers. What is perhaps unusual about these
classes is that they provide iterators that allow sequential and random
access to the contained elements. This feature allows the user to treat
these classes as specialised containers that can be combined with generic
algorithms. Another generic aspect of the BTL Matrix and Vector classes
is that they can be combined with template algorithms from the Template
Numerical Toolkit (TNT) (Pozo, 1996). TNT is a collection of generic components
for doing linear algebra and contains algorithms that work with any given
Matrix and Vector classes, proved that they have certain member functions.
The BTL Matrix and Vector classes satisfy these criteria. The Graph class
models a simple graph (no loops or multiple edges) with edges as simple
pointers between vertices. The vertices can be of any type. The GraphWithEdges
is a sub-class of Graph and adds the ability to have edges in there own
right. These edges can again be of any type. Iterators are provided for
sequential access to vertices and edges and also for access in orders determined
by the connectivity within a graph.