-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathisisWrappers.cxx
More file actions
125 lines (105 loc) · 5.21 KB
/
isisWrappers.cxx
File metadata and controls
125 lines (105 loc) · 5.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#include <XSFunctions/Utilities/XSCall.h>
#include <xsTypes.h>
#include <cfortran.h>
#include "isisWrappers.h"
// Shu Niu, Jul, 2024, fix bug introduced since Xspec 12.13.0.
void cppModelWrapper(const double *energy, int nFlux, const double *params,
int spectrumNumber, double *flux, double *fluxError, const char *initStr,
int nPar, void (*cppFunc)(const RealArray &, const RealArray &, int, RealArray &, RealArray &, const string &));
void fcppModelWrapper(const float *energy, int nFlux, const float *params,
int spectrumNumber, float *flux, float *fluxError,
int nPar, void (*cppFunc)(const RealArray &, const RealArray &, int, RealArray &, RealArray &, const string &));
void fModelWrapper(const double *energy, int nFlux, const double *params,
int nPar, int spectrumNumber, double *flux, double *fluxError,
xsf77Call fFunc);
// adaf_apec,"C_" wrapper seems not necessary.
void f_adaf(const float *energy, int nFlux, const float *params,
int spectrumNumber, float *flux, float *fluxError);
FCALLSCSUB6(f_adaf, ADAF, adaf, FLOATV, INT, FLOATV, INT, FLOATV, FLOATV)
FCALLSCSUB7(C_adaf, DADAF, dadaf, DOUBLEV, INT, DOUBLEV, INT, DOUBLEV, DOUBLEV, STRING)
void f_adaf(const float *energy, int nFlux, const float *params,
int spectrumNumber, float *flux, float *fluxError)
{
const size_t nPar = 5;
fcppModelWrapper(energy, nFlux, params, spectrumNumber, flux, fluxError,
nPar, adaf);
}
void C_adaf(const double *energy, int nFlux, const double *params,
int spectrumNumber, double *flux, double *fluxError, const char *initStr)
{
const size_t nPar = 5;
cppModelWrapper(energy, nFlux, params, spectrumNumber, flux, fluxError,
initStr, nPar, adaf);
}
// adaf_vapec
void f_vadaf(const float *energy, int nFlux, const float *params,
int spectrumNumber, float *flux, float *fluxError);
FCALLSCSUB6(f_vadaf, VADAF, vadaf, FLOATV, INT, FLOATV, INT, FLOATV, FLOATV)
FCALLSCSUB7(C_vadaf, DVADAF, dvadaf, DOUBLEV, INT, DOUBLEV, INT, DOUBLEV, DOUBLEV, STRING)
void f_vadaf(const float *energy, int nFlux, const float *params,
int spectrumNumber, float *flux, float *fluxError)
{
const size_t nPar = 18;
fcppModelWrapper(energy, nFlux, params, spectrumNumber, flux, fluxError,
nPar, vadaf);
}
void C_vadaf(const double *energy, int nFlux, const double *params,
int spectrumNumber, double *flux, double *fluxError, const char *initStr)
{
const size_t nPar = 18;
cppModelWrapper(energy, nFlux, params, spectrumNumber, flux, fluxError,
initStr, nPar, vadaf);
}
// adaf_brem
void C_badaf(const double *energy, int nFlux, const double *params,
int spectrumNumber, double *flux, double *fluxError, const char *initStr)
{
const size_t nPar = 4;
fModelWrapper(energy, nFlux, params, nPar, spectrumNumber, flux, fluxError,
badaf_);
}
void CXX_badaf(const RealArray &energyArray, const RealArray ¶ms,
int spectrumNumber, RealArray &flux, RealArray &fluxErr, const string &initString)
{
XSCallBase *funcObj = new XSCall<xsf77Call>(badaf_);
(*funcObj)(energyArray, params, spectrumNumber, flux, fluxErr, initString);
delete funcObj;
}
// adaf_xray
void f_adafx(const float *energy, int nFlux, const float *params,
int spectrumNumber, float *flux, float *fluxError);
FCALLSCSUB6(f_adafx, ADAFX, adafx, FLOATV, INT, FLOATV, INT, FLOATV, FLOATV)
FCALLSCSUB7(C_adafx, DADAFX, dadafx, DOUBLEV, INT, DOUBLEV, INT, DOUBLEV, DOUBLEV, STRING)
void f_adafx(const float *energy, int nFlux, const float *params,
int spectrumNumber, float *flux, float *fluxError)
{
const size_t nPar = 5;
fcppModelWrapper(energy, nFlux, params, spectrumNumber, flux, fluxError,
nPar, adafx);
}
void C_adafx(const double *energy, int nFlux, const double *params,
int spectrumNumber, double *flux, double *fluxError, const char *initStr)
{
const size_t nPar = 5;
cppModelWrapper(energy, nFlux, params, spectrumNumber, flux, fluxError,
initStr, nPar, adafx);
}
// adaf_vxray
void f_vadafx(const float *energy, int nFlux, const float *params,
int spectrumNumber, float *flux, float *fluxError);
FCALLSCSUB6(f_vadafx, VADAFX, vadafx, FLOATV, INT, FLOATV, INT, FLOATV, FLOATV)
FCALLSCSUB7(C_vadafx, DVADAFX, dvadafx, DOUBLEV, INT, DOUBLEV, INT, DOUBLEV, DOUBLEV, STRING)
void f_vadafx(const float *energy, int nFlux, const float *params,
int spectrumNumber, float *flux, float *fluxError)
{
const size_t nPar = 18;
fcppModelWrapper(energy, nFlux, params, spectrumNumber, flux, fluxError,
nPar, vadafx);
}
void C_vadafx(const double *energy, int nFlux, const double *params,
int spectrumNumber, double *flux, double *fluxError, const char *initStr)
{
const size_t nPar = 18;
cppModelWrapper(energy, nFlux, params, spectrumNumber, flux, fluxError,
initStr, nPar, vadafx);
}