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_zungqr_Tile - Generates an M-by-N matrix Q with orthonormal columns, which is defined as the
09: // first N columns of a product of the elementary reflectors returned by PLASMA_zgeqrf_Tile.
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* (IN)
14: //          Details of the QR factorization of the original matrix A as returned by PLASMA_zgeqrf.
15: //
16: // T        PLASMA_Complex64_t* (IN)
17: //          Auxiliary factorization data, computed by PLASMA_zgeqrf.
18: //
19: // B        PLASMA_Complex64_t* (OUT)
20: //          On exit, the M-by-N matrix Q.
21: 
22: /* ///////////// R /// E /// T /// U /// R /// N /////// V /// A /// L /// U /// E ///////////// */
23: //          = 0: successful exit
24: 
25: /* //////////////////////////////////// C /// O /// D /// E //////////////////////////////////// */
26: #include "common.h"
27: 
28: int PLASMA_zungqr_Tile(PLASMA_desc *A, PLASMA_desc *T, PLASMA_desc *B)
29: {
30:     PLASMA_desc descA = *A;
31:     PLASMA_desc descT = *T;
32:     PLASMA_desc descB = *B;
33:     plasma_context_t *plasma;
34: 
35:     plasma = plasma_context_self();
36:     if (plasma == NULL) {
37:         plasma_fatal_error("PLASMA_zungqr_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_zungqr_Tile", "invalid first descriptor");
43:         return PLASMA_ERR_ILLEGAL_VALUE;
44:     }
45:     if (plasma_desc_check(&descT) != PLASMA_SUCCESS) {
46:         plasma_error("PLASMA_zungqr_Tile", "invalid second descriptor");
47:         return PLASMA_ERR_ILLEGAL_VALUE;
48:     }
49:     if (plasma_desc_check(&descB) != PLASMA_SUCCESS) {
50:         plasma_error("PLASMA_zungqr_Tile", "invalid third descriptor");
51:         return PLASMA_ERR_ILLEGAL_VALUE;
52:     }
53:     /* Quick return */
54: /*
55:     if (N <= 0)
56:         return PLASMA_SUCCESS;
57: */
58:     plasma_parallel_call_3(plasma_pzungqr,
59:         PLASMA_desc, descA,
60:         PLASMA_desc, descB,
61:         PLASMA_desc, descT);
62: 
63:     return PLASMA_SUCCESS;
64: }