NcmSFSphericalHarmonics

NcmSFSphericalHarmonics — Spherical Harmonics object

Functions

NcmSFSphericalHarmonicsY * ncm_sf_spherical_harmonics_Y_new ()
NcmSFSphericalHarmonicsY * ncm_sf_spherical_harmonics_Y_dup ()
void ncm_sf_spherical_harmonics_Y_free ()
gdouble ncm_sf_spherical_harmonics_Y_get_lm ()
gdouble ncm_sf_spherical_harmonics_Y_get_lp1m ()
gdouble ncm_sf_spherical_harmonics_Y_get_x ()
gint ncm_sf_spherical_harmonics_Y_get_l ()
gint ncm_sf_spherical_harmonics_Y_get_m ()
void ncm_sf_spherical_harmonics_Y_next_l ()
void ncm_sf_spherical_harmonics_Y_next_l2 ()
void ncm_sf_spherical_harmonics_Y_next_l4 ()
void ncm_sf_spherical_harmonics_Y_next_l2pn ()
void ncm_sf_spherical_harmonics_Y_next_m ()
void ncm_sf_spherical_harmonics_Y_reset ()
NcmSFSphericalHarmonicsYArray * ncm_sf_spherical_harmonics_Y_array_new ()
NcmSFSphericalHarmonicsYArray * ncm_sf_spherical_harmonics_Y_array_dup ()
void ncm_sf_spherical_harmonics_Y_array_free ()
gdouble ncm_sf_spherical_harmonics_Y_array_get_lm ()
gdouble ncm_sf_spherical_harmonics_Y_array_get_lp1m ()
gdouble ncm_sf_spherical_harmonics_Y_array_get_x ()
gint ncm_sf_spherical_harmonics_Y_array_get_l ()
gint ncm_sf_spherical_harmonics_Y_array_get_m ()
void ncm_sf_spherical_harmonics_Y_array_next_l ()
void ncm_sf_spherical_harmonics_Y_array_next_l2 ()
void ncm_sf_spherical_harmonics_Y_array_next_l4 ()
void ncm_sf_spherical_harmonics_Y_array_next_l2pn ()
void ncm_sf_spherical_harmonics_Y_array_next_m ()
void ncm_sf_spherical_harmonics_Y_array_reset ()
NcmSFSphericalHarmonics * ncm_sf_spherical_harmonics_new ()
NcmSFSphericalHarmonics * ncm_sf_spherical_harmonics_ref ()
void ncm_sf_spherical_harmonics_free ()
void ncm_sf_spherical_harmonics_clear ()
void ncm_sf_spherical_harmonics_set_lmax ()
guint ncm_sf_spherical_harmonics_get_lmax ()
void ncm_sf_spherical_harmonics_start_rec ()
void ncm_sf_spherical_harmonics_start_rec_array ()
NcmSFSphericalHarmonicsK * ncm_sf_spherical_harmonics_get_Klm ()
#define NCM_SF_SPHERICAL_HARMONICS_ARRAY_INDEX()

Properties

int lmax Read / Write / Construct

Types and Values

#define NCM_TYPE_SF_SPHERICAL_HARMONICS
struct NcmSFSphericalHarmonicsK
struct NcmSFSphericalHarmonics
struct NcmSFSphericalHarmonicsP
#define NCM_SF_SPHERICAL_HARMONICS_MAX_LEN
#define NCM_SF_SPHERICAL_HARMONICS_DEFAULT_ABSTOL
#define NCM_SF_SPHERICAL_HARMONICS_ARRAY_DEFAULT_ABSTOL
#define NCM_SF_SPHERICAL_HARMONICS_EPS
#define NCM_SF_SPHERICAL_HARMONICS_LATERAL_MOVE
const gdouble sn_2l0_5
const gdouble snm1_2l0_2
const gdouble sqrt1mx2
const gdouble x
const gint l0
const gint m
const gint twol0
const gint l0mm
const gint l0pm
const gdouble Llp1
const gdouble Ll
const gdouble Mlp1
const gdouble Ml
const gdouble Pl0m
const gdouble Pl0p1m
gdouble min_Plm
const gdouble abs_Plm
const gint lmax

