libftsh
A Fast Transform for Spherical Harmonics
 All Data Structures Files Functions Variables Defines
Data Fields
Banded_Matrix Struct Reference

A one dimensional sparse matrix, with banded structure. More...

#include <libftsh.h>

Data Fields

int max_size
int max_rows
int max_bands
int n_row
int n_col
int non_zero
int * band_p
int * band_list
REALmatrix

Detailed Description

A one dimensional sparse matrix, with banded structure.

NOTES:


Field Documentation

int* band_list

A list of ints that encodes the bands kept. For each band we have three consecutive entries:

  • the first index in the band;
  • ONE PAST the last index in the band;
  • an offset telling where the coefficients start in matrix (at matrix[offset]) If you subtract the band start from the band end and add over all the bands, you should get non_zero. There are 3*band_p[n_row] ints used.
int* band_p

A list of n_row+1 integers that keep track of which bands are in which row of the matrix. band_p[i] holds (three times) the total number of bands used on all previous rows. It is used as an offset within bandlist. band_p[i] gives the beginning of the bands for that row, and band_p[i+1] gives a marker just past the end of the bands for that row. The number of bands on a row is given by (band_p[i+1]-band_p[i])/2. Note that we need access to band_p[n_row].

A list of non_zero REALs that gives the value of an entry.

int max_bands

(half) the amount of memory available for band_list. Needs to be at least band_p[n_row].

int max_rows

The amount of memory allocated for row_p. Keeping track of this separately from max_size gives us greater flexibility

int max_size

The amount of memory allocated for this matrix. This may be quite a lot larger than the amount needed for this particular matrix, but allows us to check if we have enough room when we form a matrix. Needs to be at least non_zero.

int n_col

The (theoretical) number of colums in the matrix.

int n_row

The (theoretical) number of rows in the matrix.

int non_zero

The actual number of non-zero entries in the matrix.


The documentation for this struct was generated from the following file: