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_zunmlq_Tile - overwrites the general M-by-N matrix C with Q*C, where Q is an orthogonal
09: // matrix (unitary in the complex case) defined as the product of elementary reflectors returned
10: // by PLASMA_zgelqf_Tile Q is of order M.
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: // side     PLASMA_enum (IN)
15: //          Intended usage:
16: //          = PlasmaLeft:  apply Q or Q**H from the left;
17: //          = PlasmaRight: apply Q or Q**H from the right.
18: //          Currently only PlasmaLeft is supported.
19: //
20: // trans    PLASMA_enum (IN)
21: //          Intended usage:
22: //          = PlasmaNoTrans:   no transpose, apply Q;
23: //          = PlasmaConjTrans: conjugate transpose, apply Q**H.
24: //          Currently only PlasmaConjTrans is supported.
25: //
26: // A        PLASMA_Complex64_t* (IN)
27: //          Details of the LQ factorization of the original matrix A as returned by PLASMA_zgelqf.
28: //
29: // T        PLASMA_Complex64_t* (IN)
30: //          Auxiliary factorization data, computed by PLASMA_zgelqf.
31: //
32: // B        PLASMA_Complex64_t* (INOUT)
33: //          On entry, the M-by-N matrix B.
34: //          On exit, B is overwritten by Q*B or Q**H*B.
35: 
36: /* ///////////// R /// E /// T /// U /// R /// N /////// V /// A /// L /// U /// E ///////////// */
37: //          = 0: successful exit
38: 
39: /* //////////////////////////////////// C /// O /// D /// E //////////////////////////////////// */
40: #include "common.h"
41: 
42: int PLASMA_zunmlq_Tile(PLASMA_enum side, PLASMA_enum trans, PLASMA_desc *A, PLASMA_desc *T, PLASMA_desc *B)
43: {
44:     PLASMA_desc descA = *A;
45:     PLASMA_desc descT = *T;
46:     PLASMA_desc descB = *B;
47:     plasma_context_t *plasma;
48: 
49:     plasma = plasma_context_self();
50:     if (plasma == NULL) {
51:         plasma_fatal_error("PLASMA_zunmlq_Tile", "PLASMA not initialized");
52:         return PLASMA_ERR_NOT_INITIALIZED;
53:     }
54:     /* Check descriptors for correctness */
55:     if (plasma_desc_check(&descA) != PLASMA_SUCCESS) {
56:         plasma_error("PLASMA_zunmlq_Tile", "invalid first descriptor");
57:         return PLASMA_ERR_ILLEGAL_VALUE;
58:     }
59:     if (plasma_desc_check(&descT) != PLASMA_SUCCESS) {
60:         plasma_error("PLASMA_zunmlq_Tile", "invalid second descriptor");
61:         return PLASMA_ERR_ILLEGAL_VALUE;
62:     }
63:     if (plasma_desc_check(&descB) != PLASMA_SUCCESS) {
64:         plasma_error("PLASMA_zunmlq_Tile", "invalid third descriptor");
65:         return PLASMA_ERR_ILLEGAL_VALUE;
66:     }
67:     /* Check input arguments */
68:     if (side != PlasmaLeft) {
69:         plasma_error("PLASMA_zunmlq_Tile", "only PlasmaLeft supported");
70:         return PLASMA_ERR_NOT_SUPPORTED;
71:     }
72:     if (trans != PlasmaConjTrans) {
73:         plasma_error("PLASMA_zunmlq_Tile", "only PlasmaConjTrans supported");
74:         return PLASMA_ERR_NOT_SUPPORTED;
75:     }
76:     /* Quick return - currently NOT equivalent to LAPACK's:
77:      * CALL DLASET( 'Full', MAX( M, N ), NRHS, ZERO, ZERO, B, LDB ) */
78: /*
79:     if (min(M, min(N, K)) == 0)
80:         return PLASMA_SUCCESS;
81: */
82:     plasma_parallel_call_3(plasma_pzunmlq,
83:         PLASMA_desc, descA,
84:         PLASMA_desc, descB,
85:         PLASMA_desc, descT);
86: 
87:     return PLASMA_SUCCESS;
88: }