Boost logo

Ublas :

Subject: Re: [ublas] combinatoric problem with vectors
From: Philipp Kraus (philipp.kraus_at_[hidden])
Date: 2010-12-05 11:51:19


On 2010-12-05 17:25:57 +0100, Matthias Walter said:

> On 12/05/2010 11:08 AM, Kraus Philipp wrote:
>> I have n ublas vectors with different sizes. Now I would create a
>> ublas matrix with n columns in that way, that each row has a
>> combination of the vector elements. I need all combination of the
>> vector elements (I know it is an exponential problem, but my vectors
>> are small).
> Can you be a bit more precise? How does a "combination of the vector
> elements" look like, especially when they are of different sizes? Maybe
> a small example with 2 or 3 vectors would help.

for two vectors with different size [1] & [2 3]

1 2
1 3

with equal size [1 2] & [3 4]

1 3
1 4
2 3
2 4

I hope I have written all combination :-)
Each element of each vector should be combinate with the elements of the others

Thanks

Phil