| bio | website | |
|---|---|---|
| location | ||
| age | ||
| visits | member for | 7 months |
| seen | Oct 25 '12 at 9:56 | |
| stats | profile views | 2 |
|
Oct 11 |
comment |
How to sum up large number of elements in a table quickly? @acl to me it seems that Total isn't very fast, or it is slower in this case due to something that I can't see. There is a very large amount of elements to be added. Is there an alternative way to add the elements of a Table, other than Total, For loops or Sum? |
|
Oct 11 |
comment |
How to sum up large number of elements in a table quickly? @acl I tried running my problem using Table instead of ParallelTable but the latter is considerably faster. I get 649 seconds vs a lot more for the case of Table (I actually stopped it after it passed the 10 minute mark) |
|
Oct 11 |
awarded | Editor |
|
Oct 11 |
revised |
How to sum up large number of elements in a table quickly? added 4 characters in body |
|
Oct 11 |
comment |
How to sum up large number of elements in a table quickly? @acl Thank you fo the extensive post. I have never used Compile successfully but I will try and give it another go. |
|
Oct 11 |
awarded | Student |
|
Oct 11 |
comment |
How to sum up large number of elements in a table quickly? I am afraid that I do not understand how you made f faster. Can you explain a bit more please? |
|
Oct 11 |
comment |
How to sum up large number of elements in a table quickly? A1 and A2 are 2500x2500 (but this is an example, it could be more but let's go with this because I know that it takes about 10 mins on my machine). But as I said before, these remain constant. This was the whole idea. I wanted to precalculate them in order to gain speed, and I did but the final Table[f[x],{x,1,2500}], this takes 10 mins to calculate. |
|
Oct 11 |
comment |
How to sum up large number of elements in a table quickly? I have a laptop with a 2.4 core i5 procesor and 4 Gb of ram |
|
Oct 11 |
comment |
How to sum up large number of elements in a table quickly? Hang, on I just read previous comment earlier. It takes under a second for one value of x. For 2000+ values it takes about 10 minutes. This is what I am hoping to improve. More precisely if I do: ParallelTable[f[x],{x,1,2000}], it takes about 10 mins. |
|
Oct 11 |
comment |
How to sum up large number of elements in a table quickly? well yes, you are right, f[x] takes under 1 second, but if i need to apply f to 2000 values of x then the time increases significantly. I have a feeling that there might be nothing else to do to speed this up. But hope is the last to go :) |
|
Oct 11 |
comment |
How to sum up large number of elements in a table quickly? they are constant. These are 2D tables created using Table, if this is of any help. |
|
Oct 11 |
asked | How to sum up large number of elements in a table quickly? |