elpa_generic.h 4.31 KB
Newer Older
1
2
#pragma once

3
4
5
6
7
8
9
/*  \brief generic C method for elpa_set
 *
 *  \param  handle  handle of the ELPA object for which a key/value pair should be set
 *  \param  name    the name of the key
 *  \param  value   integer/double value to be set for the key
 *  \param  error   on return the error code, which can be queried with elpa_strerr()
 *  \result void
10
11
12
13
14
15
16
17
18
 */
#define elpa_set(e, name, value, error) _Generic((value), \
                int: \
                  elpa_set_integer, \
                \
                double: \
                  elpa_set_double \
        )(e, name, value, error)

19
20
21
22
23
24
25
26

/*  \brief generic C method for elpa_get
 *
 *  \param  handle  handle of the ELPA object for which a key/value pair should be queried
 *  \param  name    the name of the key
 *  \param  value   integer/double value to be queried
 *  \param  error   on return the error code, which can be queried with elpa_strerr()
 *  \result void
27
28
29
30
31
32
33
34
35
36
 */
#define elpa_get(e, name, value, error) _Generic((value), \
                int*: \
                  elpa_get_integer, \
                \
                double*: \
                  elpa_get_double \
        )(e, name, value, error)


37
38
39
40
41
42
43
44
/*  \brief generic C method for elpa_solve
 *
 *  \param  handle  handle of the ELPA object, which defines the problem
 *  \param  a       float/double float complex/double complex pointer to matrix a
 *  \param  ev      on return: float/double pointer to eigenvalues
 *  \param  q       on return: float/double float complex/double complex pointer to eigenvectors
 *  \param  error   on return the error code, which can be queried with elpa_strerr()
 *  \result void
45
46
47
 */
#define elpa_solve(handle, a, ev, q, error) _Generic((a), \
                double*: \
48
                  elpa_solve_d, \
49
50
                \
                float*: \
51
                  elpa_solve_f, \
52
53
                \
                double complex*: \
54
                  elpa_solve_dc, \
55
56
                \
                float complex*: \
57
                  elpa_solve_fc \
58
        )(handle, a, ev, q, error)
59

60
61
62
63
64
65
66
/*  \brief generic C method for elpa_cholesky
 *
 *  \param  handle  handle of the ELPA object, which defines the problem
 *  \param  a       float/double float complex/double complex pointer to matrix a, for which
 *                  the cholesky factorizaion will be computed
 *  \param  error   on return the error code, which can be queried with elpa_strerr()
 *  \result void
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
 */
#define elpa_cholesky(handle, a, error) _Generic((a), \
                double*: \
                  elpa_cholesky_d, \
                \
                float*: \
                  elpa_cholesky_f, \
                \
                double complex*: \
                  elpa_cholesky_dc, \
                \
                float complex*: \
                  elpa_cholesky_fc \
        )(handle, a, error)


83
84
85
86
87
88
89
/*  \brief generic C method for elpa_invert_triangular
 *
 *  \param  handle  handle of the ELPA object, which defines the problem
 *  \param  a       float/double float complex/double complex pointer to matrix a, which
 *                  should be inverted
 *  \param  error   on return the error code, which can be queried with elpa_strerr()
 *  \result void
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
 */
#define elpa_invert_triangular(handle, a, error) _Generic((a), \
                double*: \
                  elpa_invert_trm_d, \
                \
                float*: \
                  elpa_invert_trm_f, \
                \
                double complex*: \
                  elpa_invert_trm_dc, \
                \
                float complex*: \
                  elpa_invert_trm_fc \
        )(handle, a, error)

105
106
107
108
109
110
111
112
113
114

/*  \brief generic C method for elpa_solve_tridi
 *
 *  \param  handle  handle of the ELPA object, which defines the problem
 *  \param  d       float/double pointer to the diagonal elements of a matrix a,
 *                  on output: eigenvalues in ascending order
 *  \param  e       float/double pointer to the subdiagonal elements of a matrix a
 *  \param  q       on output: float/double pointer to the eigenvectors
 *  \param  error   on return the error code, which can be queried with elpa_strerr()
 *  \result void
115
116
117
118
119
120
121
122
 */
#define elpa_solve_tridi(handle, d, e, q, error) _Generic((d), \
                double*: \
                  elpa_solve_tridi_d, \
                \
                float*: \
                  elpa_solve_tridi_f \
        )(handle, d, e, q, error)