CircularEngine.hpp
Go to the documentation of this file.
1 
10 #if !defined(GEOGRAPHICLIB_CIRCULARENGINE_HPP)
11 #define GEOGRAPHICLIB_CIRCULARENGINE_HPP 1
12 
13 #include <vector>
16 
17 #if defined(_MSC_VER)
18 // Squelch warnings about dll vs vector
19 # pragma warning (push)
20 # pragma warning (disable: 4251)
21 #endif
22 
23 namespace GeographicLib {
24 
53  private:
54  typedef Math::real real;
58  };
59  int _M;
60  bool _gradp;
61  unsigned _norm;
62  real _a, _r, _u, _t;
63  std::vector<real> _wc, _ws, _wrc, _wrs, _wtc, _wts;
64  real _q, _uq, _uq2;
65 
66  Math::real Value(bool gradp, real sl, real cl,
67  real& gradx, real& grady, real& gradz) const;
68 
69  friend class SphericalEngine;
70  CircularEngine(int M, bool gradp, unsigned norm,
71  real a, real r, real u, real t)
72  : _M(M)
73  , _gradp(gradp)
74  , _norm(norm)
75  , _a(a)
76  , _r(r)
77  , _u(u)
78  , _t(t)
79  , _wc(std::vector<real>(_M + 1, 0))
80  , _ws(std::vector<real>(_M + 1, 0))
81  , _wrc(std::vector<real>(_gradp ? _M + 1 : 0, 0))
82  , _wrs(std::vector<real>(_gradp ? _M + 1 : 0, 0))
83  , _wtc(std::vector<real>(_gradp ? _M + 1 : 0, 0))
84  , _wts(std::vector<real>(_gradp ? _M + 1 : 0, 0))
85  {
86  _q = _a / _r;
87  _uq = _u * _q;
88  _uq2 = Math::sq(_uq);
89  }
90 
91  void SetCoeff(int m, real wc, real ws)
92  { _wc[m] = wc; _ws[m] = ws; }
93 
94  void SetCoeff(int m, real wc, real ws,
95  real wrc, real wrs, real wtc, real wts) {
96  _wc[m] = wc; _ws[m] = ws;
97  if (_gradp) {
98  _wrc[m] = wrc; _wrs[m] = wrs;
99  _wtc[m] = wtc; _wts[m] = wts;
100  }
101  }
102 
103  public:
104 
111  : _M(-1)
112  , _gradp(true)
113  , _u(0)
114  , _t(1)
115  {}
116 
128  Math::real operator()(real sinlon, real coslon) const {
129  real dummy;
130  return Value(false, sinlon, coslon, dummy, dummy, dummy);
131  }
132 
139  Math::real operator()(real lon) const {
140  real sinlon, coslon;
141  Math::sincosd(lon, sinlon, coslon);
142  return (*this)(sinlon, coslon);
143  }
144 
162  Math::real operator()(real sinlon, real coslon,
163  real& gradx, real& grady, real& gradz) const {
164  return Value(true, sinlon, coslon, gradx, grady, gradz);
165  }
166 
182  real& gradx, real& grady, real& gradz) const {
183  real sinlon, coslon;
184  Math::sincosd(lon, sinlon, coslon);
185  return (*this)(sinlon, coslon, gradx, grady, gradz);
186  }
187  };
188 
189 } // namespace GeographicLib
190 
191 #if defined(_MSC_VER)
192 # pragma warning (pop)
193 #endif
194 
195 #endif // GEOGRAPHICLIB_CIRCULARENGINE_HPP
Matrix3f m
Matrix< RealScalar, Dynamic, Dynamic > M
Definition: bench_gemm.cpp:51
#define GEOGRAPHICLIB_EXPORT
Definition: Constants.hpp:91
The evaluation engine for SphericalHarmonic.
Definition: BFloat16.h:88
static void sincosd(T x, T &sinx, T &cosx)
Definition: Math.hpp:558
Math::real operator()(real sinlon, real coslon) const
void SetCoeff(int m, real wc, real ws, real wrc, real wrs, real wtc, real wts)
static T sq(T x)
Definition: Math.hpp:232
Namespace for GeographicLib.
void SetCoeff(int m, real wc, real ws)
Spherical harmonic sums for a circle.
Header for GeographicLib::Constants class.
Math::real operator()(real lon, real &gradx, real &grady, real &gradz) const
Math::real operator()(real sinlon, real coslon, real &gradx, real &grady, real &gradz) const
static const double lon
CircularEngine(int M, bool gradp, unsigned norm, real a, real r, real u, real t)
Header for GeographicLib::SphericalEngine class.
Point2 t(10, 10)
Math::real operator()(real lon) const


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:34:01