dlar2v.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /* dlar2v.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 _starpu_dlar2v_(integer *n, doublereal *x, doublereal *y,
  14. doublereal *z__, integer *incx, doublereal *c__, doublereal *s,
  15. integer *incc)
  16. {
  17. /* System generated locals */
  18. integer i__1;
  19. /* Local variables */
  20. integer i__;
  21. doublereal t1, t2, t3, t4, t5, t6;
  22. integer ic;
  23. doublereal ci, si;
  24. integer ix;
  25. doublereal xi, yi, zi;
  26. /* -- LAPACK auxiliary routine (version 3.2) -- */
  27. /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
  28. /* November 2006 */
  29. /* .. Scalar Arguments .. */
  30. /* .. */
  31. /* .. Array Arguments .. */
  32. /* .. */
  33. /* Purpose */
  34. /* ======= */
  35. /* DLAR2V applies a vector of real plane rotations from both sides to */
  36. /* a sequence of 2-by-2 real symmetric matrices, defined by the elements */
  37. /* of the vectors x, y and z. For i = 1,2,...,n */
  38. /* ( x(i) z(i) ) := ( c(i) s(i) ) ( x(i) z(i) ) ( c(i) -s(i) ) */
  39. /* ( z(i) y(i) ) ( -s(i) c(i) ) ( z(i) y(i) ) ( s(i) c(i) ) */
  40. /* Arguments */
  41. /* ========= */
  42. /* N (input) INTEGER */
  43. /* The number of plane rotations to be applied. */
  44. /* X (input/output) DOUBLE PRECISION array, */
  45. /* dimension (1+(N-1)*INCX) */
  46. /* The vector x. */
  47. /* Y (input/output) DOUBLE PRECISION array, */
  48. /* dimension (1+(N-1)*INCX) */
  49. /* The vector y. */
  50. /* Z (input/output) DOUBLE PRECISION array, */
  51. /* dimension (1+(N-1)*INCX) */
  52. /* The vector z. */
  53. /* INCX (input) INTEGER */
  54. /* The increment between elements of X, Y and Z. INCX > 0. */
  55. /* C (input) DOUBLE PRECISION array, dimension (1+(N-1)*INCC) */
  56. /* The cosines of the plane rotations. */
  57. /* S (input) DOUBLE PRECISION array, dimension (1+(N-1)*INCC) */
  58. /* The sines of the plane rotations. */
  59. /* INCC (input) INTEGER */
  60. /* The increment between elements of C and S. INCC > 0. */
  61. /* ===================================================================== */
  62. /* .. Local Scalars .. */
  63. /* .. */
  64. /* .. Executable Statements .. */
  65. /* Parameter adjustments */
  66. --s;
  67. --c__;
  68. --z__;
  69. --y;
  70. --x;
  71. /* Function Body */
  72. ix = 1;
  73. ic = 1;
  74. i__1 = *n;
  75. for (i__ = 1; i__ <= i__1; ++i__) {
  76. xi = x[ix];
  77. yi = y[ix];
  78. zi = z__[ix];
  79. ci = c__[ic];
  80. si = s[ic];
  81. t1 = si * zi;
  82. t2 = ci * zi;
  83. t3 = t2 - si * xi;
  84. t4 = t2 + si * yi;
  85. t5 = ci * xi + t1;
  86. t6 = ci * yi - t1;
  87. x[ix] = ci * t5 + si * t4;
  88. y[ix] = ci * t6 - si * t3;
  89. z__[ix] = ci * t4 - si * t5;
  90. ix += *incx;
  91. ic += *incc;
  92. /* L10: */
  93. }
  94. /* End of DLAR2V */
  95. return 0;
  96. } /* _starpu_dlar2v_ */