Utilities

Utilities — Miscellaneous utilities

Functions

void show_matrix_eqn ()
gsl_vector * solve_svd ()
#define C_VACUO
#define ELECTRON_CHARGE
#define PLANCK
#define THOMSON_LENGTH
int assplode ()
void chomp ()
double gaussian_noise ()
void progress_bar ()
int poisson_noise ()
size_t notrail ()
double random_flat ()
double flat_noise ()
void show_matrix ()

Types and Values

Includes

#include "utils.h"

Description

Wibble

Functions

show_matrix_eqn ()

void
show_matrix_eqn (gsl_matrix *M,
                 gsl_vector *v);

Displays a matrix equation of the form M.a = v .

Parameters

M

A matrix

 

v

A vector

 

solve_svd ()

gsl_vector *
solve_svd (gsl_vector *v,
           gsl_matrix *M,
           int *n_filt,
           int verbose);

Solves the matrix equation M.x = v, returning x. Performs rescaling and eigenvalue filtering.

Parameters

v

a gsl_vector

 

M

a gsl_matrix

 

n_filt

pointer to store the number of filtered eigenvalues

 

verbose

flag for verbosity on the terminal

 

C_VACUO

#define C_VACUO (299792458)

ELECTRON_CHARGE

#define ELECTRON_CHARGE (1.6021773e-19)

PLANCK

#define PLANCK (6.62606896e-34)

THOMSON_LENGTH

#define THOMSON_LENGTH (2.81794e-15)

assplode ()

int
assplode (const char *a,
          const char *delims,
          char ***pbits,
          AssplodeFlag flags);

chomp ()

void
chomp (char *s);

gaussian_noise ()

double
gaussian_noise (gsl_rng *rng,
                double expected,
                double stddev);

progress_bar ()

void
progress_bar (int val,
              int total,
              const char *text);

poisson_noise ()

int
poisson_noise (gsl_rng *rng,
               double expected);

notrail ()

size_t
notrail (char *s);

random_flat ()

double
random_flat (gsl_rng *rng,
             double max);

flat_noise ()

double
flat_noise (gsl_rng *rng,
            double expected,
            double width);

show_matrix ()

void
show_matrix (gsl_matrix *M);

Displays a matrix.

Parameters

M

A matrix

 

Types and Values

enum AssplodeFlag

Members

ASSPLODE_NONE

Nothing

 

ASSPLODE_DUPS

Don't merge deliminators