MAOS
Multithreaded Adaptive Optics Simulator
zmath.h File Reference

Macros

#define AOS_LIB_TYPE
 
#define AOS_SMAT(A)   s##A
 
#define AOS_ZMAT(A)   z##A
 

Typedefs

typedef fcomplex(* zminsearch_fun) (const fcomplex *x, void *info)
 

Functions

zmatznew (long nx, long ny)
 
zmatznew_file (long nx, long ny, const char *keywords, const char *format,...)
 
zmatznew_do (long nx, long ny, fcomplex *p, mem_t *mem)
 
zmatzmat_cast (const void *A)
 
int zinit (zmat **A, long nx, long ny)
 
void zfree_content (zmat *A)
 
void zfree_do (zmat *A)
 
zmatzref (const zmat *in)
 
zmatzref_reshape (const zmat *in, long nx, long ny)
 
zmatzrefcols (const zmat *in, long icol, long ncol)
 
void zcols (zmat *out, const zmat *in, long icol, long ncol)
 
int zresize (zmat *A, long nx, long ny)
 
zmatzsub (const zmat *in, long sx, long nx, long sy, long ny)
 
zmatzcat (const zmat *in1, const zmat *in2, int dim)
 
zmatzdup (const zmat *in)
 
void zzero (zmat *A)
 
int zzerocol (zmat *A, int icol)
 
uint32_t zhash (const zmat *A, uint32_t key)
 
void zcp (zmat **out0, const zmat *in)
 
zmatztrans (const zmat *A)
 
void zset (zmat *A, const fcomplex val)
 
void zshow (const zmat *A, const char *format,...)
 
void zvecperm (zmat *out, const zmat *in, const long *perm)
 
void zvecpermi (zmat *out, const zmat *in, const long *perm)
 
int zflip (zmat *A, int axis)
 
fcomplex zvecsum (const fcomplex *__restrict p, long np)
 
fcomplex zsum (const zmat *A)
 
fcomplex ztrace (const zmat *A)
 
void zsort (zmat *A, int ascend)
 
void zmaxmin (const fcomplex *__restrict p, long N, float *max, float *min)
 
fcomplex zvecdot (const fcomplex *__restrict p1, const fcomplex *__restrict p2, const float *__restrict p3, long n)
 
void znormalize_sum (fcomplex *__restrict p, long nloc, fcomplex norm)
 
void znormalize_sumabs (fcomplex *__restrict p, long nloc, fcomplex norm)
 
void znormalize_rms (fcomplex *__restrict p, long nx, fcomplex norm)
 
void znormalize_max (fcomplex *__restrict p, long nloc, fcomplex max)
 
float zmax (const zmat *A)
 
float zvecmaxabs (const fcomplex *__restrict p, long n)
 
float zmaxabs (const zmat *A)
 
float zmin (const zmat *A)
 
float zsumabs (const zmat *in)
 
float zsumsq (const zmat *in)
 
float zsumdiffsq (const zmat *A, const zmat *B)
 
void zfftshift (zmat *A)
 
int zcpcorner2center (zmat *A, const zmat *B)
 
int zshift (zmat **B0, const zmat *A, int sx, int sy)
 
zcellzcell_cast (const cell *A)
 
zcellzcellnew2 (const zcell *A)
 
zcellzcellnew3 (long nx, long ny, long *nnx, long *nny)
 
zcellzcellnew_same (long nx, long ny, long mx, long my)
 
zcellzcellnew_file (long nx, long ny, long *nnx, long *nny, const char *keywords, const char *format,...)
 
zcellzcellnewsame_file (long nx, long ny, long mx, long my, const char *keywords, const char *format,...)
 
void zcellzero (zcell *dc)
 
void zcellset (zcell *dc, fcomplex alpha)
 
zcellzcelltrans (const zcell *A)
 
zcellzcellref (const zcell *in)
 
zcellzcelldup (const zcell *in)
 
void zcellcp (zcell **out0, const zcell *in)
 
zcellzcellreduce (const zcell *A, int dim)
 
zcellzcellcat (const zcell *A, const zcell *B, int dim)
 
void zcellcat2 (zcell **A, const zcell *B, int dim)
 
zcellzcellcat_each (const zcell *A, const zcell *B, int dim)
 
zcellz2cellref (const zmat *A, long *dims, long ndim)
 
void z2cell (zcell **B, const zmat *A, const zcell *ref)
 
zmatzcell_col (zcell *input, long icol)
 
fcomplex zcellsum (const zcell *A)
 
zmatzcellsum_each (const zcell *A)
 
uint32_t zcellhash (const zcell *A, uint32_t key)
 
int zisnan (const zmat *A)
 
float znorm (const zmat *in)
 