Object Hierarchy

    GBoxed
    ├── NcmSFSphericalHarmonicsY
    ╰── NcmSFSphericalHarmonicsYArray
    GObject
    ╰── NcmSFSphericalHarmonics

Description

Object to compute the spherical harmonics $\bar{Y}_l^m (x)$ and its derivatives $\bar{Y}_{l+1}^m (x)$ and $\bar{Y}_{l+2}^m (x)$, where $x = \cos \theta$.

Functions

ncm_sf_spherical_harmonics_Y_new ()

NcmSFSphericalHarmonicsY *
ncm_sf_spherical_harmonics_Y_new (NcmSFSphericalHarmonics *spha,
                                  const gdouble abstol);

Creates a new NcmSFSphericalHarmonicsY object.

Parameters

spha

a NcmSFSphericalHarmonics

 

abstol

absolute tolerance

 

Returns

a new NcmSFSphericalHarmonicsY.


ncm_sf_spherical_harmonics_Y_dup ()

NcmSFSphericalHarmonicsY *
ncm_sf_spherical_harmonics_Y_dup (NcmSFSphericalHarmonicsY *sphaY);

Duplicates a NcmSFSphericalHarmonicsY object.

Parameters

Returns

a copy of sphaY .

[transfer full]


ncm_sf_spherical_harmonics_Y_free ()

void
ncm_sf_spherical_harmonics_Y_free (NcmSFSphericalHarmonicsY *sphaY);

Frees a NcmSFSphericalHarmonicsY object.

Parameters


ncm_sf_spherical_harmonics_Y_get_lm ()

gdouble
ncm_sf_spherical_harmonics_Y_get_lm (NcmSFSphericalHarmonicsY *sphaY);

Parameters

Returns

the current value of $\bar{Y}_l^m (x)$.


ncm_sf_spherical_harmonics_Y_get_lp1m ()

gdouble
ncm_sf_spherical_harmonics_Y_get_lp1m (NcmSFSphericalHarmonicsY *sphaY);

Parameters

Returns

the current value of $\bar{Y}_{l+1}^m (x)$.


ncm_sf_spherical_harmonics_Y_get_x ()

gdouble
ncm_sf_spherical_harmonics_Y_get_x (NcmSFSphericalHarmonicsY *sphaY);

Parameters

Returns

the current value of $x$.


ncm_sf_spherical_harmonics_Y_get_l ()

gint
ncm_sf_spherical_harmonics_Y_get_l (NcmSFSphericalHarmonicsY *sphaY);

Parameters

Returns

the current value of $l$.


ncm_sf_spherical_harmonics_Y_get_m ()

gint
ncm_sf_spherical_harmonics_Y_get_m (NcmSFSphericalHarmonicsY *sphaY);

Parameters

Returns

the current value of $m$.


ncm_sf_spherical_harmonics_Y_next_l ()

void
ncm_sf_spherical_harmonics_Y_next_l (NcmSFSphericalHarmonicsY *sphaY);

Move the recursion for $x$ to $l = l + 1$.

Parameters


ncm_sf_spherical_harmonics_Y_next_l2 ()

void
ncm_sf_spherical_harmonics_Y_next_l2 (NcmSFSphericalHarmonicsY *sphaY,
                                      gdouble * restrict Yblm);

Move the recursion for $x$ to $l = l + 2$.

Parameters

sphaY

a NcmSFSphericalHarmonicsY

 

Yblm

the four Yblm from l to l + 2.

[array fixed-size=2][element-type gdouble][out caller-allocates]

ncm_sf_spherical_harmonics_Y_next_l4 ()

void
ncm_sf_spherical_harmonics_Y_next_l4 (NcmSFSphericalHarmonicsY *sphaY,
                                      gdouble * restrict Yblm);

Move the recursion for $x$ to $l = l + 4$.

Parameters

sphaY

a NcmSFSphericalHarmonicsY

 

Yblm

the four Yblm from l to l + 3.

[array fixed-size=4][element-type gdouble][out caller-allocates]

ncm_sf_spherical_harmonics_Y_next_l2pn ()

void
ncm_sf_spherical_harmonics_Y_next_l2pn
                               (NcmSFSphericalHarmonicsY *sphaY,
                                gdouble * restrict Yblm,
                                const gint n);

