| Giewont (3) | |
|
Hello ! I'm very beginner in numerical methods... I have the pseudo-code (look at image), but I don't know how intrepret this and how I can implement this in C++... Can You help me ? image of pseudo-code: http://postimage.org/image/o6sitd3l9/ | |
|
|
|
| hamsterman (4435) | |
|
Factorization? Gram-Schmidt is for orthonormalizing a basis. Start with a (numbered) set of vectors. Take the first one, normalize it (divide it by it's length) then fix the remaining ones so that their scalar product with the first one is 0 (using the last formula in the picture). Repeat for the remaining vectors. If unclear, the algorithm should be well explained in wikipedia. | |
|
|
|
| FredFlintstone (11) | |||
|
I looked for a numerical example of the method. I wrote the C program and I have verified that the results correspond to those of the example.
| |||
|
Last edited on
|
|||
| Giewont (3) | ||||||
Thank You very much ! It works really good :) I have one more, additional question: do You know (or somebody...) how can I convert it to parallel version using OpenMP ? I tried to use:
but it doesn't work correctly. I noticed that the problematic fragment is:
but I don't know why it makes a problem... | ||||||
|
|
||||||
| hamsterman (4435) | |
| How would you parallelize this? It's a pretty sequential algorithm. I guess if you have a ridiculous number of dimensions, it might be doable... | |
|
|
|
| Giewont (3) | |
|
It's an exercise for my college. I must parallelize the sequential Gram-Schmidt's algorithm and compare execution time of both version (of course for large matrix). | |
|
|
|