linbox
|
Random sparse vector stream. More...
#include <stream.h>
Public Member Functions | |
RandomSparseStream (const Field &F, RandIter &r, double p, size_t n, size_t m=0, uint64_t seed=(uint64_t) time(NULL)) | |
Constructor. More... | |
Vector & | get (Vector &v) |
Get next element. More... | |
Self_t & | operator>> (Vector &v) |
Extraction operator form. | |
size_t | size () const |
Number of vectors to be created. | |
size_t | pos () const |
Number of vectors created so far. | |
size_t | dim () const |
Dimension of the space. | |
operator bool () const | |
Check whether we have reached the end. | |
void | reset () |
Reset the stream to start at the beginning. | |
void | setP (double p) |
Set the probability of a nonzero entry. | |
void | rewind () |
Alias for reset. | |
Legacy interface | |
These functions provide compatiblity with older parts of the library. Their use is deprecated. | |
Vector & | next (Vector &v) |
size_t | j () const |
size_t | m () const |
size_t | n () const |
Random sparse vector stream.
Generates a sequence of random sparse vectors over a given field
RandomSparseStream | ( | const Field & | F, |
RandIter & | r, | ||
double | p, | ||
size_t | n, | ||
size_t | m = 0 , |
||
uint64_t | seed = (uint64_t) time(NULL) |
||
) |
Constructor.
Construct a new stream with the given field and vector size.
F | Field over which to create random vectors |
r | |
n | Size of vectors |
p | Proportion of nonzero entries |
m | Number of vectors to return (0 for unlimited) |
seed |
|
virtual |
Get next element.
v | Vector into which to generate random vector |
Implements VectorStream< _Vector >.