dla_wwaddw.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /* _starpu_dla_wwaddw.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_dla_wwaddw__(integer *n, doublereal *x, doublereal *y,
  14. doublereal *w)
  15. {
  16. /* System generated locals */
  17. integer i__1;
  18. /* Local variables */
  19. integer i__;
  20. doublereal s;
  21. /* -- LAPACK routine (version 3.2) -- */
  22. /* -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- */
  23. /* -- Jason Riedy of Univ. of California Berkeley. -- */
  24. /* -- November 2008 -- */
  25. /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */
  26. /* -- Univ. of California Berkeley and NAG Ltd. -- */
  27. /* .. */
  28. /* .. Scalar Arguments .. */
  29. /* .. */
  30. /* .. Array Arguments .. */
  31. /* .. */
  32. /* Purpose */
  33. /* ======= */
  34. /* DLA_WWADDW adds a vector W into a doubled-single vector (X, Y). */
  35. /* This works for all extant IBM's hex and binary floating point */
  36. /* arithmetics, but not for decimal. */
  37. /* Arguments */
  38. /* ========= */
  39. /* N (input) INTEGER */
  40. /* The length of vectors X, Y, and W. */
  41. /* X, Y (input/output) DOUBLE PRECISION array, length N */
  42. /* The doubled-single accumulation vector. */
  43. /* W (input) DOUBLE PRECISION array, length N */
  44. /* The vector to be added. */
  45. /* .. */
  46. /* .. Local Scalars .. */
  47. /* .. */
  48. /* .. Executable Statements .. */
  49. /* Parameter adjustments */
  50. --w;
  51. --y;
  52. --x;
  53. /* Function Body */
  54. i__1 = *n;
  55. for (i__ = 1; i__ <= i__1; ++i__) {
  56. s = x[i__] + w[i__];
  57. s = s + s - s;
  58. y[i__] = x[i__] - s + w[i__] + y[i__];
  59. x[i__] = s;
  60. /* L10: */
  61. }
  62. return 0;
  63. } /* _starpu_dla_wwaddw__ */