MIDAPACK - MIcrowave Data Analysis PACKage  1.1b
Parallel software tools for high performance CMB DA analysis
 All Data Structures Files Functions Variables Typedefs Groups Pages
multithreaded/sequential routines

Functions

int tpltz_init (int n, int lambda, int *nfft, int *blocksize, fftw_complex **T_fft, double *T, fftw_complex **V_fft, double **V_rfft, fftw_plan *plan_f, fftw_plan *plan_b, Flag flag_stgy)
 Sets a block size and initializes all fftw arrays and plans needed for the computation.
int tpltz_cleanup (fftw_complex **T_fft, fftw_complex **V_fft, double **V_rfft, fftw_plan *plan_f, fftw_plan *plan_b)
 Cleans fftw workspace used in the Toeplitz matrix matrix product's computation.
int reset_gaps (double **V, int id0, int local_V_size, int m, int nrow, int m_rowwise, int64_t *id0gap, int *lgap, int ngap)
 Set the data to zeros at the gaps location.
int gap_masking (double **V, int l, int *id0gap, int *lgap, int ngap)
 Reduce the vector and mask the defined gaps.
int gap_filling (double **V, int l, int *id0gap, int *lgap, int ngap)
 Extend the vector and add zeros on the gaps locations.
int stmm (double **V, int n, int m, double *T, int lambda, Flag flag_stgy)
 Perform the product of a Toeplitz matrix by a general matrix using the sliding window algorithm.
int gstbmm (double **V, int nrow, int m_cw, int m_rw, Block *tpltzblocks, int nb_blocks, int64_t idp, int local_V_size, int64_t *id0gap, int *lgap, int ngap, Flag flag_stgy)
 Performs the multiplication of a symmetric, Toeplitz block-diagonal matrix with gaps, T, by an arbitrary matrix, V, distributed over processes.

Detailed Description

These are shared-memory routines.


Function Documentation

int tpltz_init ( int  n,
int  lambda,
int *  nfft,
int *  blocksize,
fftw_complex **  T_fft,
double *  T,
fftw_complex **  V_fft,
double **  V_rfft,
fftw_plan *  plan_f,
fftw_plan *  plan_b,
Flag  flag_stgy 
)

Sets a block size and initializes all fftw arrays and plans needed for the computation.

Initializes the fftw arrays and plans is necessary before any computation of the Toeplitz matrix matrix product. Use tpltz_cleanup afterwards.

See also:
tpltz_cleanup
Parameters:
nrow size of the matrix used for later product
lambdaToeplitz band width
nfftmaximum number of FFTs you want to compute at the same time
blocksizeoptimal block size used in the sliding window algorithm to compute an optimize value)
T_fftcomplex array used for FFTs
TToeplitz matrix
V_fftcomplex array used for FFTs
V_rfftreal array used for FFTs
plan_ffftw plan forward (r2c)
plan_bfftw plan backward (c2r)

Definition at line 257 of file toeplitz.c.

int tpltz_cleanup ( fftw_complex **  T_fft,
fftw_complex **  V_fft,
double **  V_rfft,
fftw_plan *  plan_f,
fftw_plan *  plan_b 
)

Cleans fftw workspace used in the Toeplitz matrix matrix product's computation.

Destroy fftw plans, free memory and reset fftw workspace.

See also:
tpltz_init
Parameters:
T_fftcomplex array used for FFTs
V_fftcomplex array used for FFTs
V_rfftreal array used for FFTs
plan_ffftw plan forward (r2c)
plan_bfftw plan backward (c2r)

Definition at line 435 of file toeplitz.c.

int reset_gaps ( double **  V,
int  id0,
int  local_V_size,
int  m,
int  nrow,
int  m_rowwise,
int64_t *  id0gap,
int *  lgap,
int  ngap 
)

Set the data to zeros at the gaps location.

The datas located on a gap are set to zeros. The gaps are defined in the time space, meaning their indexes are defined in the row dimension.

Definition at line 189 of file toeplitz_gappy.c.

int gap_masking ( double **  V,
int  l,
int *  id0gap,
int *  lgap,
int  ngap 
)

Reduce the vector and mask the defined gaps.

Parameters:
Vinput/output vector
llength of the vector
id0gapgap first index
lgapgap length
ngapnumber of gaps

Definition at line 255 of file toeplitz_gappy_seq.dev.c.

int gap_filling ( double **  V,
int  l,
int *  id0gap,
int *  lgap,
int  ngap 
)

Extend the vector and add zeros on the gaps locations.

Parameters:
Vinput/output vector
llength of the extend vector
id0gapgap first index
lgapgap length
ngapnumber of gaps

Definition at line 293 of file toeplitz_gappy_seq.dev.c.

int stmm ( double **  V,
int  n,
int  m,
double *  T,
int  lambda,
Flag  flag_stgy 
)

Perform the product of a Toeplitz matrix by a general matrix using the sliding window algorithm.

This is a simplifed call of the sequential product including initialization and cleaning. This use the flag parameters to set the comutational options.

Parameters:
V[input] data matrix (with the convention V(i,j)=V[i+j*n]) ; [out] result of the product TV
nnumber of rows of V
mnumber of columns of V
mnumber of columns of V
TToeplitz matrix data composed of the non-zero entries of his first row
lambdanumber of non-zero in the first row of the Toeplitz and size of T
flag_stgyflag strategy for the product computation

Definition at line 72 of file toeplitz_seq.c.

int gstbmm ( double **  V,
int  nrow,
int  m_cw,
int  m_rw,
Block tpltzblocks,
int  nb_blocks,
int64_t  idp,
int  local_V_size,
int64_t *  id0gap,
int *  lgap,
int  ngap,
Flag  flag_stgy 
)

Performs the multiplication of a symmetric, Toeplitz block-diagonal matrix with gaps, T, by an arbitrary matrix, V, distributed over processes.

We first rebuild the Toeplitz block matrix structure to reduce the computation cost and skip the computations of the values on the defined gaps.

The parameters are :

Parameters:
V[input] distributed data matrix (with the convention V(i,j)=V[i+j*n]) ; [out] result of the product TV
nrownumber of rows of the global data matrix V
mnumber of columns for the data matrix V in the global rowwise order
m_rowwisenumber of columns for the data matrix V in the rowwise order per processor
tpltzblockslist of the toeplitz blocks struture with its own parameters (idv, n, T_block, lambda) :
  • idv is the global row index defining for each Toeplitz block as stored in the vector T ;
  • n size of each Toeplitz block
  • T_block location of each Toeplitz matrix data composed of the non-zero entries of the first row ;
  • lambda size of each Toeplitz block data T_block. The bandwith size is then equal to lambda*2-1
nb_blocks_allnumber of all Toeplitz block on the diagonal of the full Toeplitz matrix
nb_blocks_localnumber of Toeplitz blocks as stored in T
idpglobal index of the first element of the local part of V
local_V_sizea number of all elements in local V
id0gapindex of the first element of each defined gap
lgaplength of each defined gaps
ngapnumber of defined gaps
flag_stgyflag strategy for the product computation

Definition at line 170 of file toeplitz_seq.c.