dlascl2.c 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /* dlascl2.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_dlascl2_(integer *m, integer *n, doublereal *d__,
  14. doublereal *x, integer *ldx)
  15. {
  16. /* System generated locals */
  17. integer x_dim1, x_offset, i__1, i__2;
  18. /* Local variables */
  19. integer i__, j;
  20. /* -- LAPACK routine (version 3.2.1) -- */
  21. /* -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- */
  22. /* -- Jason Riedy of Univ. of California Berkeley. -- */
  23. /* -- April 2009 -- */
  24. /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */
  25. /* -- Univ. of California Berkeley and NAG Ltd. -- */
  26. /* .. */
  27. /* .. Scalar Arguments .. */
  28. /* .. */
  29. /* .. Array Arguments .. */
  30. /* .. */
  31. /* Purpose */
  32. /* ======= */
  33. /* DLASCL2 performs a diagonal scaling on a vector: */
  34. /* x <-- D * x */
  35. /* where the diagonal matrix D is stored as a vector. */
  36. /* Eventually to be replaced by BLAS_dge_diag_scale in the new BLAS */
  37. /* standard. */
  38. /* Arguments */
  39. /* ========= */
  40. /* M (input) INTEGER */
  41. /* The number of rows of D and X. M >= 0. */
  42. /* N (input) INTEGER */
  43. /* The number of columns of D and X. N >= 0. */
  44. /* D (input) DOUBLE PRECISION array, length M */
  45. /* Diagonal matrix D, stored as a vector of length M. */
  46. /* X (input/output) DOUBLE PRECISION array, dimension (LDX,N) */
  47. /* On entry, the vector X to be scaled by D. */
  48. /* On exit, the scaled vector. */
  49. /* LDX (input) INTEGER */
  50. /* The leading dimension of the vector X. LDX >= 0. */
  51. /* ===================================================================== */
  52. /* .. Local Scalars .. */
  53. /* .. */
  54. /* .. Executable Statements .. */
  55. /* Parameter adjustments */
  56. --d__;
  57. x_dim1 = *ldx;
  58. x_offset = 1 + x_dim1;
  59. x -= x_offset;
  60. /* Function Body */
  61. i__1 = *n;
  62. for (j = 1; j <= i__1; ++j) {
  63. i__2 = *m;
  64. for (i__ = 1; i__ <= i__2; ++i__) {
  65. x[i__ + j * x_dim1] *= d__[i__];
  66. }
  67. }
  68. return 0;
  69. } /* _starpu_dlascl2_ */