NAME
Indexed_vector - Indexed vector type
SYNOPSIS
#include "m/m_vector.h"
Example compile flags (system dependent):
-DLINUX_X86_64 -DLINUX_X86_64_OPTERON -DGNU_COMPILER
-I/home/kobus/include
-L/home/kobus/misc/load/linux_x86_64_opteron -L/usr/lib/x86_64-linux-gnu
-lKJB -lfftw3 -lgsl -lgslcblas -ljpeg -lSVM -lstdc++ -lpthread -lSLATEC -lg2c -lacml -lacml_mv -lblas -lg2c -lncursesw
typedef struct Indexed_vector
{
int length;
Indexed_vector_element *elements;
}
Indexed_vector;
DESCRIPTION
This type is an allocated vector of type Indexed_vector_element which is a
structure of two members: element, and index. Two typical uses of this data
type is to access N elements in random order, but without duplications, and
to sort a vector while keeping track of where the elements were originally
(as that might be an index into other data structures). The first use is
accomplished using the routines get_random_indexed_vector(), followed by
ascend_sort_indexed_vector(), followed by stepping throught the index values
of the now sorted, originally random vector. The second task is accomplished
by creating an indexed version of the vector with vp_get_indexed_vector(),
and doing either an ascend_sort_indexed_vector() or a
descend_sort_indexed_vector(), and then accessing the elements in order, but
using the index member of the structure to link to other information
regarding those elements.
DISCLAIMER
This software is not adequatedly tested. It is recomended that
results are checked independantly where appropriate.
AUTHOR
Kobus Barnard
DOCUMENTER
Kobus Barnard
SEE ALSO
Vector
,
Vector_vector
,
V_v_v
,
V_v_v_v
,
Indexed_vector_element
,
get_1D_dp_array_from_vector