c@427: /* dlaswp.f -- translated by f2c (version 20061008). c@427: You must link the resulting object file with libf2c: c@427: on Microsoft Windows system, link with libf2c.lib; c@427: on Linux or Unix systems, link with .../path/to/libf2c.a -lm c@427: or, if you install libf2c.a in a standard place, with -lf2c -lm c@427: -- in that order, at the end of the command line, as in c@427: cc *.o -lf2c -lm c@427: Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., c@427: c@427: http://www.netlib.org/f2c/libf2c.zip c@427: */ c@427: c@427: #include "f2c.h" c@427: #include "blaswrap.h" c@427: c@427: /* Subroutine */ int dlaswp_(integer *n, doublereal *a, integer *lda, integer c@427: *k1, integer *k2, integer *ipiv, integer *incx) c@427: { c@427: /* System generated locals */ c@427: integer a_dim1, a_offset, i__1, i__2, i__3, i__4; c@427: c@427: /* Local variables */ c@427: integer i__, j, k, i1, i2, n32, ip, ix, ix0, inc; c@427: doublereal temp; c@427: c@427: c@427: /* -- LAPACK auxiliary routine (version 3.2) -- */ c@427: /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */ c@427: /* November 2006 */ c@427: c@427: /* .. Scalar Arguments .. */ c@427: /* .. */ c@427: /* .. Array Arguments .. */ c@427: /* .. */ c@427: c@427: /* Purpose */ c@427: /* ======= */ c@427: c@427: /* DLASWP performs a series of row interchanges on the matrix A. */ c@427: /* One row interchange is initiated for each of rows K1 through K2 of A. */ c@427: c@427: /* Arguments */ c@427: /* ========= */ c@427: c@427: /* N (input) INTEGER */ c@427: /* The number of columns of the matrix A. */ c@427: c@427: /* A (input/output) DOUBLE PRECISION array, dimension (LDA,N) */ c@427: /* On entry, the matrix of column dimension N to which the row */ c@427: /* interchanges will be applied. */ c@427: /* On exit, the permuted matrix. */ c@427: c@427: /* LDA (input) INTEGER */ c@427: /* The leading dimension of the array A. */ c@427: c@427: /* K1 (input) INTEGER */ c@427: /* The first element of IPIV for which a row interchange will */ c@427: /* be done. */ c@427: c@427: /* K2 (input) INTEGER */ c@427: /* The last element of IPIV for which a row interchange will */ c@427: /* be done. */ c@427: c@427: /* IPIV (input) INTEGER array, dimension (K2*abs(INCX)) */ c@427: /* The vector of pivot indices. Only the elements in positions */ c@427: /* K1 through K2 of IPIV are accessed. */ c@427: /* IPIV(K) = L implies rows K and L are to be interchanged. */ c@427: c@427: /* INCX (input) INTEGER */ c@427: /* The increment between successive values of IPIV. If IPIV */ c@427: /* is negative, the pivots are applied in reverse order. */ c@427: c@427: /* Further Details */ c@427: /* =============== */ c@427: c@427: /* Modified by */ c@427: /* R. C. Whaley, Computer Science Dept., Univ. of Tenn., Knoxville, USA */ c@427: c@427: /* ===================================================================== */ c@427: c@427: /* .. Local Scalars .. */ c@427: /* .. */ c@427: /* .. Executable Statements .. */ c@427: c@427: /* Interchange row I with row IPIV(I) for each of rows K1 through K2. */ c@427: c@427: /* Parameter adjustments */ c@427: a_dim1 = *lda; c@427: a_offset = 1 + a_dim1; c@427: a -= a_offset; c@427: --ipiv; c@427: c@427: /* Function Body */ c@427: if (*incx > 0) { c@427: ix0 = *k1; c@427: i1 = *k1; c@427: i2 = *k2; c@427: inc = 1; c@427: } else if (*incx < 0) { c@427: ix0 = (1 - *k2) * *incx + 1; c@427: i1 = *k2; c@427: i2 = *k1; c@427: inc = -1; c@427: } else { c@427: return 0; c@427: } c@427: c@427: n32 = *n / 32 << 5; c@427: if (n32 != 0) { c@427: i__1 = n32; c@427: for (j = 1; j <= i__1; j += 32) { c@427: ix = ix0; c@427: i__2 = i2; c@427: i__3 = inc; c@427: for (i__ = i1; i__3 < 0 ? i__ >= i__2 : i__ <= i__2; i__ += i__3) c@427: { c@427: ip = ipiv[ix]; c@427: if (ip != i__) { c@427: i__4 = j + 31; c@427: for (k = j; k <= i__4; ++k) { c@427: temp = a[i__ + k * a_dim1]; c@427: a[i__ + k * a_dim1] = a[ip + k * a_dim1]; c@427: a[ip + k * a_dim1] = temp; c@427: /* L10: */ c@427: } c@427: } c@427: ix += *incx; c@427: /* L20: */ c@427: } c@427: /* L30: */ c@427: } c@427: } c@427: if (n32 != *n) { c@427: ++n32; c@427: ix = ix0; c@427: i__1 = i2; c@427: i__3 = inc; c@427: for (i__ = i1; i__3 < 0 ? i__ >= i__1 : i__ <= i__1; i__ += i__3) { c@427: ip = ipiv[ix]; c@427: if (ip != i__) { c@427: i__2 = *n; c@427: for (k = n32; k <= i__2; ++k) { c@427: temp = a[i__ + k * a_dim1]; c@427: a[i__ + k * a_dim1] = a[ip + k * a_dim1]; c@427: a[ip + k * a_dim1] = temp; c@427: /* L40: */ c@427: } c@427: } c@427: ix += *incx; c@427: /* L50: */ c@427: } c@427: } c@427: c@427: return 0; c@427: c@427: /* End of DLASWP */ c@427: c@427: } /* dlaswp_ */