Ian Jauslin
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/ss_integral_double.h')
-rw-r--r--src/ss_integral_double.h170
1 files changed, 170 insertions, 0 deletions
diff --git a/src/ss_integral_double.h b/src/ss_integral_double.h
new file mode 100644
index 0000000..67ec1de
--- /dev/null
+++ b/src/ss_integral_double.h
@@ -0,0 +1,170 @@
+/*
+Copyright 2016 Ian Jauslin
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+/*
+ Computation of the sunrise diagram
+
+ Takes a pointer to an integrand function 'I' as an argument. 'I' must have the following arguments
+ long double I(long double p1, long double p2, long double q1, long double q2, long double K1, long double K2, long double t1, long double t2, long double phi, long double W)
+*/
+
+#ifndef SS_INTEGRAL_DOUBLE_H
+#define SS_INTEGRAL_DOUBLE_H
+
+#include <libinum.h>
+#include "double_util.h"
+
+// extra arguments for the integrations
+// A_FF
+typedef struct ssFF_argsint_rho_double {
+ hh_params_double params;
+ TYPE_I_DOUBLE;
+ array_ldouble abcissa;
+ array_ldouble weights;
+} ssFF_argsint_rho_double;
+typedef struct ssFF_argsint_theta_double {
+ hh_params_double params;
+ TYPE_I_DOUBLE;
+ array_ldouble abcissa;
+ array_ldouble weights;
+ long double rho;
+} ssFF_argsint_theta_double;
+typedef struct ssFF_argsint_psi_double {
+ hh_params_double params;
+ TYPE_I_DOUBLE;
+ array_ldouble abcissa;
+ array_ldouble weights;
+ long double rho;
+ long double theta;
+} ssFF_argsint_psi_double;
+typedef struct ssFF_argsint_z_double {
+ hh_params_double params;
+ TYPE_I_DOUBLE;
+ long double rho;
+ long double theta;
+ long double psi;
+} ssFF_argsint_z_double;
+
+// A_RF
+typedef struct ssRF_argsint_theta_double {
+ hh_params_double params;
+ TYPE_I_DOUBLE;
+ array_ldouble abcissa;
+ array_ldouble weights;
+} ssRF_argsint_theta_double;
+typedef struct ssRF_argsint_varphi_double {
+ hh_params_double params;
+ TYPE_I_DOUBLE;
+ array_ldouble abcissa;
+ array_ldouble weights;
+ long double theta;
+} ssRF_argsint_varphi_double;
+typedef struct ssRF_argsint_r_double {
+ hh_params_double params;
+ TYPE_I_DOUBLE;
+ array_ldouble abcissa;
+ array_ldouble weights;
+ long double theta;
+ long double varphi;
+} ssRF_argsint_r_double;
+typedef struct ssRF_argsint_rho_double {
+ hh_params_double params;
+ TYPE_I_DOUBLE;
+ long double theta;
+ long double varphi;
+ long double r;
+} ssRF_argsint_rho_double;
+
+// A_RR
+typedef struct ssRR_argsint_theta_double {
+ hh_params_double params;
+ TYPE_I_DOUBLE;
+ array_ldouble abcissa;
+ array_ldouble weights;
+ int sector_theta;
+} ssRR_argsint_theta_double;
+typedef struct ssRR_argsint_varphi_double {
+ hh_params_double params;
+ TYPE_I_DOUBLE;
+ array_ldouble abcissa;
+ array_ldouble weights;
+ int sector_theta;
+ long double theta;
+} ssRR_argsint_varphi_double;
+typedef struct ssRR_argsint_r_double {
+ hh_params_double params;
+ TYPE_I_DOUBLE;
+ array_ldouble abcissa;
+ array_ldouble weights;
+ long double theta;
+ long double varphi;
+} ssRR_argsint_r_double;
+typedef struct ssRR_argsint_rho_double {
+ hh_params_double params;
+ TYPE_I_DOUBLE;
+ long double theta;
+ long double varphi;
+ long double r;
+} ssRR_argsint_rho_double;
+
+
+// compute the integral
+int ss_integrate_double(long double* out, TYPE_I_DOUBLE, hh_params_double params, array_ldouble abcissa, array_ldouble weights, unsigned int threads);
+
+// compute the integral A_FF
+int ssFF_integrate_double(long double* out, TYPE_I_DOUBLE, hh_params_double params, array_ldouble abcissa, array_ldouble weights, unsigned int threads);
+// integrand of the integral over rho in A_FF
+int ssFF_integrand_rho_double(long double* out, long double rho, void* args);
+// integrand of the integral over theta in A_FF
+int ssFF_integrand_theta_double(long double* out, long double theta, void* args);
+// integrand of the integral over psi in A_FF
+int ssFF_integrand_psi_double(long double* out, long double psi, void* args);
+// integrand of the integral over z in A_FF
+int ssFF_integrand_z_double(long double* out, long double z, void* args);
+
+// compute the integral A_RF
+int ssRF_integrate_double(long double* out, TYPE_I_DOUBLE, hh_params_double params, array_ldouble abcissa, array_ldouble weights, unsigned int threads);
+// integrand of the integral over theta in A_RF
+int ssRF_integrand_theta_double(long double* out, long double theta, void* args);
+// integrand of the integral over varphi in A_RF
+int ssRF_integrand_varphi_double(long double* out, long double varphi, void* args);
+// integrand of the integral over r in A_RF
+int ssRF_integrand_r_double(long double* out, long double r, void* args);
+// integrand of the integral over rho in A_RF
+int ssRF_integrand_rho_double(long double* out, long double rho, void* args);
+
+// compute the integral A_RR
+int ssRR_integrate_double(long double* out, TYPE_I_DOUBLE, hh_params_double params, array_ldouble abcissa, array_ldouble weights, unsigned int threads);
+// integrand of the integral over theta in A_RR
+int ssRR_integrand_theta_double(long double* out, long double theta, void* args);
+// integrand of the integral over varphi in A_RR
+int ssRR_integrand_varphi_double(long double* out, long double varphi, void* args);
+// integrand of the integral over r in A_RR
+int ssRR_integrand_r_double(long double* out, long double r, void* args);
+// integrand of the integral over rho in A_RR
+int ssRR_integrand_rho_double(long double* out, long double rho, void* args);
+
+// R(theta;
+long double ss_R_double(long double theta, int sector);
+
+// cutoff function
+long double ss_cutoff_double(long double x);
+
+// periodic norm
+long double ss_norm_double(long double k1, long double k2);
+
+#endif
+