LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
zlarcm.f
Go to the documentation of this file.
1*> \brief \b ZLARCM copies all or part of a real two-dimensional array to a complex array.
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download ZLARCM + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zlarcm.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zlarcm.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlarcm.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE ZLARCM( M, N, A, LDA, B, LDB, C, LDC, RWORK )
20*
21* .. Scalar Arguments ..
22* INTEGER LDA, LDB, LDC, M, N
23* ..
24* .. Array Arguments ..
25* DOUBLE PRECISION A( LDA, * ), RWORK( * )
26* COMPLEX*16 B( LDB, * ), C( LDC, * )
27* ..
28*
29*
30*> \par Purpose:
31* =============
32*>
33*> \verbatim
34*>
35*> ZLARCM performs a very simple matrix-matrix multiplication:
36*> C := A * B,
37*> where A is M by M and real; B is M by N and complex;
38*> C is M by N and complex.
39*> \endverbatim
40*
41* Arguments:
42* ==========
43*
44*> \param[in] M
45*> \verbatim
46*> M is INTEGER
47*> The number of rows of the matrix A and of the matrix C.
48*> M >= 0.
49*> \endverbatim
50*>
51*> \param[in] N
52*> \verbatim
53*> N is INTEGER
54*> The number of columns and rows of the matrix B and
55*> the number of columns of the matrix C.
56*> N >= 0.
57*> \endverbatim
58*>
59*> \param[in] A
60*> \verbatim
61*> A is DOUBLE PRECISION array, dimension (LDA, M)
62*> On entry, A contains the M by M matrix A.
63*> \endverbatim
64*>
65*> \param[in] LDA
66*> \verbatim
67*> LDA is INTEGER
68*> The leading dimension of the array A. LDA >=max(1,M).
69*> \endverbatim
70*>
71*> \param[in] B
72*> \verbatim
73*> B is COMPLEX*16 array, dimension (LDB, N)
74*> On entry, B contains the M by N matrix B.
75*> \endverbatim
76*>
77*> \param[in] LDB
78*> \verbatim
79*> LDB is INTEGER
80*> The leading dimension of the array B. LDB >=max(1,M).
81*> \endverbatim
82*>
83*> \param[out] C
84*> \verbatim
85*> C is COMPLEX*16 array, dimension (LDC, N)
86*> On exit, C contains the M by N matrix C.
87*> \endverbatim
88*>
89*> \param[in] LDC
90*> \verbatim
91*> LDC is INTEGER
92*> The leading dimension of the array C. LDC >=max(1,M).
93*> \endverbatim
94*>
95*> \param[out] RWORK
96*> \verbatim
97*> RWORK is DOUBLE PRECISION array, dimension (2*M*N)
98*> \endverbatim
99*
100* Authors:
101* ========
102*
103*> \author Univ. of Tennessee
104*> \author Univ. of California Berkeley
105*> \author Univ. of Colorado Denver
106*> \author NAG Ltd.
107*
108*> \ingroup larcm
109*
110* =====================================================================
111 SUBROUTINE zlarcm( M, N, A, LDA, B, LDB, C, LDC, RWORK )
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 DOUBLE PRECISION A( LDA, * ), RWORK( * )
122 COMPLEX*16 B( LDB, * ), C( LDC, * )
123* ..
124*
125* =====================================================================
126*
127* .. Parameters ..
128 DOUBLE PRECISION ONE, ZERO
129 parameter( one = 1.0d0, zero = 0.0d0 )
130* ..
131* .. Local Scalars ..
132 INTEGER I, J, L
133* ..
134* .. Intrinsic Functions ..
135 INTRINSIC dble, dcmplx, dimag
136* ..
137* .. External Subroutines ..
138 EXTERNAL dgemm
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 ) = dble( b( i, j ) )
150 10 CONTINUE
151 20 CONTINUE
152*
153 l = m*n + 1
154 CALL dgemm( 'N', 'N', m, n, m, one, a, lda, rwork, m, 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 ) = dimag( b( i, j ) )
165 50 CONTINUE
166 60 CONTINUE
167 CALL dgemm( 'N', 'N', m, n, m, one, a, lda, rwork, m, zero,
168 $ rwork( l ), m )
169 DO 80 j = 1, n
170 DO 70 i = 1, m
171 c( i, j ) = dcmplx( dble( c( i, j ) ),
172 $ rwork( l+( j-1 )*m+i-1 ) )
173 70 CONTINUE
174 80 CONTINUE
175*
176 RETURN
177*
178* End of ZLARCM
179*
180 END
subroutine dgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
DGEMM
Definition dgemm.f:188
subroutine zlarcm(m, n, a, lda, b, ldb, c, ldc, rwork)
ZLARCM copies all or part of a real two-dimensional array to a complex array.
Definition zlarcm.f:112