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;
57  real _a;
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 
170  Math::real operator()(real tau, real x, real y, real z) const {
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 
205  Math::real operator()(real tau, real x, real y, real z,
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
const SphericalEngine::coeff & Coefficients1() const
#define GEOGRAPHICLIB_EXPORT
Definition: Constants.hpp:91
Scalar * y
CircularEngine Circle(real tau, real p, real z, bool gradp) const
Math::real operator()(real tau, real x, real y, real z, real &gradx, real &grady, real &gradz) const
#define N
Definition: gksort.c:12
DiscreteKey S(1, 2)
const SphericalEngine::coeff & Coefficients() const
Package up coefficients for SphericalEngine.
Array< int, Dynamic, 1 > v
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Namespace for GeographicLib.
Math::real operator()(real tau, real x, real y, real z) const
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)
Header for GeographicLib::CircularEngine class.
Matrix< Scalar, Dynamic, Dynamic > C
Definition: bench_gemm.cpp:50
Spherical harmonic sums for a circle.
Exception handling for GeographicLib.
Definition: Constants.hpp:389
Header for GeographicLib::Constants class.
float * p
Spherical harmonic series with a correction to the coefficients.
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)
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.


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:36:19