MAOS
Multithreaded Adaptive Optics Simulator
|
Macros | |
#define | sinc(x) ((x)!=0?(sin(M_PI*x)/(M_PI*x)):1) |
#define | mysqrt(A) (A<0?-sqrt(-A):sqrt(A)) |
Typedefs | |
typedef real(* | golden_section_fun) (void *param, real x) |
Functions | |
long double | factorial (long n1, long n2) |
long * | invperm (long *p, long np) |
void | maxminlong (const long *__restrict p, long N, long *__restrict max, long *__restrict min) |
long | nextpow2 (long n) |
long | nextfftsize (long n) |
unsigned long | mylog2 (unsigned long n) |
real | golden_section_search (golden_section_fun f, void *param, real x1, real x4, real tau) |
spint * | readspint (file_t *fp, long *nx, long *ny) |
int | readvec (void *p, uint32_t magic_p, uint32_t magic_file, size_t size, size_t nmemb, file_t *fp) |
A few math routines
Compute the factorial from n1 to n2. Overflow LONG if n2>20, so we use double as output.
Compute max, min and sum of a long vector
Read spint array of size nx*ny from file and do optional data conversion.
int readvec | ( | void * | p, |
uint32_t | magic_p, | ||
uint32_t | magic_file, | ||
size_t | size, | ||
size_t | nmemb, | ||
file_t * | fp | ||
) |
Read a vector from file and perform conversion if type mismatches.