1 //#define CXXBLAS_DEBUG_OUT(x) std::cerr << x << std::endl;
2
3 #define STR(x) #x
4 #define STRING(x) STR(x)
5
6 #define FLENS_DEFAULT_INDEXTYPE int
7
8 #include <flens/lapack/interface/include/config.h>
9
10
11 namespace flens { namespace lapack {
12
13 extern "C" {
14
15 //-- dpotrf --------------------------------------------------------------------
16 void
17 LAPACK_DECL(dpotrf)(const char *UPLO,
18 const INTEGER *N,
19 DOUBLE *A,
20 const INTEGER *LDA,
21 INTEGER *INFO)
22 {
23 DEBUG_FLENS_LAPACK("dpotrf");
24 //
25 // Test the input parameters so that we pass LAPACK error checks
26 //
27 *INFO = 0;
28 if (*UPLO!='U' && *UPLO!='L') {
29 *INFO = -1;
30 } else if (*N<0) {
31 *INFO = -2;
32 } else if (*LDA<std::max(INTEGER(1), *N)) {
33 *INFO = -4;
34 }
35 if (*INFO!=0) {
36 *INFO = -(*INFO);
37 LAPACK_ERROR("DPOTRF", INFO);
38 *INFO = -(*INFO);
39 return;
40 }
41 //
42 // Call FLENS implementation
43 //
44 StorageUpLo upLo = StorageUpLo(*UPLO);
45 DFSView AFS = DFSView(*N, *N, A, *LDA);
46 DSyMatrixView _A = DSyMatrixView(AFS, upLo);
47
48 *INFO = potrf(_A);
49 }
50
51 } // extern "C"
52
53 } } // namespace lapack, flens
2
3 #define STR(x) #x
4 #define STRING(x) STR(x)
5
6 #define FLENS_DEFAULT_INDEXTYPE int
7
8 #include <flens/lapack/interface/include/config.h>
9
10
11 namespace flens { namespace lapack {
12
13 extern "C" {
14
15 //-- dpotrf --------------------------------------------------------------------
16 void
17 LAPACK_DECL(dpotrf)(const char *UPLO,
18 const INTEGER *N,
19 DOUBLE *A,
20 const INTEGER *LDA,
21 INTEGER *INFO)
22 {
23 DEBUG_FLENS_LAPACK("dpotrf");
24 //
25 // Test the input parameters so that we pass LAPACK error checks
26 //
27 *INFO = 0;
28 if (*UPLO!='U' && *UPLO!='L') {
29 *INFO = -1;
30 } else if (*N<0) {
31 *INFO = -2;
32 } else if (*LDA<std::max(INTEGER(1), *N)) {
33 *INFO = -4;
34 }
35 if (*INFO!=0) {
36 *INFO = -(*INFO);
37 LAPACK_ERROR("DPOTRF", INFO);
38 *INFO = -(*INFO);
39 return;
40 }
41 //
42 // Call FLENS implementation
43 //
44 StorageUpLo upLo = StorageUpLo(*UPLO);
45 DFSView AFS = DFSView(*N, *N, A, *LDA);
46 DSyMatrixView _A = DSyMatrixView(AFS, upLo);
47
48 *INFO = potrf(_A);
49 }
50
51 } // extern "C"
52
53 } } // namespace lapack, flens