ezp
Loading...
Searching...
No Matches
ezp.h
1/*******************************************************************************
2 * Copyright (C) 2025 Theodore Chang
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 ******************************************************************************/
17
18#ifndef EZP_H
19#define EZP_H
20
21#include <complex>
22#include <cstdint>
23
24#ifdef EZP_INT64
25using int_t = std::int64_t;
26#else
27using int_t = std::int32_t;
28#endif
29
30using complex8 = std::complex<float>;
31using complex16 = std::complex<double>;
32
33#define EZP_UNDERSCORE
34
35#ifdef EZP_UNDERSCORE
36#define EZP_APPEND_UNDERSCORE(name) name##_
37#else
38#define EZP_APPEND_UNDERSCORE(name) name
39#endif
40
41#define EZP(name) EZP_APPEND_UNDERSCORE(name)
42
43#define numroc EZP(numroc)
44
45#define blacs_exit EZP(blacs_exit)
46#define blacs_get EZP(blacs_get)
47#define blacs_gridexit EZP(blacs_gridexit)
48#define blacs_gridinfo EZP(blacs_gridinfo)
49#define blacs_gridinit EZP(blacs_gridinit)
50#define blacs_pinfo EZP(blacs_pinfo)
51
52#define descinit EZP(descinit)
53
54#define pcdbtrf EZP(pcdbtrf)
55#define pcdbtrs EZP(pcdbtrs)
56#define pcgbtrf EZP(pcgbtrf)
57#define pcgbtrs EZP(pcgbtrs)
58#define pcgemr2d EZP(pcgemr2d)
59#define pcgetrf EZP(pcgetrf)
60#define pcgetrs EZP(pcgetrs)
61#define pcpbtrf EZP(pcpbtrf)
62#define pcpbtrs EZP(pcpbtrs)
63#define pcpotrf EZP(pcpotrf)
64#define pcpotrs EZP(pcpotrs)
65#define pddbtrf EZP(pddbtrf)
66#define pddbtrs EZP(pddbtrs)
67#define pdgbsv EZP(pdgbsv)
68#define pdgbtrf EZP(pdgbtrf)
69#define pdgbtrs EZP(pdgbtrs)
70#define pdgemr2d EZP(pdgemr2d)
71#define pdgesv EZP(pdgesv)
72#define pdgetrf EZP(pdgetrf)
73#define pdgetrs EZP(pdgetrs)
74#define pdpbtrf EZP(pdpbtrf)
75#define pdpbtrs EZP(pdpbtrs)
76#define pdposv EZP(pdposv)
77#define pdpotrf EZP(pdpotrf)
78#define pdpotrs EZP(pdpotrs)
79#define psdbtrf EZP(psdbtrf)
80#define psdbtrs EZP(psdbtrs)
81#define psgbsv EZP(psgbsv)
82#define psgbtrf EZP(psgbtrf)
83#define psgbtrs EZP(psgbtrs)
84#define psgemr2d EZP(psgemr2d)
85#define psgesv EZP(psgesv)
86#define psgetrf EZP(psgetrf)
87#define psgetrs EZP(psgetrs)
88#define pspbtrf EZP(pspbtrf)
89#define pspbtrs EZP(pspbtrs)
90#define psposv EZP(psposv)
91#define pspotrf EZP(pspotrf)
92#define pspotrs EZP(pspotrs)
93#define pzdbtrf EZP(pzdbtrf)
94#define pzdbtrs EZP(pzdbtrs)
95#define pzgbtrf EZP(pzgbtrf)
96#define pzgbtrs EZP(pzgbtrs)
97#define pzgemr2d EZP(pzgemr2d)
98#define pzgetrf EZP(pzgetrf)
99#define pzgetrs EZP(pzgetrs)
100#define pzpbtrf EZP(pzpbtrf)
101#define pzpbtrs EZP(pzpbtrs)
102#define pzpotrf EZP(pzpotrf)
103#define pzpotrs EZP(pzpotrs)
104
105#define igamn2d EZP(igamn2d)
106#define igamx2d EZP(igamx2d)
107#define igebr2d EZP(igebr2d)
108
109#ifdef __cplusplus
110extern "C" {
111#endif
112
113int_t numroc(const int_t* n, const int_t* nb, const int_t* iproc, const int_t* isrcproc, const int_t* nprocs);
114
115void blacs_exit(const int_t* notDone);
116void blacs_get(const int_t* ConTxt, const int_t* what, int_t* val);
117void blacs_gridexit(const int_t* ConTxt);
118void blacs_gridinfo(const int_t* ConTxt, int_t* nprow, int_t* npcol, int_t* myrow, int_t* mycol);
119void blacs_gridinit(int_t* ConTxt, const char* layout, const int_t* nprow, const int_t* npcol);
120void blacs_pinfo(int_t* mypnum, int_t* nprocs);
121
122void descinit(int_t* desc, const int_t* m, const int_t* n, const int_t* mb, const int_t* nb, const int_t* irsrc, const int_t* icsrc, const int_t* ictxt, const int_t* lld, int_t* info);
123
124void pcdbtrf(const int_t* n, const int_t* bwl, const int_t* bwu, complex8* a, const int_t* ja, const int_t* desca, complex8* af, const int_t* laf, complex8* work, const int_t* lwork, int_t* info);
125void pcdbtrs(const char* trans, const int_t* n, const int_t* bwl, const int_t* bwu, const int_t* nrhs, complex8* a, const int_t* ja, const int_t* desca, complex8* b, const int_t* ib, const int_t* descb, complex8* af, const int_t* laf, complex8* work, const int_t* lwork, int_t* info);
126void pcgbtrf(const int_t* n, const int_t* bwl, const int_t* bwu, complex8* a, const int_t* ja, const int_t* desca, int_t* ipiv, complex8* af, const int_t* laf, complex8* work, const int_t* lwork, int_t* info);
127void pcgbtrs(const char* trans, const int_t* n, const int_t* bwl, const int_t* bwu, const int_t* nrhs, complex8* a, const int_t* ja, const int_t* desca, int_t* ipiv, complex8* b, const int_t* ib, const int_t* descb, complex8* af, const int_t* laf, complex8* work, const int_t* lwork, int_t* info);
128void pcgemr2d(const int_t* m, const int_t* n, const complex8* a, const int_t* ia, const int_t* ja, const int_t* desca, complex8* b, const int_t* ib, const int_t* jb, const int_t* descb, const int_t* ictxt);
129void pcgetrf(const int_t* m, const int_t* n, complex8* a, const int_t* ia, const int_t* ja, const int_t* desca, int_t* ipiv, int_t* info);
130void pcgetrs(const char* trans, const int_t* n, const int_t* nrhs, const complex8* a, const int_t* ia, const int_t* ja, const int_t* desca, const int_t* ipiv, complex8* b, const int_t* ib, const int_t* jb, const int_t* descb, int_t* info);
131void pcpbtrf(const char* uplo, const int_t* n, const int_t* bw, complex8* a, const int_t* ja, const int_t* desca, complex8* af, const int_t* laf, complex8* work, const int_t* lwork, int_t* info);
132void pcpbtrs(const char* uplo, const int_t* n, const int_t* bw, const int_t* nrhs, complex8* a, const int_t* ja, const int_t* desca, complex8* b, const int_t* ib, const int_t* descb, complex8* af, const int_t* laf, complex8* work, const int_t* lwork, int_t* info);
133void pcpotrf(const char* uplo, const int_t* n, complex8* a, const int_t* ia, const int_t* ja, const int_t* desca, int_t* info);
134void pcpotrs(const char* uplo, const int_t* n, const int_t* nrhs, const complex8* a, const int_t* ia, const int_t* ja, const int_t* desca, complex8* b, const int_t* ib, const int_t* jb, const int_t* descb, int_t* info);
135void pddbtrf(const int_t* n, const int_t* bwl, const int_t* bwu, double* a, const int_t* ja, const int_t* desca, double* af, const int_t* laf, double* work, const int_t* lwork, int_t* info);
136void pddbtrs(const char* trans, const int_t* n, const int_t* bwl, const int_t* bwu, const int_t* nrhs, double* a, const int_t* ja, const int_t* desca, double* b, const int_t* ib, const int_t* descb, double* af, const int_t* laf, double* work, const int_t* lwork, int_t* info);
137void pdgbsv(const int_t* n, const int_t* bwl, const int_t* bwu, const int_t* nrhs, double* a, const int_t* ja, const int_t* desca, int_t* ipiv, double* b, const int_t* ib, const int_t* descb, double* work, const int_t* lwork, int_t* info);
138void pdgbtrf(const int_t* n, const int_t* bwl, const int_t* bwu, double* a, const int_t* ja, const int_t* desca, int_t* ipiv, double* af, const int_t* laf, double* work, const int_t* lwork, int_t* info);
139void pdgbtrs(const char* trans, const int_t* n, const int_t* bwl, const int_t* bwu, const int_t* nrhs, double* a, const int_t* ja, const int_t* desca, int_t* ipiv, double* b, const int_t* ib, const int_t* descb, double* af, const int_t* laf, double* work, const int_t* lwork, int_t* info);
140void pdgemr2d(const int_t* m, const int_t* n, const double* a, const int_t* ia, const int_t* ja, const int_t* desca, double* b, const int_t* ib, const int_t* jb, const int_t* descb, const int_t* ictxt);
141void pdgesv(const int_t* n, const int_t* nrhs, double* a, const int_t* ia, const int_t* ja, const int_t* desca, int_t* ipiv, double* b, const int_t* ib, const int_t* jb, const int_t* descb, int_t* info);
142void pdgetrf(const int_t* m, const int_t* n, double* a, const int_t* ia, const int_t* ja, const int_t* desca, int_t* ipiv, int_t* info);
143void pdgetrs(const char* trans, const int_t* n, const int_t* nrhs, const double* a, const int_t* ia, const int_t* ja, const int_t* desca, const int_t* ipiv, double* b, const int_t* ib, const int_t* jb, const int_t* descb, int_t* info);
144void pdpbtrf(const char* uplo, const int_t* n, const int_t* bw, double* a, const int_t* ja, const int_t* desca, double* af, const int_t* laf, double* work, const int_t* lwork, int_t* info);
145void pdpbtrs(const char* uplo, const int_t* n, const int_t* bw, const int_t* nrhs, double* a, const int_t* ja, const int_t* desca, double* b, const int_t* ib, const int_t* descb, double* af, const int_t* laf, double* work, const int_t* lwork, int_t* info);
146void pdposv(const char* uplo, const int_t* n, const int_t* nrhs, double* a, const int_t* ia, const int_t* ja, const int_t* desca, double* b, const int_t* ib, const int_t* jb, const int_t* descb, int_t* info);
147void pdpotrf(const char* uplo, const int_t* n, double* a, const int_t* ia, const int_t* ja, const int_t* desca, int_t* info);
148void pdpotrs(const char* uplo, const int_t* n, const int_t* nrhs, const double* a, const int_t* ia, const int_t* ja, const int_t* desca, double* b, const int_t* ib, const int_t* jb, const int_t* descb, int_t* info);
149void psdbtrf(const int_t* n, const int_t* bwl, const int_t* bwu, float* a, const int_t* ja, const int_t* desca, float* af, const int_t* laf, float* work, const int_t* lwork, int_t* info);
150void psdbtrs(const char* trans, const int_t* n, const int_t* bwl, const int_t* bwu, const int_t* nrhs, float* a, const int_t* ja, const int_t* desca, float* b, const int_t* ib, const int_t* descb, float* af, const int_t* laf, float* work, const int_t* lwork, int_t* info);
151void psgbsv(const int_t* n, const int_t* bwl, const int_t* bwu, const int_t* nrhs, float* a, const int_t* ja, const int_t* desca, int_t* ipiv, float* b, const int_t* ib, const int_t* descb, float* work, const int_t* lwork, int_t* info);
152void psgbtrf(const int_t* n, const int_t* bwl, const int_t* bwu, float* a, const int_t* ja, const int_t* desca, int_t* ipiv, float* af, const int_t* laf, float* work, const int_t* lwork, int_t* info);
153void psgbtrs(const char* trans, const int_t* n, const int_t* bwl, const int_t* bwu, const int_t* nrhs, float* a, const int_t* ja, const int_t* desca, int_t* ipiv, float* b, const int_t* ib, const int_t* descb, float* af, const int_t* laf, float* work, const int_t* lwork, int_t* info);
154void psgemr2d(const int_t* m, const int_t* n, const float* a, const int_t* ia, const int_t* ja, const int_t* desca, float* b, const int_t* ib, const int_t* jb, const int_t* descb, const int_t* ictxt);
155void psgesv(const int_t* n, const int_t* nrhs, float* a, const int_t* ia, const int_t* ja, const int_t* desca, int_t* ipiv, float* b, const int_t* ib, const int_t* jb, const int_t* descb, int_t* info);
156void psgetrf(const int_t* m, const int_t* n, float* a, const int_t* ia, const int_t* ja, const int_t* desca, int_t* ipiv, int_t* info);
157void psgetrs(const char* trans, const int_t* n, const int_t* nrhs, const float* a, const int_t* ia, const int_t* ja, const int_t* desca, const int_t* ipiv, float* b, const int_t* ib, const int_t* jb, const int_t* descb, int_t* info);
158void pspbtrf(const char* uplo, const int_t* n, const int_t* bw, float* a, const int_t* ja, const int_t* desca, float* af, const int_t* laf, float* work, const int_t* lwork, int_t* info);
159void pspbtrs(const char* uplo, const int_t* n, const int_t* bw, const int_t* nrhs, float* a, const int_t* ja, const int_t* desca, float* b, const int_t* ib, const int_t* descb, float* af, const int_t* laf, float* work, const int_t* lwork, int_t* info);
160void psposv(const char* uplo, const int_t* n, const int_t* nrhs, float* a, const int_t* ia, const int_t* ja, const int_t* desca, float* b, const int_t* ib, const int_t* jb, const int_t* descb, int_t* info);
161void pspotrf(const char* uplo, const int_t* n, float* a, const int_t* ia, const int_t* ja, const int_t* desca, int_t* info);
162void pspotrs(const char* uplo, const int_t* n, const int_t* nrhs, const float* a, const int_t* ia, const int_t* ja, const int_t* desca, float* b, const int_t* ib, const int_t* jb, const int_t* descb, int_t* info);
163void pzdbtrf(const int_t* n, const int_t* bwl, const int_t* bwu, complex16* a, const int_t* ja, const int_t* desca, complex16* af, const int_t* laf, complex16* work, const int_t* lwork, int_t* info);
164void pzdbtrs(const char* trans, const int_t* n, const int_t* bwl, const int_t* bwu, const int_t* nrhs, complex16* a, const int_t* ja, const int_t* desca, complex16* b, const int_t* ib, const int_t* descb, complex16* af, const int_t* laf, complex16* work, const int_t* lwork, int_t* info);
165void pzgbtrf(const int_t* n, const int_t* bwl, const int_t* bwu, complex16* a, const int_t* ja, const int_t* desca, int_t* ipiv, complex16* af, const int_t* laf, complex16* work, const int_t* lwork, int_t* info);
166void pzgbtrs(const char* trans, const int_t* n, const int_t* bwl, const int_t* bwu, const int_t* nrhs, complex16* a, const int_t* ja, const int_t* desca, int_t* ipiv, complex16* b, const int_t* ib, const int_t* descb, complex16* af, const int_t* laf, complex16* work, const int_t* lwork, int_t* info);
167void pzgemr2d(const int_t* m, const int_t* n, const complex16* a, const int_t* ia, const int_t* ja, const int_t* desca, complex16* b, const int_t* ib, const int_t* jb, const int_t* descb, const int_t* ictxt);
168void pzgetrf(const int_t* m, const int_t* n, complex16* a, const int_t* ia, const int_t* ja, const int_t* desca, int_t* ipiv, int_t* info);
169void pzgetrs(const char* trans, const int_t* n, const int_t* nrhs, const complex16* a, const int_t* ia, const int_t* ja, const int_t* desca, const int_t* ipiv, complex16* b, const int_t* ib, const int_t* jb, const int_t* descb, int_t* info);
170void pzpbtrf(const char* uplo, const int_t* n, const int_t* bw, complex16* a, const int_t* ja, const int_t* desca, complex16* af, const int_t* laf, complex16* work, const int_t* lwork, int_t* info);
171void pzpbtrs(const char* uplo, const int_t* n, const int_t* bw, const int_t* nrhs, complex16* a, const int_t* ja, const int_t* desca, complex16* b, const int_t* ib, const int_t* descb, complex16* af, const int_t* laf, complex16* work, const int_t* lwork, int_t* info);
172void pzpotrf(const char* uplo, const int_t* n, complex16* a, const int_t* ia, const int_t* ja, const int_t* desca, int_t* info);
173void pzpotrs(const char* uplo, const int_t* n, const int_t* nrhs, const complex16* a, const int_t* ia, const int_t* ja, const int_t* desca, complex16* b, const int_t* ib, const int_t* jb, const int_t* descb, int_t* info);
174
175void igamn2d(const int_t* ConTxt, const char* scope, const char* top, const int_t* m, const int_t* n, int_t* A, const int_t* lda, int_t* rA, int_t* cA, const int_t* ldia, const int_t* rdest, const int_t* cdest);
176void igamx2d(const int_t* ConTxt, const char* scope, const char* top, const int_t* m, const int_t* n, int_t* A, const int_t* lda, int_t* rA, int_t* cA, const int_t* ldia, const int_t* rdest, const int_t* cdest);
177void igebr2d(const int_t* ConTxt, const char* scope, const char* top, const int_t* m, const int_t* n, int_t* A, const int_t* lda, const int_t* rsrc, const int_t* csrc);
178
179#ifdef __cplusplus
180}
181#endif
182
183#endif // EZP_H