10#if !defined(GEOGRAPHICLIB_SPHERICALENGINE_HPP)
11#define GEOGRAPHICLIB_SPHERICALENGINE_HPP 1
19# pragma warning (push)
20# pragma warning (disable: 4251)
46 static std::vector<real>& sqrttable();
53 s =
real(pow(
real(std::numeric_limits<real>::radix),
54 -3 * (std::numeric_limits<real>::max_exponent < (1<<14) ?
55 std::numeric_limits<real>::max_exponent : (1<<14))
62 return std::numeric_limits<real>::epsilon() *
63 sqrt(std::numeric_limits<real>::epsilon());
101 int _nNx, _nmx, _mmx;
102 std::vector<real>::const_iterator _cCnm;
103 std::vector<real>::const_iterator _sSnm;
108 coeff() : _nNx(-1) , _nmx(-1) , _mmx(-1) {}
125 const std::vector<real>& S,
126 int N,
int nmx,
int mmx)
133 if (!((_nNx >= _nmx && _nmx >= _mmx && _mmx >= 0) ||
135 (_nmx == -1 && _mmx == -1)))
137 if (!(index(_nmx, _mmx) <
int(C.size()) &&
138 index(_nmx, _mmx) <
int(S.size()) + (_nNx + 1)))
155 const std::vector<real>& S,
165 if (!(index(_nmx, _mmx) <
int(C.size()) &&
166 index(_nmx, _mmx) <
int(S.size()) + (_nNx + 1)))
173 int N()
const {
return _nNx; }
177 int nmx()
const {
return _nmx; }
181 int mmx()
const {
return _mmx; }
190 {
return m * _nNx - m * (m - 1) / 2 + n; }
216 {
return m > _mmx || n > _nmx ? 0 : *(_cCnm + k) * f; }
228 {
return m > _mmx || n > _nmx ? 0 : *(_sSnm + (k - (_nNx + 1))) * f; }
239 {
return (M + 1) * (2 * N - M + 2) / 2; }
250 {
return Csize(N, M) - (N + 1); }
277 static void readcoeffs(std::istream& stream,
int& N,
int& M,
278 std::vector<real>& C, std::vector<real>& S,
279 bool truncate =
false);
311 template<
bool gradp, normalization norm,
int L>
339 template<
bool gradp, normalization norm,
int L>
361 static void RootTable(
int N);
373 std::vector<real> temp(0);
374 sqrttable().swap(temp);
381# pragma warning (pop)
Header for GeographicLib::Constants class.
#define GEOGRAPHICLIB_EXPORT
GeographicLib::Math::real real
Spherical harmonic sums for a circle.
Exception handling for GeographicLib.
Package up coefficients for SphericalEngine.
coeff(const std::vector< real > &C, const std::vector< real > &S, int N)
coeff(const std::vector< real > &C, const std::vector< real > &S, int N, int nmx, int mmx)
Math::real Sv(int k) const
Math::real Sv(int k, int n, int m, real f) const
static int Csize(int N, int M)
static int Ssize(int N, int M)
Math::real Cv(int k, int n, int m, real f) const
int index(int n, int m) const
Math::real Cv(int k) const
The evaluation engine for SphericalHarmonic.
static void RootTable(int N)
static void ClearRootTable()
Namespace for GeographicLib.