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_cgelqf_Tile - Computes the tile LQ factorization of a complex M-by-N matrix A: A = L * Q.
09: // All matrices are passed through descriptors. All dimensions are taken from the descriptors.
10: 
11: /* ///////////////////// A /// R /// G /// U /// M /// E /// N /// T /// S ///////////////////// */
12: // A        PLASMA_Complex32_t* (INOUT)
13: //          On entry, the M-by-N matrix A.
14: //          On exit, the elements on and below the diagonal of the array contain the m-by-min(M,N)
15: //          lower trapezoidal matrix L (L is lower triangular if M <= N); the elements above the
16: //          diagonal represent the unitary matrix Q as a product of elementary reflectors, stored
17: //          by tiles.
18: //
19: // T        PLASMA_Complex32_t* (OUT)
20: //          On exit, auxiliary factorization data, required by PLASMA_cgelqs to solve the system
21: //          of equations.
22: 
23: /* ///////////// R /// E /// T /// U /// R /// N /////// V /// A /// L /// U /// E ///////////// */
24: //          = 0: successful exit
25: 
26: /* //////////////////////////////////// C /// O /// D /// E //////////////////////////////////// */
27: #include "common.h"
28: 
29: int PLASMA_cgelqf_Tile(PLASMA_desc *A, PLASMA_desc *T)
30: {
31:     PLASMA_desc descA = *A;
32:     PLASMA_desc descT = *T;
33:     plasma_context_t *plasma;
34: 
35:     plasma = plasma_context_self();
36:     if (plasma == NULL) {
37:         plasma_fatal_error("PLASMA_cgelqf_Tile", "PLASMA not initialized");
38:         return PLASMA_ERR_NOT_INITIALIZED;
39:     }
40:     /* Check descriptors for correctness */
41:     if (plasma_desc_check(&descA) != PLASMA_SUCCESS) {
42:         plasma_error("PLASMA_cgelqf_Tile", "invalid first descriptor");
43:         return PLASMA_ERR_ILLEGAL_VALUE;
44:     }
45:     if (plasma_desc_check(&descT) != PLASMA_SUCCESS) {
46:         plasma_error("PLASMA_cgelqf_Tile", "invalid second descriptor");
47:         return PLASMA_ERR_ILLEGAL_VALUE;
48:     }
49:     /* Check input arguments */
50:     /* Quick return */
51: /*
52:     if (min(M, N) == 0)
53:         return PLASMA_SUCCESS;
54: */
55:     plasma_parallel_call_2(plasma_pcgelqf,
56:         PLASMA_desc, descA,
57:         PLASMA_desc, descT);
58: 
59:     return PLASMA_SUCCESS;
60: }