zlakf2.c
Go to the documentation of this file.
00001 /* zlakf2.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 doublecomplex c_b1 = {0.,0.};
00019 
00020 /* Subroutine */ int zlakf2_(integer *m, integer *n, doublecomplex *a, 
00021         integer *lda, doublecomplex *b, doublecomplex *d__, doublecomplex *e, 
00022         doublecomplex *z__, integer *ldz)
00023 {
00024     /* System generated locals */
00025     integer a_dim1, a_offset, b_dim1, b_offset, d_dim1, d_offset, e_dim1, 
00026             e_offset, z_dim1, z_offset, i__1, i__2, i__3, i__4, i__5;
00027     doublecomplex z__1;
00028 
00029     /* Local variables */
00030     integer i__, j, l, ik, jk, mn, mn2;
00031     extern /* Subroutine */ int zlaset_(char *, integer *, integer *, 
00032             doublecomplex *, doublecomplex *, doublecomplex *, integer *);
00033 
00034 
00035 /*  -- LAPACK test routine (version 3.1) -- */
00036 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00037 /*     November 2006 */
00038 
00039 /*     .. Scalar Arguments .. */
00040 /*     .. */
00041 /*     .. Array Arguments .. */
00042 /*     .. */
00043 
00044 /*  Purpose */
00045 /*  ======= */
00046 
00047 /*  Form the 2*M*N by 2*M*N matrix */
00048 
00049 /*         Z = [ kron(In, A)  -kron(B', Im) ] */
00050 /*             [ kron(In, D)  -kron(E', Im) ], */
00051 
00052 /*  where In is the identity matrix of size n and X' is the transpose */
00053 /*  of X. kron(X, Y) is the Kronecker product between the matrices X */
00054 /*  and Y. */
00055 
00056 /*  Arguments */
00057 /*  ========= */
00058 
00059 /*  M       (input) INTEGER */
00060 /*          Size of matrix, must be >= 1. */
00061 
00062 /*  N       (input) INTEGER */
00063 /*          Size of matrix, must be >= 1. */
00064 
00065 /*  A       (input) COMPLEX*16, dimension ( LDA, M ) */
00066 /*          The matrix A in the output matrix Z. */
00067 
00068 /*  LDA     (input) INTEGER */
00069 /*          The leading dimension of A, B, D, and E. ( LDA >= M+N ) */
00070 
00071 /*  B       (input) COMPLEX*16, dimension ( LDA, N ) */
00072 /*  D       (input) COMPLEX*16, dimension ( LDA, M ) */
00073 /*  E       (input) COMPLEX*16, dimension ( LDA, N ) */
00074 /*          The matrices used in forming the output matrix Z. */
00075 
00076 /*  Z       (output) COMPLEX*16, dimension ( LDZ, 2*M*N ) */
00077 /*          The resultant Kronecker M*N*2 by M*N*2 matrix (see above.) */
00078 
00079 /*  LDZ     (input) INTEGER */
00080 /*          The leading dimension of Z. ( LDZ >= 2*M*N ) */
00081 
00082 /*  ==================================================================== */
00083 
00084 /*     .. Parameters .. */
00085 /*     .. */
00086 /*     .. Local Scalars .. */
00087 /*     .. */
00088 /*     .. External Subroutines .. */
00089 /*     .. */
00090 /*     .. Executable Statements .. */
00091 
00092 /*     Initialize Z */
00093 
00094     /* Parameter adjustments */
00095     e_dim1 = *lda;
00096     e_offset = 1 + e_dim1;
00097     e -= e_offset;
00098     d_dim1 = *lda;
00099     d_offset = 1 + d_dim1;
00100     d__ -= d_offset;
00101     b_dim1 = *lda;
00102     b_offset = 1 + b_dim1;
00103     b -= b_offset;
00104     a_dim1 = *lda;
00105     a_offset = 1 + a_dim1;
00106     a -= a_offset;
00107     z_dim1 = *ldz;
00108     z_offset = 1 + z_dim1;
00109     z__ -= z_offset;
00110 
00111     /* Function Body */
00112     mn = *m * *n;
00113     mn2 = mn << 1;
00114     zlaset_("Full", &mn2, &mn2, &c_b1, &c_b1, &z__[z_offset], ldz);
00115 
00116     ik = 1;
00117     i__1 = *n;
00118     for (l = 1; l <= i__1; ++l) {
00119 
00120 /*        form kron(In, A) */
00121 
00122         i__2 = *m;
00123         for (i__ = 1; i__ <= i__2; ++i__) {
00124             i__3 = *m;
00125             for (j = 1; j <= i__3; ++j) {
00126                 i__4 = ik + i__ - 1 + (ik + j - 1) * z_dim1;
00127                 i__5 = i__ + j * a_dim1;
00128                 z__[i__4].r = a[i__5].r, z__[i__4].i = a[i__5].i;
00129 /* L10: */
00130             }
00131 /* L20: */
00132         }
00133 
00134 /*        form kron(In, D) */
00135 
00136         i__2 = *m;
00137         for (i__ = 1; i__ <= i__2; ++i__) {
00138             i__3 = *m;
00139             for (j = 1; j <= i__3; ++j) {
00140                 i__4 = ik + mn + i__ - 1 + (ik + j - 1) * z_dim1;
00141                 i__5 = i__ + j * d_dim1;
00142                 z__[i__4].r = d__[i__5].r, z__[i__4].i = d__[i__5].i;
00143 /* L30: */
00144             }
00145 /* L40: */
00146         }
00147 
00148         ik += *m;
00149 /* L50: */
00150     }
00151 
00152     ik = 1;
00153     i__1 = *n;
00154     for (l = 1; l <= i__1; ++l) {
00155         jk = mn + 1;
00156 
00157         i__2 = *n;
00158         for (j = 1; j <= i__2; ++j) {
00159 
00160 /*           form -kron(B', Im) */
00161 
00162             i__3 = *m;
00163             for (i__ = 1; i__ <= i__3; ++i__) {
00164                 i__4 = ik + i__ - 1 + (jk + i__ - 1) * z_dim1;
00165                 i__5 = j + l * b_dim1;
00166                 z__1.r = -b[i__5].r, z__1.i = -b[i__5].i;
00167                 z__[i__4].r = z__1.r, z__[i__4].i = z__1.i;
00168 /* L60: */
00169             }
00170 
00171 /*           form -kron(E', Im) */
00172 
00173             i__3 = *m;
00174             for (i__ = 1; i__ <= i__3; ++i__) {
00175                 i__4 = ik + mn + i__ - 1 + (jk + i__ - 1) * z_dim1;
00176                 i__5 = j + l * e_dim1;
00177                 z__1.r = -e[i__5].r, z__1.i = -e[i__5].i;
00178                 z__[i__4].r = z__1.r, z__[i__4].i = z__1.i;
00179 /* L70: */
00180             }
00181 
00182             jk += *m;
00183 /* L80: */
00184         }
00185 
00186         ik += *m;
00187 /* L90: */
00188     }
00189 
00190     return 0;
00191 
00192 /*     End of ZLAKF2 */
00193 
00194 } /* zlakf2_ */


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:56:41