Boost logo

Ublas :

Subject: Re: [ublas] Distinct rows in a matrix
From: Paweł Szlendak (ogee_at_[hidden])
Date: 2008-10-31 05:41:43


Matwey V. Kornilov pisze:
> Pawe? Szlendak wrote:
>
>
>> I want to evaluate how many distinct rows it contains. In this simple
>> example the answer should be:
>>
>> 2 distinct rows -> [1 2 3], [4 5 6]
>>
>
>
> Do you mean 'linearly independent'? It seems like you can calculate rank of
> the matrix using the lu_factorizating functions.
>
>
Unfortunatelly, linear independence is not what I want to check. Since,
having

       A = [ 1 2 3; 4 5 6 ; 2 4 6]

rank(A) = 2 and there are 3 distict rows although row 1 is a linear
combination of row 3.
What I am trying to obtain is something like SQL query:

select distinct *
from A