clacrm.c
Go to the documentation of this file.
00001 /* clacrm.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_b6 = 1.f;
00019 static real c_b7 = 0.f;
00020 
00021 /* Subroutine */ int clacrm_(integer *m, integer *n, complex *a, integer *lda, 
00022          real *b, integer *ldb, complex *c__, integer *ldc, real *rwork)
00023 {
00024     /* System generated locals */
00025     integer b_dim1, b_offset, a_dim1, a_offset, c_dim1, c_offset, i__1, i__2, 
00026             i__3, i__4, i__5;
00027     real r__1;
00028     complex q__1;
00029 
00030     /* Builtin functions */
00031     double r_imag(complex *);
00032 
00033     /* Local variables */
00034     integer i__, j, l;
00035     extern /* Subroutine */ int sgemm_(char *, char *, integer *, integer *, 
00036             integer *, real *, real *, integer *, real *, integer *, real *, 
00037             real *, integer *);
00038 
00039 
00040 /*  -- LAPACK auxiliary routine (version 3.2) -- */
00041 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00042 /*     November 2006 */
00043 
00044 /*     .. Scalar Arguments .. */
00045 /*     .. */
00046 /*     .. Array Arguments .. */
00047 /*     .. */
00048 
00049 /*  Purpose */
00050 /*  ======= */
00051 
00052 /*  CLACRM performs a very simple matrix-matrix multiplication: */
00053 /*           C := A * B, */
00054 /*  where A is M by N and complex; B is N by N and real; */
00055 /*  C is M by N and complex. */
00056 
00057 /*  Arguments */
00058 /*  ========= */
00059 
00060 /*  M       (input) INTEGER */
00061 /*          The number of rows of the matrix A and of the matrix C. */
00062 /*          M >= 0. */
00063 
00064 /*  N       (input) INTEGER */
00065 /*          The number of columns and rows of the matrix B and */
00066 /*          the number of columns of the matrix C. */
00067 /*          N >= 0. */
00068 
00069 /*  A       (input) COMPLEX array, dimension (LDA, N) */
00070 /*          A contains the M by N matrix A. */
00071 
00072 /*  LDA     (input) INTEGER */
00073 /*          The leading dimension of the array A. LDA >=max(1,M). */
00074 
00075 /*  B       (input) REAL array, dimension (LDB, N) */
00076 /*          B contains the N by N matrix B. */
00077 
00078 /*  LDB     (input) INTEGER */
00079 /*          The leading dimension of the array B. LDB >=max(1,N). */
00080 
00081 /*  C       (input) COMPLEX array, dimension (LDC, N) */
00082 /*          C contains the M by N matrix C. */
00083 
00084 /*  LDC     (input) INTEGER */
00085 /*          The leading dimension of the array C. LDC >=max(1,N). */
00086 
00087 /*  RWORK   (workspace) REAL array, dimension (2*M*N) */
00088 
00089 /*  ===================================================================== */
00090 
00091 /*     .. Parameters .. */
00092 /*     .. */
00093 /*     .. Local Scalars .. */
00094 /*     .. */
00095 /*     .. Intrinsic Functions .. */
00096 /*     .. */
00097 /*     .. External Subroutines .. */
00098 /*     .. */
00099 /*     .. Executable Statements .. */
00100 
00101 /*     Quick return if possible. */
00102 
00103     /* Parameter adjustments */
00104     a_dim1 = *lda;
00105     a_offset = 1 + a_dim1;
00106     a -= a_offset;
00107     b_dim1 = *ldb;
00108     b_offset = 1 + b_dim1;
00109     b -= b_offset;
00110     c_dim1 = *ldc;
00111     c_offset = 1 + c_dim1;
00112     c__ -= c_offset;
00113     --rwork;
00114 
00115     /* Function Body */
00116     if (*m == 0 || *n == 0) {
00117         return 0;
00118     }
00119 
00120     i__1 = *n;
00121     for (j = 1; j <= i__1; ++j) {
00122         i__2 = *m;
00123         for (i__ = 1; i__ <= i__2; ++i__) {
00124             i__3 = i__ + j * a_dim1;
00125             rwork[(j - 1) * *m + i__] = a[i__3].r;
00126 /* L10: */
00127         }
00128 /* L20: */
00129     }
00130 
00131     l = *m * *n + 1;
00132     sgemm_("N", "N", m, n, n, &c_b6, &rwork[1], m, &b[b_offset], ldb, &c_b7, &
00133             rwork[l], m);
00134     i__1 = *n;
00135     for (j = 1; j <= i__1; ++j) {
00136         i__2 = *m;
00137         for (i__ = 1; i__ <= i__2; ++i__) {
00138             i__3 = i__ + j * c_dim1;
00139             i__4 = l + (j - 1) * *m + i__ - 1;
00140             c__[i__3].r = rwork[i__4], c__[i__3].i = 0.f;
00141 /* L30: */
00142         }
00143 /* L40: */
00144     }
00145 
00146     i__1 = *n;
00147     for (j = 1; j <= i__1; ++j) {
00148         i__2 = *m;
00149         for (i__ = 1; i__ <= i__2; ++i__) {
00150             rwork[(j - 1) * *m + i__] = r_imag(&a[i__ + j * a_dim1]);
00151 /* L50: */
00152         }
00153 /* L60: */
00154     }
00155     sgemm_("N", "N", m, n, n, &c_b6, &rwork[1], m, &b[b_offset], ldb, &c_b7, &
00156             rwork[l], m);
00157     i__1 = *n;
00158     for (j = 1; j <= i__1; ++j) {
00159         i__2 = *m;
00160         for (i__ = 1; i__ <= i__2; ++i__) {
00161             i__3 = i__ + j * c_dim1;
00162             i__4 = i__ + j * c_dim1;
00163             r__1 = c__[i__4].r;
00164             i__5 = l + (j - 1) * *m + i__ - 1;
00165             q__1.r = r__1, q__1.i = rwork[i__5];
00166             c__[i__3].r = q__1.r, c__[i__3].i = q__1.i;
00167 /* L70: */
00168         }
00169 /* L80: */
00170     }
00171 
00172     return 0;
00173 
00174 /*     End of CLACRM */
00175 
00176 } /* clacrm_ */


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