001: /* ///////////////////////////// P /// L /// A /// S /// M /// A /////////////////////////////// */
002: /* ///                    PLASMA auxiliary routines (version 2.1.0)                          ///
003:  * ///                    Author: Jakub Kurzak                                               ///
004:  * ///                    Release Date: November, 15th 2009                                  ///
005:  * ///                    PLASMA is a software package provided by Univ. of Tennessee,       ///
006:  * ///                    Univ. of California Berkeley and Univ. of Colorado Denver          /// */
007: /* ///////////////////////////////////////////////////////////////////////////////////////////// */
008: #include "common.h"
009: #include "workspace.h"
010: 
011: /* /////////////////////////// P /// U /// R /// P /// O /// S /// E /////////////////////////// */
012: // PLASMA_Alloc_Workspace_sgels - Allocates workspace for PLASMA_sgels or PLASMA_sgels_Tile
013: // routine.
014: 
015: /* ///////////////////// A /// R /// G /// U /// M /// E /// N /// T /// S ///////////////////// */
016: // M        int (IN)
017: //          The number of rows of the matrix A. M >= 0.
018: //
019: // N        int (IN)
020: //          The number of columns of the matrix A.  N >= 0.
021: //
022: // T        float* (OUT)
023: //          On exit, workspace handle for storage of the extra T factors required by the tile QR
024: //          or the tile LQ factorization.
025: 
026: /* ///////////// R /// E /// T /// U /// R /// N /////// V /// A /// L /// U /// E ///////////// */
027: //          = 0: successful exit
028: 
029: /* //////////////////////////////////// C /// O /// D /// E //////////////////////////////////// */
030: int PLASMA_Alloc_Workspace_sgels(int M, int N, float **T) {
031:     return plasma_alloc_ibnb(M, N, PLASMA_FUNC_SGELS, PlasmaRealFloat, (void**)T); }
032: 
033: /* /////////////////////////// P /// U /// R /// P /// O /// S /// E /////////////////////////// */
034: // PLASMA_Alloc_Workspace_sgeqrf - Allocates workspace for PLASMA_sgeqrf or PLASMA_sgeqrf_Tile
035: // routine.
036: 
037: /* ///////////////////// A /// R /// G /// U /// M /// E /// N /// T /// S ///////////////////// */
038: // M        int (IN)
039: //          The number of rows of the matrix A. M >= 0.
040: //
041: // N        int (IN)
042: //          The number of columns of the matrix A.  N >= 0.
043: //
044: // T        float* (OUT)
045: //          On exit, workspace handle for storage of the extra T factors required by the tile QR
046: //          factorization.
047: 
048: /* ///////////// R /// E /// T /// U /// R /// N /////// V /// A /// L /// U /// E ///////////// */
049: //          = 0: successful exit
050: 
051: /* //////////////////////////////////// C /// O /// D /// E //////////////////////////////////// */
052: int PLASMA_Alloc_Workspace_sgeqrf(int M, int N, float **T) {
053:     return plasma_alloc_ibnb(M, N, PLASMA_FUNC_SGELS, PlasmaRealFloat, (void**)T); }
054: 
055: /* /////////////////////////// P /// U /// R /// P /// O /// S /// E /////////////////////////// */
056: // PLASMA_Alloc_Workspace_sgelqf - Allocates workspace for PLASMA_sgelqf or PLASMA_sgelqf_Tile
057: // routines.
058: 
059: /* ///////////////////// A /// R /// G /// U /// M /// E /// N /// T /// S ///////////////////// */
060: // M        int (IN)
061: //          The number of rows of the matrix A. M >= 0.
062: //
063: // N        int (IN)
064: //          The number of columns of the matrix A.  N >= 0.
065: //
066: // T        float* (OUT)
067: //          On exit, workspace handle for storage of the extra T factors required by the tile LQ
068: //          factorization.
069: 
070: /* ///////////// R /// E /// T /// U /// R /// N /////// V /// A /// L /// U /// E ///////////// */
071: //          = 0: successful exit
072: 
073: /* //////////////////////////////////// C /// O /// D /// E //////////////////////////////////// */
074: int PLASMA_Alloc_Workspace_sgelqf(int M, int N, float **T) {
075:     return plasma_alloc_ibnb(M, N, PLASMA_FUNC_SGELS, PlasmaRealFloat, (void**)T); }
076: 
077: /* /////////////////////////// P /// U /// R /// P /// O /// S /// E /////////////////////////// */
078: // PLASMA_Alloc_Workspace_sgesv - Allocates workspace for PLASMA_sgesv or PLASMA_sgesv_Tile
079: // routines.
080: 
081: /* ///////////////////// A /// R /// G /// U /// M /// E /// N /// T /// S ///////////////////// */
082: // N        int (IN)
083: //          The number of linear equations, i.e., the order of the matrix A. N >= 0.
084: //
085: // L        float* (OUT)
086: //          On exit, workspace handle for storage of the extra L factors required by the tile LU
087: //          factorization.
088: //
089: // IPIV     int** (OUT)
090: //          On exit, workspace handle for storage of pivot indexes required by the tile LU
091: //          factorization (not equivalent to LAPACK).
092: 
093: /* ///////////// R /// E /// T /// U /// R /// N /////// V /// A /// L /// U /// E ///////////// */
094: //          = 0: successful exit
095: 
096: /* //////////////////////////////////// C /// O /// D /// E //////////////////////////////////// */
097: int PLASMA_Alloc_Workspace_sgesv(int N, float **L, int **IPIV) {
098:     int status = plasma_alloc_ibnb(N, N, PLASMA_FUNC_SGESV, PlasmaRealFloat, (void**)L);
099:     if (status != PLASMA_SUCCESS)
100:         return status;
101:     return plasma_alloc_ipiv(N, N, PLASMA_FUNC_SGESV, (void**)IPIV); }
102: 
103: /* /////////////////////////// P /// U /// R /// P /// O /// S /// E /////////////////////////// */
104: // PLASMA_Alloc_Workspace_sgetrf - Allocates workspace for PLASMA_sgetrf or PLASMA_sgetrf_Tile
105: // routines.
106: 
107: /* ///////////////////// A /// R /// G /// U /// M /// E /// N /// T /// S ///////////////////// */
108: // M        int (IN)
109: //          The number of rows of the matrix A. M >= 0.
110: //
111: // N        int (IN)
112: //          The number of columns of the matrix A.  N >= 0.
113: //
114: // L        float* (OUT)
115: //          On exit, workspace handle for storage of the extra L factors required by the tile LU
116: //          factorization.
117: //
118: // IPIV     int** (OUT)
119: //          On exit, workspace handle for storage of pivot indexes required by the tile LU
120: //          factorization (not equivalent to LAPACK).
121: 
122: /* ///////////// R /// E /// T /// U /// R /// N /////// V /// A /// L /// U /// E ///////////// */
123: //          = 0: successful exit
124: 
125: /* //////////////////////////////////// C /// O /// D /// E //////////////////////////////////// */
126: int PLASMA_Alloc_Workspace_sgetrf(int M, int N, float **L, int **IPIV) {
127:     int status = plasma_alloc_ibnb(M, N, PLASMA_FUNC_SGESV, PlasmaRealFloat, (void**)L);
128:     if (status != PLASMA_SUCCESS)
129:         return status;
130:     return plasma_alloc_ipiv(M, N, PLASMA_FUNC_SGESV, (void**)IPIV); }
131: