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


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