00001 /* DLACPY.F -- translated by f2c (version 19941215). 00002 You must link the resulting object file with the libraries: 00003 -lf2c -lm (in that order) 00004 */ 00005 00006 #include "f2c.h" 00007 00008 /* Subroutine */ int dlacpy_(uplo, m, n, a, lda, b, ldb, uplo_len) 00009 char *uplo; 00010 integer *m, *n; 00011 doublereal *a; 00012 integer *lda; 00013 doublereal *b; 00014 integer *ldb; 00015 ftnlen uplo_len; 00016 { 00017 /* System generated locals */ 00018 integer a_dim1, a_offset, b_dim1, b_offset, i__1, i__2; 00019 00020 /* Local variables */ 00021 static integer i, j; 00022 extern logical lsame_(); 00023 00024 00025 /* -- LAPACK auxiliary routine (version 1.1) -- */ 00026 /* Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., */ 00027 /* Courant Institute, Argonne National Lab, and Rice University */ 00028 /* February 29, 1992 */ 00029 00030 /* .. Scalar Arguments .. */ 00031 /* .. */ 00032 /* .. Array Arguments .. */ 00033 /* .. */ 00034 00035 /* Purpose */ 00036 /* ======= */ 00037 00038 /* DLACPY copies all or part of a two-dimensional matrix A to another */ 00039 /* matrix B. */ 00040 00041 /* Arguments */ 00042 /* ========= */ 00043 00044 /* UPLO (input) CHARACTER*1 */ 00045 /* Specifies the part of the matrix A to be copied to B. */ 00046 /* = 'U': Upper triangular part */ 00047 /* = 'L': Lower triangular part */ 00048 /* Otherwise: All of the matrix A */ 00049 00050 /* M (input) INTEGER */ 00051 /* The number of rows of the matrix A. M >= 0. */ 00052 00053 /* N (input) INTEGER */ 00054 /* The number of columns of the matrix A. N >= 0. */ 00055 00056 /* A (input) DOUBLE PRECISION array, dimension (LDA,N) */ 00057 /* The m by n matrix A. If UPLO = 'U', only the upper triangle 00058 */ 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) DOUBLE PRECISION 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 00074 /* .. Local Scalars .. */ 00075 /* .. */ 00076 /* .. External Functions .. */ 00077 /* .. */ 00078 /* .. Intrinsic Functions .. */ 00079 /* .. */ 00080 /* .. Executable Statements .. */ 00081 00082 /* Parameter adjustments */ 00083 a_dim1 = *lda; 00084 a_offset = a_dim1 + 1; 00085 a -= a_offset; 00086 b_dim1 = *ldb; 00087 b_offset = b_dim1 + 1; 00088 b -= b_offset; 00089 00090 /* Function Body */ 00091 if (lsame_(uplo, "U", 1L, 1L)) { 00092 i__1 = *n; 00093 for (j = 1; j <= i__1; ++j) { 00094 i__2 = min(j,*m); 00095 for (i = 1; i <= i__2; ++i) { 00096 b[i + j * b_dim1] = a[i + j * a_dim1]; 00097 /* L10: */ 00098 } 00099 /* L20: */ 00100 } 00101 } else if (lsame_(uplo, "L", 1L, 1L)) { 00102 i__1 = *n; 00103 for (j = 1; j <= i__1; ++j) { 00104 i__2 = *m; 00105 for (i = j; i <= i__2; ++i) { 00106 b[i + j * b_dim1] = a[i + j * a_dim1]; 00107 /* L30: */ 00108 } 00109 /* L40: */ 00110 } 00111 } else { 00112 i__1 = *n; 00113 for (j = 1; j <= i__1; ++j) { 00114 i__2 = *m; 00115 for (i = 1; i <= i__2; ++i) { 00116 b[i + j * b_dim1] = a[i + j * a_dim1]; 00117 /* L50: */ 00118 } 00119 /* L60: */ 00120 } 00121 } 00122 return 0; 00123 00124 /* End of DLACPY */ 00125 00126 } /* dlacpy_ */ 00127