![]() |
MAOS
Multithreaded Adaptive Optics Simulator
|
Macros | |
| #define | cellfree(A) |
| #define | writebin_async(A, ncol) |
Functions | |
| cell * | cellnew (long nx, long ny) |
| cell * | cellref (const_anyarray in) |
| uint32_t | cellhash (const_anyarray A, uint32_t key) |
| cell * | cellconvert (cell *A, cell *(*fun_convert)(cell *)) |
| int | 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,...) |
| cell * | readdata (file_t *fp, M_ID id, header_t *header) |
| cell * | readbin_fp (file_t *fp, M_ID id, int level) |
| cell * | readbin_id (M_ID id, int level, const char *format,...) |
| cell * | readbin (const char *format,...) |
| void | writecell_async (const_anyarray A, long ncol) |
| void | writebin_header (anyarray dc, const char *keywords, const char *format,...) |
| cell * | readsock (int sock) |
| void | writesock (const_anyarray dc, int sock) |
Function for a generic cell. Cast a typed cell (dcell, ccell, ...) to cell* to use them.
| #define cellfree | ( | A | ) |
free a cell array and zero the pointer.
| #define writebin_async | ( | A, | |
| ncol ) |
Create a generic cell array.
| [in] | nx | Number of rows. Negative is treated as 0. |
| [in] | ny | Number of columns. Negative is treated as 0. |
| cell * cellref | ( | const_anyarray | in | ) |
Construct a reference base on type. Cell arrays are recreated with each element referenced.
| [in] | in | Array or cell array to reference. |
| uint32_t cellhash | ( | const_anyarray | in, |
| uint32_t | key ) |
Compute a hash of the numerical content of array or cell array in (recursively) using key as the seed. Returns the updated key. Sparse arrays are skipped.
| [in] | in | Array or cell array. |
| [in] | key | Seed of the hash. |
Convert elements of cell array in place.
| [in,out] | A | Array or cell array whose (non-cell) elements are replaced by the result of fun_convert. |
| [in] | fun_convert | Conversion function. It takes ownership of its input and returns the converted array. |
check the size of cell array if exist. Otherwise create it
| [in,out] | A_ | Pointer to the cell array. Created if NULL, otherwise its type and size are checked. |
| [in] | nx | Number of rows. |
| [in] | ny | Number of columns. |
| void cellinit2 | ( | panyarray | A_, |
| const_anyarray | B_ ) |
check the size of cell array if exist. Otherwise create it with the same layout as B. m is created for dcell
| [in,out] | A_ | Pointer to the cell array. Created if NULL, otherwise its type and size are checked. |
| [in] | B_ | The reference cell array. Must be a cell. |
Obtain the dimensions of the dense matrix assembled from cell array A. nx, ny are the total rows and columns. *nxs and *nys are allocated (caller frees) to contain the number of rows of each cell row and columns of each cell column. Cells along a row (column) must have the same number of rows (columns).
| [in] | A_ | The cell array. |
| [out] | nx | Total number of rows. |
| [out] | ny | Total number of columns. |
| [out] | nxs | Newly allocated number of rows of each cell row; the caller frees it. NULL if A is empty. |
| [out] | nys | Newly allocated number of columns of each cell column; the caller frees it. NULL if A is empty. |
Resize a generic cell array. Elements outside of the new size are freed and new elements are NULL.
| [in,out] | A_ | The cell array. Must be valid and with m unset. |
| [in] | nx | New number of rows. |
| [in] | ny | New number of columns. |
| int cell_is_diag | ( | const_anyarray | A_ | ) |
Check whether the cell has only diagonal entries.
| [in] | A_ | The cell array. |
| void cellfree_do | ( | anyarray | A_ | ) |
free a mat or cell object.
| [in,out] | A_ | The object to free (recursively for cell arrays). May be NULL. |
| void writedata | ( | file_t * | fp, |
| const_anyarray | A_, | ||
| long | ncol ) |
Write array or cell array to file.
| [in] | fp | File to write to. Must be NULL when ncol>0. |
| [in] | A_ | Array or cell array to write. |
| [in] | ncol | 0: normal writing. -1: initialize async data. >0: async writing of the first ncol columns. |
| void writebin | ( | const_anyarray | A, |
| const char * | format, | ||
| ... ) |
Write array or cell array A to file with name given by the printf-style format. Does nothing if the file name is empty or cannot be opened.
| [in] | A | Array or cell array to write. |
| [in] | format | printf-style format of the file name. |
Read a block which may be cell array or basic arrys. do not scan. id is intended only for the fundamental data. header is read first if header==0 or header->id==0.
| [in] | fp | File to read from. |
| [in] | id | Requested type of the fundamental data. 0 to use the type in the file. |
| [in,out] | header | Header of the block. May be NULL. Its str is taken by the returned cell array. |
| cell * readbin_fp | ( | file_t * | fp, |
| M_ID | id, | ||
| int | level ) |
Read array or cell array from an opened file, socket, or pipe, like readbin_id().
| [in] | fp | File to read from, e.g., from zfdopen_as(). |
| [in] | id | Requested fundamental data type. 0 for native. |
| [in] | level | Cell nesting level, see readdata_auto(). -1 to detect automatically. |
| cell * readbin_id | ( | M_ID | id, |
| int | level, | ||
| const char * | format, | ||
| ... ) |
Read array or cell array from file with name given by the printf-style format. id is the requested fundamental data type (converted if necessary, 0 for native), level is the cell nesting level, see readdata_auto(). Returns NULL if the file cannot be opened. The caller owns the result.
| [in] | id | Requested fundamental data type. 0 for native. |
| [in] | level | Cell nesting level, see readdata_auto(). |
| [in] | format | printf-style format of the file name. |
| cell * readbin | ( | const char * | format, |
| ... ) |
Read any data from file with automatic type and nesting detection. The caller needs to cast the result and free it.
| [in] | format | printf-style format of the file name. |
| void writecell_async | ( | const_anyarray | A, |
| long | ncol ) |
Asynchronously write data to the file previously initialized with writedata() with ncol=-1.
| [in] | A | Array or cell array to write. |
| [in] | ncol | Number of columns that are ready to write. Must not be 0. |
| void writebin_header | ( | anyarray | Ac_, |
| const char * | keywords, | ||
| const char * | format, | ||
| ... ) |
A generic routine for write data to file with separate keywords
| [in,out] | Ac_ | Array or cell array to write; its keywords are replaced by keywords if not NULL. |
| [in] | keywords | Keywords to write. |
| [in] | format | printf-style format of the file name. |
| 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.
| [in] | sock | The socket. |
| 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.
| [in] | A | Array or cell array to write. |
| [in] | sock | The socket. |