The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Sparse Array Question
Replies: 6   Last Post: Apr 25, 2013 2:52 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Chris Arthur

Posts: 28
Registered: 10/4/11
Sparse Array Question
Posted: Apr 23, 2013 9:39 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


I have a list of rules for defining a SparseArray. The list has some
coordinates repeated with different values. If a coordinate appears in
the list more than once, I want to sum up the values, and then have a

i.e., if my list were myList={{1,1}->1,{2,1}->2,{1,1}->3} then my
SparseArray should have {1,1}->4. I've tried using ReplacePart on an
array to say myArray=ReplacePart[myArray,...] but this seems horribly
inefficient as a way to change values in an array.

I'm using Mathematica 5.2



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.