MAOS
Multithreaded Adaptive Optics Simulator
Loading...
Searching...
No Matches
cell.h File Reference

Macros

#define cellfree(A)   if(A){cellfree_do(A); A=NULL;}
 
#define writebin_async(A, ncol)   writecell_async(A, ncol)
 

Functions

cellcellnew (long nx, long ny)
 
cellcellref (const_anyarray in)
 Construct a reference base on type.
 
uint32_t cellhash (const_anyarray A, uint32_t key)
 
cellcellconvert (cell *A, cell *(*fun_convert)(cell *))
 Convert elements of cell array.
 
void cellinit (panyarray A, long nx, long ny)
 
void cellinit2 (panyarray A, const_anyarray B)
 
void celldim (const_anyarray A_, long *nx, long *ny, long **nxs, long **nys)
 
void cellresize (anyarray in, long nx, long ny)
 
int cell_is_diag (const_anyarray A)
 
void cellfree_do (anyarray dc)
 
void writedata (file_t *fd, const_anyarray A, long ncol)
 
void writebin (const_anyarray dc, const char *format,...)
 
cellreaddata (file_t *fp, M_ID id, header_t *header)
 
cellreadbin_id (M_ID id, int level, const char *format,...)
 
cellreadbin (const char *format,...)
 
void writecell_async (const_anyarray A, long ncol)
 
void writebin_header (anyarray dc, const char *keywords, const char *format,...)
 
cellreadsock (int sock)
 
void writesock (const_anyarray dc, int sock)
 

Detailed Description

Function for a generic cell. use CELL() to case to cell.

Macro Definition Documentation

◆ cellfree

#define cellfree (   A)    if(A){cellfree_do(A); A=NULL;}

free a cell array and zero the pointer.

Function Documentation

◆ cellnew()

cell * cellnew ( long  nx,
long  ny 
)

Create a generic cell array.

◆ cellinit()

void cellinit ( panyarray  A_,
long  nx,
long  ny 
)

check the size of cell array if exist. Otherwise create it

◆ cellinit2()

void cellinit2 ( panyarray  A_,
const_anyarray  B_ 
)

check the size of cell array if exist. Otherwise create it. m is created for dcell

◆ celldim()

void celldim ( const_anyarray  A_,
long nx,
long ny,
long **  nxs,
long **  nys 
)

Obtain the dimensions.

◆ cellresize()

void cellresize ( anyarray  A_,
long  nx,
long  ny 
)

Resize a generic cell array.

◆ cell_is_diag()

int cell_is_diag ( const_anyarray  A_)

Check whether the cell has only diagonal entries.

◆ cellfree_do()

void cellfree_do ( anyarray  A_)

free a mat or cell object.

◆ writedata()

void writedata ( file_t *  fp,
const_anyarray  A_,
long  ncol 
)

ncol: 0: normal writing. -1: initialize async data. >0: async writing.

◆ writecell_async()

void writecell_async ( const_anyarray  A,
long  ncol 
)

Calls writebin with build in fp

◆ writebin_header()

void writebin_header ( anyarray  Ac_,
const char *  keywords,
const char *  format,
  ... 
)

A generic routine for write data to file with separate keywords

◆ readsock()

cell * readsock ( int  sock)

A generic routine for reading data from socket. User need to cast the result. We dup the fd to avoid close it after read.

◆ writesock()

void writesock ( const_anyarray  A,
int  sock 
)

A generic routine for write data to socket. We dup the fd to avoid close it after read.