158 lines
		
	
	
		
			3.8 KiB
		
	
	
	
		
			Fortran
		
	
	
	
			
		
		
	
	
			158 lines
		
	
	
		
			3.8 KiB
		
	
	
	
		
			Fortran
		
	
	
	
| *> \brief \b CLACRT performs a linear transformation of a pair of complex vectors.
 | |
| *
 | |
| *  =========== DOCUMENTATION ===========
 | |
| *
 | |
| * Online html documentation available at
 | |
| *            http://www.netlib.org/lapack/explore-html/
 | |
| *
 | |
| *> \htmlonly
 | |
| *> Download CLACRT + dependencies
 | |
| *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/clacrt.f">
 | |
| *> [TGZ]</a>
 | |
| *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/clacrt.f">
 | |
| *> [ZIP]</a>
 | |
| *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/clacrt.f">
 | |
| *> [TXT]</a>
 | |
| *> \endhtmlonly
 | |
| *
 | |
| *  Definition:
 | |
| *  ===========
 | |
| *
 | |
| *       SUBROUTINE CLACRT( N, CX, INCX, CY, INCY, C, S )
 | |
| *
 | |
| *       .. Scalar Arguments ..
 | |
| *       INTEGER            INCX, INCY, N
 | |
| *       COMPLEX            C, S
 | |
| *       ..
 | |
| *       .. Array Arguments ..
 | |
| *       COMPLEX            CX( * ), CY( * )
 | |
| *       ..
 | |
| *
 | |
| *
 | |
| *> \par Purpose:
 | |
| *  =============
 | |
| *>
 | |
| *> \verbatim
 | |
| *>
 | |
| *> CLACRT performs the operation
 | |
| *>
 | |
| *>    (  c  s )( x )  ==> ( x )
 | |
| *>    ( -s  c )( y )      ( y )
 | |
| *>
 | |
| *> where c and s are complex and the vectors x and y are complex.
 | |
| *> \endverbatim
 | |
| *
 | |
| *  Arguments:
 | |
| *  ==========
 | |
| *
 | |
| *> \param[in] N
 | |
| *> \verbatim
 | |
| *>          N is INTEGER
 | |
| *>          The number of elements in the vectors CX and CY.
 | |
| *> \endverbatim
 | |
| *>
 | |
| *> \param[in,out] CX
 | |
| *> \verbatim
 | |
| *>          CX is COMPLEX array, dimension (N)
 | |
| *>          On input, the vector x.
 | |
| *>          On output, CX is overwritten with c*x + s*y.
 | |
| *> \endverbatim
 | |
| *>
 | |
| *> \param[in] INCX
 | |
| *> \verbatim
 | |
| *>          INCX is INTEGER
 | |
| *>          The increment between successive values of CX.  INCX <> 0.
 | |
| *> \endverbatim
 | |
| *>
 | |
| *> \param[in,out] CY
 | |
| *> \verbatim
 | |
| *>          CY is COMPLEX array, dimension (N)
 | |
| *>          On input, the vector y.
 | |
| *>          On output, CY is overwritten with -s*x + c*y.
 | |
| *> \endverbatim
 | |
| *>
 | |
| *> \param[in] INCY
 | |
| *> \verbatim
 | |
| *>          INCY is INTEGER
 | |
| *>          The increment between successive values of CY.  INCY <> 0.
 | |
| *> \endverbatim
 | |
| *>
 | |
| *> \param[in] C
 | |
| *> \verbatim
 | |
| *>          C is COMPLEX
 | |
| *> \endverbatim
 | |
| *>
 | |
| *> \param[in] S
 | |
| *> \verbatim
 | |
| *>          S is COMPLEX
 | |
| *>          C and S define the matrix
 | |
| *>             [  C   S  ].
 | |
| *>             [ -S   C  ]
 | |
| *> \endverbatim
 | |
| *
 | |
| *  Authors:
 | |
| *  ========
 | |
| *
 | |
| *> \author Univ. of Tennessee
 | |
| *> \author Univ. of California Berkeley
 | |
| *> \author Univ. of Colorado Denver
 | |
| *> \author NAG Ltd.
 | |
| *
 | |
| *> \ingroup complexOTHERauxiliary
 | |
| *
 | |
| *  =====================================================================
 | |
|       SUBROUTINE CLACRT( N, CX, INCX, CY, INCY, C, S )
 | |
| *
 | |
| *  -- LAPACK auxiliary routine --
 | |
| *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
 | |
| *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
 | |
| *
 | |
| *     .. Scalar Arguments ..
 | |
|       INTEGER            INCX, INCY, N
 | |
|       COMPLEX            C, S
 | |
| *     ..
 | |
| *     .. Array Arguments ..
 | |
|       COMPLEX            CX( * ), CY( * )
 | |
| *     ..
 | |
| *
 | |
| * =====================================================================
 | |
| *
 | |
| *     .. Local Scalars ..
 | |
|       INTEGER            I, IX, IY
 | |
|       COMPLEX            CTEMP
 | |
| *     ..
 | |
| *     .. Executable Statements ..
 | |
| *
 | |
|       IF( N.LE.0 )
 | |
|      $   RETURN
 | |
|       IF( INCX.EQ.1 .AND. INCY.EQ.1 )
 | |
|      $   GO TO 20
 | |
| *
 | |
| *     Code for unequal increments or equal increments not equal to 1
 | |
| *
 | |
|       IX = 1
 | |
|       IY = 1
 | |
|       IF( INCX.LT.0 )
 | |
|      $   IX = ( -N+1 )*INCX + 1
 | |
|       IF( INCY.LT.0 )
 | |
|      $   IY = ( -N+1 )*INCY + 1
 | |
|       DO 10 I = 1, N
 | |
|          CTEMP = C*CX( IX ) + S*CY( IY )
 | |
|          CY( IY ) = C*CY( IY ) - S*CX( IX )
 | |
|          CX( IX ) = CTEMP
 | |
|          IX = IX + INCX
 | |
|          IY = IY + INCY
 | |
|    10 CONTINUE
 | |
|       RETURN
 | |
| *
 | |
| *     Code for both increments equal to 1
 | |
| *
 | |
|    20 CONTINUE
 | |
|       DO 30 I = 1, N
 | |
|          CTEMP = C*CX( I ) + S*CY( I )
 | |
|          CY( I ) = C*CY( I ) - S*CX( I )
 | |
|          CX( I ) = CTEMP
 | |
|    30 CONTINUE
 | |
|       RETURN
 | |
|       END
 |