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

how to implement thin orthonormalizing inplace

Tags: None
(comma "," separated)
qzxuhui
Registered Member
Posts
1
Karma
0
I want to implement thin orthonormalizing.

I'm interested in "orthonormalizing" a set of N vectors in d dimensions.

I already found some references for this topic.

* viewtopic.php?t=91271
* viewtopic.php?f=74&t=118568&p=297246&hilit=Gram#p297246

My matrix may exist linear dependency.
I want to find the orthogonal basis of the space, if exist linear dependency, just choosing a random direction.
From experiments, I found QR decomposition works well and modified Gram Schmidt not so stable.
```
Eigen::MatrixXd A(vector_size, num_vector), A_orth(vector_size, num_vector);
Eigen::HouseholderQR<Eigen::MatrixXd> qr(A);
A_orth.setIdentity();
qr.householderQ().applyThisOnTheLeft(A_orth);
```
In this way, the vector before the operation is stored in A. After operation, the orthonormalized vector is saved in A_orth.
How can I modify the above code to implement in-place qr decomposition?
Or how can I implement "save" modified Gram Schmidt?
Any advice will greatly help.
Thanks for your time.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]