dpotri.c 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /* dpotri.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_dpotri_(char *uplo, integer *n, doublereal *a, integer *
  14. lda, integer *info)
  15. {
  16. /* System generated locals */
  17. integer a_dim1, a_offset, i__1;
  18. /* Local variables */
  19. extern logical _starpu_lsame_(char *, char *);
  20. extern /* Subroutine */ int _starpu_xerbla_(char *, integer *), _starpu_dlauum_(
  21. char *, integer *, doublereal *, integer *, integer *),
  22. _starpu_dtrtri_(char *, char *, integer *, doublereal *, integer *,
  23. integer *);
  24. /* -- LAPACK routine (version 3.2) -- */
  25. /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
  26. /* November 2006 */
  27. /* .. Scalar Arguments .. */
  28. /* .. */
  29. /* .. Array Arguments .. */
  30. /* .. */
  31. /* Purpose */
  32. /* ======= */
  33. /* DPOTRI computes the inverse of a real symmetric positive definite */
  34. /* matrix A using the Cholesky factorization A = U**T*U or A = L*L**T */
  35. /* computed by DPOTRF. */
  36. /* Arguments */
  37. /* ========= */
  38. /* UPLO (input) CHARACTER*1 */
  39. /* = 'U': Upper triangle of A is stored; */
  40. /* = 'L': Lower triangle of A is stored. */
  41. /* N (input) INTEGER */
  42. /* The order of the matrix A. N >= 0. */
  43. /* A (input/output) DOUBLE PRECISION array, dimension (LDA,N) */
  44. /* On entry, the triangular factor U or L from the Cholesky */
  45. /* factorization A = U**T*U or A = L*L**T, as computed by */
  46. /* DPOTRF. */
  47. /* On exit, the upper or lower triangle of the (symmetric) */
  48. /* inverse of A, overwriting the input factor U or L. */
  49. /* LDA (input) INTEGER */
  50. /* The leading dimension of the array A. LDA >= max(1,N). */
  51. /* INFO (output) INTEGER */
  52. /* = 0: successful exit */
  53. /* < 0: if INFO = -i, the i-th argument had an illegal value */
  54. /* > 0: if INFO = i, the (i,i) element of the factor U or L is */
  55. /* zero, and the inverse could not be computed. */
  56. /* ===================================================================== */
  57. /* .. External Functions .. */
  58. /* .. */
  59. /* .. External Subroutines .. */
  60. /* .. */
  61. /* .. Intrinsic Functions .. */
  62. /* .. */
  63. /* .. Executable Statements .. */
  64. /* Test the input parameters. */
  65. /* Parameter adjustments */
  66. a_dim1 = *lda;
  67. a_offset = 1 + a_dim1;
  68. a -= a_offset;
  69. /* Function Body */
  70. *info = 0;
  71. if (! _starpu_lsame_(uplo, "U") && ! _starpu_lsame_(uplo, "L")) {
  72. *info = -1;
  73. } else if (*n < 0) {
  74. *info = -2;
  75. } else if (*lda < max(1,*n)) {
  76. *info = -4;
  77. }
  78. if (*info != 0) {
  79. i__1 = -(*info);
  80. _starpu_xerbla_("DPOTRI", &i__1);
  81. return 0;
  82. }
  83. /* Quick return if possible */
  84. if (*n == 0) {
  85. return 0;
  86. }
  87. /* Invert the triangular Cholesky factor U or L. */
  88. _starpu_dtrtri_(uplo, "Non-unit", n, &a[a_offset], lda, info);
  89. if (*info > 0) {
  90. return 0;
  91. }
  92. /* Form inv(U)*inv(U)' or inv(L)'*inv(L). */
  93. _starpu_dlauum_(uplo, n, &a[a_offset], lda, info);
  94. return 0;
  95. /* End of DPOTRI */
  96. } /* _starpu_dpotri_ */