| Top |
Functions
Functions
ncm_util_sqrt1px_m1 ()
gdouble
ncm_util_sqrt1px_m1 (const gdouble x);
Calculates $\sqrt{1+x}-1$ using the appropriated expression to avoid round-off when $x \approx 0$.
ncm_util_1pcosx ()
gdouble ncm_util_1pcosx (const gdouble sinx,const gdouble cosx);
Calculates $1 + \cos(x)$ using the appropriated taylor series when $\cos(x) \approx -1$.
ncm_util_1mcosx ()
gdouble ncm_util_1mcosx (const gdouble sinx,const gdouble cosx);
Calculates $1 - \cos(x)$ using the appropriated taylor series when $\cos(x) \approx 1$.
ncm_util_1psinx ()
gdouble ncm_util_1psinx (const gdouble sinx,const gdouble cosx);
Calculates $1 + \sin(x)$ using the appropriated taylor series when $\sin(x) \approx -1$.
ncm_util_1msinx ()
gdouble ncm_util_1msinx (const gdouble sinx,const gdouble cosx);
Calculates $1 - \sin(x)$ using the appropriated taylor series when $\sin(x) \approx 1$.
ncm_util_cos2x ()
gdouble ncm_util_cos2x (const gdouble sinx,const gdouble cosx);
Calculates $\cos(2x)$ using the appropriated taylor series when $\sin(x) \approx 1$.
ncm_util_mln_1mIexpzA_1pIexpmzA ()
void ncm_util_mln_1mIexpzA_1pIexpmzA (const gdouble rho,const gdouble theta,const gdouble A,gdouble *rho1,gdouble *theta1);
Computes $$z_1 = z - \ln\left(\frac{1-i e^{+z} A}{1+i e^{-z} A}\right),$$ where $z = \rho + i\theta$
and return the new $z_1 = \rho_1 + i\theta_1$ into rho1
and $\theta1$.
ncm_cmp ()
gint ncm_cmp (gdouble x,gdouble y,const gdouble reltol,const gdouble abstol);
Compare x and y and return -1 if x < y, 0 if x == y and 1 if x > y,
all comparisons are done with precision prec
.
ncm_util_cvode_check_flag ()
gboolean ncm_util_cvode_check_flag (gpointer flagvalue,const gchar *funcname,gint opt);
FIXME
ncm_util_basename_fits ()
gchar *
ncm_util_basename_fits (const gchar *fits_filename);
Extracts the extension .fits or .fit from fits_filename
and returns
the prefix. If the extension is not found a copy of fits_filename
is
returned.
ncm_util_function_params ()
gchar * ncm_util_function_params (const gchar *func,gdouble **x,guint *len);
Extracts the function name and its numerical parameters.
ncm_util_fact_size ()
gulong
ncm_util_fact_size (const gulong n);
Calculate the smallest factorization of n
such that
$n_f = 2^\mu \times 3^\nu \times 5^\alpha \times 7^\beta$
and $n_f \geq n$.
This functions is useful to find a fft size such that fftw can optimized it more easily.
ncm_util_sleep_ms ()
void
ncm_util_sleep_ms (gint milliseconds);
Suspend the thread execution for milliseconds
.
ncm_complex_dup ()
NcmComplex *
ncm_complex_dup (NcmComplex *c);
Allocates a new complex number and copy the contents of c
to it.
ncm_complex_free ()
void
ncm_complex_free (NcmComplex *c);
Frees c
, it should not be used on a statically allocated NcmComplex.
ncm_complex_clear ()
void
ncm_complex_clear (NcmComplex **c);
Frees *c
and sets *c
to NULL, it should not be used on a statically allocated NcmComplex.
ncm_complex_set ()
void ncm_complex_set (NcmComplex *c,const gdouble a,const gdouble b);
Sets c
to $a + I b$.
ncm_complex_res_add_mul_real ()
void ncm_complex_res_add_mul_real (NcmComplex * restrict c1,const NcmComplex * restrict c2,const gdouble v);
Computes c1
= c1
+ c2
* v
, assuming that
c1
and c2
are different.
ncm_complex_res_add_mul ()
void ncm_complex_res_add_mul (NcmComplex * restrict c1,const NcmComplex * restrict c2,const NcmComplex * restrict c3);
Computes c1
= c1
+ c2
* c3
, assuming that
c1
and c2
are different.
ncm_complex_mul_real ()
void ncm_complex_mul_real (NcmComplex *c,const gdouble v);
Computes c1
= c1
* v
.
ncm_complex_res_mul ()
void ncm_complex_res_mul (NcmComplex * restrict c1,const NcmComplex * restrict c2);
Computes c1
= c1
* c2
, assuming that
c1
and c2
are different.
ncm_util_smooth_trans ()
gdouble ncm_util_smooth_trans (gdouble f0,gdouble f1,gdouble z0,gdouble dz,gdouble z);
ncm_util_smooth_trans_get_theta ()
void ncm_util_smooth_trans_get_theta (gdouble z0,gdouble dz,gdouble z,gdouble *theta0,gdouble *theta1);
ncm_util_position_angle ()
gdouble ncm_util_position_angle (gdouble ra1,gdouble dec1,gdouble ra2,gdouble dec2);
Computes the on-sky position angle (East of North) between object1 (ra1
, dec1
) and object2 (ra2
, dec2).
The input coordinates ((ra1
, dec1
), (ra2
, dec2
)) must be given in decimal degrees.
ncm_util_great_circle_distance ()
gdouble ncm_util_great_circle_distance (gdouble ra1,gdouble dec1,gdouble ra2,gdouble dec2);
Compute the great circle distance (or separation, as defined in astropy) between poistion 1 (ra1
, dec1
) and position 2 (ra2
, dec2
).
See Great-circle distance, in particular the Vincenty equation (implemented here).
The input coordinates ((ra1
, dec1
), (ra2
, dec2
)) must be given in decimal degrees.
ncm_acb_get_complex()
#define ncm_acb_get_complex(z) (arf_get_d (arb_midref (acb_realref (z)), ARF_RND_NEAR) + I * arf_get_d (arb_midref (acb_imagref (z)), ARF_RND_NEAR))