/usr/include/CLHEP/GenericFunctions/EllipticIntegral.icc is in libclhep-dev 2.1.2.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 159 160 | // -*- C++ -*-
// $Id:
#include "gsl/gsl_sf_ellint.h"
#include <cmath>
#include <signal.h>
#include <assert.h>
namespace Genfun {
namespace EllipticIntegral {
//-----------------------------------------------------------------------------//
// FIRST KIND //
//-----------------------------------------------------------------------------//
FUNCTION_OBJECT_IMP(FirstKind)
inline
FirstKind::FirstKind():
_k("K", 1.0,0.0,1.0)
{
}
inline
FirstKind::~FirstKind() {
}
inline
FirstKind::FirstKind(const FirstKind & right):
_k(right._k)
{
}
inline
Parameter & FirstKind::k() {
return _k;
}
inline
const Parameter & FirstKind::k() const {
return _k;
}
inline
double FirstKind::operator() (double x) const {
gsl_sf_result result;
int status = gsl_sf_ellint_F_e(x,_k.getValue(), GSL_PREC_DOUBLE, &result);
if (status!=0) {
std::cerr << "Warning, GSL function gsl_sf_ellint_F_impl"
<< " return code" << status << std::endl;
raise(SIGFPE);
}
return result.val;
}
//-----------------------------------------------------------------------------//
// SECOND KIND //
//-----------------------------------------------------------------------------//
FUNCTION_OBJECT_IMP(SecondKind)
inline
SecondKind::SecondKind():
_k("K", 1.0,0.0,1.0)
{
}
inline
SecondKind::~SecondKind() {
}
inline
SecondKind::SecondKind(const SecondKind & right):
_k(right._k)
{
}
inline
Parameter & SecondKind::k() {
return _k;
}
inline
const Parameter & SecondKind::k() const {
return _k;
}
inline
double SecondKind::operator() (double x) const {
gsl_sf_result result;
int status = gsl_sf_ellint_E_e(x,_k.getValue(), GSL_PREC_DOUBLE, &result);
if (status!=0) {
std::cerr << "Warning, GSL function gsl_sf_ellint_E_impl"
<< " return code" << status << std::endl;
raise(SIGFPE);
}
return result.val;
}
//-----------------------------------------------------------------------------//
// THIRD KIND //
//-----------------------------------------------------------------------------//
FUNCTION_OBJECT_IMP(ThirdKind)
inline
ThirdKind::ThirdKind():
_k("K", 1.0,0.0, 1.0),
_n("N", 1.0,0.0,10.0)
{
}
inline
ThirdKind::~ThirdKind() {
}
inline
ThirdKind::ThirdKind(const ThirdKind & right):
_k(right._k),
_n(right._n)
{
}
inline
Parameter & ThirdKind::k() {
return _k;
}
inline
const Parameter & ThirdKind::k() const {
return _k;
}
inline
Parameter & ThirdKind::n() {
return _n;
}
inline
const Parameter & ThirdKind::n() const {
return _n;
}
inline
double ThirdKind::operator() (double x) const {
gsl_sf_result result;
int status = gsl_sf_ellint_P_e(x,_k.getValue(),_n.getValue(), GSL_PREC_DOUBLE, &result);
if (status!=0) {
std::cerr << "Warning, GSL function gsl_ellint_P_impl"
<< " return code" << status << std::endl;
raise(SIGFPE);
}
return result.val;
}
} // end namespace EllipticIntegral
} // end namespace Genfun
|