dlakf2.c
Go to the documentation of this file.
00001 /* dlakf2.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 doublereal c_b3 = 0.;
00019 
00020 /* Subroutine */ int dlakf2_(integer *m, integer *n, doublereal *a, integer *
00021         lda, doublereal *b, doublereal *d__, doublereal *e, doublereal *z__, 
00022         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;
00027 
00028     /* Local variables */
00029     integer i__, j, l, ik, jk, mn, mn2;
00030     extern /* Subroutine */ int dlaset_(char *, integer *, integer *, 
00031             doublereal *, doublereal *, doublereal *, 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) DOUBLE PRECISION, 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) DOUBLE PRECISION, dimension ( LDA, N ) */
00071 /*  D       (input) DOUBLE PRECISION, dimension ( LDA, M ) */
00072 /*  E       (input) DOUBLE PRECISION, dimension ( LDA, N ) */
00073 /*          The matrices used in forming the output matrix Z. */
00074 
00075 /*  Z       (output) DOUBLE PRECISION, 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     dlaset_("Full", &mn2, &mn2, &c_b3, &c_b3, &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                 z__[ik + i__ - 1 + (ik + j - 1) * z_dim1] = a[i__ + j * 
00126                         a_dim1];
00127 /* L10: */
00128             }
00129 /* L20: */
00130         }
00131 
00132 /*        form kron(In, D) */
00133 
00134         i__2 = *m;
00135         for (i__ = 1; i__ <= i__2; ++i__) {
00136             i__3 = *m;
00137             for (j = 1; j <= i__3; ++j) {
00138                 z__[ik + mn + i__ - 1 + (ik + j - 1) * z_dim1] = d__[i__ + j *
00139                          d_dim1];
00140 /* L30: */
00141             }
00142 /* L40: */
00143         }
00144 
00145         ik += *m;
00146 /* L50: */
00147     }
00148 
00149     ik = 1;
00150     i__1 = *n;
00151     for (l = 1; l <= i__1; ++l) {
00152         jk = mn + 1;
00153 
00154         i__2 = *n;
00155         for (j = 1; j <= i__2; ++j) {
00156 
00157 /*           form -kron(B', Im) */
00158 
00159             i__3 = *m;
00160             for (i__ = 1; i__ <= i__3; ++i__) {
00161                 z__[ik + i__ - 1 + (jk + i__ - 1) * z_dim1] = -b[j + l * 
00162                         b_dim1];
00163 /* L60: */
00164             }
00165 
00166 /*           form -kron(E', Im) */
00167 
00168             i__3 = *m;
00169             for (i__ = 1; i__ <= i__3; ++i__) {
00170                 z__[ik + mn + i__ - 1 + (jk + i__ - 1) * z_dim1] = -e[j + l * 
00171                         e_dim1];
00172 /* L70: */
00173             }
00174 
00175             jk += *m;
00176 /* L80: */
00177         }
00178 
00179         ik += *m;
00180 /* L90: */
00181     }
00182 
00183     return 0;
00184 
00185 /*     End of DLAKF2 */
00186 
00187 } /* dlakf2_ */


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