02 September 2018 09:08:57 AM
SVD_TRUNCATED
C version
Demonstrate the use of the truncated or economy-size
Singular Value Decomposition (SVD) for cases where
the sizes of M and N are very different.
SVD_TRUNCATED_U_TEST
M = 4
N = 3
A:
Col: 0 1 2
Row
0: 0.218418 0.415307 0.043829
1: 0.956318 0.066119 0.633966
2: 0.829509 0.257578 0.061727
3: 0.561695 0.109957 0.449539
UN:
Col: 0 1 2
Row
0: -0.183175 -0.646219 -0.706139
1: -0.712493 0.427285 -0.029831
2: -0.507765 -0.582870 0.611171
3: -0.448303 0.245135 -0.356298
SN:
Col: 0 1 2
Row
0: 1.586180 0.000000 0.000000
1: 0.000000 0.488342 0.000000
2: 0.000000 0.000000 0.276424
V:
Col: 0 1 2
Row
0: -0.879083 -0.160400 0.448871
1: -0.191193 -0.743962 -0.640286
2: -0.436645 0.648685 -0.623337
Maximum error |A - U*S*V'| = 3.33067e-16
Recomputed A = U * S * V':
Col: 0 1 2
Row
0: 0.218418 0.415307 0.043829
1: 0.956318 0.066119 0.633966
2: 0.829509 0.257578 0.061727
3: 0.561695 0.109957 0.449539
SVD_TRUNCATED_V_TEST
M = 3
N = 4
A:
Col: 0 1 2 3
Row
0: 0.218418 0.561695 0.257578 0.633966
1: 0.956318 0.415307 0.109957 0.061727
2: 0.829509 0.066119 0.043829 0.449539
U:
Col: 0 1 2
Row
0: -0.458728 -0.880639 -0.118507
1: -0.658087 0.426317 -0.620626
2: -0.597068 0.206710 0.775100
SM:
Col: 0 1 2
Row
0: 1.494101 0.000000 0.000000
1: 0.000000 0.681157 0.000000
2: 0.000000 0.000000 0.366801
VM:
Col: 0 1 2
Row
0: -0.819763 0.567879 0.064213
1: -0.381802 -0.446198 -0.744454
2: -0.145029 -0.250892 -0.176649
3: -0.401476 -0.644573 0.640671
Maximum error |A - U*S*V'| = 1.11022e-15
Recomputed A = U * S * V':
Col: 0 1 2 3
Row
0: 0.218418 0.561695 0.257578 0.633966
1: 0.956318 0.415307 0.109957 0.061727
2: 0.829509 0.066119 0.043829 0.449539
SVD_TRUNCATED
Normal end of execution.
02 September 2018 09:08:57 AM