I'm testing libraries for numerical computing and time they take to calculate SVD. During testing I encountered an issue for which I don't have an answer. I generated 2 matrices:
- random tall matrix using Matlab with function randi([10,50],6000000,6)
- matrix of the same shape combining vectors with very different ranges of numbers using following code:
a = rand(6000000,1);
b= randi([1000000,2000000],6000000,1);
c= randi([100,200],6000000,1);
d= randi([5000000,6000000],6000000,1);
e= randi([15000000,16000000],6000000,1);
f= randi([-70000,-90000],6000000,1);
A= [a b c d e f];
Second matrix has much higher condition number (around 1e+7). Now if I try to calculate SVD of these two matrices then calculations take visibly more time on first matrix no matter which library I use. I would expect the opposite results. What is a reason behind it?