|
geomc 1.0
A c++ linear algebra template library
|
Class and methods for representing band-limited functions on the surface of a 3D sphere. More...
#include <geomc/function/SphericalHarmonics.h>
Public Member Functions | |
| SphericalHarmonics () | |
| template<index_t B> | |
| SphericalHarmonics (const ZonalHarmonics< T, B > &zh) | |
| template<index_t B> | |
| SphericalHarmonics (const ZonalHarmonics< T, B > &zh, Vec< T, 3 > new_axis) | |
| SphericalHarmonics (index_t bands) | |
| index_t | bands () const |
| void | clear () |
| T & | coeff (index_t l, index_t m) |
| T | coeff (index_t l, index_t m) const |
| template<index_t ZH_Bands> | |
| void | convolve (const ZonalHarmonics< T, ZH_Bands > &zh) |
| T | dot (const SphericalHarmonics< T, Bands > &other) const |
| T | eval (T alt, T azi) const |
| T | eval (Vec< T, 3 > d) const |
| T * | get () |
| const T * | get () const |
| void | normalize () |
| SphericalHarmonics< T, Bands > & | operator*= (T k) |
| SphericalHarmonics< T, Bands > | operator+ (const SphericalHarmonics< T, Bands > &sh) |
| SphericalHarmonics< T, Bands > & | operator+= (const SphericalHarmonics< T, Bands > &sh) |
| SphericalHarmonics< T, Bands > & | operator+= (T k) |
| SphericalHarmonics< T, Bands > & | operator- () |
| SphericalHarmonics< T, Bands > & | operator/= (T k) |
| void | project (T alt, T azi, T val) |
| void | project (Vec< T, 3 > d, T val) |
| index_t | size () const |
Static Public Member Functions | |
| static SphericalHarmonics< T, Bands > | basis (Vec< T, 3 > d, index_t n=Bands) |
Construct a SphericalHarmonics basis for the direction given by d. | |
Public Attributes | |
| UniqueStorage< T, Bands *Bands > | coeffs |
| Coefficient vector. | |
Protected Member Functions | |
| T | _eval (T cos_alt, T azi) const |
| void | _project (T cos_alt, T azi, T val) |
Protected Attributes | |
| Dimension< Bands >::storage_t | n_bands |
Class and methods for representing band-limited functions on the surface of a 3D sphere.
| T | Type of evaluated function. |
| Bands | Number of bands to represent, or 0 if the band count is dynamic. |
Memory requirements are O(n2) on the number of bands.
This implementation uses the Condon-Shortley phase convention.
Complex-valued SH functions are not yet natively supported.
|
inline |
Construct a new SphericalHarmonics.
If dynamically sized, only a single DC band will be allocated.
|
inlineexplicit |
Construct a new SphericalHarmonics. (Dynamic size).
| bands | Number of bands to represent. Ignored unless the template parameter Bands is 0 (dynamic). |
|
inline |
Construct a new SphericalHarmonics matching the function described by the given ZonalHarmonics.
|
inline |
Construct a new SphericalHarmonics matching the given ZonalHarmonics, re-oriented so that the axis of symmetry aligns with new_axis.
| zh | ZonalHarmonics funciton. |
| new_axis | New axis of rotational symmetry. |
|
inline |
|
inlinestatic |
Construct a SphericalHarmonics basis for the direction given by d.
| d | Direction for basis. |
| n | Number of bands to use, if dynamic. |
|
inline |
Set all coefficients to zero.
|
inline |
Get the stored SH coefficient for band l and sub-band m.
| l | Integer in [0, bands()). |
| m | Integer in [-l, l]. |
|
inline |
Get the stored SH coefficient for band l and sub-band m.
| l | Integer in [0, bands()). |
| m | Integer in [-l, l]. |
|
inline |
Convolve this SphericalHarmonics with a point spread function described by zh.
| zh | Point spread (kernel) function. |
|
inline |
Compute the inner product of this SH function with other.
this and other.
|
inline |
Evaluate this SphericalHarmonics function in the direction described by alt and azi.
| alt | Angle from the polar axis. |
| azi | Azimuthal (longitude) angle. |
|
inline |
Evaluate this SphericalHarmonics function in given direction. The polar direction is aligned with z+, and the x-axis has zero azimuthal angle.
| d | Direction along which to sample the funciton. |
|
inline |
Get a pointer to the array of coefficients.
|
inline |
Get a pointer to the array of coefficients.
|
inline |
Ensure the integral over the entire sphere is 1. If the integral is currently 0, no change will be made.
|
inline |
Multiply this SphericalHarmonics function by a constant value.
| k | Gain factor. |
|
inline |
Construct a SphericalHarmonics function which is the sum of this and another.
|
inline |
Add another SphericalHarmonics function to this one.
|
inline |
Add a constant value to this SphericalHarmonics function.
| k | Bias. |
|
inline |
Negate the values of this SphericalHarmonics function.
|
inline |
Divide this SphericalHarmonics function by a constant value.
| k | Divisor. |
|
inline |
Project the Dirac delta function with direction given by alt and azi, and integral val onto the spherical harmonic basis. The projection will be added to the current representation. In other words, "add" the supplied sample to the representation.
To represent a known function on the sphere, draw many samples from it and project each sample, then divide by the number of samples.
| d | Direction of sample to project. |
| val | Value of sample. |
|
inline |
Project the Dirac delta function with direction d and integral val onto the spherical harmonic basis. The projection will be added to the current representation. In other words, "add" the supplied sample to the representation.
To represent a known function on the sphere, draw many samples from it and project each sample, then divide by 4π times the number of samples.
| alt | Angle from the polar axis. |
| azi | Azimuthal (longitude) angle. |
| val | Value of sample. |
|
inline |