public static DenseMatrix64F[] createSpan( int dimen, int numVectors , Random rand ) {
        if( dimen < numVectors )
            throw new IllegalArgumentException("The number of vectors must be less than or equal to the dimension");

        DenseMatrix64F u[] = new DenseMatrix64F[numVectors];

        u[0] = RandomMatrices.createRandom(dimen,1,-1,1,rand);
        NormOps.normalizeF(u[0]);

        for( int i = 1; i < numVectors; i++ ) {
//            System.out.println(" i = "+i);
            DenseMatrix64F a = new DenseMatrix64F(dimen,1);
            DenseMatrix64F r=null;

            for( int j = 0; j < i; j++ ) {
//                System.out.println("j = "+j);
                if( j == 0 )
                    r = RandomMatrices.createRandom(dimen,1,-1,1,rand);

                // find a vector that is normal to vector j
                // u[i] = (1/2)*(r + Q[j]*r)
                a.set(r);
                VectorVectorMult.householder(-2.0,u[j],r,a);
                CommonOps.add(r,a,a);
                CommonOps.scale(0.5,a);

//                UtilEjml.print(a);

                DenseMatrix64F t = a;
                a = r;
                r = t;

                // normalize it so it doesn't get too small
                double val = NormOps.normF(r);
                if( val == 0 || Double.isNaN(val) || Double.isInfinite(val))
                    throw new RuntimeException("Failed sanity check");
                CommonOps.divide(val,r);
            }

            u[i] = r;
        }

        return u;
    }