Timeline for How to Set parts of indexed lists?
Current License: CC BY-SA 3.0
20 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 7, 2017 at 8:34 | answer | added | Albert Retey | timeline score: 10 | |
| Feb 20, 2013 at 2:03 | answer | added | Murta | timeline score: 1 | |
| Jun 23, 2012 at 10:36 | history | tweeted | twitter.com/#!/StackMma/status/216479882060894210 | ||
| Jun 23, 2012 at 10:19 | answer | added | Mr.Wizard | timeline score: 11 | |
| Jun 22, 2012 at 15:45 | answer | added | Rojo | timeline score: 6 | |
| Jun 22, 2012 at 13:51 | vote | accept | gwr | ||
| Jun 22, 2012 at 13:33 | history | edited | gwr | CC BY-SA 3.0 | I changed 'array' to 'list' in the first sentence as that seems more precise. |
| Jun 22, 2012 at 13:23 | answer | added | Leonid Shifrin | timeline score: 12 | |
| Jun 22, 2012 at 11:29 | comment | added | István Zachar | I think it is a rather important question, I have run into this issue several times when (as Leonid states below in a comment) I've tried to avoid ReplacePart, but the input expression wasn't simply a symbol. I've changed the title to reflect the generality of the question, please feel free to roll back if you find it less informative. | |
| Jun 22, 2012 at 11:26 | history | edited | István Zachar | CC BY-SA 3.0 | edited title |
| Jun 22, 2012 at 10:49 | answer | added | image_doctor | timeline score: 5 | |
| Jun 22, 2012 at 10:32 | answer | added | gwr | timeline score: 3 | |
| Jun 22, 2012 at 10:14 | comment | added | gwr | Szabolcs, I am just trying to have an indexed variable be a list or to be more precise an array. While in principle you are right that I might transfer every index to a numerical range and thus one could come around by simply adding the index-dimension to the arrray dimension, there is good reason to work with the 'sparse' definitions allowed by using an index for the variable itself. My problem at hand is that I am changing code already written. Adding the index in the variable name is a simple replacement. Adding it as an array dimension means a lot of work... | |
| Jun 22, 2012 at 10:09 | comment | added | gwr | Just to make this clearer, I have edited the original question in order to make it clearer by having the index be a symbol. | |
| Jun 22, 2012 at 10:08 | comment | added | Szabolcs | I had the impression that you were doing a numeric/programming type of work, not symbolic manipulation (since you were using Part to change arrays element by element). What exactly are you doing? | |
| Jun 22, 2012 at 10:08 | history | edited | gwr | CC BY-SA 3.0 | I changed the index from a numerical value (1 before) to a symbol (e.g. 'i') in order to make this problem clearer and why thus adding the index as a new dimension to the tensor might not always be the option of choice. |
| Jun 22, 2012 at 9:50 | comment | added | gwr | Szabolcs, as written below, I am a bit amazed at what seems 'illogical' in not being able to address downvalues. I might have to use the list-option as you suggest, but for a more symbolic reference like matM[a] it would be very nice to do it the way I suggested. I should be possible, shouldn't it? | |
| Jun 22, 2012 at 9:40 | answer | added | jVincent | timeline score: 1 | |
| Jun 22, 2012 at 9:37 | comment | added | Szabolcs | Is using a list instead and doing matM[[1]][[1,10]]=10 an option for you application? Could you explain why you need an indexed variable? Then it would be easier to come up with a solution. (As you noticed, assigning to Part doens't work with DownValues...) | |
| Jun 22, 2012 at 9:27 | history | asked | gwr | CC BY-SA 3.0 |