iladlr.c 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /* iladlr.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. integer _starpu_iladlr_(integer *m, integer *n, doublereal *a, integer *lda)
  14. {
  15. /* System generated locals */
  16. integer a_dim1, a_offset, ret_val, i__1;
  17. /* Local variables */
  18. integer i__, j;
  19. /* -- LAPACK auxiliary routine (version 3.2.1) -- */
  20. /* -- April 2009 -- */
  21. /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */
  22. /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
  23. /* .. Scalar Arguments .. */
  24. /* .. */
  25. /* .. Array Arguments .. */
  26. /* .. */
  27. /* Purpose */
  28. /* ======= */
  29. /* ILADLR scans A for its last non-zero row. */
  30. /* Arguments */
  31. /* ========= */
  32. /* M (input) INTEGER */
  33. /* The number of rows of the matrix A. */
  34. /* N (input) INTEGER */
  35. /* The number of columns of the matrix A. */
  36. /* A (input) DOUBLE PRECISION array, dimension (LDA,N) */
  37. /* The m by n matrix A. */
  38. /* LDA (input) INTEGER */
  39. /* The leading dimension of the array A. LDA >= max(1,M). */
  40. /* ===================================================================== */
  41. /* .. Parameters .. */
  42. /* .. */
  43. /* .. Local Scalars .. */
  44. /* .. */
  45. /* .. Executable Statements .. */
  46. /* Quick test for the common case where one corner is non-zero. */
  47. /* Parameter adjustments */
  48. a_dim1 = *lda;
  49. a_offset = 1 + a_dim1;
  50. a -= a_offset;
  51. /* Function Body */
  52. if (*m == 0) {
  53. ret_val = *m;
  54. } else if (a[*m + a_dim1] != 0. || a[*m + *n * a_dim1] != 0.) {
  55. ret_val = *m;
  56. } else {
  57. /* Scan up each column tracking the last zero row seen. */
  58. ret_val = 0;
  59. i__1 = *n;
  60. for (j = 1; j <= i__1; ++j) {
  61. for (i__ = *m; i__ >= 1; --i__) {
  62. if (a[i__ + j * a_dim1] != 0.) {
  63. break;
  64. }
  65. }
  66. ret_val = max(ret_val,i__);
  67. }
  68. }
  69. return ret_val;
  70. } /* _starpu_iladlr_ */