ctpttr.c
Go to the documentation of this file.
00001 /* ctpttr.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 ctpttr_(char *uplo, integer *n, complex *ap, complex *a, 
00017         integer *lda, integer *info)
00018 {
00019     /* System generated locals */
00020     integer a_dim1, a_offset, i__1, i__2, i__3, i__4;
00021 
00022     /* Local variables */
00023     integer i__, j, k;
00024     extern logical lsame_(char *, char *);
00025     logical lower;
00026     extern /* Subroutine */ int xerbla_(char *, integer *);
00027 
00028 
00029 /*  -- LAPACK routine (version 3.2)                                    -- */
00030 
00031 /*  -- Contributed by Julien Langou of the Univ. of Colorado Denver    -- */
00032 /*  -- November 2008                                                   -- */
00033 
00034 /*  -- LAPACK is a software package provided by Univ. of Tennessee,    -- */
00035 /*  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
00036 
00037 /*     .. Scalar Arguments .. */
00038 /*     .. */
00039 /*     .. Array Arguments .. */
00040 /*     .. */
00041 
00042 /*  Purpose */
00043 /*  ======= */
00044 
00045 /*  CTPTTR copies a triangular matrix A from standard packed format (TP) */
00046 /*  to standard full format (TR). */
00047 
00048 /*  Arguments */
00049 /*  ========= */
00050 
00051 /*  UPLO    (input) CHARACTER */
00052 /*          = 'U':  A is upper triangular. */
00053 /*          = 'L':  A is lower triangular. */
00054 
00055 /*  N       (input) INTEGER */
00056 /*          The order of the matrix A. N >= 0. */
00057 
00058 /*  AP      (input) COMPLEX array, dimension ( N*(N+1)/2 ), */
00059 /*          On entry, the upper or lower triangular matrix A, packed */
00060 /*          columnwise in a linear array. The j-th column of A is stored */
00061 /*          in the array AP as follows: */
00062 /*          if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j; */
00063 /*          if UPLO = 'L', AP(i + (j-1)*(2n-j)/2) = A(i,j) for j<=i<=n. */
00064 
00065 /*  A       (output) COMPLEX array, dimension ( LDA, N ) */
00066 /*          On exit, the triangular matrix A.  If UPLO = 'U', the leading */
00067 /*          N-by-N upper triangular part of A contains the upper */
00068 /*          triangular part of the matrix A, and the strictly lower */
00069 /*          triangular part of A is not referenced.  If UPLO = 'L', the */
00070 /*          leading N-by-N lower triangular part of A contains the lower */
00071 /*          triangular part of the matrix A, and the strictly upper */
00072 /*          triangular part of A is not referenced. */
00073 
00074 /*  LDA     (input) INTEGER */
00075 /*          The leading dimension of the array A.  LDA >= max(1,N). */
00076 
00077 /*  INFO    (output) INTEGER */
00078 /*          = 0:  successful exit */
00079 /*          < 0:  if INFO = -i, the i-th argument had an illegal value */
00080 
00081 /*  ===================================================================== */
00082 
00083 /*     .. Parameters .. */
00084 /*     .. */
00085 /*     .. Local Scalars .. */
00086 /*     .. */
00087 /*     .. External Functions .. */
00088 /*     .. */
00089 /*     .. External Subroutines .. */
00090 /*     .. */
00091 /*     .. Executable Statements .. */
00092 
00093 /*     Test the input parameters. */
00094 
00095     /* Parameter adjustments */
00096     --ap;
00097     a_dim1 = *lda;
00098     a_offset = 1 + a_dim1;
00099     a -= a_offset;
00100 
00101     /* Function Body */
00102     *info = 0;
00103     lower = lsame_(uplo, "L");
00104     if (! lower && ! lsame_(uplo, "U")) {
00105         *info = -1;
00106     } else if (*n < 0) {
00107         *info = -2;
00108     } else if (*lda < max(1,*n)) {
00109         *info = -5;
00110     }
00111     if (*info != 0) {
00112         i__1 = -(*info);
00113         xerbla_("CTPTTR", &i__1);
00114         return 0;
00115     }
00116 
00117     if (lower) {
00118         k = 0;
00119         i__1 = *n;
00120         for (j = 1; j <= i__1; ++j) {
00121             i__2 = *n;
00122             for (i__ = j; i__ <= i__2; ++i__) {
00123                 ++k;
00124                 i__3 = i__ + j * a_dim1;
00125                 i__4 = k;
00126                 a[i__3].r = ap[i__4].r, a[i__3].i = ap[i__4].i;
00127             }
00128         }
00129     } else {
00130         k = 0;
00131         i__1 = *n;
00132         for (j = 1; j <= i__1; ++j) {
00133             i__2 = j;
00134             for (i__ = 1; i__ <= i__2; ++i__) {
00135                 ++k;
00136                 i__3 = i__ + j * a_dim1;
00137                 i__4 = k;
00138                 a[i__3].r = ap[i__4].r, a[i__3].i = ap[i__4].i;
00139             }
00140         }
00141     }
00142 
00143 
00144     return 0;
00145 
00146 /*     End of CTPTTR */
00147 
00148 } /* ctpttr_ */


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