iladlc.c 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /* iladlc.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_iladlc_(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__;
  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. /* ILADLC scans A for its last non-zero column. */
  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 (*n == 0) {
  53. ret_val = *n;
  54. } else if (a[*n * a_dim1 + 1] != 0. || a[*m + *n * a_dim1] != 0.) {
  55. ret_val = *n;
  56. } else {
  57. /* Now scan each column from the end, returning with the first non-zero. */
  58. for (ret_val = *n; ret_val >= 1; --ret_val) {
  59. i__1 = *m;
  60. for (i__ = 1; i__ <= i__1; ++i__) {
  61. if (a[i__ + ret_val * a_dim1] != 0.) {
  62. return ret_val;
  63. }
  64. }
  65. }
  66. }
  67. return ret_val;
  68. } /* _starpu_iladlc_ */