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

Help in Distributing a Sylvester Matrix !

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

Help in Distributing a Sylvester Matrix !

Postby arad » Fri May 23, 2008 8:01 pm

Hello guys

This is a type of 9 x 9 Sylvester matrix

1 2 3 4 0 0 0 0 0
0 1 2 3 4 0 0 0 0
0 0 1 2 3 4 0 0 0
0 0 0 1 2 3 4 0 0
0 0 0 0 1 2 3 4 0
0 0 0 0 0 1 2 3 4
5 6 7 8 9 10 11 0 0
0 5 6 7 8 9 10 11 0
0 0 5 6 7 8 9 10 11

while the code I used to generate it is :

Code: Select all
SUBROUTINE MATINIT( AA, DESCA )
*
*     MATINIT generates and distributes matrices A and B (depicted in
*     figures 2.5 and 2.6) to a 2 x 3 process grid
*
*     .. Array Arguments ..
      INTEGER            DESCA( * )
      DOUBLE PRECISION   AA( * ) , C (1,4), D(1,7)
*     .. Parameters ..
      INTEGER            CTXT_, LLD_ ,I ,J, M
      PARAMETER          ( CTXT_ = 2, LLD_ = 9 )
*     ..
*     .. Local Scalars ..
      INTEGER            ICTXT, MXLLDA, MYCOL, MYROW, NPCOL, NPROW

*     .. External Subroutines ..
      EXTERNAL           BLACS_GRIDINFO, PDELSET
*     ..
*     .. Executable Statements ..
*
      ICTXT = DESCA( CTXT_ )
      CALL BLACS_GRIDINFO( ICTXT, NPROW, NPCOL, MYROW, MYCOL )
*
       C(1,1)=1.0D0
       C(1,2)=2.0D0
       C(1,3)=3.0D0
       C(1,4)=4.0D0
       D(1,1)=5.0D0
       D(1,2)=6.0D0
       D(1,3)=7.0D0
       D(1,4)=8.0D0
       D(1,5)=9.0D0
       D(1,6)=10.0D0
       D(1,7)=11.0D0
       DO 30 I=1, 9
       IF (I.LT.7) THEN
       DO 50 J=0, 3
       CALL PDELSET(AA ,I,I+J,DESCA,C(1,J+1))
 50    CONTINUE
       ELSE IF (I.GE.7) THEN
       DO 60 M=0, 6
       CALL PDELSET(AA,I,I-M,DESCA,D(1,7-M))
 60    CONTINUE
       END IF
 30   CONTINUE
*
      RETURN
      END


I am asking actyually if there is any better way to generate a Sylvester matrix.. I want actually to generate a 30x30 or bigger Sylvester matrix which has a lot of zeros in it , a non dense matrix. My main problem is that i want to test the QR factorization on it and so I want try to make the algorithm cheaper avoiding the operations between the zero elements !

Thanks !!
arad
 
Posts: 17
Joined: Wed Apr 16, 2008 4:12 pm

Return to User Discussion

Who is online

Users browsing this forum: No registered users and 5 guests