I should have precised that n << length(v)
A good way in this case is to form the cross product matrix (by a
combination of dot(slice, slice)), and call cholfact!(x, :U, Val{true}) on
it
On Monday, October 5, 2015 at 11:31:24 AM UTC-4, Glen O wrote:
>
> I'm assuming that v is an array of vectors. Does this do any better?
>
> N=zeros(length(v[1]),max(length(v[1]),length(v))) # Because there can't be
> more than this many columns
> i=0
> for w=v
> if any(w.!=0)&&w!=N[:,1:i]*(N[:,1:i]\w)
> i+=1
> N[:,i]=j
> end
> end
> N=N[:,1:i]
>
> Note: may have minor issue for rounding errors, so some rounding during
> testing may be necessary to avoid problems. Also, this is written from 0.3,
> I cannot guarantee that everything will work correctly in 0.4.
>
> On Tuesday, 6 October 2015 01:06:15 UTC+10, Matt wrote:
>>
>> Given a set of vectors v1, ...., vn, I'd like to construct a matrix where
>> columns correspond to a linearly independent subset of these vectors.
>> Currenly, I form the matrix hcat(v1, ..., vn), use qrfact!() on it, check
>> the diagonal of the :R matrix and construct a new matrix as hcat(vj,...)
>> I'm looking for a way that would use less memory. Is there a more memory
>> efficient way ? (for instance a way to avoid the construction of an
>> intermediary matrix when finding the subset of vectors, or a way to delete
>> columns in place in a matrix)
>>
>