ilaclr.c 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /* ilaclr.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_ilaclr_(integer *m, integer *n, complex *a, integer *lda)
  14. {
  15. /* System generated locals */
  16. integer a_dim1, a_offset, ret_val, i__1, i__2;
  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. /* ILACLR 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) COMPLEX 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(complicated condition) */ {
  55. i__1 = *m + a_dim1;
  56. i__2 = *m + *n * a_dim1;
  57. if (a[i__1].r != 0.f || a[i__1].i != 0.f || (a[i__2].r != 0.f || a[
  58. i__2].i != 0.f)) {
  59. ret_val = *m;
  60. } else {
  61. /* Scan up each column tracking the last zero row seen. */
  62. ret_val = 0;
  63. i__1 = *n;
  64. for (j = 1; j <= i__1; ++j) {
  65. for (i__ = *m; i__ >= 1; --i__) {
  66. i__2 = i__ + j * a_dim1;
  67. if (a[i__2].r != 0.f || a[i__2].i != 0.f) {
  68. break;
  69. }
  70. }
  71. ret_val = max(ret_val,i__);
  72. }
  73. }
  74. }
  75. return ret_val;
  76. } /* _starpu_ilaclr_ */