LASs - Linear Algebra Routines on OmpSs  1.0.0
LASs
ddss_dposv.c
Go to the documentation of this file.
1 #include "../include/lass.h"
2 
3 /**
4  *
5  * @file ddss_dposv.c
6  *
7  * @brief LASs-DDSs ddss_dpotrf routine.
8  *
9  * LASs-DDSs is a software package provided by:
10  * Barcelona Supercomputing Center - Centro Nacional de Supercomputacion
11  *
12  * @author Pedro Valero-Lara pedro.valero@bsc.es
13  * @date 2018-05-04
14  * @reviewer
15  * @modified
16  *
17  **/
18 
19 /**
20  *
21  * @ingroup DDSS
22  *
23  * Solves a system of linear equations A \times X = B, where A is a m-by-m
24  * simmetric positive definite matrix and X and B are m-by-nrhs matrices.
25  * The matrix A is descomposed as:
26  *
27  * A = L \times L^T
28  * or
29  * A = U^T \times U
30  *
31  * where L is a lower triangular matrix and U is an upper triangular matrix.
32  *
33 **/
34 
35 /**
36  *
37  * @param[in]
38  * UPLO enum DDSS_UPLO.
39  * UPLO specifies the form of A is stored:
40  * - Lower: Lower triangle of A is stored. The upper traingular part is
41  * not referenced.
42  * - Upper: Upper triangle of A is stored. The lower triangular part is
43  * not referenced.
44  *
45  * @param[in]
46  * N int.
47  * N specifies the order of the square matrix A. N >= 0.
48  *
49  * @param[in]
50  * NRHS int.
51  * NRHS specifies the number of right-hand-sides (number
52  * of columns of B). NRHS >= 0.
53  *
54  * @param[in,out]
55  * A double *.
56  * A is a pointer to a positive definite matrix of dimension N by LDA.
57  * On exit, if return value is Success, the matrix A
58  * is overwriten by the factor U or L.
59  *
60  * @param[in]
61  * LDA int.
62  * LDA specifies the number of columns of A ( row-major order ).
63  * LDA must be at least max( 1, N ).
64  *
65  * @param[in,out]
66  * B double *.
67  * B is a pointer to a matrix of dimension N by NRHS, which stores the
68  * right-hand-sides of the systems of linear equations.
69  * (row-major order). On exit, if return value is Success, the matrix B
70  * is overwriten by the solution matrix X.
71  *
72  * @param[in]
73  * LDB int.
74  * LDB specifies the number of columns of B ( row-major order ).
75  * LDB must be at least max( 1, NRHS ).
76  *
77  **/
78 
79 /**
80  *
81  * @retval Success sucessful exit
82  * @retval NoSuccess unsucessful exit
83  *
84  **/
85 
86 /**
87  *
88  * @sa kdposv
89  *
90  **/
91 
92 int ddss_dposv( enum DDSS_UPLO UPLO,
93  int N, int NRHS,
94  double *A, int LDA,
95  double *B, int LDB )
96 {
97 
98  // Argument checking
99  if ( ( UPLO != Upper ) && ( UPLO != Lower ) )
100  {
101  fprintf( stderr, "Illegal value of UPLO, in ddss_dposv code\n" );
102  return NoSuccess;
103  }
104 
105  if ( N < 0 )
106  {
107  fprintf( stderr, "Illegal value of N, in ddss_dposv code\n" );
108  return NoSuccess;
109  }
110 
111  if ( NRHS < 0 )
112  {
113  fprintf( stderr, "Illegal value of NRHS, in ddss_dposv code\n" );
114  return NoSuccess;
115  }
116 
117  if ( LDA < MAX( 1, N ) )
118  {
119  fprintf( stderr, "Illegal value of LDA, in ddss_dposv code\n" );
120  return NoSuccess;
121  }
122 
123  if ( LDB < MAX( 1, NRHS ) )
124  {
125  fprintf( stderr, "Illegal value of LDB, in ddss_dposv code\n" );
126  return NoSuccess;
127  }
128 
129  // Quick return
130  if ( MAX( N, 0 ) == 0 || MAX( NRHS, 0 ) == 0 )
131  {
132  return Success;
133  }
134 
135  return kdposv( UPLO, N, NRHS, A, LDA, B, LDB );
136 
137 }
int ddss_dposv(enum DDSS_UPLO UPLO, int N, int NRHS, double *A, int LDA, double *B, int LDB)
Definition: ddss_dposv.c:92
enum LASS_RETURN kdposv(enum DDSS_UPLO UPLO, int N, int NRHS, double *A, int LDA, double *B, int LDB)
Definition: kdposv.c:95