libftsh
A Fast Transform for Spherical Harmonics
|
Contains simple functions based on the Banded_Matrix struct. More...
#include "libftsh.h"
Defines | |
#define | ENTEREXIT 0 |
Functions | |
Banded_Matrix | init_bdmat_memory (int max_size, int max_rows, int max_bands) |
void | give_bdmat_memory (Banded_Matrix *current, Banded_Matrix *previous) |
void | free_bdmat_memory (Banded_Matrix *in) |
void | bdmat_copy (Banded_Matrix *out, Banded_Matrix *in) |
void | dump_bin_bdmat (Banded_Matrix *x, FILE *out) |
void | load_bin_bdmat (Banded_Matrix *x, FILE *in) |
Contains simple functions based on the Banded_Matrix struct.
Summary:
void bdmat_copy | ( | Banded_Matrix * | out, |
Banded_Matrix * | in | ||
) |
This routine copies a Banded_Matrix.
INPUTS: in -- the Banded_Matrix to copy
OUTPUT: out -- the values of in are copied to out Should be initialized as follows
void dump_bin_bdmat | ( | Banded_Matrix * | x, |
FILE * | out | ||
) |
This routine dumps a Banded_Matrix to a file in binary format.
INPUTS:
OUTPUT: writes into the file given by out. The writing mode ("wb" or "ab") is determined outside of this routine.
void free_bdmat_memory | ( | Banded_Matrix * | in | ) |
This routine frees the memory that was given to a Banded_Matrix by init_bdmat_memory.
INPUT: in -- the Banded_Matrix to free. it must have been initialized by init_bdmat_memory, or we will attempt to free things not gotten by calloc, probaby causing catastrophic failure.
NOTES:
void give_bdmat_memory | ( | Banded_Matrix * | current, |
Banded_Matrix * | previous | ||
) |
This routine sets up memory for the next Banded_Matrix we wish to use.
It looks at the previous Banded_Matrix we used, and increments fields
INPUT: previous -- the last Banded_Matrix we used
OUTPUT: current -- the Banded_Matrix we wish to use next
We set the .band_p, .band_list, and .matrix fields to the next available ints and REAL. .max_size, .max_rows, and .max_bands are set to account for the amount used in previous. also set: .non_zero=0; .n_row=-1 .n_col=0
Banded_Matrix init_bdmat_memory | ( | int | max_size, |
int | max_rows, | ||
int | max_bands | ||
) |
This routine gets a large amount of memory for Banded_Matrix's, and gives it to a single Banded_Matrix to hold. This special Banded_Matrix acts as a pointer to this block of memory, and also keeps track of how large this memory is.
INPUT:
OUPUT: returns a Banded_Matrix with
void load_bin_bdmat | ( | Banded_Matrix * | x, |
FILE * | in | ||
) |
This routine boads a Banded_Matrix to a file in binary format, as written by dump_bin_bdmat
INPUTS:
OUTPUT: x -- is filled in.