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

Contains functions interacting the Banded_Matrix struct with others. More...

#include "libftsh.h"

Defines

#define ENTEREXIT   0
#define OLDLOOPS   0

Functions

void bdmat_dvect_multiply (Dense_Vector *out, Banded_Matrix *inmat, Dense_Vector *invect)
void bdmat_t_dvect_multiply (Dense_Vector *out, Banded_Matrix *inmat, Dense_Vector *invect)
void dmat_to_bdmat (Banded_Matrix *out, Dense_Matrix *in, REAL cutoff, int min_gap)

Detailed Description

Contains functions interacting the Banded_Matrix struct with others.

Summary:


Define Documentation

#define OLDLOOPS   0

Switch on old or new method to loop. New method tries to localize variables and should be faster. In my tests it made synthesis twice as fast but did not help analysis. The compiler optimization may be already doing some localization to the old loops.


Function Documentation

void bdmat_dvect_multiply ( Dense_Vector out,
Banded_Matrix inmat,
Dense_Vector invect 
)

This routine applies a Banded_Matrix to a Dense_Vector to produce a Dense_Vector. The matrix may be square or rectangular.

INPUTS:

  • out -- the Dense_Vector to put the result in. Should be initialized as follows:
    • .max_size is the amount of memory available.
    • .vector points to .max_size REAL
  • inmat -- the Banded_Matrix.
  • invect -- the Dense_Vector

OUTPUT: out is modified so out = inmat * invect

NOTES:

  • might want to hold some things as local registers, rather than repeatedly accessing arrays.
  • looping structure may be inefficient

Here is the caller graph for this function:

void bdmat_t_dvect_multiply ( Dense_Vector out,
Banded_Matrix inmat,
Dense_Vector invect 
)

This routine applies the TRANSPOSE of a Banded_Matrix to a Dense_Vector to produce a Dense_Vector. The matrix may be square or rectangular.

INPUTS:

  • out -- the Dense_Vector to put the result in. Should be initialized as follows
    • .max_size is the amount of memory available
    • .vector points to .max_size REAL
  • inmat -- the Banded_Matrix.
  • invect -- the Dense_Vector

OUTPUT: out is modified so out = TRANSPOSE(inmat) * invect

NOTES:

  • might want to hold some things as local registers, rather than repeatedly accessing arrays
  • looping structure may be inefficient

Here is the caller graph for this function:

void dmat_to_bdmat ( Banded_Matrix out,
Dense_Matrix in,
REAL  cutoff,
int  min_gap 
)

Convert a matrix in Dense_Matrix form to Banded_Matrix form.

INPUT:

  • out -- Where to put the result in Banded_Matrix format. Should be initialized as follows
    • .max_rows is the amount of row memory available
    • .band_p points to .max_rows ints +.max_bands is the amount of band memory available
    • .band_list points to 3*.max_bands ints
    • .max_size is the amount of main memory available
    • .matrix points to .max_size REAL
  • in -- the Dense_Matrix
  • cutoff -- the truncation threshold to use in the conversion. Entries less than cutoff are discarded. To disable truncation, set cutoff <0 .
  • min_gap -- the minimal allowed gap between bands. Coefficients less than cutoff are retained if removing them makes a gap of less than min_gap. To disable, set to 0.

OUTPUT: out

NOTES:

  • not checking for sufficient memory

Here is the caller graph for this function: