slacpy.c
Go to the documentation of this file.
00001 /* slacpy.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 /* Subroutine */ int slacpy_(char *uplo, integer *m, integer *n, real *a, 
00017         integer *lda, real *b, integer *ldb)
00018 {
00019     /* System generated locals */
00020     integer a_dim1, a_offset, b_dim1, b_offset, i__1, i__2;
00021 
00022     /* Local variables */
00023     integer i__, j;
00024     extern logical lsame_(char *, char *);
00025 
00026 
00027 /*  -- LAPACK auxiliary routine (version 3.2) -- */
00028 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00029 /*     November 2006 */
00030 
00031 /*     .. Scalar Arguments .. */
00032 /*     .. */
00033 /*     .. Array Arguments .. */
00034 /*     .. */
00035 
00036 /*  Purpose */
00037 /*  ======= */
00038 
00039 /*  SLACPY copies all or part of a two-dimensional matrix A to another */
00040 /*  matrix B. */
00041 
00042 /*  Arguments */
00043 /*  ========= */
00044 
00045 /*  UPLO    (input) CHARACTER*1 */
00046 /*          Specifies the part of the matrix A to be copied to B. */
00047 /*          = 'U':      Upper triangular part */
00048 /*          = 'L':      Lower triangular part */
00049 /*          Otherwise:  All of the matrix A */
00050 
00051 /*  M       (input) INTEGER */
00052 /*          The number of rows of the matrix A.  M >= 0. */
00053 
00054 /*  N       (input) INTEGER */
00055 /*          The number of columns of the matrix A.  N >= 0. */
00056 
00057 /*  A       (input) REAL array, dimension (LDA,N) */
00058 /*          The m by n matrix A.  If UPLO = 'U', only the upper triangle */
00059 /*          or trapezoid is accessed; if UPLO = 'L', only the lower */
00060 /*          triangle or trapezoid is accessed. */
00061 
00062 /*  LDA     (input) INTEGER */
00063 /*          The leading dimension of the array A.  LDA >= max(1,M). */
00064 
00065 /*  B       (output) REAL array, dimension (LDB,N) */
00066 /*          On exit, B = A in the locations specified by UPLO. */
00067 
00068 /*  LDB     (input) INTEGER */
00069 /*          The leading dimension of the array B.  LDB >= max(1,M). */
00070 
00071 /*  ===================================================================== */
00072 
00073 /*     .. Local Scalars .. */
00074 /*     .. */
00075 /*     .. External Functions .. */
00076 /*     .. */
00077 /*     .. Intrinsic Functions .. */
00078 /*     .. */
00079 /*     .. Executable Statements .. */
00080 
00081     /* Parameter adjustments */
00082     a_dim1 = *lda;
00083     a_offset = 1 + a_dim1;
00084     a -= a_offset;
00085     b_dim1 = *ldb;
00086     b_offset = 1 + b_dim1;
00087     b -= b_offset;
00088 
00089     /* Function Body */
00090     if (lsame_(uplo, "U")) {
00091         i__1 = *n;
00092         for (j = 1; j <= i__1; ++j) {
00093             i__2 = min(j,*m);
00094             for (i__ = 1; i__ <= i__2; ++i__) {
00095                 b[i__ + j * b_dim1] = a[i__ + j * a_dim1];
00096 /* L10: */
00097             }
00098 /* L20: */
00099         }
00100     } else if (lsame_(uplo, "L")) {
00101         i__1 = *n;
00102         for (j = 1; j <= i__1; ++j) {
00103             i__2 = *m;
00104             for (i__ = j; i__ <= i__2; ++i__) {
00105                 b[i__ + j * b_dim1] = a[i__ + j * a_dim1];
00106 /* L30: */
00107             }
00108 /* L40: */
00109         }
00110     } else {
00111         i__1 = *n;
00112         for (j = 1; j <= i__1; ++j) {
00113             i__2 = *m;
00114             for (i__ = 1; i__ <= i__2; ++i__) {
00115                 b[i__ + j * b_dim1] = a[i__ + j * a_dim1];
00116 /* L50: */
00117             }
00118 /* L60: */
00119         }
00120     }
00121     return 0;
00122 
00123 /*     End of SLACPY */
00124 
00125 } /* slacpy_ */


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