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;
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 
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 
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
SphericalEngine.hpp
Header for GeographicLib::SphericalEngine class.
GeographicLib
Namespace for GeographicLib.
Definition: JacobiConformal.hpp:15
x
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
Definition: gnuplot_common_settings.hh:12
CircularEngine.hpp
Header for GeographicLib::CircularEngine class.
GeographicLib::SphericalHarmonic::operator()
Math::real operator()(real x, real y, real z, real &gradx, real &grady, real &gradz) const
Definition: SphericalHarmonic.hpp:257
GeographicLib::SphericalHarmonic::SphericalHarmonic
SphericalHarmonic()
Definition: SphericalHarmonic.hpp:211
GEOGRAPHICLIB_EXPORT
#define GEOGRAPHICLIB_EXPORT
Definition: Constants.hpp:91
GeographicLib::SphericalEngine::SCHMIDT
@ SCHMIDT
Definition: SphericalEngine.hpp:84
GeographicLib::SphericalHarmonic::normalization
normalization
Definition: SphericalHarmonic.hpp:74
pybind_wrapper_test_script.dummy
dummy
Definition: pybind_wrapper_test_script.py:42
GeographicLib::Math::real
double real
Definition: Math.hpp:129
GeographicLib::SphericalHarmonic::operator()
Math::real operator()(real x, real y, real z) const
Definition: SphericalHarmonic.hpp:224
GeographicLib::SphericalEngine::coeff
Package up coefficients for SphericalEngine.
Definition: SphericalEngine.hpp:99
GeographicLib::SphericalHarmonic::SphericalHarmonic
SphericalHarmonic(const std::vector< real > &C, const std::vector< real > &S, int N, real a, unsigned norm=FULL)
Definition: SphericalHarmonic.hpp:167
GeographicLib::CircularEngine
Spherical harmonic sums for a circle.
Definition: CircularEngine.hpp:52
GeographicLib::SphericalHarmonic
Spherical harmonic series.
Definition: SphericalHarmonic.hpp:69
GeographicLib::SphericalHarmonic::SphericalHarmonic
SphericalHarmonic(const std::vector< real > &C, const std::vector< real > &S, int N, int nmx, int mmx, real a, unsigned norm=FULL)
Definition: SphericalHarmonic.hpp:198
GeographicLib::SphericalEngine::FULL
@ FULL
Definition: SphericalEngine.hpp:77
pybind_wrapper_test_script.z
z
Definition: pybind_wrapper_test_script.py:61
Constants.hpp
Header for GeographicLib::Constants class.
y
Scalar * y
Definition: level1_cplx_impl.h:124
GeographicLib::SphericalHarmonic::_norm
unsigned _norm
Definition: SphericalHarmonic.hpp:125
tree::f
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Definition: testExpression.cpp:218
GeographicLib::SphericalHarmonic::_a
real _a
Definition: SphericalHarmonic.hpp:124
a
ArrayXXi a
Definition: Array_initializer_list_23_cxx11.cpp:1
C
Matrix< Scalar, Dynamic, Dynamic > C
Definition: bench_gemm.cpp:50
GeographicLib::SphericalHarmonic::Coefficients
const SphericalEngine::coeff & Coefficients() const
Definition: SphericalHarmonic.hpp:348
p
float * p
Definition: Tutorial_Map_using.cpp:9
v
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
N
#define N
Definition: igam.h:9
GeographicLib::SphericalHarmonic::Circle
CircularEngine Circle(real p, real z, bool gradp) const
Definition: SphericalHarmonic.hpp:324
real
Definition: main.h:100
GeographicLib::SphericalHarmonic::real
Math::real real
Definition: SphericalHarmonic.hpp:122
S
DiscreteKey S(1, 2)


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:14:02