LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ clacrm()

subroutine clacrm ( integer m,
integer n,
complex, dimension( lda, * ) a,
integer lda,
real, dimension( ldb, * ) b,
integer ldb,
complex, dimension( ldc, * ) c,
integer ldc,
real, dimension( * ) rwork )

CLACRM multiplies a complex matrix by a square real matrix.

Download CLACRM + dependencies [TGZ] [ZIP] [TXT]

Purpose:
!>
!> CLACRM performs a very simple matrix-matrix multiplication:
!>          C := A * B,
!> where A is M by N and complex; B is N by N and real;
!> C is M by N and complex.
!> 
Parameters
[in]M
!>          M is INTEGER
!>          The number of rows of the matrix A and of the matrix C.
!>          M >= 0.
!> 
[in]N
!>          N is INTEGER
!>          The number of columns and rows of the matrix B and
!>          the number of columns of the matrix C.
!>          N >= 0.
!> 
[in]A
!>          A is COMPLEX array, dimension (LDA, N)
!>          On entry, A contains the M by N matrix A.
!> 
[in]LDA
!>          LDA is INTEGER
!>          The leading dimension of the array A. LDA >=max(1,M).
!> 
[in]B
!>          B is REAL array, dimension (LDB, N)
!>          On entry, B contains the N by N matrix B.
!> 
[in]LDB
!>          LDB is INTEGER
!>          The leading dimension of the array B. LDB >=max(1,N).
!> 
[out]C
!>          C is COMPLEX array, dimension (LDC, N)
!>          On exit, C contains the M by N matrix C.
!> 
[in]LDC
!>          LDC is INTEGER
!>          The leading dimension of the array C. LDC >=max(1,N).
!> 
[out]RWORK
!>          RWORK is REAL array, dimension (2*M*N)
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 111 of file clacrm.f.

112*
113* -- LAPACK auxiliary routine --
114* -- LAPACK is a software package provided by Univ. of Tennessee, --
115* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
116*
117* .. Scalar Arguments ..
118 INTEGER LDA, LDB, LDC, M, N
119* ..
120* .. Array Arguments ..
121 REAL B( LDB, * ), RWORK( * )
122 COMPLEX A( LDA, * ), C( LDC, * )
123* ..
124*
125* =====================================================================
126*
127* .. Parameters ..
128 REAL ONE, ZERO
129 parameter( one = 1.0e0, zero = 0.0e0 )
130* ..
131* .. Local Scalars ..
132 INTEGER I, J, L
133* ..
134* .. Intrinsic Functions ..
135 INTRINSIC aimag, cmplx, real
136* ..
137* .. External Subroutines ..
138 EXTERNAL sgemm
139* ..
140* .. Executable Statements ..
141*
142* Quick return if possible.
143*
144 IF( ( m.EQ.0 ) .OR. ( n.EQ.0 ) )
145 $ RETURN
146*
147 DO 20 j = 1, n
148 DO 10 i = 1, m
149 rwork( ( j-1 )*m+i ) = real( a( i, j ) )
150 10 CONTINUE
151 20 CONTINUE
152*
153 l = m*n + 1
154 CALL sgemm( 'N', 'N', m, n, n, one, rwork, m, b, ldb, zero,
155 $ rwork( l ), m )
156 DO 40 j = 1, n
157 DO 30 i = 1, m
158 c( i, j ) = rwork( l+( j-1 )*m+i-1 )
159 30 CONTINUE
160 40 CONTINUE
161*
162 DO 60 j = 1, n
163 DO 50 i = 1, m
164 rwork( ( j-1 )*m+i ) = aimag( a( i, j ) )
165 50 CONTINUE
166 60 CONTINUE
167 CALL sgemm( 'N', 'N', m, n, n, one, rwork, m, b, ldb, zero,
168 $ rwork( l ), m )
169 DO 80 j = 1, n
170 DO 70 i = 1, m
171 c( i, j ) = cmplx( real( c( i, j ) ),
172 $ rwork( l+( j-1 )*m+i-1 ) )
173 70 CONTINUE
174 80 CONTINUE
175*
176 RETURN
177*
178* End of CLACRM
179*
subroutine sgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
SGEMM
Definition sgemm.f:188
Here is the call graph for this function:
Here is the caller graph for this function: