 LAPACK  3.10.1 LAPACK: Linear Algebra PACKage

## ◆ clarcm()

 subroutine clarcm ( integer M, integer N, real, dimension( lda, * ) A, integer LDA, complex, dimension( ldb, * ) B, integer LDB, complex, dimension( ldc, * ) C, integer LDC, real, dimension( * ) RWORK )

CLARCM copies all or part of a real two-dimensional array to a complex array.

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

Purpose:
``` CLARCM performs a very simple matrix-matrix multiplication:
C := A * B,
where A is M by M and real; B is M by N and complex;
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 REAL array, dimension (LDA, M) On entry, A contains the M by M matrix A.``` [in] LDA ``` LDA is INTEGER The leading dimension of the array A. LDA >=max(1,M).``` [in] B ``` B is COMPLEX array, dimension (LDB, N) On entry, B contains the M by N matrix B.``` [in] LDB ``` LDB is INTEGER The leading dimension of the array B. LDB >=max(1,M).``` [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,M).``` [out] RWORK ` RWORK is REAL array, dimension (2*M*N)`

Definition at line 113 of file clarcm.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 A( LDA, * ), RWORK( * )
124  COMPLEX B( LDB, * ), 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( b( i, j ) )
152  10 CONTINUE
153  20 CONTINUE
154 *
155  l = m*n + 1
156  CALL sgemm( 'N', 'N', m, n, m, one, a, lda, rwork, m, 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( b( i, j ) )
167  50 CONTINUE
168  60 CONTINUE
169  CALL sgemm( 'N', 'N', m, n, m, one, a, lda, rwork, m, 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 CLARCM
181 *
subroutine sgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
SGEMM
Definition: sgemm.f:187
Here is the call graph for this function:
Here is the caller graph for this function: