This forum has been archived. All content is frozen. Please use KDE Discuss instead.

FullPivLU::image

Tags: None
(comma "," separated)
rafaelguglielmetti
Registered Member
Posts
15
Karma
0
OS

FullPivLU::image

Wed Jul 20, 2016 2:14 pm
Hello,
When using the method image of an FullPivLU object: the columns form a basis of the column space of the original matrix.

My questions is the following: does the columns of FullPivLU.image(A) always are some columns of the original matrix A?

Thanks a lot.

Best,

Rafael
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: FullPivLU::image

Wed Jul 20, 2016 3:04 pm
Yes they are. See the respective code by yourself:

Code: Select all
for(Index i = 0; i < rank(); ++i)
      dst.col(i) = originalMatrix().col(dec().permutationQ().indices().coeff(pivots.coeff(i)));
rafaelguglielmetti
Registered Member
Posts
15
Karma
0
OS

Re: FullPivLU::image

Wed Jul 20, 2016 4:45 pm
Great, thank you!

BTW, merci pour cette excellente librairie!
rafaelguglielmetti
Registered Member
Posts
15
Karma
0
OS

Re: FullPivLU::image

Thu Jul 21, 2016 7:43 am
Sorry to ask a question again but I'd like to be sure that I understood correctly.

If I want to know the rank() indices of the columns which are linerarly independant I have to take every i such that lu.permutationQ().indices()[i] < rank()

Is it correct?

Thanks!
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: FullPivLU::image

Mon Jul 25, 2016 12:59 pm
not exactly, you have to skip the smallest pivots:

Code: Select all
    Matrix<Index, Dynamic, 1, 0, MaxSmallDimAtCompileTime, 1> pivots(rank());
    RealScalar premultiplied_threshold = dec().maxPivot() * dec().threshold();
    Index p = 0;
    for(Index i = 0; i < dec().nonzeroPivots(); ++i)
      if(abs(dec().matrixLU().coeff(i,i)) > premultiplied_threshold)
        pivots.coeffRef(p++) = i;


so what you're looking for would be a "imageIndices()" method?
rafaelguglielmetti
Registered Member
Posts
15
Karma
0
OS

Re: FullPivLU::image

Mon Jul 25, 2016 1:49 pm
Yes, that's what I need.

Finally, I took the first rank() entries of lu.permutationQ().indices() and sorted them (I need to preserve the order of my vectors).
This gives me the indices I want.


Bookmarks



Who is online

Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]