Gyoto
GyotoUtils.h
Go to the documentation of this file.
1
8/*
9 Copyright 2011, 2016 Thibaut Paumard
10
11 This file is part of Gyoto.
12
13 Gyoto is free software: you can redistribute it and/or modify
14 it under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 Gyoto is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
25 */
26
27#ifndef __GyotoUtils_H_
28#define __GyotoUtils_H_
29
30#include "GyotoDefs.h"
31
32#include <string>
33#include <vector>
34
35namespace Gyoto {
37
40 void debug(int mode);
41
43
46 int debug();
47
49
60 void verbose(int mode);
61
63
66 int verbose();
67
69
81 void convert(double * const x, const std::size_t nelem,
82 const double mass_sun, const double distance_kpc,
83 const std::string unit);
84
86
96 double atof(const char * str);
97
99
102 void help(std::string class_name);
103
105 std::vector<std::string> split(std::string const &src, std::string const &delim);
106
108 /*
109 boost Bessel function as implemented in
110 #include <boost/math/special_functions/bessel.hpp>
111 are 50% longer than the following, while the following
112 give results accurate at ~1e-6 which is more than enough.
113 */
114 double bessi0(double xx);
115 double bessi1(double xx);
116 double bessk0(double xx);
117 double bessk1(double xx);
118 double bessk(int nn, double xx);
119
120 double hypergeom (double kappaIndex, double thetae);
121
123 void cartesianToSpherical(double const cpos[3], double spos[3]);
125 void sphericalToCartesian(double const spos[3], double cpos[3]);
126
128
132 // Keep argument names for swig!
133 void matrix4Invert(double ARGOUT_ARRAY2[4][4], double const IN_ARRAY2[4][4]);
134
136
144 // Keep argument names for swig!
145 void matrix4CircularInvert(double ARGOUT_ARRAY2[4][4], double const IN_ARRAY2[4][4]);
146}
147
148#endif
Gyoto ubiquitous macros and typedefs.
Namespace for the Gyoto library.
Definition GyotoAstrobj.h:44
std::vector< std::string > split(std::string const &src, std::string const &delim)
Split string.
void matrix4Invert(double ARGOUT_ARRAY2[4][4], double const IN_ARRAY2[4][4])
Invert 4x4 matrix.
double hypergeom(double kappaIndex, double thetae)
Gauss hypergeometric 2F1 term for kappa-distribution synchrotron.
void sphericalToCartesian(double const spos[3], double cpos[3])
Tranform from spherical 3-position to Cartesian 3-position.
double bessk1(double xx)
Modified Bessel function K1
double bessi0(double xx)
Bessel function computation.
void matrix4CircularInvert(double ARGOUT_ARRAY2[4][4], double const IN_ARRAY2[4][4])
Invert 4x4 circular spacetime metric.
int verbose()
Get verbosity level.
double bessk0(double xx)
Modified Bessel function K0
double bessi1(double xx)
Modified Bessel function I1
void convert(double *const x, const std::size_t nelem, const double mass_sun, const double distance_kpc, const std::string unit)
Convert lengths (deprecated)
int debug()
Get debug mode.
double atof(const char *str)
Interpret C string as double.
double bessk(int nn, double xx)
Modified Bessel function.
void cartesianToSpherical(double const cpos[3], double spos[3])
Tranform from Cartesian 3-position to spherical 3-position.
void help(std::string class_name)
Print help on class.