float zstd (const zmat *in)
 
void zrandu (zmat *A, const fcomplex mean, rand_t *rstat)
 
void zrandn (zmat *A, const fcomplex sigma, rand_t *rstat)
 
void zscale (zmat *A, float w)
 
fcomplex zinn (const zmat *A, const zmat *B)
 
fcomplex zwdot (const fcomplex *a, const zmat *w, const fcomplex *b)
 
void zcwm (zmat *A, const zmat *B)
 
void zcwm2 (zmat *A, const zmat *B1, float wt1, const zmat *B2, float wt2)
 
void zcwm3 (zmat *__restrict A, const zmat *__restrict W, const zmat *__restrict B1, const float wt1, const zmat *__restrict B2, const float wt2)
 
void zcwmcol (zmat *__restrict A, const zmat *__restrict B)
 
void zcwm3col (zmat *__restrict A, const zmat *__restrict W, const zmat *__restrict B1, const float wt1, const zmat *__restrict B2, const float wt2)
 
void zcwmrow (zmat *__restrict A, const zmat *__restrict B)
 
void zcwmcol2 (zmat *__restrict A, const zmat *__restrict B1, const float wt1, const zmat *__restrict B2, const float wt2)
 
void zcwmrow2 (zmat *__restrict A, const zmat *__restrict B1, const float wt1, const zmat *__restrict B2, const float wt2)
 
void zcwdiv (zmat *B, const zmat *A, fcomplex value)
 
void zmulvec (fcomplex *__restrict y, const zmat *__restrict A, const fcomplex *__restrict x, const fcomplex alpha)
 
void zmm (zmat **C0, const fcomplex beta, const zmat *A, const zmat *B, const char trans[2], const fcomplex alpha)
 
void zinvspd_inplace (zmat *A)
 
zmatzinvspd (const zmat *A)
 
void zinv_inplace (zmat *A)
 
zmatzinv (const zmat *A)
 
zmatzchol (const zmat *A)
 
zmatzmcc (const zmat *A, const zmat *wt)
 
zmatzimcc (const zmat *A, const zmat *wt)
 
zmatztmcc (const zmat *A, const zmat *wt)
 
zmatzpinv2 (const zmat *A, const_anyarray W, float thres)
 
zmatzpinv (const zmat *A, const_anyarray W)
 
fcomplex zdiff (const zmat *A, const zmat *B)
 
int zcircle (zmat *A, float cx, float cy, float dx, float dy, float r, fcomplex val)
 
int zcircle_symbolic (zmat *A, float cx, float cy, float dx, float dy, float r)
 
void zrotvec (zmat *A, const float theta)
 
void zrotvect (zmat *A, const float theta)
 
void zrotvecnn (zmat **B0, const zmat *A, float theta)
 
void zmulvec3 (fcomplex *y, const zmat *A, const fcomplex *x)
 
void zcorr (zmat **corr, const zmat *A, const zmat *B)
 
void zpara3 (float *grad, const zmat *corr)
 
void zcog (float *grad, const zmat *i0, float offsetx, float offsety, float thres, float bkgrnd, float flux)
 
void zshift2center (zmat *A, float offsetx, float offsety)
 
int zclip (zmat *A, float min, float max)
 
void zgramschmidt (zmat *Mod, float *amp)
 
void zmuldiag (zmat *A, const zmat *s)
 
void zcwpow (zmat *A, float power)
 
void zcwexp (zmat *A, float alpha)
 
void zcwpow_thres (zmat *A, float power, float thres)
 
void zsvd (zmat **U, smat **Sdiag, zmat **VT, const zmat *A)
 
void zsvd_cache (zmat **U, smat **Sdiag, zmat **VT, const zmat *A)
 
void zsvd_pow (zmat *A, float power, float thres)
 
void zexpm (zmat **out, float alpha, const zmat *A, float beta)
 
void zpolyval (zmat *A, smat *p)
 
void zaddI (zmat *A, fcomplex val)
 
void zadd (zmat **B0, fcomplex bc, const zmat *A, const fcomplex ac)
 
void zadd_relax (zmat **B0, fcomplex bc, const zmat *A, const fcomplex ac)
 
void zaddcol (zmat *B, long icol, fcomplex bc, const zmat *A, const fcomplex ac)
 
void zadds (zmat *A, const fcomplex ac)
 
zmatzlogspace (float emin, float emax, long n)
 
zmatzlinspace (float min, float dx, long n)
 
zmatzinterp1 (const zmat *xin, const zmat *yin, const zmat *xnew, fcomplex y0)
 
zmatzinterp1_2 (const zmat *xyin, const zmat *xnew)
 
zmatzinterp1linear (const zmat *xin, const zmat *yin, const zmat *xnew, fcomplex y0)
 
