|
#define | ELECTRON_CHARGE (1.6021773e-19) |
|
#define | ELECTRON_MASS (9.1093837015e-31) |
|
#define | PLANCK (6.62606896e-34) |
|
#define | C_VACUO (299792458) |
|
#define | THOMSON_LENGTH (2.81794e-15) |
|
#define | CLEAR_BIT(val, bit) (((val) | (bit)) ^ (bit)) |
|
#define | rad2deg(a) ((a)*180/M_PI) |
|
#define | deg2rad(a) ((a)*M_PI/180) |
|
#define | is_odd(a) ((a)%2==1) |
|
#define | biggest(a, b) ((a>b) ? (a) : (b)) |
|
#define | smallest(a, b) ((a<b) ? (a) : (b)) |
|
#define | ph_en_to_lambda(a) ((PLANCK*C_VACUO)/(a)) |
|
#define | ph_lambda_to_en(a) ((PLANCK*C_VACUO)/(a)) |
|
#define | eV_to_J(a) ((a)*ELECTRON_CHARGE) |
|
#define | J_to_eV(a) ((a)/ELECTRON_CHARGE) |
|
#define | ph_lambda_to_eV(a) J_to_eV(ph_lambda_to_en(a)) |
|
#define | ph_eV_to_lambda(a) ph_en_to_lambda(eV_to_J(a)) |
|
#define | ph_eV_to_k(a) ((a)*ELECTRON_CHARGE/PLANCK/C_VACUO) |
|
#define | UNUSED |
|
#define | likely(x) (x) |
|
#define | unlikely(x) (x) |
|
|
void | show_matrix_eqn (gsl_matrix *M, gsl_vector *v) |
|
void | show_matrix (gsl_matrix *M) |
|
void | show_vector (gsl_vector *M) |
|
gsl_vector * | solve_inv (gsl_vector *v, gsl_matrix *M) |
|
gsl_vector * | solve_svd (gsl_vector *v, gsl_matrix *M, int *n_filt, int verbose) |
|
gsl_matrix * | matrix_mult2 (gsl_matrix *A, gsl_matrix *B) |
|
gsl_matrix * | matrix_mult3 (gsl_matrix *A, gsl_matrix *B, gsl_matrix *C) |
|
gsl_matrix * | matrix_invert (gsl_matrix *m) |
|
size_t | notrail (char *s) |
|
int | convert_int (const char *str, int *pval) |
|
int | convert_float (const char *str, double *pval) |
|
void | chomp (char *s) |
|
void * | srealloc (void *arr, size_t new_size) |
|
int | assplode (const char *a, const char *delims, char ***pbits, AssplodeFlag flags) |
|
void | progress_bar (int val, int total, const char *text) |
|
double | random_flat (gsl_rng *rng, double max) |
|
double | flat_noise (gsl_rng *rng, double expected, double width) |
|
double | gaussian_noise (gsl_rng *rng, double expected, double stddev) |
|
int | poisson_noise (gsl_rng *rng, double expected) |
|
void | rotate2d (double *x, double *y, double cx, double cy, double ang) |
|
void | STATUS (const char *format,...) |
|
void | ERROR (const char *format,...) |
|
void | set_log_message_func (LogMsgFunc new_log_msg_func, void *vp) |
|
void * | cfmalloc (size_t size) |
|
void | cffree (void *ptr) |
|
void * | cfcalloc (size_t nmemb, size_t size) |
|
void * | cfrealloc (void *ptr, size_t size) |
|
char * | cfstrdup (const char *s) |
|
char * | cfstrndup (const char *s, size_t n) |
|
int | set_mm_funcs (void *(*cfmalloc)(size_t size), void(*cffree)(void *ptr), void *(*cfcalloc)(size_t nmemb, size_t size), void *(*cfrealloc)(void *ptr, size_t size)) |
|
char * | check_prefix (char *prefix) |
|
char * | safe_basename (const char *in) |
|
char * | safe_strdup (const char *in) |
|
void | strip_extension (char *bfn) |
|
char * | load_entire_file (const char *filename) |
|
int | file_exists (const char *filename) |
|
int | is_dir (const char *filename) |
|
const char * | filename_extension (const char *fn, const char **ext2) |
|
struct quaternion | normalise_quaternion (struct quaternion q) |
|
double | quaternion_modulus (struct quaternion q) |
|
struct quaternion | random_quaternion (gsl_rng *rng) |
|
int | quaternion_valid (struct quaternion q) |
|
struct rvec | quat_rot (struct rvec q, struct quaternion z) |
|
int | compare_double (const void *av, const void *bv) |
|
int | crystfel_has_peakfinder9 (void) |
|
Miscellaneous utility functions