Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » sci.math.* » sci.math.num-analysis.independent

Topic: Use of ARPACK
Replies: 7   Last Post: Dec 9, 2011 9:15 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ] Topics: [ Previous | Next ]
Peter Spellucci

Posts: 205
Registered: 11/9/09
Re: Use of ARPACK
Posted: Dec 8, 2011 9:55 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Dieter Britz <dieterhansbritz@gmail.com> writes:
>Alois Steindl wrote:
>

>> Hello,
>> Dieter Britz <dieterhansbritz@gmail.com> writes:
>>

>>> Are there any simple examples for what I want to do, i.e. use ARPACK
>>> on a sparse matrix that I preduce myself?

>> It seems impossible to guess from your description, what you really want
>> to do. In order to use ARPACK, you will have to provide the matrix
>> elements in the required form.
>> How do you produce your matrix?
>>
>> Alois
>>

>
>It will be in the form of three arrays, for row and column indices
>and values. I see no provision for such data structures in the examples
>in the ARPACK examples. They seem to assume fixed matrices, whose
>values etc are generated within the routines. I was hoping for an example
>showing how to handle a sparse matrix in the form I mention.
>
>Or are there other programs to do this job?
>
>The frustrating thing is that a theoretical chemist I know reckons
>that what with my "small" matrices (up to a few hundreds x a few hundreds),
>it probably will not pay me to use ARPACK instead of a routine like
>RGG, which is for non-sparse matrices, because of the overhead for
>ARPACK. . However, I want to make sure this is correct.
>--
>Dieter Britz (dieterhansbritz<at>gmail.com)


well this is in fortran :
you have the notation (i1(i),i2(i),val(i)) i=1,nz
denoting the elements A(i1(i),i2(i)) of your matrix which are nonzero.
you also have a vector v(1:n) and need the result w=A*v:

do i=1,n
w(i)=0.d0
enddo
do i=1,nz
w(i1(i)) = w(i1(i))+val(i)*v(i2(i))
enddo

that should do it
hth
peter




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

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2013. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.