ncm_sf_spherical_harmonics_Y_next_m ()

void
ncm_sf_spherical_harmonics_Y_next_m (NcmSFSphericalHarmonicsY *sphaY);

Restart the recursion for $x$ at $l = m + 1,\; m = m + 1$. If the value of $Ybll < a$ where $a$ is the absolute tolerance, advance $l$ until the tolerance is reached.

Parameters


ncm_sf_spherical_harmonics_Y_reset ()

void
ncm_sf_spherical_harmonics_Y_reset (NcmSFSphericalHarmonicsY *sphaY);

ncm_sf_spherical_harmonics_Y_array_new ()

NcmSFSphericalHarmonicsYArray *
ncm_sf_spherical_harmonics_Y_array_new
                               (NcmSFSphericalHarmonics *spha,
                                const gint len,
                                const gdouble abstol);

Creates a new NcmSFSphericalHarmonicsYArray object. This object is used to contain the results of the computation of the spherical harmonics for an array of angles $\theta_i$ with length len .

Parameters

spha

a NcmSFSphericalHarmonics

 

len

array length

 

abstol

absolute tolerance

 

ncm_sf_spherical_harmonics_Y_array_dup ()

NcmSFSphericalHarmonicsYArray *
ncm_sf_spherical_harmonics_Y_array_dup
                               (NcmSFSphericalHarmonicsYArray *sphaYa);

Duplicates a NcmSFSphericalHarmonicsYArray object.

Parameters

Returns

a copy of sphaYa .

[transfer full]


ncm_sf_spherical_harmonics_Y_array_free ()

void
ncm_sf_spherical_harmonics_Y_array_free
                               (NcmSFSphericalHarmonicsYArray *sphaYa);

Frees a NcmSFSphericalHarmonicsYArray object.

Parameters


ncm_sf_spherical_harmonics_Y_array_get_lm ()

gdouble
ncm_sf_spherical_harmonics_Y_array_get_lm
                               (NcmSFSphericalHarmonicsYArray *sphaYa,
                                const gint len,
                                const gint i);

ncm_sf_spherical_harmonics_Y_array_get_lp1m ()

gdouble
ncm_sf_spherical_harmonics_Y_array_get_lp1m
                               (NcmSFSphericalHarmonicsYArray *sphaYa,
                                const gint len,
                                const gint i);

ncm_sf_spherical_harmonics_Y_array_get_x ()

gdouble
ncm_sf_spherical_harmonics_Y_array_get_x
                               (NcmSFSphericalHarmonicsYArray *sphaYa,
                                const gint i);

ncm_sf_spherical_harmonics_Y_array_get_l ()

gint
ncm_sf_spherical_harmonics_Y_array_get_l
                               (NcmSFSphericalHarmonicsYArray *sphaYa);

ncm_sf_spherical_harmonics_Y_array_get_m ()

gint
ncm_sf_spherical_harmonics_Y_array_get_m
                               (NcmSFSphericalHarmonicsYArray *sphaYa);

ncm_sf_spherical_harmonics_Y_array_next_l ()

void
ncm_sf_spherical_harmonics_Y_array_next_l
                               (NcmSFSphericalHarmonicsYArray *sphaYa,
                                const gint len);

ncm_sf_spherical_harmonics_Y_array_next_l2 ()

void
ncm_sf_spherical_harmonics_Y_array_next_l2
                               (NcmSFSphericalHarmonicsYArray *sphaYa,
                                const gint len,
                                gdouble * restrict Yblm);

ncm_sf_spherical_harmonics_Y_array_next_l4 ()

void
ncm_sf_spherical_harmonics_Y_array_next_l4
                               (NcmSFSphericalHarmonicsYArray *sphaYa,
                                const gint len,
                                gdouble * restrict Yblm);

ncm_sf_spherical_harmonics_Y_array_next_l2pn ()

void
ncm_sf_spherical_harmonics_Y_array_next_l2pn
                               (NcmSFSphericalHarmonicsYArray *sphaYa,
                                const gint len,
                                gdouble * restrict Yblm,
                                const gint n);

ncm_sf_spherical_harmonics_Y_array_next_m ()

