I'm trying to use the the generalized SVD function dggsvd3 in C and I'm having the following issue.
In a very simplified way I'm creating the following function:
[U,V,Q,C,S] = my_dggsvd3_in_C(A,B),
where A and B are my inputs and they 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]]
With these inputs I have the following outputs:
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 than the one from MATLAB.
In MATLAB, for the same inputs, Q has the following value.
Q =
0.3456 -0.6562 0.8602
5.8426 -2.5466 -0.7678
3.9969 -5.5656 -0.4228
Can someone please explain me what is going on?
I can attach my C code if needed.
Thanks in advance.
Tiago