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 
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
SphericalEngine.hpp
Header for GeographicLib::SphericalEngine class.
GeographicLib
Namespace for GeographicLib.
Definition: JacobiConformal.hpp:15
GeographicLib::CircularEngine::normalization
normalization
Definition: CircularEngine.hpp:55
GeographicLib::CircularEngine::operator()
Math::real operator()(real lon, real &gradx, real &grady, real &gradz) const
Definition: CircularEngine.hpp:181
GeographicLib::CircularEngine::CircularEngine
CircularEngine(int M, bool gradp, unsigned norm, real a, real r, real u, real t)
Definition: CircularEngine.hpp:70
GeographicLib::Math::sincosd
static void sincosd(T x, T &sinx, T &cosx)
Definition: Math.hpp:558
GeographicLib::CircularEngine::operator()
Math::real operator()(real sinlon, real coslon) const
Definition: CircularEngine.hpp:128
GEOGRAPHICLIB_EXPORT
#define GEOGRAPHICLIB_EXPORT
Definition: Constants.hpp:91
GeographicLib::CircularEngine::operator()
Math::real operator()(real sinlon, real coslon, real &gradx, real &grady, real &gradz) const
Definition: CircularEngine.hpp:162
GeographicLib::CircularEngine::_uq2
real _uq2
Definition: CircularEngine.hpp:64
GeographicLib::SphericalEngine::SCHMIDT
@ SCHMIDT
Definition: SphericalEngine.hpp:84
GeographicLib::CircularEngine::_u
real _u
Definition: CircularEngine.hpp:62
pybind_wrapper_test_script.dummy
dummy
Definition: pybind_wrapper_test_script.py:42
GeographicLib::SphericalEngine
The evaluation engine for SphericalHarmonic.
Definition: SphericalEngine.hpp:40
GeographicLib::Math::real
double real
Definition: Math.hpp:129
GeographicLib::CircularEngine::SetCoeff
void SetCoeff(int m, real wc, real ws)
Definition: CircularEngine.hpp:91
GeographicLib::CircularEngine::real
Math::real real
Definition: CircularEngine.hpp:54
GeographicLib::CircularEngine
Spherical harmonic sums for a circle.
Definition: CircularEngine.hpp:52
cl
Definition: cxx11_tensor_builtins_sycl.cpp:30
GeographicLib::SphericalEngine::FULL
@ FULL
Definition: SphericalEngine.hpp:77
m
Matrix3f m
Definition: AngleAxis_mimic_euler.cpp:1
Constants.hpp
Header for GeographicLib::Constants class.
a
ArrayXXi a
Definition: Array_initializer_list_23_cxx11.cpp:1
GeographicLib::CircularEngine::SetCoeff
void SetCoeff(int m, real wc, real ws, real wrc, real wrs, real wtc, real wts)
Definition: CircularEngine.hpp:94
GeographicLib::CircularEngine::_M
int _M
Definition: CircularEngine.hpp:59
std
Definition: BFloat16.h:88
GeographicLib::CircularEngine::_norm
unsigned _norm
Definition: CircularEngine.hpp:61
lon
static const double lon
Definition: testGeographicLib.cpp:34
GeographicLib::Math::sq
static T sq(T x)
Definition: Math.hpp:232
align_3::t
Point2 t(10, 10)
GeographicLib::CircularEngine::_gradp
bool _gradp
Definition: CircularEngine.hpp:60
GeographicLib::CircularEngine::CircularEngine
CircularEngine()
Definition: CircularEngine.hpp:110
real
Definition: main.h:100
GeographicLib::CircularEngine::operator()
Math::real operator()(real lon) const
Definition: CircularEngine.hpp:139
GeographicLib::CircularEngine::_wts
std::vector< real > _wts
Definition: CircularEngine.hpp:63
M
Matrix< RealScalar, Dynamic, Dynamic > M
Definition: bench_gemm.cpp:51


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:01:58