SphericalHarmonic1.hpp
Go to the documentation of this file.
1 
10 #if !defined(GEOGRAPHICLIB_SPHERICALHARMONIC1_HPP)
11 #define GEOGRAPHICLIB_SPHERICALHARMONIC1_HPP 1
12 
13 #include <vector>
17 
18 namespace GeographicLib {
19 
33  public:
52  };
53 
54  private:
55  typedef Math::real real;
58  unsigned _norm;
59 
60  public:
88  SphericalHarmonic1(const std::vector<real>& C,
89  const std::vector<real>& S,
90  int N,
91  const std::vector<real>& C1,
92  const std::vector<real>& S1,
93  int N1,
94  real a, unsigned norm = FULL)
95  : _a(a)
96  , _norm(norm) {
97  if (!(N1 <= N))
98  throw GeographicErr("N1 cannot be larger that N");
99  _c[0] = SphericalEngine::coeff(C, S, N);
100  _c[1] = SphericalEngine::coeff(C1, S1, N1);
101  }
102 
134  SphericalHarmonic1(const std::vector<real>& C,
135  const std::vector<real>& S,
136  int N, int nmx, int mmx,
137  const std::vector<real>& C1,
138  const std::vector<real>& S1,
139  int N1, int nmx1, int mmx1,
140  real a, unsigned norm = FULL)
141  : _a(a)
142  , _norm(norm) {
143  if (!(nmx1 <= nmx))
144  throw GeographicErr("nmx1 cannot be larger that nmx");
145  if (!(mmx1 <= mmx))
146  throw GeographicErr("mmx1 cannot be larger that mmx");
147  _c[0] = SphericalEngine::coeff(C, S, N, nmx, mmx);
148  _c[1] = SphericalEngine::coeff(C1, S1, N1, nmx1, mmx1);
149  }
150 
157 
171  real f[] = {1, tau};
172  real v = 0;
173  real dummy;
174  switch (_norm) {
175  case FULL:
176  v = SphericalEngine::Value<false, SphericalEngine::FULL, 2>
177  (_c, f, x, y, z, _a, dummy, dummy, dummy);
178  break;
179  case SCHMIDT:
180  v = SphericalEngine::Value<false, SphericalEngine::SCHMIDT, 2>
181  (_c, f, x, y, z, _a, dummy, dummy, dummy);
182  break;
183  }
184  return v;
185  }
186 
206  real& gradx, real& grady, real& gradz) const {
207  real f[] = {1, tau};
208  real v = 0;
209  switch (_norm) {
210  case FULL:
211  v = SphericalEngine::Value<true, SphericalEngine::FULL, 2>
212  (_c, f, x, y, z, _a, gradx, grady, gradz);
213  break;
214  case SCHMIDT:
215  v = SphericalEngine::Value<true, SphericalEngine::SCHMIDT, 2>
216  (_c, f, x, y, z, _a, gradx, grady, gradz);
217  break;
218  }
219  return v;
220  }
221 
246  CircularEngine Circle(real tau, real p, real z, bool gradp) const {
247  real f[] = {1, tau};
248  switch (_norm) {
249  case FULL:
250  return gradp ?
251  SphericalEngine::Circle<true, SphericalEngine::FULL, 2>
252  (_c, f, p, z, _a) :
253  SphericalEngine::Circle<false, SphericalEngine::FULL, 2>
254  (_c, f, p, z, _a);
255  break;
256  case SCHMIDT:
257  default: // To avoid compiler warnings
258  return gradp ?
259  SphericalEngine::Circle<true, SphericalEngine::SCHMIDT, 2>
260  (_c, f, p, z, _a) :
261  SphericalEngine::Circle<false, SphericalEngine::SCHMIDT, 2>
262  (_c, f, p, z, _a);
263  break;
264  }
265  }
266 
271  { return _c[0]; }
276  { return _c[1]; }
277  };
278 
279 } // namespace GeographicLib
280 
281 #endif // GEOGRAPHICLIB_SPHERICALHARMONIC1_HPP
GeographicLib::SphericalHarmonic1::_a
real _a
Definition: SphericalHarmonic1.hpp:57
S1
static double S1[]
Definition: shichi.c:61
GeographicLib::SphericalHarmonic1::SphericalHarmonic1
SphericalHarmonic1()
Definition: SphericalHarmonic1.hpp:156
SphericalEngine.hpp
Header for GeographicLib::SphericalEngine class.
GeographicLib
Namespace for GeographicLib.
Definition: JacobiConformal.hpp:15
GeographicLib::SphericalHarmonic1::Coefficients1
const SphericalEngine::coeff & Coefficients1() const
Definition: SphericalHarmonic1.hpp:275
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::SphericalHarmonic1::Circle
CircularEngine Circle(real tau, real p, real z, bool gradp) const
Definition: SphericalHarmonic1.hpp:246
GeographicLib::SphericalHarmonic1::_norm
unsigned _norm
Definition: SphericalHarmonic1.hpp:58
GEOGRAPHICLIB_EXPORT
#define GEOGRAPHICLIB_EXPORT
Definition: Constants.hpp:91
GeographicLib::SphericalEngine::SCHMIDT
@ SCHMIDT
Definition: SphericalEngine.hpp:84
GeographicLib::GeographicErr
Exception handling for GeographicLib.
Definition: Constants.hpp:389
pybind_wrapper_test_script.dummy
dummy
Definition: pybind_wrapper_test_script.py:42
GeographicLib::Math::real
double real
Definition: Math.hpp:129
GeographicLib::SphericalHarmonic1::operator()
Math::real operator()(real tau, real x, real y, real z, real &gradx, real &grady, real &gradz) const
Definition: SphericalHarmonic1.hpp:205
GeographicLib::SphericalHarmonic1::real
Math::real real
Definition: SphericalHarmonic1.hpp:55
GeographicLib::SphericalEngine::coeff
Package up coefficients for SphericalEngine.
Definition: SphericalEngine.hpp:99
GeographicLib::SphericalHarmonic1::Coefficients
const SphericalEngine::coeff & Coefficients() const
Definition: SphericalHarmonic1.hpp:270
GeographicLib::CircularEngine
Spherical harmonic sums for a circle.
Definition: CircularEngine.hpp:52
C1
Definition: test_operator_overloading.cpp:97
GeographicLib::SphericalHarmonic1::operator()
Math::real operator()(real tau, real x, real y, real z) const
Definition: SphericalHarmonic1.hpp:170
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::SphericalHarmonic1::SphericalHarmonic1
SphericalHarmonic1(const std::vector< real > &C, const std::vector< real > &S, int N, const std::vector< real > &C1, const std::vector< real > &S1, int N1, real a, unsigned norm=FULL)
Definition: SphericalHarmonic1.hpp:88
tree::f
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Definition: testExpression.cpp:218
a
ArrayXXi a
Definition: Array_initializer_list_23_cxx11.cpp:1
C
Matrix< Scalar, Dynamic, Dynamic > C
Definition: bench_gemm.cpp:50
p
float * p
Definition: Tutorial_Map_using.cpp:9
GeographicLib::SphericalHarmonic1::normalization
normalization
Definition: SphericalHarmonic1.hpp:37
v
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
N
#define N
Definition: igam.h:9
GeographicLib::SphericalHarmonic1
Spherical harmonic series with a correction to the coefficients.
Definition: SphericalHarmonic1.hpp:32
real
Definition: main.h:100
S
DiscreteKey S(1, 2)
GeographicLib::SphericalHarmonic1::SphericalHarmonic1
SphericalHarmonic1(const std::vector< real > &C, const std::vector< real > &S, int N, int nmx, int mmx, const std::vector< real > &C1, const std::vector< real > &S1, int N1, int nmx1, int mmx1, real a, unsigned norm=FULL)
Definition: SphericalHarmonic1.hpp:134


gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:36:23