void
ncm_sf_spherical_harmonics_Y_array_next_m
                               (NcmSFSphericalHarmonicsYArray *sphaYa,
                                const gint len);

ncm_sf_spherical_harmonics_Y_array_reset ()

void
ncm_sf_spherical_harmonics_Y_array_reset
                               (NcmSFSphericalHarmonicsYArray *sphaYa,
                                const gint len);

ncm_sf_spherical_harmonics_new ()

NcmSFSphericalHarmonics *
ncm_sf_spherical_harmonics_new (const gint lmax);

Creates a new NcmSFSphericalHarmonics object.

Parameters

lmax

$\ell_\mathrm{max}$

 

Returns

a new NcmSFSphericalHarmonics.


ncm_sf_spherical_harmonics_ref ()

NcmSFSphericalHarmonics *
ncm_sf_spherical_harmonics_ref (NcmSFSphericalHarmonics *spha);

Increase the reference of spha by one.

Parameters

Returns

spha .

[transfer full]


ncm_sf_spherical_harmonics_free ()

void
ncm_sf_spherical_harmonics_free (NcmSFSphericalHarmonics *spha);

Decrease the reference count of spha by one.

Parameters


ncm_sf_spherical_harmonics_clear ()

void
ncm_sf_spherical_harmonics_clear (NcmSFSphericalHarmonics **spha);

Decrease the reference count of spha by one, and sets the pointer *spha to NULL.

Parameters


ncm_sf_spherical_harmonics_set_lmax ()

void
ncm_sf_spherical_harmonics_set_lmax (NcmSFSphericalHarmonics *spha,
                                     const gint lmax);

Sets the maximum l to lmax .

Parameters

spha

a NcmSFSphericalHarmonics

 

lmax

maximum l

 

ncm_sf_spherical_harmonics_get_lmax ()

guint
ncm_sf_spherical_harmonics_get_lmax (NcmSFSphericalHarmonics *spha);

Gets the maximum l to lmax .

Parameters

Returns

the currently used lmax.


ncm_sf_spherical_harmonics_start_rec ()

void
ncm_sf_spherical_harmonics_start_rec (NcmSFSphericalHarmonics *spha,
                                      NcmSFSphericalHarmonicsY *sphaY,
                                      const gdouble theta);

Start recursion for $\theta$ at $l = 0,\; m = 0$.

Parameters

spha

a NcmSFSphericalHarmonics

 

sphaY

a NcmSFSphericalHarmonicsY

 

theta

$\theta \in [0, \pi]$

 

ncm_sf_spherical_harmonics_start_rec_array ()

void
ncm_sf_spherical_harmonics_start_rec_array
                               (NcmSFSphericalHarmonics *spha,
                                NcmSFSphericalHarmonicsYArray *sphaYa,
                                const gint len,
                                const gdouble *theta);

Start recursion for the array $\theta_i$ at $l = 0,\; m = 0$. The array theta must have length len .

Parameters

spha

a NcmSFSphericalHarmonics

 

sphaYa

a NcmSFSphericalHarmonicsYArray

 

len

array length

 

theta

array of angles $\theta_i \in [0, \pi]$.

[array length=len][element-type gdouble]

ncm_sf_spherical_harmonics_get_Klm ()

NcmSFSphericalHarmonicsK *
ncm_sf_spherical_harmonics_get_Klm (NcmSFSphericalHarmonics *spha,
                                    const gint l0,
                                    const gint m);

Gets an array of NcmSFSphericalHarmonicsK with the coeficients necessary to move the recurence from $(l_0, m)\; \to\; (l_\mathrm{max}, m)$.

[skip]

Parameters

spha

a NcmSFSphericalHarmonics

 

l0

First $l_0$

 

m

$m$ index

 

Returns

a pointer to an array of NcmSFSphericalHarmonicsK.

[array][element-type NcmSFSphericalHarmonicsK]


NCM_SF_SPHERICAL_HARMONICS_ARRAY_INDEX()

#define NCM_SF_SPHERICAL_HARMONICS_ARRAY_INDEX(ai, li, len) ((li) * (len) + (ai))

Types and Values

NCM_TYPE_SF_SPHERICAL_HARMONICS

