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_zgetrf_Tile - Computes an LU factorization of a general M-by-N matrix A
09: // using the tile LU algorithm with partial tile pivoting with row interchanges.
10: // All matrices are passed through descriptors. All dimensions are taken from the descriptors.
11: 
12: /* ///////////////////// A /// R /// G /// U /// M /// E /// N /// T /// S ///////////////////// */
13: // A        PLASMA_Complex64_t* (INOUT)
14: //          On entry, the M-by-N matrix to be factored.
15: //          On exit, the tile factors L and U from the factorization.
16: //
17: // L        PLASMA_Complex64_t* (OUT)
18: //          On exit, auxiliary factorization data, related to the tile L factor,
19: //          required by PLASMA_zgetrs to solve the system of equations.
20: //
21: // IPIV     int* (OUT)
22: //          The pivot indices that define the permutations (not equivalent to LAPACK).
23: 
24: /* ///////////// R /// E /// T /// U /// R /// N /////// V /// A /// L /// U /// E ///////////// */
25: //          = 0: successful exit
26: //          > 0: if i, U(i,i) is exactly zero. The factorization has been completed,
27: //               but the factor U is exactly singular, and division by zero will occur
28: //               if it is used to solve a system of equations.
29: 
30: /* //////////////////////////////////// C /// O /// D /// E //////////////////////////////////// */
31: #include "common.h"
32: 
33: int PLASMA_zgetrf_Tile(PLASMA_desc *A, PLASMA_desc *L, int *IPIV)
34: {
35:     PLASMA_desc descA = *A;
36:     PLASMA_desc descL = *L;
37:     plasma_context_t *plasma;
38: 
39:     plasma = plasma_context_self();
40:     if (plasma == NULL) {
41:         plasma_fatal_error("PLASMA_zgetrf_Tile", "PLASMA not initialized");
42:         return PLASMA_ERR_NOT_INITIALIZED;
43:     }
44:     /* Check descriptors for correctness */
45:     if (plasma_desc_check(&descA) != PLASMA_SUCCESS) {
46:         plasma_error("PLASMA_zgetrf_Tile", "invalid first descriptor");
47:         return PLASMA_ERR_ILLEGAL_VALUE;
48:     }
49:     if (plasma_desc_check(&descL) != PLASMA_SUCCESS) {
50:         plasma_error("PLASMA_zgetrf_Tile", "invalid second descriptor");
51:         return PLASMA_ERR_ILLEGAL_VALUE;
52:     }
53:     /* Check input arguments */
54:     /* Quick return */
55: /*
56:     if (min(M, N) == 0)
57:         return PLASMA_SUCCESS;
58: */
59:     /* Clear IPIV and Lbdl */
60:     plasma_memzero(IPIV, descA.mt*descA.nt*PLASMA_NB, PlasmaInteger);
61:     plasma_memzero(descL.mat, descL.mt*descL.nt*PLASMA_IBNBSIZE, PlasmaComplexDouble);
62: 
63:     /* Set INFO to SUCCESS */
64:     PLASMA_INFO = PLASMA_SUCCESS;
65: 
66:     plasma_parallel_call_3(plasma_pzgetrf,
67:         PLASMA_desc, descA,
68:         PLASMA_desc, descL,
69:         int*, IPIV);
70: 
71:     return PLASMA_INFO;
72: }