Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Growing span of vectors

I'm trying to generate a basis of a vector space that satisfies certain properties. The method I'm using is kind of randomized, but fast, the bottleneck at the moment is how to maintain a structure that serves to check if the current element is in the basis or not. In code it would be something like this:

while V.dimension() < n:
    w = random vector
    if has_good_property(w) and w not in V:
        v += span([w])

This code recomputes the echelonized basis of V on each iteration and I feel that it could be made more efficient.

Any suggestions?