1

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?

Intech
  • 11
  • 2
  • I'm sorry but I made mistake in the post (edited it now). Dimensions of matrices I tested were exactly the same. – Intech Sep 11 '23 at 18:18
  • 2
    What does "visibly more time" mean in quantitative terms? – Wolfgang Bangerth Sep 11 '23 at 20:49
  • I was not able to reproduce this. MATLAB complained about f= randi([-70000,-90000],6000000,1); (wanting the -90000 first.) After fixing that, I computed the economy SVDs of both matrices and saw no real difference in time. – Brian Borchers Sep 11 '23 at 21:31
  • Could you please provide the exact timing you see? as well as ensure that the code runs. Without this data, it looks like the observations you have are not easily reproducible. – Anton Menshov Sep 11 '23 at 21:48

0 Answers0