comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: adding sparse arrays
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: adding sparse arrays [message #54301 is a reply to message #54300] Thu, 07 June 2007 07:32 Go to previous messageGo to previous message
nivedita.raghunath is currently offline  nivedita.raghunath
Messages: 15
Registered: July 2006
Junior Member
Hi all,

Thanks for the suggestions.

The arrays that I'm working with are really huge so there's no option
of A+B. I cannot convert to full matrix form using fulstr and have to
work only with the sparse arrays A and B to get another sparse array (A
+B). The non-zero elements of the two arrays are in different index
positions (ija), so the sa vectors cannot be added directly.

Under these constraints, whats the best (and the fastest) way to add
them?

-Nivedita


On Jun 7, 4:36 am, Paolo Grigis <pgri...@astro.phys.ethz.ch> wrote:
> nivedita.raghun...@gmail.com wrote:
>> Hello all,
>
>> How do I add two sparse arrays? The fact that a sparse function to add
>> doesn't exist makes me think its pretty simple, but I just can't get
>> it. I do not want to use any loops.
>
> Well, it depends where the non-zero, non-diagonal elements of the two
> arrays are. If they are located in the same positions, you just need
> to add the sa vectors while keeping the ija vectors fixed.
>
> Ciao,
> Paolo
>
>
>
>
>
>> Thanks in advance.
>
>> -Nivedita- Hide quoted text -
>
> - Show quoted text -
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Executable files
Next Topic: scaling idlGrAxis ticks?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 02:17:21 PDT 2025

Total time taken to generate the page: 0.40119 seconds