New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
possible issue dggsvd3 function #109
Comments
Debugging SVD is really simple,
Check that that U,V,Q,C and S satisfy the gsvd relation with A and B. Check
that U, Q are orthonormal
Do it for both your C code and matlab.
I think you'll find the answer you are looking for after running these tests
…On Thu, Jan 12, 2017 at 12:25 PM, Tiago Freitas Pereira < ***@***.***> wrote:
In a very simplified way, I created the following function in C that uses
the Generalized SVD function dggsvd3.
[U,V,Q,C,S] = my_gsvd_in_C(A,B), where the inputs are:
A = [[ 1., 1., 2.],
[ 0., 1., 3.],
[ 0., 4., 3.]]
B = [[ 0.2, 1.4, 2. ],
[ 0.4, 1. , 3.2],
[ 0.3, 4.5, 3.3]]
The outputs that I get are the following:
U = [[-0.45904757, 0.22321234, -0.8599137 ],
[-0.88154988, -0.23451243, 0.40972397],
[-0.11020501, 0.94613961, 0.30442518]]
V = [[-0.38233328, 0.1538968 , 0.91111856],
[-0.92047714, -0.149751 , -0.36096602],
[-0.0808894 , 0.97667313, -0.19891328]]
C = [ 0.69954115, 0.64582169, 0.99967773]
S = [ 0.71459232, 0.76348828, 0.02538585]
Q = [[-0.09327252, -0.55839886, 0.82431241],
[ 0.70757717, 0.54528323, 0.44944494],
[ 0.70045328, -0.6251855 , -0.34425035]]
My problem is with the output of Q.
This output is completely different from the one from MATLAB.
Calling the function gsvd from MATLAB, with the same inputs, I have the
following value for Q
Q =
0.3456 -0.6562 0.8602
5.8426 -2.5466 -0.7678
3.9969 -5.5656 -0.4228
I don't know what is going on. I can send my C code if needed.
Sorry for any duplicate message, I posted the same issue in the LAPACK
forum.
Thanks in advance for any answer
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#109>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/ACMdtA7Q7qqxr0lxxZ5oNIzBYL2w6X6Hks5rRmIegaJpZM4LiBLp>
.
|
So, I've tested that.
In Matab, only U and V are orthonormal (they are same as in C), but not Q and
which I think it is correct |
You say "Calling the function gsvd from MATLAB, with the same inputs, I have the following value for
Julien. |
Wow, that's right. I will close the issue Cheers |
Another question
and BETA like this
Thanks in advance. |
Tiago. (1) Next time you have a question about LAPACK, can you post it on the LAPACK forum? http://icl.cs.utk.edu/lapack-forum/ As opposed to on GitHub. We use GitHub Issue to track bugs, etc. I am not sure we want to use it for user support. User support is on the forum. Thanks. (2) What do you mean by Julien. |
In a very simplified way, I created the following function in C that uses the Generalized SVD function dggsvd3.
[U,V,Q,C,S] = my_gsvd_in_C(A,B), where the inputs are:
The outputs that I get are the following:
My problem is with the output of Q.
This output is completely different from the one from MATLAB.
Calling the function gsvd from MATLAB, with the same inputs, I have the following value for Q
I don't know what is going on. I can send my C code if needed.
Sorry for any duplicate message, I posted the same issue in the LAPACK forum.
Thanks in advance for any answer
The text was updated successfully, but these errors were encountered: