SphericalHarmonic.hpp
Go to the documentation of this file.
1 
10 #if !defined(GEOGRAPHICLIB_SPHERICALHARMONIC_HPP)
11 #define GEOGRAPHICLIB_SPHERICALHARMONIC_HPP 1
12 
13 #include <vector>
17 
18 namespace GeographicLib {
19 
70  public:
119  };
120 
121  private:
122  typedef Math::real real;
124  real _a;
125  unsigned _norm;
126 
127  public:
167  SphericalHarmonic(const std::vector<real>& C,
168  const std::vector<real>& S,
169  int N, real a, unsigned norm = FULL)
170  : _a(a)
171  , _norm(norm)
172  { _c[0] = SphericalEngine::coeff(C, S, N); }
173 
198  SphericalHarmonic(const std::vector<real>& C,
199  const std::vector<real>& S,
200  int N, int nmx, int mmx,
201  real a, unsigned norm = FULL)
202  : _a(a)
203  , _norm(norm)
204  { _c[0] = SphericalEngine::coeff(C, S, N, nmx, mmx); }
205 
212 
224  Math::real operator()(real x, real y, real z) const {
225  real f[] = {1};
226  real v = 0;
227  real dummy;
228  switch (_norm) {
229  case FULL:
230  v = SphericalEngine::Value<false, SphericalEngine::FULL, 1>
231  (_c, f, x, y, z, _a, dummy, dummy, dummy);
232  break;
233  case SCHMIDT:
234  v = SphericalEngine::Value<false, SphericalEngine::SCHMIDT, 1>
235  (_c, f, x, y, z, _a, dummy, dummy, dummy);
236  break;
237  }
238  return v;
239  }
240 
257  Math::real operator()(real x, real y, real z,
258  real& gradx, real& grady, real& gradz) const {
259  real f[] = {1};
260  real v = 0;
261  switch (_norm) {
262  case FULL:
263  v = SphericalEngine::Value<true, SphericalEngine::FULL, 1>
264  (_c, f, x, y, z, _a, gradx, grady, gradz);
265  break;
266  case SCHMIDT:
267  v = SphericalEngine::Value<true, SphericalEngine::SCHMIDT, 1>
268  (_c, f, x, y, z, _a, gradx, grady, gradz);
269  break;
270  }
271  return v;
272  }
273 
324  CircularEngine Circle(real p, real z, bool gradp) const {
325  real f[] = {1};
326  switch (_norm) {
327  case FULL:
328  return gradp ?
329  SphericalEngine::Circle<true, SphericalEngine::FULL, 1>
330  (_c, f, p, z, _a) :
331  SphericalEngine::Circle<false, SphericalEngine::FULL, 1>
332  (_c, f, p, z, _a);
333  break;
334  case SCHMIDT:
335  default: // To avoid compiler warnings
336  return gradp ?
337  SphericalEngine::Circle<true, SphericalEngine::SCHMIDT, 1>
338  (_c, f, p, z, _a) :
339  SphericalEngine::Circle<false, SphericalEngine::SCHMIDT, 1>
340  (_c, f, p, z, _a);
341  break;
342  }
343  }
344 
349  { return _c[0]; }
350  };
351 
352 } // namespace GeographicLib
353 
354 #endif // GEOGRAPHICLIB_SPHERICALHARMONIC_HPP
Math::real operator()(real x, real y, real z) const
#define GEOGRAPHICLIB_EXPORT
Definition: Constants.hpp:91
Scalar * y
CircularEngine Circle(real p, real z, bool gradp) const
ArrayXcf v
Definition: Cwise_arg.cpp:1
#define N
Definition: gksort.c:12
Math::real operator()(real x, real y, real z, real &gradx, real &grady, real &gradz) const
Array33i a
Package up coefficients for SphericalEngine.
Key S(std::uint64_t j)
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Namespace for GeographicLib.
const SphericalEngine::coeff & Coefficients() const
Header for GeographicLib::CircularEngine class.
Matrix< Scalar, Dynamic, Dynamic > C
Definition: bench_gemm.cpp:37
Spherical harmonic sums for a circle.
Header for GeographicLib::Constants class.
float * p
Spherical harmonic series.
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Header for GeographicLib::SphericalEngine class.
SphericalHarmonic(const std::vector< real > &C, const std::vector< real > &S, int N, real a, unsigned norm=FULL)
SphericalHarmonic(const std::vector< real > &C, const std::vector< real > &S, int N, int nmx, int mmx, real a, unsigned norm=FULL)


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:44:49