The LAPACK forum has moved to https://github.com/Reference-LAPACK/lapack/discussions.

Diagonal complex matrix

Open discussion regarding features, bugs, issues, vendors, etc.

Diagonal complex matrix

Postby martas » Thu Aug 16, 2007 2:00 am

Hi, I am trying to use the BLAS/LAPACK libraries in C to perform some memory intensive calculations. One way to speed this up would be for me to produce a sparse (actually, diagonal) complex matrix, of size at least 1000 * 1000. I noticed that BLAS has methods to generate sparse matrices by listing the non zero entries and their indices, but I haven't been able to find a method to generate complex sparse/diagonal matrices, and I don't really want to populate an entire array with predominantly zeroes.

Does anyone have any ideas?

Thanks very much

Marta
martas
 
Posts: 3
Joined: Thu Aug 16, 2007 1:54 am

Postby Danesh_D » Thu Aug 16, 2007 7:19 am

Hi Marta,

I think you have a simpler solution rather than using BLAS. You can simply save all elemenets of you matrix (I assume that it is diagonal) in a vector of 1000 elements. Then you can use ScaLAPACK functions which is tailored for diagonal matrices or simply write routines which for example adds a digonal matrix with another matrix. If you needed source code of these functions let me know.

Danesh
Danesh_D
 
Posts: 31
Joined: Mon Jun 04, 2007 10:03 pm

Postby martas » Thu Aug 16, 2007 6:13 pm

Hi Danesh,

Thanks for your reply.

I am running 32 bit Windows, unfortunately, and it seems to me that in order to get the best performance out of ScaLapack, I need a 64 bit machine, or else the Linux OS.

Is that correct?

Sorry for my ignorance - I only learnt about ACML, BLAS and Lapack in the last couple of days. I had previously written my code in scilab, which allowed me to do element-wise matrix operations, so the things I am asking about were not an issue. But the calculations were too slow, which is why I am trying to switch to ACML.

Thanks

Marta
martas
 
Posts: 3
Joined: Thu Aug 16, 2007 1:54 am

Postby Julien Langou » Fri Aug 17, 2007 11:09 am

Hello Marta,

you are right ACML has a kind of sparse BLAS implemented in it. I have never used
it personnally. It is not the exactly what we call the sparse BLAS though (I think).
From what I have understood they have an implementation of some routines
proposed in: David S. Dodson, Roger G. Grimes, John G. Lewis, Sparse Extensions to the
FORTRAN Basic Linear Algebra Subprograms, ACM Trans. Math. Soft., 17 (1991), pp.
253–263. If this is what you need you might go and try and use ACML.

Now for the BLAS in itself, I am not sure what kind of operation you want to do, but it
looks to me that you would be better off simply rewriting your Scilab code in C or Fortran.
The executable should be faster than the Scilab equivallent.

Your operation looks very specific that might be the best way to go.

Julien.
Julien Langou
 
Posts: 835
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA

Postby martas » Sun Aug 26, 2007 7:03 pm

Thanks to both of you for your help.

Marta
martas
 
Posts: 3
Joined: Thu Aug 16, 2007 1:54 am


Return to User Discussion

Who is online

Users browsing this forum: No registered users and 4 guests