clakf2.c
Go to the documentation of this file.
00001 /* clakf2.f -- translated by f2c (version 20061008).
00002    You must link the resulting object file with libf2c:
00003         on Microsoft Windows system, link with libf2c.lib;
00004         on Linux or Unix systems, link with .../path/to/libf2c.a -lm
00005         or, if you install libf2c.a in a standard place, with -lf2c -lm
00006         -- in that order, at the end of the command line, as in
00007                 cc *.o -lf2c -lm
00008         Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
00009 
00010                 http://www.netlib.org/f2c/libf2c.zip
00011 */
00012 
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015 
00016 /* Table of constant values */
00017 
00018 static complex c_b1 = {0.f,0.f};
00019 
00020 /* Subroutine */ int clakf2_(integer *m, integer *n, complex *a, integer *lda, 
00021          complex *b, complex *d__, complex *e, complex *z__, integer *ldz)
00022 {
00023     /* System generated locals */
00024     integer a_dim1, a_offset, b_dim1, b_offset, d_dim1, d_offset, e_dim1, 
00025             e_offset, z_dim1, z_offset, i__1, i__2, i__3, i__4, i__5;
00026     complex q__1;
00027 
00028     /* Local variables */
00029     integer i__, j, l, ik, jk, mn, mn2;
00030     extern /* Subroutine */ int claset_(char *, integer *, integer *, complex 
00031             *, complex *, complex *, integer *);
00032 
00033 
00034 /*  -- LAPACK test routine (version 3.1) -- */
00035 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00036 /*     November 2006 */
00037 
00038 /*     .. Scalar Arguments .. */
00039 /*     .. */
00040 /*     .. Array Arguments .. */
00041 /*     .. */
00042 
00043 /*  Purpose */
00044 /*  ======= */
00045 
00046 /*  Form the 2*M*N by 2*M*N matrix */
00047 
00048 /*         Z = [ kron(In, A)  -kron(B', Im) ] */
00049 /*             [ kron(In, D)  -kron(E', Im) ], */
00050 
00051 /*  where In is the identity matrix of size n and X' is the transpose */
00052 /*  of X. kron(X, Y) is the Kronecker product between the matrices X */
00053 /*  and Y. */
00054 
00055 /*  Arguments */
00056 /*  ========= */
00057 
00058 /*  M       (input) INTEGER */
00059 /*          Size of matrix, must be >= 1. */
00060 
00061 /*  N       (input) INTEGER */
00062 /*          Size of matrix, must be >= 1. */
00063 
00064 /*  A       (input) COMPLEX, dimension ( LDA, M ) */
00065 /*          The matrix A in the output matrix Z. */
00066 
00067 /*  LDA     (input) INTEGER */
00068 /*          The leading dimension of A, B, D, and E. ( LDA >= M+N ) */
00069 
00070 /*  B       (input) COMPLEX, dimension ( LDA, N ) */
00071 /*  D       (input) COMPLEX, dimension ( LDA, M ) */
00072 /*  E       (input) COMPLEX, dimension ( LDA, N ) */
00073 /*          The matrices used in forming the output matrix Z. */
00074 
00075 /*  Z       (output) COMPLEX, dimension ( LDZ, 2*M*N ) */
00076 /*          The resultant Kronecker M*N*2 by M*N*2 matrix (see above.) */
00077 
00078 /*  LDZ     (input) INTEGER */
00079 /*          The leading dimension of Z. ( LDZ >= 2*M*N ) */
00080 
00081 /*  ==================================================================== */
00082 
00083 /*     .. Parameters .. */
00084 /*     .. */
00085 /*     .. Local Scalars .. */
00086 /*     .. */
00087 /*     .. External Subroutines .. */
00088 /*     .. */
00089 /*     .. Executable Statements .. */
00090 
00091 /*     Initialize Z */
00092 
00093     /* Parameter adjustments */
00094     e_dim1 = *lda;
00095     e_offset = 1 + e_dim1;
00096     e -= e_offset;
00097     d_dim1 = *lda;
00098     d_offset = 1 + d_dim1;
00099     d__ -= d_offset;
00100     b_dim1 = *lda;
00101     b_offset = 1 + b_dim1;
00102     b -= b_offset;
00103     a_dim1 = *lda;
00104     a_offset = 1 + a_dim1;
00105     a -= a_offset;
00106     z_dim1 = *ldz;
00107     z_offset = 1 + z_dim1;
00108     z__ -= z_offset;
00109 
00110     /* Function Body */
00111     mn = *m * *n;
00112     mn2 = mn << 1;
00113     claset_("Full", &mn2, &mn2, &c_b1, &c_b1, &z__[z_offset], ldz);
00114 
00115     ik = 1;
00116     i__1 = *n;
00117     for (l = 1; l <= i__1; ++l) {
00118 
00119 /*        form kron(In, A) */
00120 
00121         i__2 = *m;
00122         for (i__ = 1; i__ <= i__2; ++i__) {
00123             i__3 = *m;
00124             for (j = 1; j <= i__3; ++j) {
00125                 i__4 = ik + i__ - 1 + (ik + j - 1) * z_dim1;
00126                 i__5 = i__ + j * a_dim1;
00127                 z__[i__4].r = a[i__5].r, z__[i__4].i = a[i__5].i;
00128 /* L10: */
00129             }
00130 /* L20: */
00131         }
00132 
00133 /*        form kron(In, D) */
00134 
00135         i__2 = *m;
00136         for (i__ = 1; i__ <= i__2; ++i__) {
00137             i__3 = *m;
00138             for (j = 1; j <= i__3; ++j) {
00139                 i__4 = ik + mn + i__ - 1 + (ik + j - 1) * z_dim1;
00140                 i__5 = i__ + j * d_dim1;
00141                 z__[i__4].r = d__[i__5].r, z__[i__4].i = d__[i__5].i;
00142 /* L30: */
00143             }
00144 /* L40: */
00145         }
00146 
00147         ik += *m;
00148 /* L50: */
00149     }
00150 
00151     ik = 1;
00152     i__1 = *n;
00153     for (l = 1; l <= i__1; ++l) {
00154         jk = mn + 1;
00155 
00156         i__2 = *n;
00157         for (j = 1; j <= i__2; ++j) {
00158 
00159 /*           form -kron(B', Im) */
00160 
00161             i__3 = *m;
00162             for (i__ = 1; i__ <= i__3; ++i__) {
00163                 i__4 = ik + i__ - 1 + (jk + i__ - 1) * z_dim1;
00164                 i__5 = j + l * b_dim1;
00165                 q__1.r = -b[i__5].r, q__1.i = -b[i__5].i;
00166                 z__[i__4].r = q__1.r, z__[i__4].i = q__1.i;
00167 /* L60: */
00168             }
00169 
00170 /*           form -kron(E', Im) */
00171 
00172             i__3 = *m;
00173             for (i__ = 1; i__ <= i__3; ++i__) {
00174                 i__4 = ik + mn + i__ - 1 + (jk + i__ - 1) * z_dim1;
00175                 i__5 = j + l * e_dim1;
00176                 q__1.r = -e[i__5].r, q__1.i = -e[i__5].i;
00177                 z__[i__4].r = q__1.r, z__[i__4].i = q__1.i;
00178 /* L70: */
00179             }
00180 
00181             jk += *m;
00182 /* L80: */
00183         }
00184 
00185         ik += *m;
00186 /* L90: */
00187     }
00188 
00189     return 0;
00190 
00191 /*     End of CLAKF2 */
00192 
00193 } /* clakf2_ */


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:55:30