zmatzinterp1log (const zmat *xin, const zmat *yin, const zmat *xnew, fcomplex y0)
 
void zblend (zmat *__restrict A, zmat *__restrict B, int overlap)
 
void zhistfill (zmat **out, const zmat *A, float center, float spacing, int n)
 
zmatzspline_prep (zmat *x, zmat *y)
 
zmatzspline_eval (zmat *coeff, zmat *x, zmat *xnew)
 
zmatzspline (zmat *x, zmat *y, zmat *xnew)
 
void zcwlog10 (zmat *A)
 
void zcwlog (zmat *A)
 
void zembed (zmat *__restrict A, const zmat *__restrict B, const float theta)
 
void zembedd (zmat *__restrict A, const smat *__restrict B, const float theta)
 
float zfwhm (zmat *A)
 
void zgauss_fit (float *mr, float *ma, float *mb, float *theta, zmat *A, float thres)
 
float zgauss_width (zmat *A, float thres)
 
float zfwhm_gauss (zmat *A)
 
zmatzenc (const zmat *A, const zmat *dvec, int type, int nthread)
 
int zminsearch (fcomplex *x, int nmod, fcomplex ftol, int nmax, zminsearch_fun fun, void *info)
 
void zbessik (fcomplex x, fcomplex xnu, fcomplex *ri, fcomplex *rk, fcomplex *rip, fcomplex *rkp)
 
fcomplex ztrapz (const zmat *x, const zmat *y)
 
float zcellnorm (const zcell *in)
 
void zcellscale (anyarray A, float w)
 
void zcelldropempty (zcell **A0, int dim)
 
fcomplex zcellinn (const zcell *A, const zcell *B)
 
void zcellcwm (zcell *B, const zcell *A)
 
zcellzcellinvspd (zcell *A)
 
zcellzcellinv (zcell *A)
 
zcellzcellinvspd_each (zcell *A)
 
zcellzcellpinv2 (const zcell *A, const_anyarray W, float thres)
 
zcellzcellpinv (const zcell *A, const zspcell *W)
 
void zcellsvd_pow (zcell *A, float power, float thres)
 
void zcellcwpow (zcell *A, float power)
 
void zcelldropzero (zcell *B, float thres)
 
float zcelldiff (const zcell *A, const zcell *B)
 
int zcellclip (zcell *Ac, float min, float max)
 
zcellzcellsub (const zcell *in, long sx, long nx, long sy, long ny)
 
zcellzbspline_prep (zmat *x, zmat *y, zmat *z)
 
zmatzbspline_eval (zcell *coeff, zmat *x, zmat *y, zmat *xnew, zmat *ynew)
 
void zmaprot (anyarray A_, real theta)
 
void zcwmc (zmat *__restrict A, const zmat *__restrict B, const float alpha)
 
void zcwmd (zmat *__restrict A, const smat *__restrict B, const float alpha)
 
void zembed_wvf (zmat *__restrict A, const float *opd, const float *amp, const int nopdx, const int nopdy, const float wvl, const float theta)
 
void zembedc_flag (zmat *__restrict A, const zmat *__restrict B, const float theta, CEMBED flag)
 
void zcpcorner (zmat *A, const zmat *__restrict B, CEMBED flag)
 
void zabstoreal (zmat *A)
 
void zabs2toreal (zmat *A, float scale)
 
void zcpd (zmat **__restrict A, const smat *__restrict B)
 
void zreal2d (smat **__restrict A0, float alpha, const zmat *__restrict B, float beta)
 
void zimag2d (smat **__restrict A0, float alpha, const zmat *__restrict B, float beta)
 
void zabs22d (smat **__restrict A0, float alpha, const zmat *__restrict B, float beta)
 
void ztilt2 (zmat *otf, zmat *otfin, float sx, float sy, int peak_corner)
 
void ztilt (zmat *otf, float sx, float sy, int peak_corner)
 
void zcogreal (float *grad, const zmat *i0, float offsetx, float offsety, float thres, float bkgrnd)
 
void zcogabs (float *grad, const zmat *i0, float offsetx, float offsety, float thres, float bkgrnd)
 
void zwritedata (file_t *fp, const zmat *A, long ncol)
 
zmatzreaddata (file_t *fp, header_t *header)
 
zmatznew_mmap (long nx, long ny, const char *keywords, const char *format,...)
 
zcellzcellnew_mmap (long nx, long ny, long *nnx, long *nny, const char *keywords, const char *format,...)
 
zcellzcellnewsame_mmap (long nx, long ny, long mx, long my, const char *keywords, const char *format,...)
 
zmatzread_mmap (const char *format,...)
 
zcellzcellread_mmap (const char *format,...)
 
