drot.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* drot.f -- translated by f2c (version 20061008).
  2. You must link the resulting object file with libf2c:
  3. on Microsoft Windows system, link with libf2c.lib;
  4. on Linux or Unix systems, link with .../path/to/libf2c.a -lm
  5. or, if you install libf2c.a in a standard place, with -lf2c -lm
  6. -- in that order, at the end of the command line, as in
  7. cc *.o -lf2c -lm
  8. Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
  9. http://www.netlib.org/f2c/libf2c.zip
  10. */
  11. #include "f2c.h"
  12. #include "blaswrap.h"
  13. /* Subroutine */ int drot_(integer *n, doublereal *dx, integer *incx,
  14. doublereal *dy, integer *incy, doublereal *c__, doublereal *s)
  15. {
  16. /* System generated locals */
  17. integer i__1;
  18. /* Local variables */
  19. integer i__, ix, iy;
  20. doublereal dtemp;
  21. /* .. Scalar Arguments .. */
  22. /* .. */
  23. /* .. Array Arguments .. */
  24. /* .. */
  25. /* Purpose */
  26. /* ======= */
  27. /* applies a plane rotation. */
  28. /* jack dongarra, linpack, 3/11/78. */
  29. /* modified 12/3/93, array(1) declarations changed to array(*) */
  30. /* .. Local Scalars .. */
  31. /* .. */
  32. /* Parameter adjustments */
  33. --dy;
  34. --dx;
  35. /* Function Body */
  36. if (*n <= 0) {
  37. return 0;
  38. }
  39. if (*incx == 1 && *incy == 1) {
  40. goto L20;
  41. }
  42. /* code for unequal increments or equal increments not equal */
  43. /* to 1 */
  44. ix = 1;
  45. iy = 1;
  46. if (*incx < 0) {
  47. ix = (-(*n) + 1) * *incx + 1;
  48. }
  49. if (*incy < 0) {
  50. iy = (-(*n) + 1) * *incy + 1;
  51. }
  52. i__1 = *n;
  53. for (i__ = 1; i__ <= i__1; ++i__) {
  54. dtemp = *c__ * dx[ix] + *s * dy[iy];
  55. dy[iy] = *c__ * dy[iy] - *s * dx[ix];
  56. dx[ix] = dtemp;
  57. ix += *incx;
  58. iy += *incy;
  59. /* L10: */
  60. }
  61. return 0;
  62. /* code for both increments equal to 1 */
  63. L20:
  64. i__1 = *n;
  65. for (i__ = 1; i__ <= i__1; ++i__) {
  66. dtemp = *c__ * dx[i__] + *s * dy[i__];
  67. dy[i__] = *c__ * dy[i__] - *s * dx[i__];
  68. dx[i__] = dtemp;
  69. /* L30: */
  70. }
  71. return 0;
  72. } /* drot_ */