01: /* ///////////////////////////// P /// L /// A /// S /// M /// A /////////////////////////////// */
02: /* ///                    PLASMA computational routine (version 2.0.0)                       ///
03:  * ///                    Release Date: July, 4th 2009                                       ///
04:  * ///                    PLASMA is a software package provided by Univ. of Tennessee,       ///
05:  * ///                    Univ. of California Berkeley and Univ. of Colorado Denver          /// */
06: 
07: /* /////////////////////////// P /// U /// R /// P /// O /// S /// E /////////////////////////// */
08: // PLASMA_cpotrf_Tile - Computes the Cholesky factorization of a symmetric positive definite
09: // (or Hermitian positive definite in the complex case) matrix A.
10: // The factorization has the form
11: //
12: //   A = U**H * U, if uplo = PlasmaUpper, or
13: //   A = L * L**H, if uplo =  PlasmaLower,
14: //
15: // where U is an upper triangular matrix and L is a lower triangular matrix.
16: // All matrices are passed through descriptors. All dimensions are taken from the descriptors.
17: 
18: /* ///////////////////// A /// R /// G /// U /// M /// E /// N /// T /// S ///////////////////// */
19: // uplo     PLASMA_enum (IN)
20: //          = PlasmaUpper: Upper triangle of A is stored;
21: //          = PlasmaLower: Lower triangle of A is stored.
22: //
23: // A        PLASMA_Complex32_t* (INOUT)
24: //          On entry, the symmetric positive definite (or Hermitian) matrix A.
25: //          If uplo = PlasmaUpper, the leading N-by-N upper triangular part of A
26: //          contains the upper triangular part of the matrix A, and the strictly lower triangular
27: //          part of A is not referenced.
28: //          If UPLO = 'L', the leading N-by-N lower triangular part of A contains the lower
29: //          triangular part of the matrix A, and the strictly upper triangular part of A is not
30: //          referenced.
31: //          On exit, if return value = 0, the factor U or L from the Cholesky factorization
32: //          A = U**H*U or A = L*L**H.
33: 
34: /* ///////////// R /// E /// T /// U /// R /// N /////// V /// A /// L /// U /// E ///////////// */
35: //          = 0: successful exit
36: //          > 0: if i, the leading minor of order i of A is not positive definite, so the
37: //               factorization could not be completed, and the solution has not been computed.
38: 
39: /* //////////////////////////////////// C /// O /// D /// E //////////////////////////////////// */
40: #include "common.h"
41: 
42: int PLASMA_cpotrf_Tile(PLASMA_enum uplo, PLASMA_desc *A)
43: {
44:     PLASMA_desc descA = *A;
45:     plasma_context_t *plasma;
46: 
47:     plasma = plasma_context_self();
48:     if (plasma == NULL) {
49:         plasma_fatal_error("PLASMA_cpotrf_Tile", "PLASMA not initialized");
50:         return PLASMA_ERR_NOT_INITIALIZED;
51:     }
52:     /* Check descriptors for correctness */
53:     if (plasma_desc_check(&descA) != PLASMA_SUCCESS) {
54:         plasma_error("PLASMA_cpotrf_Tile", "invalid descriptor");
55:         return PLASMA_ERR_ILLEGAL_VALUE;
56:     }
57:     /* Check input arguments */
58:     if (uplo != PlasmaUpper && uplo != PlasmaLower) {
59:         plasma_error("PLASMA_cpotrf_Tile", "illegal value of uplo");
60:         return -1;
61:     }
62:     /* Quick return */
63: /*
64:     if (max(N, 0) == 0)
65:         return PLASMA_SUCCESS;
66: */
67:     plasma_parallel_call_2(plasma_pcpotrf,
68:         PLASMA_enum, uplo,
69:         PLASMA_desc, descA);
70: 
71:     return PLASMA_INFO;
72: }