Package up coefficients for SphericalEngine.
More...
#include <SphericalEngine.hpp>
|
| coeff () |
|
| coeff (const std::vector< real > &C, const std::vector< real > &S, int N, int nmx, int mmx) |
|
| coeff (const std::vector< real > &C, const std::vector< real > &S, int N) |
|
Math::real | Cv (int k) const |
|
Math::real | Cv (int k, int n, int m, real f) const |
|
int | index (int n, int m) const |
|
int | mmx () const |
|
int | N () const |
|
int | nmx () const |
|
Math::real | Sv (int k) const |
|
Math::real | Sv (int k, int n, int m, real f) const |
|
Package up coefficients for SphericalEngine.
This packages up the C, S coefficients and information about how the coefficients are stored into a single structure. This allows a vector of type SphericalEngine::coeff to be passed to SphericalEngine::Value. This class also includes functions to aid indexing into C and S.
The storage layout of the coefficients is documented in SphericalHarmonic and SphericalHarmonic::SphericalHarmonic.
Definition at line 99 of file SphericalEngine.hpp.
◆ coeff() [1/3]
GeographicLib::SphericalEngine::coeff::coeff |
( |
| ) |
|
|
inline |
◆ coeff() [2/3]
GeographicLib::SphericalEngine::coeff::coeff |
( |
const std::vector< real > & |
C, |
|
|
const std::vector< real > & |
S, |
|
|
int |
N, |
|
|
int |
nmx, |
|
|
int |
mmx |
|
) |
| |
|
inline |
The general constructor.
- Parameters
-
[in] | C | a vector of coefficients for the cosine terms. |
[in] | S | a vector of coefficients for the sine terms. |
[in] | N | the degree giving storage layout for C and S. |
[in] | nmx | the maximum degree to be used. |
[in] | mmx | the maximum order to be used. |
- Exceptions
-
GeographicErr | if N, nmx, and mmx do not satisfy N ≥ nmx ≥ mmx ≥ −1. |
GeographicErr | if C or S is not big enough to hold the coefficients. |
std::bad_alloc | if the memory for the square root table can't be allocated. |
Definition at line 124 of file SphericalEngine.hpp.
◆ coeff() [3/3]
GeographicLib::SphericalEngine::coeff::coeff |
( |
const std::vector< real > & |
C, |
|
|
const std::vector< real > & |
S, |
|
|
int |
N |
|
) |
| |
|
inline |
The constructor for full coefficient vectors.
- Parameters
-
[in] | C | a vector of coefficients for the cosine terms. |
[in] | S | a vector of coefficients for the sine terms. |
[in] | N | the maximum degree and order. |
- Exceptions
-
GeographicErr | if N does not satisfy N ≥ −1. |
GeographicErr | if C or S is not big enough to hold the coefficients. |
std::bad_alloc | if the memory for the square root table can't be allocated. |
Definition at line 152 of file SphericalEngine.hpp.
◆ Csize()
static int GeographicLib::SphericalEngine::coeff::Csize |
( |
int |
N, |
|
|
int |
M |
|
) |
| |
|
inlinestatic |
The size of the coefficient vector for the cosine terms.
- Parameters
-
[in] | N | the maximum degree. |
[in] | M | the maximum order. |
- Returns
- the size of the vector of cosine terms as stored in column major order.
Definition at line 236 of file SphericalEngine.hpp.
◆ Cv() [1/2]
Math::real GeographicLib::SphericalEngine::coeff::Cv |
( |
int |
k | ) |
const |
|
inline |
An element of C.
- Parameters
-
[in] | k | the one-dimensional index. |
- Returns
- the value of the C coefficient.
Definition at line 195 of file SphericalEngine.hpp.
◆ Cv() [2/2]
An element of C with checking.
- Parameters
-
[in] | k | the one-dimensional index. |
[in] | n | the requested degree. |
[in] | m | the requested order. |
[in] | f | a multiplier. |
- Returns
- the value of the C coefficient multiplied by f in n and m are in range else 0.
Definition at line 213 of file SphericalEngine.hpp.
◆ index()
int GeographicLib::SphericalEngine::coeff::index |
( |
int |
n, |
|
|
int |
m |
|
) |
| const |
|
inline |
The one-dimensional index into C and S.
- Parameters
-
[in] | n | the degree. |
[in] | m | the order. |
- Returns
- the one-dimensional index.
Definition at line 187 of file SphericalEngine.hpp.
◆ mmx()
int GeographicLib::SphericalEngine::coeff::mmx |
( |
| ) |
const |
|
inline |
◆ N()
int GeographicLib::SphericalEngine::coeff::N |
( |
| ) |
const |
|
inline |
◆ nmx()
int GeographicLib::SphericalEngine::coeff::nmx |
( |
| ) |
const |
|
inline |
◆ readcoeffs()
void GeographicLib::SphericalEngine::coeff::readcoeffs |
( |
std::istream & |
stream, |
|
|
int & |
N, |
|
|
int & |
M, |
|
|
std::vector< real > & |
C, |
|
|
std::vector< real > & |
S |
|
) |
| |
|
static |
Load coefficients from a binary stream.
- Parameters
-
[in] | stream | the input stream. |
[out] | N | The maximum degree of the coefficients. |
[out] | M | The maximum order of the coefficients. |
[out] | C | The vector of cosine coefficients. |
[out] | S | The vector of sine coefficients. |
- Exceptions
-
GeographicErr | if N and M do not satisfy N ≥ M ≥ −1. |
GeographicErr | if there's an error reading the data. |
std::bad_alloc | if the memory for C or S can't be allocated. |
N and M are read as 4-byte ints. C and S are resized to accommodate all the coefficients (with the m = 0 coefficients for S excluded) and the data for these coefficients read as 8-byte doubles. The coefficients are stored in column major order. The bytes in the stream should use little-endian ordering. IEEE floating point is assumed for the coefficients.
Definition at line 387 of file SphericalEngine.cpp.
◆ Ssize()
static int GeographicLib::SphericalEngine::coeff::Ssize |
( |
int |
N, |
|
|
int |
M |
|
) |
| |
|
inlinestatic |
The size of the coefficient vector for the sine terms.
- Parameters
-
[in] | N | the maximum degree. |
[in] | M | the maximum order. |
- Returns
- the size of the vector of cosine terms as stored in column major order.
Definition at line 247 of file SphericalEngine.hpp.
◆ Sv() [1/2]
Math::real GeographicLib::SphericalEngine::coeff::Sv |
( |
int |
k | ) |
const |
|
inline |
An element of S.
- Parameters
-
[in] | k | the one-dimensional index. |
- Returns
- the value of the S coefficient.
Definition at line 202 of file SphericalEngine.hpp.
◆ Sv() [2/2]
An element of S with checking.
- Parameters
-
[in] | k | the one-dimensional index. |
[in] | n | the requested degree. |
[in] | m | the requested order. |
[in] | f | a multiplier. |
- Returns
- the value of the S coefficient multiplied by f in n and m are in range else 0.
Definition at line 225 of file SphericalEngine.hpp.
◆ _Cnm
std::vector<real>::const_iterator GeographicLib::SphericalEngine::coeff::_Cnm |
|
private |
◆ _mmx
int GeographicLib::SphericalEngine::coeff::_mmx |
|
private |
◆ _nmx
int GeographicLib::SphericalEngine::coeff::_nmx |
|
private |
◆ _Nx
int GeographicLib::SphericalEngine::coeff::_Nx |
|
private |
◆ _Snm
std::vector<real>::const_iterator GeographicLib::SphericalEngine::coeff::_Snm |
|
private |
The documentation for this class was generated from the following files: