SINGULAR VALUE Decomposition simple code in c
-
15-11-2019 - |
Question
I am looking for SINGULAR VALUE Decomposition(SVD) code in C, Would you please help me?
I found many sources but I cannot run them, I am looking for a version svd code that provide 3 matrix of S, V and U for me.
Solution
You can use the Numerical recipies code for that svdcmp.c reference. Actually in my case I found more accurate the openCV one, but both work fine.
OTHER TIPS
Don't write it yourself, don't deal with trying to build someone else's source. Use a library that provides this function for you. There's probably already one available on your target platform.
Specifically, use the industry-standard LAPACK library or use the GSL or whatever other linear algebra library you want. They all have an SVD implementation.