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_zpotrs_Tile - Solves a system of linear equations A * X = B with a symmetric positive
09: // definite (or Hermitian positive definite in the complex case) matrix A using the Cholesky
10: // factorization A = U**H*U or A = L*L**H computed by PLASMA_zpotrf.
11: // All matrices are passed through descriptors. All dimensions are taken from the descriptors.
12: 
13: /* ///////////////////// A /// R /// G /// U /// M /// E /// N /// T /// S ///////////////////// */
14: // uplo     PLASMA_enum (IN)
15: //          = PlasmaUpper: Upper triangle of A is stored;
16: //          = PlasmaLower: Lower triangle of A is stored.
17: //
18: // A        PLASMA_Complex64_t* (IN)
19: //          The triangular factor U or L from the Cholesky factorization A = U**H*U or A = L*L**H,
20: //          computed by PLASMA_zpotrf.
21: //
22: // B        PLASMA_Complex64_t* (INOUT)
23: //          On entry, the N-by-NRHS right hand side matrix B.
24: //          On exit, if return value = 0, the N-by-NRHS solution matrix X.
25: 
26: /* ///////////// R /// E /// T /// U /// R /// N /////// V /// A /// L /// U /// E ///////////// */
27: //          = 0: successful exit
28: 
29: /* //////////////////////////////////// C /// O /// D /// E //////////////////////////////////// */
30: #include "common.h"
31: 
32: int PLASMA_zpotrs_Tile(PLASMA_enum uplo, PLASMA_desc *A, PLASMA_desc *B)
33: {
34:     PLASMA_desc descA = *A;
35:     PLASMA_desc descB = *B;
36:     plasma_context_t *plasma;
37: 
38:     plasma = plasma_context_self();
39:     if (plasma == NULL) {
40:         plasma_fatal_error("PLASMA_zpotrs_Tile", "PLASMA not initialized");
41:         return PLASMA_ERR_NOT_INITIALIZED;
42:     }
43:     /* Check descriptors for correctness */
44:     if (plasma_desc_check(&descA) != PLASMA_SUCCESS) {
45:         plasma_error("PLASMA_zpotrs_Tile", "invalid first descriptor");
46:         return PLASMA_ERR_ILLEGAL_VALUE;
47:     }
48:     if (plasma_desc_check(&descB) != PLASMA_SUCCESS) {
49:         plasma_error("PLASMA_zpotrs_Tile", "invalid second descriptor");
50:         return PLASMA_ERR_ILLEGAL_VALUE;
51:     }
52:     /* Check input arguments */
53:     if (uplo != PlasmaUpper && uplo != PlasmaLower) {
54:         plasma_error("PLASMA_zpotrs_Tile", "illegal value of uplo");
55:         return -1;
56:     }
57:     /* Quick return */
58: /*
59:     if (min(N, NRHS) == 0)
60:         return PLASMA_SUCCESS;
61: */
62:     plasma_parallel_call_7(plasma_pztrsm,
63:         PLASMA_enum, PlasmaLeft,
64:         PLASMA_enum, uplo,
65:         PLASMA_enum, uplo == PlasmaUpper ? PlasmaConjTrans : PlasmaNoTrans,
66:         PLASMA_enum, PlasmaNonUnit,
67:         PLASMA_Complex64_t, 1.0,
68:         PLASMA_desc, descA,
69:         PLASMA_desc, descB);
70: 
71:     plasma_parallel_call_7(plasma_pztrsm,
72:         PLASMA_enum, PlasmaLeft,
73:         PLASMA_enum, uplo,
74:         PLASMA_enum, uplo == PlasmaUpper ? PlasmaNoTrans : PlasmaConjTrans,
75:         PLASMA_enum, PlasmaNonUnit,
76:         PLASMA_Complex64_t, 1.0,
77:         PLASMA_desc, descA,
78:         PLASMA_desc, descB);
79: 
80:     return PLASMA_SUCCESS;
81: }