Re: [eigen] Eigen "views"

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


On 16.08.2011 08:41, Gael Guennebaud wrote:
there are some major differences though:

With PermutationMatrix you can do transposed products.

With such views you can repeat a row (or column) multiple times,
remove some, etc.

The conclusion is that though there is a non null intersection none of
them is a subset of the other one.

Maybe I'm missing something, but I would say this means that permutation matrices _are_ a subset of views. I guess internally you store permutation matrices exactly as you would store views, i.e. by a vector of indexes, don't you?

I would even say that (in a limited way) transposed products with views are also possible. Having a permutation matrix P, with corresponding indexes p (P = I(:,p);) one can write in Matlab notation:

B = A*P,  or B     = A(:,p);
B = A*P', or B(:,p)= A;
B = P*A,  or B(p,:)= A;
B = P'*A, or B     = A(p,:);

assuming all dimensions agree, and I did not mix anything up.
That means at least the expressions A*P and P'*A are equivalent if P is just a view.
The question would be what should happen with expressions such as
B(:,p) = ...;
if indexes in p are not unique. Matlab, as it seems, then uses the last corresponding entry of p, i.e., it basically just overwrites the row/column every time.


Christoph


--
----------------------------------------------
Dipl.-Inf. Christoph Hertzberg
Cartesium 0.051
Universität Bremen
Enrique-Schmidt-Straße 5
28359 Bremen

Tel: (+49) 421-218-64252
----------------------------------------------



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/