Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'How to improve this program? 3q' topicStudent Support Forum > General > "How to improve this program? 3q"

Next Comment >Help | Reply To Topic
Author Comment/Response
Eden
08/08/13 06:20am

For[n = 2000, n < 10000, n += 500, sum = 0;
pp = 1/ParallelSum[1/i^2, {i, 1, n}];
A = ConstantArray[0, {n, n}];
For[i = 1, i <= n, i++, A[[i, n + 1 - i]] = 1];
H = IdentityMatrix[n];
For[i = 0, i < n, i++,
For[j = 1, j < n + 1 - i, j++,
H[[j, j + i]] = Sqrt[pp]/(Sqrt[n - i]*(i + 1))]];
T := A.Orthogonalize[N[H].A, Dot];
Z = T.N[H].A.T\[Transpose].A;
For[i = 1, i <= n, i++, For[j = 1, j <= i, j++, Z[[i, j]] = 0]];
sum = ParallelSum[(Z[[i, j]])^2, {i, 1, n}, {j, 1, n}];
Print[sum]
]

URL: ,

Subject (listing for 'How to improve this program? 3q')
Author Date Posted
How to improve this program? 3q Eden 08/08/13 06:20am
Re: How to improve this program? 3q Forum Modera... 08/13/13 4:05pm
Next Comment >Help | Reply To Topic