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 #include <glob.h>
35 
36 namespace Gyoto {
38 
41  void debug(int mode);
42 
44 
47  int debug();
48 
50 
61  void verbose(int mode);
62 
64 
67  int verbose();
68 
70 
82  void convert(double * const x, const std::size_t nelem,
83  const double mass_sun, const double distance_kpc,
84  const std::string unit);
85 
87 
97  double atof(const char * str);
98 
100 
103  void help(std::string class_name);
104 
106  std::vector<std::string> split(std::string const &src, std::string const &delim);
107 
109  /*
110  boost Bessel function as implemented in
111  #include <boost/math/special_functions/bessel.hpp>
112  are 50% longer than the following, while the following
113  give results accurate at ~1e-6 which is more than enough.
114  */
115  double bessi0(double xx);
116  double bessi1(double xx);
117  double bessk0(double xx);
118  double bessk1(double xx);
119  double bessk(int nn, double xx);
120 
121  double hypergeom (double kappaIndex, double thetae);
122 
124  void cartesianToSpherical(double const cpos[3], double spos[3]);
126  void sphericalToCartesian(double const spos[3], double cpos[3]);
127 
129 
133  // Keep argument names for swig!
134  void matrix4Invert(double ARGOUT_ARRAY2[4][4], double const IN_ARRAY2[4][4]);
135 
137 
145  // Keep argument names for swig!
146  void matrix4CircularInvert(double ARGOUT_ARRAY2[4][4], double const IN_ARRAY2[4][4]);
147 
149 
173  std::vector<std::string> glob(const std::string pattern,
174  int flags = GLOB_NOCHECK | GLOB_NOSORT |
175  GLOB_TILDE | GLOB_BRACE);
176 }
177 
178 #endif
void sphericalToCartesian(double const spos[3], double cpos[3])
Tranform from spherical 3-position to Cartesian 3-position.
double bessk(int nn, double xx)
Modified Bessel function.
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)
void matrix4Invert(double ARGOUT_ARRAY2[4][4], double const IN_ARRAY2[4][4])
Invert 4x4 matrix.
#define size_t
If not defined in <sys/types.h>.
Definition: GyotoConfig.h:424
void verbose(int mode)
Set verbosity level.
void help(std::string class_name)
Print help on class.
double atof(const char *str)
Interpret C string as double.
double bessi1(double xx)
Modified Bessel function I1
void cartesianToSpherical(double const cpos[3], double spos[3])
Tranform from Cartesian 3-position to spherical 3-position.
Gyoto ubiquitous macros and typedefs.
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:46
double bessk1(double xx)
Modified Bessel function K1
void debug(int mode)
Set debug mode.
std::vector< std::string > split(std::string const &src, std::string const &delim)
Split string.
double hypergeom(double kappaIndex, double thetae)
Gauss hypergeometric 2F1 term for kappa-distribution synchrotron.
void matrix4CircularInvert(double ARGOUT_ARRAY2[4][4], double const IN_ARRAY2[4][4])
Invert 4x4 circular spacetime metric.
double bessk0(double xx)
Modified Bessel function K0
double bessi0(double xx)
Bessel function computation.
std::vector< std::string > glob(const std::string pattern, int flags=GLOB_NOCHECK|GLOB_NOSORT|GLOB_TILDE|GLOB_BRACE)
Generate pathnames matching a pattern.