libftsh
A Fast Transform for Spherical Harmonics
 All Data Structures Files Functions Variables Defines
Defines | Functions
fast1_fromfile.c File Reference

Load precomputed data for fast1 transform. More...

#include "libftsh.h"

Defines

#define ENTEREXIT   0

Functions

void fast1_fromfile (int *numpts_ptr, int *band_limit_ptr, REAL **node_ptr, REAL **weight_ptr, Pm_1D **pmn_matrix_ptr, Pm_1D_Workspace *pmnwork, FILE *fp)
void load_fast1 (int *numpts_ptr, int *band_limit_ptr, int *num_levels_ptr, REAL **node_ptr, REAL **weight_ptr, Fast1_Save *saves_fordump, Pm_1D **pmn_matrix_ptr, FILE *fp)

Detailed Description

Load precomputed data for fast1 transform.

Summary:


Function Documentation

void fast1_fromfile ( int *  numpts_ptr,
int *  band_limit_ptr,
REAL **  node_ptr,
REAL **  weight_ptr,
Pm_1D **  pmn_matrix_ptr,
Pm_1D_Workspace pmnwork,
FILE *  fp 
)

This routine loads the initialization dumped by dump_fast1, interprets it and does all the set-up necessary to do the synthesis or analysis transform

INPUTS: fp -- the objects are read from the file pointed to by fp, in binary format. The file must be opened before calling this routine.

OUTPUTS:

  • numpts -- the number of points on the full interval.
  • band_limit -- the bound on the degree of the expansion. In \(P^m_n\) notation this bounds n.
  • node -- an array of length numpts with the nodes, usually Arcsin of the usual gaussian nodes.
  • weight -- an array of length numpts with the quadrature weights
  • pmn_matrix -- an array of band_limit (==order_limit) Pm_1D structures, each representing the compressed matrix for one m.
  • pmn_work -- a structure holding workspace and other precomputed values used by the transform, independent of m

NOTES:

  • node and weight are not needed for the synthesis/analysis routines but are provided here for other uses.

Here is the call graph for this function:

void load_fast1 ( int *  numpts_ptr,
int *  band_limit_ptr,
int *  num_levels_ptr,
REAL **  node_ptr,
REAL **  weight_ptr,
Fast1_Save saves_fordump,
Pm_1D **  pmn_matrix_ptr,
FILE *  fp 
)

This routine loads the initialization dumped by dump_fast1.

We interpret what we read and re-align pointers and such to get things ready to use.

INPUTS: fp -- the objects are read from the file pointed to by fp, in binary format. The file must be opened before calling this routine

OUTPUTS:

  • numpts -- the number of points on the full interval.
  • band_limit -- the bound on the degree of the expansion. In P^m_n notation this bounds n.
  • num_levels -- the number of dyadic levels used in the adaption
  • node -- an array of length numpts with the nodes, usually Arcsin of the usual gaussian nodes.
  • weights -- an array of length numpts with the quadrature weights
  • saves_fordump -- a structure containing the information needed for the bells. Constructed by init_fast1
  • pmn_matrix -- an array of band_limit (==order_limit) Pm_1D structures, each representing the compressed matrix for one m.

NOTES:

  • num_levels is not needed by the synthesis/analysis routines. It may be useful to keep it so we could re-dump.
  • saves_for dump is also not needed. we could free it here.
  • we free plan_holder, thus losing our handle on the trig plans This may cause memory leaks since we can't free them easily
  • We now have separate workspace for each trig plan, but these could be combined.

Here is the call graph for this function:

Here is the caller graph for this function: