linbox  1
Classes | Functions
linbox/vector

Classes

class  BitVector
class  ReverseVector< Vector >
class  Sparse_Vector< T, I >
 vector< Pair<T> > and actualsize More...
class  VectorStream< _Vector >
 Vector factory. More...
class  Subiterator< Iterator >
 Subvector iterator class provides striding iterators.A Subiterator steps by a fixed stride thru the underlying container. Subiter<Iterator> requires that Iterator be a random access iterator class and then itself provides the full functionality of a random access iterator class. See STL documentation for that functionality. Documented here is only the constructor from (1) an iterator of an underlying container and (2) a stride amount. More...
class  Subvector< Iterator, ConstIterator >
 Dense subvectorThis class provides a statically sized subvector of a random access container (such as std::vector, deque). It does not work on sparse linbox vectors. It implements all of the types and methods of a std::vector except for those that invalidate iterators, i.e., those (potentially) involving vector resizing, such as push_back(), insert(), resize(). More...

Functions

template<class Field , class Vector >
Vector randomVector (Field &F, size_t n, typename Field::RandIter &r)

Detailed Description

All LinBox dense vectors must implement the dense vector common object interface as it is defined in the dense vector archetype. It is basically the non-resizing subset of functionality of the STL vector<T> container. For information on the STL vector, see SGI's [Standard Template Library Programmer's Guide]{http://www.sgi.com/Technology/STL/}.

All LinBox sparse vectors must implement the sparse vector common object interface as it is defined in the sparse vector archetype.

The LinBox sparse vector common object interface is the same as either the STL sequence of pairs of { size} and a field element or an STL unique and pair associative container. (That is, an STL map without the operator[].) It is also always assumed that the entries in the sparse vector are in ascending order starting with the first index no less than zero.

LinBox vectors are indexed starting at zero, not one, just like STL vectors and C-style arrays.

See also:
Archetypes

Function Documentation

Vector LinBox::randomVector ( Field F,
size_t  n,
typename Field::RandIter &  r 
) [inline]

Random vector generator This templated function takes a field and a random field element generator and returns a vector of random field elements. The vector is dense in the field elements, even if the vector is a sparse LinBox vector. The funtion is templatized by the field and the vector types being used. This function calls another function by the same name with an additional parameter of the vector category of the vector it is called with. This mechanism is used because functions cannot have partial template specializations like classes can. This new, extended function can be specialized for specific fields and vectors to allow for better performance.

Returns:
v vector of random field elements
Parameters:
FField in which arithmetic is done
ninteger number of elements in vector
rRandom field element generator