From fa9b6f2b9bcb80778e63ef2aa4e17c7573de0015 Mon Sep 17 00:00:00 2001 From: Ian Jauslin Date: Tue, 24 May 2016 13:39:23 +0000 Subject: Initial commit --- src/ss_integral.h | 200 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 src/ss_integral.h (limited to 'src/ss_integral.h') diff --git a/src/ss_integral.h b/src/ss_integral.h new file mode 100644 index 0000000..fb30ddd --- /dev/null +++ b/src/ss_integral.h @@ -0,0 +1,200 @@ +/* +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 +*/ + +#ifndef SS_INTEGRAL_H +#define SS_INTEGRAL_H + +#include +#include "types.h" + +// compute pi and sqrt3 ahead of time +struct ss_cache { + mpfr_t pi; + mpfr_t sqrt3; +}; + +// extra arguments for the integrations +// A_FF +typedef struct ssFF_argsint_rho { + hh_params params; + TYPE_I; + array_mpfr abcissa; + array_mpfr weights; + struct ss_cache cache; + array_2_mpfr tmpss; + array_pthread_t* thread_ids; +} ssFF_argsint_rho; +typedef struct ssFF_argsint_theta { + hh_params params; + TYPE_I; + array_mpfr abcissa; + array_mpfr weights; + struct ss_cache cache; + array_2_mpfr tmpss; + mpfr_ptr rho; +} ssFF_argsint_theta; +typedef struct ssFF_argsint_psi { + hh_params params; + TYPE_I; + array_mpfr abcissa; + array_mpfr weights; + struct ss_cache cache; + array_2_mpfr tmpss; + mpfr_ptr rho; + mpfr_ptr theta; +} ssFF_argsint_psi; +typedef struct ssFF_argsint_z { + hh_params params; + TYPE_I; + struct ss_cache cache; + array_2_mpfr tmpss; + mpfr_ptr rho; + mpfr_ptr theta; + mpfr_ptr psi; +} ssFF_argsint_z; + +// A_RF +typedef struct ssRF_argsint_theta { + hh_params params; + TYPE_I; + array_mpfr abcissa; + array_mpfr weights; + struct ss_cache cache; + array_2_mpfr tmpss; + array_pthread_t* thread_ids; +} ssRF_argsint_theta; +typedef struct ssRF_argsint_varphi { + hh_params params; + TYPE_I; + array_mpfr abcissa; + array_mpfr weights; + struct ss_cache cache; + array_2_mpfr tmpss; + mpfr_ptr theta; +} ssRF_argsint_varphi; +typedef struct ssRF_argsint_r { + hh_params params; + TYPE_I; + array_mpfr abcissa; + array_mpfr weights; + struct ss_cache cache; + array_2_mpfr tmpss; + mpfr_ptr theta; + mpfr_ptr varphi; +} ssRF_argsint_r; +typedef struct ssRF_argsint_rho { + hh_params params; + TYPE_I; + struct ss_cache cache; + array_2_mpfr tmpss; + mpfr_ptr theta; + mpfr_ptr varphi; + mpfr_ptr r; +} ssRF_argsint_rho; + +// A_RR +typedef struct ssRR_argsint_theta { + hh_params params; + TYPE_I; + array_mpfr abcissa; + array_mpfr weights; + struct ss_cache cache; + array_2_mpfr tmpss; + array_pthread_t* thread_ids; + int sector_theta; +} ssRR_argsint_theta; +typedef struct ssRR_argsint_varphi { + hh_params params; + TYPE_I; + array_mpfr abcissa; + array_mpfr weights; + struct ss_cache cache; + array_2_mpfr tmpss; + int sector_theta; + mpfr_ptr theta; +} ssRR_argsint_varphi; +typedef struct ssRR_argsint_r { + hh_params params; + TYPE_I; + array_mpfr abcissa; + array_mpfr weights; + struct ss_cache cache; + array_2_mpfr tmpss; + mpfr_ptr theta; + mpfr_ptr varphi; +} ssRR_argsint_r; +typedef struct ssRR_argsint_rho { + hh_params params; + TYPE_I; + struct ss_cache cache; + array_2_mpfr tmpss; + mpfr_ptr theta; + mpfr_ptr varphi; + mpfr_ptr r; +} ssRR_argsint_rho; + +// compute the integral +int ss_integrate(mpfr_t* out, TYPE_I, hh_params params, array_mpfr abcissa, array_mpfr weights, unsigned int threads); + +// compute the integral A_FF +int ssFF_integrate(mpfr_t* out, TYPE_I, hh_params params, array_mpfr abcissa, array_mpfr weights, struct ss_cache cache, array_2_mpfr tmpss , unsigned int threads); +// integrand of the integral over rho in A_FF +int ssFF_integrand_rho(mpfr_t* out, mpfr_t rho, void* args); +// integrand of the integral over theta in A_FF +int ssFF_integrand_theta(mpfr_t* out, mpfr_t theta, void* args); +// integrand of the integral over psi in A_FF +int ssFF_integrand_psi(mpfr_t* out, mpfr_t psi, void* args); +// integrand of the integral over z in A_FF +int ssFF_integrand_z(mpfr_t* out, mpfr_t z, void* args); + +// compute the integral A_RF +int ssRF_integrate(mpfr_t* out, TYPE_I, hh_params params, array_mpfr abcissa, array_mpfr weights, struct ss_cache cache, array_2_mpfr tmpss, unsigned int threads); +// integrand of the integral over theta in A_RF +int ssRF_integrand_theta(mpfr_t* out, mpfr_t theta, void* args); +// integrand of the integral over varphi in A_RF +int ssRF_integrand_varphi(mpfr_t* out, mpfr_t varphi, void* args); +// integrand of the integral over r in A_RF +int ssRF_integrand_r(mpfr_t* out, mpfr_t r, void* args); +// integrand of the integral over rho in A_RF +int ssRF_integrand_rho(mpfr_t* out, mpfr_t rho, void* args); + +// compute the integral A_RR +int ssRR_integrate(mpfr_t* out, TYPE_I, hh_params params, array_mpfr abcissa, array_mpfr weights, struct ss_cache cache, array_2_mpfr tmpss, unsigned int threads); +// integrand of the integral over theta in A_RR +int ssRR_integrand_theta(mpfr_t* out, mpfr_t theta, void* args); +// integrand of the integral over varphi in A_RR +int ssRR_integrand_varphi(mpfr_t* out, mpfr_t varphi, void* args); +// integrand of the integral over r in A_RR +int ssRR_integrand_r(mpfr_t* out, mpfr_t r, void* args); +// integrand of the integral over rho in A_RR +int ssRR_integrand_rho(mpfr_t* out, mpfr_t rho, void* args); + +// R(theta) +int ss_R(mpfr_t out, mpfr_t theta, unsigned int sector, struct ss_cache cache); + +// cutoff function +int ss_cutoff(mpfr_t out, mpfr_t x, mpfr_t tmp1, mpfr_t tmp2); + +// periodic norm +int ss_norm(mpfr_t out, mpfr_t k1, mpfr_t k2, struct ss_cache cache, mpfr_t tmp1, mpfr_t tmp2); + +#endif + + -- cgit v1.2.3-54-g00ecf