LAPACK 3.12.0
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 113 of file clacrm.f.

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