forked from Shallyn/pyWaveformGenerator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpUtils.h
159 lines (134 loc) · 5.58 KB
/
pUtils.h
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
/**
* Writer: Xiaolin.liu
*
* This module contains basic functions for calculation.
* Functions list:
* Kernel:
* 20xx.xx.xx, LOC
**/
#ifndef __INCLUDE_PUTILS__
#define __INCLUDE_PUTILS__
#include "pStructs.h"
#include "mySpherical.h"
INT get_egw_flag();
INT get_DebugFlag();
void set_DebugFlag(INT flag);
#define IS_DEBUG (get_DebugFlag())
#define DEBUG_START \
do{set_DebugFlag(1);}while(0)
#define DEBUG_END \
do{set_DebugFlag(0);}while(0)
INT get_InputDebugFlag();
void set_InputDebugFlag(INT flag);
#define INPUT_DEBUG_FLAG (get_InputDebugFlag())
#define SET_INPUT_DEBUG_FLAG(flag) \
do{set_InputDebugFlag(flag);}while(0)
INT get_VersionFlag();
void set_VersionFlag(INT flag);
#define CODE_VERSION (get_VersionFlag())
#define SET_CODE_VERSION(ver) \
do{set_VersionFlag(ver);}while(0)
INT get_ConserveFlag();
REAL8 get_ConserveTime();
void set_ConserveFlag(INT flag, REAL8 ctime);
#define CONSERVE_FLAG (get_ConserveFlag())
#define GET_CONSERV_TIME (get_ConserveTime())
#define SET_CONSERV(flag, ctime) \
do{set_ConserveFlag(flag, ctime);}while(0)
REAL8 *rotate_vector(const REAL8 v[], const REAL8 k[], const REAL8 theta,REAL8 result[] );
REAL8 inner_product3d(const REAL8 values1[], const REAL8 values2[]);
REAL8 *cross_product3d(const REAL8 values1[],
const REAL8 values2[],
REAL8 result[] );
REAL8 SEOBWignerDAmp(UINT l, INT m, INT mp, REAL8 beta);
REAL8 SEOBWignerDPhase(INT m, INT mp, REAL8 alpha, REAL8 gamma);
REAL8 SEOBCalculateChiS(REAL8 chi1dotZ, REAL8 chi2dotZ);
REAL8 SEOBCalculateChiA(REAL8 chi1dotZ, REAL8 chi2dotZ);
SpinEOBDynamics *CreateSpinEOBDynamics(UINT length);
void DestroySpinEOBDynamics(SpinEOBDynamics *dy);
void DestroySpinEOBParams(SpinEOBParams *params);
INT EOBCalculateSigmaStar(REAL8Vector *sigmaStar,
REAL8 mass1,
REAL8 mass2,
REAL8Vector *s1norm,
REAL8Vector *s2norm);
INT EOBCalculateSigmaKerr(REAL8Vector *sigmaKerr,
REAL8Vector *s1norm,
REAL8Vector *s2norm);
INT XLALSimIMRSpinEOBCalculateSigmaStar(REAL8Vector *sigmaStar,
REAL8 mass1,
REAL8 mass2,
REAL8Vector *s1,
REAL8Vector *s2);
INT XLALSimIMRSpinEOBCalculateSigmaKerr(REAL8Vector *sigmaKerr,
REAL8 mass1,
REAL8 mass2,
REAL8Vector *s1,
REAL8Vector *s2);
SEOBdynamics *CreateSEOBdynamics(INT length);
void DestroySEOBdynamics(SEOBdynamics *seobdynamics);
SEOBSAdynamics *CreateSEOBSAdynamics(INT length);
void DestroySEOBSAdynamics(SEOBSAdynamics *seobdynamics);
SEOBPrecdynamics *CreateSEOBPrecdynamics(INT length);
void DestroySEOBPrecdynamics(SEOBPrecdynamics *seobdynamics);
int SphHarmListEOBNonQCCoeffs_AddMode(
SphHarmListEOBNonQCCoeffs **list_prepended, /* List structure to prepend to */
EOBNonQCCoeffs *nqcCoeffs, /* Mode data to be added */
UINT l, /*< Mode number l */
INT m /*< Mode number m */
);
SphHarmListEOBNonQCCoeffs *SphHarmListEOBNonQCCoeffs_GetMode(
SphHarmListEOBNonQCCoeffs
*list, /* List structure to get a particular mode from */
UINT l, /*< Mode number l */
INT m /*< Mode number m */
);
int DestroySphHarmListEOBNonQCCoeffs
(
SphHarmListEOBNonQCCoeffs *list /* Pointer to list to be destroyed */
);
int CAmpPhaseSequence_Init(
CAmpPhaseSequence **campphase, /* Double pointer to campphase sequence */
int size /* Size of data */
);
void DestroyCAmpPhaseSequence(
CAmpPhaseSequence *campphase /* Pointer to structure to be destroyed */
);
int SphHarmListCAmpPhaseSequence_AddMode(
SphHarmListCAmpPhaseSequence *
*list_prepended, /* List structure to prepend to */
CAmpPhaseSequence *campphase, /* Mode data to be added */
UINT l, /*< Mode number l */
INT m /*< Mode number m */
);
SphHarmListCAmpPhaseSequence *SphHarmListCAmpPhaseSequence_GetMode(
SphHarmListCAmpPhaseSequence *list, /* List structure to get a particular mode from */
UINT l, /*< Mode number l */
INT m /*< Mode number m */
);
int DestroySphHarmListCAmpPhaseSequence(
SphHarmListCAmpPhaseSequence *list /* Pointer to list to be destroyed */
);
void XLALSphHarmTimeSeriesSetTData(
SphHarmTimeSeries *ts, /**< Linked list to be prepended */
REAL8Vector* tdata /**< series of time data*/
);
SphHarmTimeSeries* XLALSphHarmTimeSeriesAddMode(
SphHarmTimeSeries *appended, /**< Linked list to be prepended */
const COMPLEX16TimeSeries* inmode, /**< Time series of h_lm mode being prepended */
UINT l, /**< l index of h_lm mode being prepended */
INT m /**< m index of h_lm mode being prepended */
);
COMPLEX16TimeSeries* XLALSphHarmTimeSeriesGetMode(
SphHarmTimeSeries *ts, /**< linked list to extract mode from */
UINT l, /**< l index of h_lm mode to get */
INT m /**< m index of h_lm mode to get */
);
void DestroySphHarmTimeSeries(SphHarmTimeSeries *ts);
void DestroySEOBCoreOutputs(SEOBCoreOutputs *all);
void DestroySEOBPrecCoreOutputs(SEOBPrecCoreOutputs *all);
int XLALEOBFindRobustPeak(REAL8 *tPeakQuant, REAL8Vector *tVec,
REAL8Vector *quantVec,
UINT window_width);
#endif