libftsh
A Fast Transform for Spherical Harmonics
|
Contains simple functions based on the Dense_Matrix struct. More...
#include "libftsh.h"
Defines | |
#define | ENTEREXIT 0 |
Functions | |
Dense_Matrix | init_dmat_memory (unsigned int n) |
void | give_dmat_memory (Dense_Matrix *current, Dense_Matrix *previous) |
void | free_dmat_memory (Dense_Matrix *in) |
void | dump_bin_dmat (Dense_Matrix *x, FILE *out) |
void | load_bin_dmat (Dense_Matrix *x, FILE *in) |
Contains simple functions based on the Dense_Matrix struct.
Summary:
void dump_bin_dmat | ( | Dense_Matrix * | x, |
FILE * | out | ||
) |
This routine dumps a Dense_Matrix to a file in binary format.
This is efficient, but not human readable.
INPUTS:
OUTPUT: writes into the file given by out. The writing mode ("wb" or "ab") is determined outside of this routine.
void free_dmat_memory | ( | Dense_Matrix * | in | ) |
This routine frees the memory that was given to a Dense_Matrix by init_dmat_memory.
INPUT: in -- the Dense_Matrix to free. it must have been initialized by init_dmat_memory, or we will attempt to free things not gotten by calloc, probaby causing catastrophic failure.
NOTES:
void give_dmat_memory | ( | Dense_Matrix * | current, |
Dense_Matrix * | previous | ||
) |
This routine sets up memory for the next Dense_Matrix we wish to use.
It looks at the previous Dense_Matrix we used, and increments fields
INPUT: previous -- the last Dense_Matrix we used.
OUTPUT: current -- the Dense_Matrix we wish to use next. We align current->matrix to the first space not used by previous->matrix, and set current->max_size to account for the amount used in previous.
Dense_Matrix init_dmat_memory | ( | unsigned int | n | ) |
This routine gets a large amount of memory for Dense_Matrix's, and gives it to a single Dense_Matrix to hold. This special Dense_Matrix acts as a pointer to this block of memory, and also keeps track of how large this memory is.
INPUT: n -- the amount of memory to get
OUPUT: returns a Dense_Matrix with
void load_bin_dmat | ( | Dense_Matrix * | x, |
FILE * | in | ||
) |
This routine loads a Dense_Matrix from a file in binary format, as written by dump_bin_dmat.
INPUTS:
OUTPUT: x -- is filled in.