zspzspnew (long nx, long ny, long nzmax)
 
zspzspref (zsp *A)
 
zspzspdup (const zsp *A)
 
zspzspnew2 (const zsp *A)
 
zspzspnewrandu (long nx, long ny, const fcomplex mean, float fill, rand_t *rstat)
 
void zspsetnzmax (zsp *sp, long nzmax)
 
zspzsp_cast (const cell *A)
 
void zspfree_do (zsp *sp)
 
void zspdisp (const zsp *sp)
 
int zspcheck (const zsp *sp)
 
void zspscale (zsp *A, const fcomplex beta)
 
void zspscalex (zsp *A, const zmat *xs)
 
void zspscaley (zsp *A, const zmat *ys)
 
zspcellzspcellref (const zspcell *in)
 
zspcellzspcell_cast (const cell *A)
 
void zspcellscale (zspcell *A, const fcomplex beta)
 
zspzspnewdiag (long N, fcomplex *vec, fcomplex alpha)
 
zmatzspdiag (const zsp *A)
 
void zspmuldiag (zsp *__restrict A, const fcomplex *w, fcomplex alpha)
 
void zspmv (zmat *y, const zsp *A, const zmat *__restrict x, char trans, fcomplex alpha)
 
void zspmulcreal (fcomplex *__restrict y, const zsp *A, const fcomplex *__restrict x, float alpha)
 
void zspmm (zmat **yout, const zsp *A, const zmat *x, const char trans[2], const fcomplex alpha)
 
void zmulsp (zmat **yout, const zmat *x, const zsp *A, const char trans[2], const fcomplex alpha)
 
fcomplex zspwdinn (const zmat *y, const zsp *A, const zmat *x)
 
fcomplex zspcellwdinn (const zcell *y, const zspcell *A, const zcell *x)
 
void zcellmm (panyarray C0, const_anyarray A, const_anyarray B, const char trans[2], const float alpha)
 
zcellzcellmm2 (const zcell *A, const zcell *B, const char trans[2])
 
zspz2sp (zmat *A, float thres)
 
void zspfull (zmat **out0, const zsp *A, const char trans, const fcomplex f)
 
void zspcellfull (zcell **out0, const zspcell *A, const char trans, const fcomplex f)
 
zspzspadd2 (const zsp *A, fcomplex a, const zsp *B, fcomplex b)
 
void zspadd (zsp **A0, fcomplex alpha, const zsp *B, fcomplex beta)
 
void zcelladd (panyarray pA, float ac, const_anyarray B, float bc)
 
void zcelladdsp (zcell **pA, float ac, const zspcell *B, float bc)
 
void zspcelladd (zspcell **pA, float ac, const zspcell *B, float bc)
 
void zspaddI (zsp *A0, fcomplex alpha)
 
void zcelladdI (anyarray A, fcomplex alpha)
 
zspzsptrans (const zsp *A)
 
void zspconj (zsp *)
 
zspzspmulsp (const zsp *A, const zsp *B, const char trans[2])
 
void zspmulsp2 (zsp **C0, const zsp *A, const zsp *B, const char trans[2], const fcomplex scale)
 
zspcellzspcelltrans (const zspcell *spc)
 
zspzspcat (const zsp *A, const zsp *B, int type)
 
zspzspcell2sp (const zspcell *A)
 
zmatzspsum (const zsp *A, int col)
 
zmatzspsumabs (const zsp *A, int col)
 
void zspclean (zsp *A)
 
void zspdroptol (zsp *A, float thres)
 
void zspcelldroptol (zspcell *A, float thres)
 
void zspsort (zsp *A)
 
void zspcellsort (zspcell *A)
 
void zspsym (zsp **A)
 
void zspcellsym (zspcell **A)
 
zspzspconvolvop (zmat *A)
 
zspzspperm (zsp *A, int reverse, long *pcol, long *prow)
 
zspzspinvbdiag (const zsp *A, long bs)
 
zcellzspblockextract (const zsp *A, long bs)
 
zmatzcell2m (const_anyarray A)
 
void zspwritedata (file_t *fp, const zsp *sp)
 
zspzspreaddata (file_t *fp, header_t *header)
 
void zfft_free_plan (struct fft_t *fft)
 
void zfft2 (zmat *A, int dir)
 
void zfft2i (zmat *A, int dir)
 
void zfft2s (zmat *A, int dir)
 
void zfft2partial (zmat *A, int ncomp, int dir)
 
zmatzffttreat (zmat *A)
 
void sfft_free_plan (struct fft_t *fft)
 
void scell_fft2 (scell *dc, int dir)
 
void sfft1plan_r2hc (smat *out, int dir)
 
void sfft1 (smat *A, int dir)