xerbla_array.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /* xerbla_array.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 xerbla_array__(char *srname_array__, integer *
  14. srname_len__, integer *info, ftnlen srname_array_len)
  15. {
  16. /* System generated locals */
  17. integer i__1, i__2, i__3;
  18. /* Builtin functions */
  19. /* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen);
  20. integer i_len(char *, ftnlen);
  21. /* Local variables */
  22. integer i__;
  23. extern /* Subroutine */ int xerbla_(char *, integer *);
  24. char srname[32];
  25. /* -- LAPACK auxiliary routine (version 3.0) -- */
  26. /* Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., */
  27. /* September 19, 2006 */
  28. /* .. Scalar Arguments .. */
  29. /* .. */
  30. /* .. Array Arguments .. */
  31. /* .. */
  32. /* Purpose */
  33. /* ======= */
  34. /* XERBLA_ARRAY assists other languages in calling XERBLA, the LAPACK */
  35. /* and BLAS error handler. Rather than taking a Fortran string argument */
  36. /* as the function's name, XERBLA_ARRAY takes an array of single */
  37. /* characters along with the array's length. XERBLA_ARRAY then copies */
  38. /* up to 32 characters of that array into a Fortran string and passes */
  39. /* that to XERBLA. If called with a non-positive SRNAME_LEN, */
  40. /* XERBLA_ARRAY will call XERBLA with a string of all blank characters. */
  41. /* Say some macro or other device makes XERBLA_ARRAY available to C99 */
  42. /* by a name lapack_xerbla and with a common Fortran calling convention. */
  43. /* Then a C99 program could invoke XERBLA via: */
  44. /* { */
  45. /* int flen = strlen(__func__); */
  46. /* lapack_xerbla(__func__, &flen, &info); */
  47. /* } */
  48. /* Providing XERBLA_ARRAY is not necessary for intercepting LAPACK */
  49. /* errors. XERBLA_ARRAY calls XERBLA. */
  50. /* Arguments */
  51. /* ========= */
  52. /* SRNAME_ARRAY (input) CHARACTER(1) array, dimension (SRNAME_LEN) */
  53. /* The name of the routine which called XERBLA_ARRAY. */
  54. /* SRNAME_LEN (input) INTEGER */
  55. /* The length of the name in SRNAME_ARRAY. */
  56. /* INFO (input) INTEGER */
  57. /* The position of the invalid parameter in the parameter list */
  58. /* of the calling routine. */
  59. /* ===================================================================== */
  60. /* .. */
  61. /* .. Local Scalars .. */
  62. /* .. */
  63. /* .. Local Arrays .. */
  64. /* .. */
  65. /* .. Intrinsic Functions .. */
  66. /* .. */
  67. /* .. External Functions .. */
  68. /* .. */
  69. /* .. Executable Statements .. */
  70. /* Parameter adjustments */
  71. --srname_array__;
  72. /* Function Body */
  73. s_copy(srname, "", (ftnlen)32, (ftnlen)0);
  74. /* Computing MIN */
  75. i__2 = *srname_len__, i__3 = i_len(srname, (ftnlen)32);
  76. i__1 = min(i__2,i__3);
  77. for (i__ = 1; i__ <= i__1; ++i__) {
  78. *(unsigned char *)&srname[i__ - 1] = *(unsigned char *)&
  79. srname_array__[i__];
  80. }
  81. xerbla_(srname, info);
  82. return 0;
  83. } /* xerbla_array__ */