#define NCM_TYPE_SF_SPHERICAL_HARMONICS             (ncm_sf_spherical_harmonics_get_type ())

struct NcmSFSphericalHarmonicsK

struct NcmSFSphericalHarmonicsK {
  gdouble l;
  gdouble lp1;
};

Recurrence coefficients.

Members

gdouble l;

$K_l$

 

gdouble lp1;

$K_{l+1}$

 

struct NcmSFSphericalHarmonics

struct NcmSFSphericalHarmonics;

struct NcmSFSphericalHarmonicsP

struct NcmSFSphericalHarmonicsP {
  gdouble x;
  gdouble sqrt1mx2;
  gdouble l0m;
  gdouble l0p1m;
  gdouble lm;
  gdouble lp1m;
};

Boxed P values.

Members

gdouble x;

$x$

 

gdouble sqrt1mx2;

$\sqrt{1-x^2}$

 

gdouble l0m;

$P_{l_0}^m$

 

gdouble l0p1m;

$P_{l_0+1}^m$

 

gdouble lm;

$P_{l}^m$

 

gdouble lp1m;

$P_{l+1}^m$

 

NCM_SF_SPHERICAL_HARMONICS_MAX_LEN

#define NCM_SF_SPHERICAL_HARMONICS_MAX_LEN 6

NCM_SF_SPHERICAL_HARMONICS_DEFAULT_ABSTOL

#define NCM_SF_SPHERICAL_HARMONICS_DEFAULT_ABSTOL (1.0e-20)

NCM_SF_SPHERICAL_HARMONICS_ARRAY_DEFAULT_ABSTOL

#define NCM_SF_SPHERICAL_HARMONICS_ARRAY_DEFAULT_ABSTOL (1.0e-40)

NCM_SF_SPHERICAL_HARMONICS_EPS

#define NCM_SF_SPHERICAL_HARMONICS_EPS (1.0e-280)

NCM_SF_SPHERICAL_HARMONICS_LATERAL_MOVE

#define NCM_SF_SPHERICAL_HARMONICS_LATERAL_MOVE 1

sn_2l0_5

    const gdouble sn_2l0_5   = _SN (2 * l0 + 5);

snm1_2l0_2

    const gdouble snm1_2l0_2 = _SNM1 (2 * l0 + 2);

sqrt1mx2

      const gdouble sqrt1mx2 = sphaYa->sqrt1mx2[i];

x

      const gdouble x        = sphaYa->x[i];

l0

    const gint l0      = sphaYa->l0;

m

    const gint m       = sphaYa->m;

twol0

    const gint twol0   = 2 * l0;

l0mm

    const gint l0mm    = l0 - m;

l0pm

    const gint l0pm    = l0 + m;

Llp1

    const gdouble Llp1 = _SN (twol0 + 1) * _SN (l0mm + 1)   * _SNM1 (twol0 + 3) * _SNM1 (l0mm);

Ll

    const gdouble Ll   = _SN (l0pm + 1)  * _SNM1 (l0mm);

Mlp1

    const gdouble Mlp1 = _SN (l0mm + 1)  * _SNM1 (l0pm + 2);

Ml

    const gdouble Ml   = _SN (twol0 + 3) * _SN (l0pm + 1) * _SNM1 (twol0 + 1) * _SNM1 (l0pm + 2);

Pl0m

      const gdouble Pl0m     = sphaYa->Yl0m[NCM_SF_SPHERICAL_HARMONICS_ARRAY_INDEX (i, 0, len)];

Pl0p1m

      const gdouble Pl0p1m   = sphaYa->Yl0m[NCM_SF_SPHERICAL_HARMONICS_ARRAY_INDEX (i, 1, len)];

min_Plm

    gdouble min_Plm = GSL_POSINF;

abs_Plm

      const gdouble abs_Plm = fabs (sphaYa->Ylm[NCM_SF_SPHERICAL_HARMONICS_ARRAY_INDEX (i, 0, len)]);

lmax

      const gint lmax = ncm_sf_spherical_harmonics_get_lmax (spha);

Property Details

The “lmax” property

  “lmax”                     int

max l.

Owner: NcmSFSphericalHarmonics

Flags: Read / Write / Construct

Allowed values: >= 0

Default value: 1024