zgbbrd.f.html

来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 490 行 · 第 1/3 页

HTML
490
字号
                  ELSE
                     NRT = NR
                  END IF
                  IF( NRT.GT.0 )
     $               CALL <a name="ZLARTV.314"></a><a href="zlartv.f.html#ZLARTV.1">ZLARTV</a>( NRT, AB( L+1, J1+KUN-1 ), INCA,
     $                            AB( L, J1+KUN ), INCA,
     $                            RWORK( J1+KUN ), WORK( J1+KUN ), KB1 )
   50          CONTINUE
<span class="comment">*</span><span class="comment">
</span>               IF( ML.EQ.ML0 .AND. MU.GT.MU0 ) THEN
                  IF( MU.LE.N-I+1 ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">                    generate plane rotation to annihilate a(i,i+mu-1)
</span><span class="comment">*</span><span class="comment">                    within the band, and apply rotation from the right
</span><span class="comment">*</span><span class="comment">
</span>                     CALL <a name="ZLARTG.325"></a><a href="zlartg.f.html#ZLARTG.1">ZLARTG</a>( AB( KU-MU+3, I+MU-2 ),
     $                            AB( KU-MU+2, I+MU-1 ),
     $                            RWORK( I+MU-1 ), WORK( I+MU-1 ), RA )
                     AB( KU-MU+3, I+MU-2 ) = RA
                     CALL <a name="ZROT.329"></a><a href="zrot.f.html#ZROT.1">ZROT</a>( MIN( KL+MU-2, M-I ),
     $                          AB( KU-MU+4, I+MU-2 ), 1,
     $                          AB( KU-MU+3, I+MU-1 ), 1,
     $                          RWORK( I+MU-1 ), WORK( I+MU-1 ) )
                  END IF
                  NR = NR + 1
                  J1 = J1 - KB1
               END IF
<span class="comment">*</span><span class="comment">
</span>               IF( WANTPT ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">                 accumulate product of plane rotations in P'
</span><span class="comment">*</span><span class="comment">
</span>                  DO 60 J = J1, J2, KB1
                     CALL <a name="ZROT.343"></a><a href="zrot.f.html#ZROT.1">ZROT</a>( N, PT( J+KUN-1, 1 ), LDPT,
     $                          PT( J+KUN, 1 ), LDPT, RWORK( J+KUN ),
     $                          DCONJG( WORK( J+KUN ) ) )
   60             CONTINUE
               END IF
<span class="comment">*</span><span class="comment">
</span>               IF( J2+KB.GT.M ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">                 adjust J2 to keep within the bounds of the matrix
</span><span class="comment">*</span><span class="comment">
</span>                  NR = NR - 1
                  J2 = J2 - KB1
               END IF
<span class="comment">*</span><span class="comment">
</span>               DO 70 J = J1, J2, KB1
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">                 create nonzero element a(j+kl+ku,j+ku-1) below the
</span><span class="comment">*</span><span class="comment">                 band and store it in WORK(1:n)
</span><span class="comment">*</span><span class="comment">
</span>                  WORK( J+KB ) = WORK( J+KUN )*AB( KLU1, J+KUN )
                  AB( KLU1, J+KUN ) = RWORK( J+KUN )*AB( KLU1, J+KUN )
   70          CONTINUE
<span class="comment">*</span><span class="comment">
</span>               IF( ML.GT.ML0 ) THEN
                  ML = ML - 1
               ELSE
                  MU = MU - 1
               END IF
   80       CONTINUE
   90    CONTINUE
      END IF
<span class="comment">*</span><span class="comment">
</span>      IF( KU.EQ.0 .AND. KL.GT.0 ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">        A has been reduced to complex lower bidiagonal form
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">        Transform lower bidiagonal form to upper bidiagonal by applying
</span><span class="comment">*</span><span class="comment">        plane rotations from the left, overwriting superdiagonal
</span><span class="comment">*</span><span class="comment">        elements on subdiagonal elements
</span><span class="comment">*</span><span class="comment">
</span>         DO 100 I = 1, MIN( M-1, N )
            CALL <a name="ZLARTG.384"></a><a href="zlartg.f.html#ZLARTG.1">ZLARTG</a>( AB( 1, I ), AB( 2, I ), RC, RS, RA )
            AB( 1, I ) = RA
            IF( I.LT.N ) THEN
               AB( 2, I ) = RS*AB( 1, I+1 )
               AB( 1, I+1 ) = RC*AB( 1, I+1 )
            END IF
            IF( WANTQ )
     $         CALL <a name="ZROT.391"></a><a href="zrot.f.html#ZROT.1">ZROT</a>( M, Q( 1, I ), 1, Q( 1, I+1 ), 1, RC,
     $                    DCONJG( RS ) )
            IF( WANTC )
     $         CALL <a name="ZROT.394"></a><a href="zrot.f.html#ZROT.1">ZROT</a>( NCC, C( I, 1 ), LDC, C( I+1, 1 ), LDC, RC,
     $                    RS )
  100    CONTINUE
      ELSE
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">        A has been reduced to complex upper bidiagonal form or is
</span><span class="comment">*</span><span class="comment">        diagonal
</span><span class="comment">*</span><span class="comment">
</span>         IF( KU.GT.0 .AND. M.LT.N ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">           Annihilate a(m,m+1) by applying plane rotations from the
</span><span class="comment">*</span><span class="comment">           right
</span><span class="comment">*</span><span class="comment">
</span>            RB = AB( KU, M+1 )
            DO 110 I = M, 1, -1
               CALL <a name="ZLARTG.409"></a><a href="zlartg.f.html#ZLARTG.1">ZLARTG</a>( AB( KU+1, I ), RB, RC, RS, RA )
               AB( KU+1, I ) = RA
               IF( I.GT.1 ) THEN
                  RB = -DCONJG( RS )*AB( KU, I )
                  AB( KU, I ) = RC*AB( KU, I )
               END IF
               IF( WANTPT )
     $            CALL <a name="ZROT.416"></a><a href="zrot.f.html#ZROT.1">ZROT</a>( N, PT( I, 1 ), LDPT, PT( M+1, 1 ), LDPT,
     $                       RC, DCONJG( RS ) )
  110       CONTINUE
         END IF
      END IF
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     Make diagonal and superdiagonal elements real, storing them in D
</span><span class="comment">*</span><span class="comment">     and E
</span><span class="comment">*</span><span class="comment">
</span>      T = AB( KU+1, 1 )
      DO 120 I = 1, MINMN
         ABST = ABS( T )
         D( I ) = ABST
         IF( ABST.NE.ZERO ) THEN
            T = T / ABST
         ELSE
            T = CONE
         END IF
         IF( WANTQ )
     $      CALL ZSCAL( M, T, Q( 1, I ), 1 )
         IF( WANTC )
     $      CALL ZSCAL( NCC, DCONJG( T ), C( I, 1 ), LDC )
         IF( I.LT.MINMN ) THEN
            IF( KU.EQ.0 .AND. KL.EQ.0 ) THEN
               E( I ) = ZERO
               T = AB( 1, I+1 )
            ELSE
               IF( KU.EQ.0 ) THEN
                  T = AB( 2, I )*DCONJG( T )
               ELSE
                  T = AB( KU, I+1 )*DCONJG( T )
               END IF
               ABST = ABS( T )
               E( I ) = ABST
               IF( ABST.NE.ZERO ) THEN
                  T = T / ABST
               ELSE
                  T = CONE
               END IF
               IF( WANTPT )
     $            CALL ZSCAL( N, T, PT( I+1, 1 ), LDPT )
               T = AB( KU+1, I+1 )*DCONJG( T )
            END IF
         END IF
  120 CONTINUE
      RETURN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     End of <a name="ZGBBRD.463"></a><a href="zgbbrd.f.html#ZGBBRD.1">ZGBBRD</a>
</span><span class="comment">*</span><span class="comment">
</span>      END

</pre>

 </body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?