Skip to main content

Timeline for How to Set parts of indexed lists?

Current License: CC BY-SA 3.0

7 events
when toggle format what by license comment
Jun 22, 2012 at 14:53 comment added gwr Testing this runs as fast as direct assignment for a non-indexed var. Does this solution have the same memory disadvantages as ReplacePart does? (the indexed-var needs to be copied and reassigned)
Jun 22, 2012 at 13:54 history edited gwr CC BY-SA 3.0
Change the setIndexed functions arguments to be more readable with regard to the OP.
Jun 22, 2012 at 13:29 comment added gwr As I had written to Szabolcs the reason for choosing an index was the more simple way to change existing code. But the SparseArray is simply the list-solution with better allocation of resources in case of lots of empty cells? I can't see how this is a replacement for an indexed var which essentially allows dynamic programming?
Jun 22, 2012 at 11:44 comment added image_doctor Clearly this is a good question, as it is generating a lot of debate :) Have you found the built in SparseArray doesn't quite fit your application?
Jun 22, 2012 at 11:16 comment added gwr The reasons for using indexed variables as opposed to lists is addressed in the Mathematica reference (reference.wolfram.com/mathematica/tutorial/…). Why should these reasons - sparse definitions made only when needed - not apply when the variable contains an array?
Jun 22, 2012 at 10:52 comment added image_doctor As others have hinted, the more elegant way might be not to use an indexed array, but perhaps we need more information to know why an indexed array is the best solution?
Jun 22, 2012 at 10:32 history answered gwr CC BY-SA 3.0