MCPcopy Create free account
hub / github.com/numpy/numpy / sswap_

Function sswap_

numpy/linalg/lapack_lite/f2c_blas.c:12500–12601  ·  view source on GitHub ↗

Subroutine */

Source from the content-addressed store, hash-verified

12498} /* sscal_ */
12499
12500/* Subroutine */ int sswap_(integer *n, real *sx, integer *incx, real *sy,
12501 integer *incy)
12502{
12503 /* System generated locals */
12504 integer i__1;
12505
12506 /* Local variables */
12507 static integer i__, m, ix, iy, mp1;
12508 static real stemp;
12509
12510
12511/*
12512 Purpose
12513 =======
12514
12515 interchanges two vectors.
12516 uses unrolled loops for increments equal to 1.
12517
12518 Further Details
12519 ===============
12520
12521 jack dongarra, linpack, 3/11/78.
12522 modified 12/3/93, array(1) declarations changed to array(*)
12523
12524 =====================================================================
12525*/
12526
12527 /* Parameter adjustments */
12528 --sy;
12529 --sx;
12530
12531 /* Function Body */
12532 if (*n <= 0) {
12533 return 0;
12534 }
12535 if (*incx == 1 && *incy == 1) {
12536 goto L20;
12537 }
12538
12539/*
12540 code for unequal increments or equal increments not equal
12541 to 1
12542*/
12543
12544 ix = 1;
12545 iy = 1;
12546 if (*incx < 0) {
12547 ix = (-(*n) + 1) * *incx + 1;
12548 }
12549 if (*incy < 0) {
12550 iy = (-(*n) + 1) * *incy + 1;
12551 }
12552 i__1 = *n;
12553 for (i__ = 1; i__ <= i__1; ++i__) {
12554 stemp = sx[ix];
12555 sx[ix] = sy[iy];
12556 sy[iy] = stemp;
12557 ix += *incx;

Callers 9

sbdsdc_Function · 0.85
sbdsqr_Function · 0.85
sgebak_Function · 0.85
sgebal_Function · 0.85
sgetf2_Function · 0.85
slasdq_Function · 0.85
slasy2_Function · 0.85
sstedc_Function · 0.85
ssteqr_Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected