toeplitz.h File Reference

Main project header file. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <f2c.h>
#include <clapack.h>
#include <gsl/gsl_cblas.h>
#include <cuda_runtime.h>

Go to the source code of this file.

Classes

struct  interval_cpu_info_struct
struct  exec_window_entry_struct
struct  extract_device_info_struct
struct  extract_global_info_struct

Defines

#define SINGLE
#define blockSize   256
#define align(x)   (((x) + 255) & ~255)
#define half_warp   16
#define half_warp_mask   0x0F
#define print_vector_gpu(name, v, n)
#define T   float
#define Tsf   "%f"
#define _nrm2   cblas_snrm2
#define _scal   cblas_sscal
#define _axpy   cblas_saxpy
#define _gemv   cblas_sgemv
#define _gemm   cblas_sgemm
#define _spmv   cblas_sspmv
#define _dot   cblas_sdot
#define _spsv   sspsv_
#define _stev   sstev_
#define TRUE   1
#define FALSE   0
#define INTERVAL_NONE   -1

Typedefs

typedef struct
interval_cpu_info_struct 
interval_cpu_info
typedef struct
exec_window_entry_struct 
exec_window_entry
typedef struct
extract_device_info_struct 
extract_device_info
typedef struct
extract_global_info_struct 
extract_global_info

Functions

struct __align__ (16 *sizeof(T)) tridiagonal_entry_struct
struct __align__ (16 *sizeof(float)) interval_gpu_info_struct
int readInput (int *n, T **t, FILE *file)
void print_vector (const char *name, T *v, int n)
void print_matrix (const char *name, T *m, int cols, int rows, int lda)
void toeplitz_gershgorin (const T *t, unsigned int n, T *low, T *up)
void toeplitz_mult (int n, const T *t, const T *x, T *y)
void levinson (unsigned int n, T td, const T *t0, const T *b0, T *x)
void sort_eigenvalues (unsigned int extracted, unsigned int n, T *el, T *ev)
interval_cpu_infocalc_eigen_intervals (T *t, unsigned int n, T lbg, T ubg, unsigned int max_eig_interval, unsigned int *num_intervals)
unsigned int extract_eigenvalues (unsigned int n, unsigned int k, unsigned int max_k, unsigned int p_lda, unsigned int *converged, unsigned int *extracted, unsigned int required, T a, T b, const T *t, const T *p, const T *alpha, const T *beta, T tolerance, T *l, T *v)

Variables

 tridiagonal_entry
 interval_gpu_info


Detailed Description

Main project header file.

Author:
Leandro GraciĆ” Gil, leagragi@inf.upv.es
Date:
18/11/08

Definition in file toeplitz.h.


Define Documentation

#define _axpy   cblas_saxpy

Definition at line 71 of file toeplitz.h.

#define _dot   cblas_sdot

Definition at line 75 of file toeplitz.h.

#define _gemm   cblas_sgemm

Definition at line 73 of file toeplitz.h.

#define _gemv   cblas_sgemv

Definition at line 72 of file toeplitz.h.

#define _nrm2   cblas_snrm2

Definition at line 69 of file toeplitz.h.

#define _scal   cblas_sscal

Definition at line 70 of file toeplitz.h.

#define _spmv   cblas_sspmv

Definition at line 74 of file toeplitz.h.

#define _spsv   sspsv_

Definition at line 76 of file toeplitz.h.

#define _stev   sstev_

Definition at line 77 of file toeplitz.h.

#define align (  )     (((x) + 255) & ~255)

Definition at line 55 of file toeplitz.h.

#define blockSize   256

Definition at line 54 of file toeplitz.h.

#define FALSE   0

Definition at line 98 of file toeplitz.h.

#define half_warp   16

Definition at line 57 of file toeplitz.h.

#define half_warp_mask   0x0F

Definition at line 58 of file toeplitz.h.

#define INTERVAL_NONE   -1

Definition at line 102 of file toeplitz.h.

#define print_vector_gpu ( name,
v,
 ) 

Value:

{ if(tid == 0) { \
                                        fprintf(stderr, "%s: [", name); \
                                        for(int _i=0; _i<n; ++_i) fprintf(stderr, " %.6f", v[_i]); \
                                        fprintf(stderr, " ]\n"); } }

Definition at line 60 of file toeplitz.h.

#define SINGLE

Definition at line 45 of file toeplitz.h.

#define T   float

Definition at line 67 of file toeplitz.h.

#define TRUE   1

Definition at line 94 of file toeplitz.h.

#define Tsf   "%f"

Definition at line 68 of file toeplitz.h.


Typedef Documentation


Function Documentation

struct __align__ ( 16 *  sizeoffloat  )  [read]

< Iteration in which interval extraction was launched.

< Flag indicating if interval has been already processed.

< Shift value used in the interval.

< Matrices of size n_align x max_k. Contains base vectors for symmetric and skew-symmetric Krylov subspaces.

< Vector of size max(5 * align(n), 4 * align(n) + max_k).

< Struct vector of size max_k.

Definition at line 140 of file toeplitz.h.

struct __align__ ( 16 *  sizeofT  )  [read]

Definition at line 108 of file toeplitz.h.

interval_cpu_info* calc_eigen_intervals ( T *  t,
unsigned int  n,
lbg,
ubg,
unsigned int  max_eig_interval,
unsigned int *  num_intervals 
)

Calculates intervals containing approximately the same number of eigenvalues along a given interval. Only interval-specific information is written in the array. All other data is initialized to 0.

Parameters:
t Vector defining a symmetric Toeplitz matrix whose eigenvalue intervals will be calculated.
n Size of vector t.
lbg Lower bound of the initial interval to be subdivided (usually Gershgorin disc).
ubg Upper bound of the initial interval to be subdivided (usually Gershgorin disc).
max_eig_interval Maximum number of eigenvalues per interval.
num_intervals Number of extracted intervals.
Returns:
Pointer to an array of size num_intervals containing interval info. NULL in case of error.

Definition at line 105 of file eigen.c.

unsigned int extract_eigenvalues ( unsigned int  n,
unsigned int  k,
unsigned int  max_k,
unsigned int  p_lda,
unsigned int *  converged,
unsigned int *  extracted,
unsigned int  required,
a,
b,
const T *  t,
const T *  p,
const T *  alpha,
const T *  beta,
tolerance,
T *  l,
T *  v 
)

Check convergence and extract eigenvalues of a symmetric Toeplitz matrix given a tridiagonal shift-and-invert Lanczos approximation.

Note:
sigma shift value is assumed to be the halfway between a and b.
Parameters:
n Size of the Toeplitz matrix defined by t and number of rows of p.
k Current size of Krylov subspace and number of columns of p.
max_k Maximum allowed size of the Krylov subspace.
p_lda Leading dimension of Krylov subspace vectors stored in p.
converged Pointer to number of converged eigenvalues. Just initialize to 0 on start and let the function use it.
extracted Pointer to number of currently extracted eigenvalues.
required Number of eigenvalues that should be extracted.
a Start of the interval whose eigenvalues are being extracted.
b End of the interval whose eigenvalues are being extracted.
t Vector of size n defining the symmetric Toeplitz matrix.
p Matrix of size n x k containing Lanczos vectors.
alpha Vector of size k containing the main diagonal of the symmetric tridiagonal matrix.
beta Vector of size k-1 containing the second diagonal of the symmetric tridiagonal matrix.
tolerance Tolerance threshold used to check eigenvalue convergence.
l Output vector where up to required eigenvalues will be stored.
v Output matrix where up to required eigenvectors will be stored (column order).
Returns:
Number of eigenvalues extracted during this call.

Definition at line 174 of file eigen.c.

void levinson ( unsigned int  n,
td,
const T *  t0,
const T *  b0,
T *  x 
)

Solve system toeplitz(r0) * x = b0 where r0 defines a symmetric positive-definite Toeplitz matrix.

Parameters:
n Size of r0, b0 and x vectors.
td Main diagonal element of the symmetric Toeplitz matrix.
t0 Rest of the symmetric Toeplitz matrix data in vector form.
b0 Right-hand side vector data.
x Result vector.
Note:
If matrix is not positive-definite the algorithm can still converge.

Definition at line 97 of file toeplitz.c.

void print_matrix ( const char *  name,
T *  m,
int  rows,
int  cols,
int  lda 
)

Print a given matrix using standard error output.

Parameters:
name Name of the matrix (C-style string).
m Pointer to matrix data (column ordering).
rows Number of rows.
cols Number of columns.
lda Leading dimension of the matrix.

Definition at line 87 of file utils.c.

void print_vector ( const char *  name,
T *  v,
int  n 
)

Print a given vector using standard error output.

Parameters:
name Name of the vector (C-style string).
v Pointer to vector data.
n Size of the vector.

Definition at line 67 of file utils.c.

int readInput ( int *  n,
T **  t,
FILE *  file 
)

Auxiliar function for reading input data from standard input.

Parameters:
n Pointer to variable that will store input data size.
t Pointer to variable that will store input data vector.
file File where contents should be read from.
Returns:
1 if successful, 0 otherwise.

Definition at line 39 of file utils.c.

void sort_eigenvalues ( unsigned int  extracted,
unsigned int  n,
T *  el,
T *  ev 
)

Sort eigenvalues and eigenvectors using quicksort algorithm.

Parameters:
extracted Number of extracted eigenvalues.
n Size of eigenvectors.
el Pointer to vector containing eigenvalues.
ev Pointer to matrix containing eigenvectors.

Definition at line 68 of file eigen.c.

void toeplitz_gershgorin ( const T *  t,
unsigned int  n,
T *  low,
T *  up 
)

Calculate Gershgorin disc for a given Toeplitz symmetric matrix.

Parameters:
t Vector defining a symmetric Toeplitz matrix.
n Size of vector t.
low Lower bound of the Gershgorin disc interval.
up Upper bound of the Gershgorin disc interval.

Definition at line 42 of file toeplitz.c.

void toeplitz_mult ( int  n,
const T *  t,
const T *  x,
T *  y 
)

Calculate y = toeplitz(t) * x matrix-vector product where t is in vector form.

Parameters:
n Size of t and x, y vectors.
t Data of the symmetric Toeplitz matrix in vector form.
x Data of the input vector.
y Data of the destination vector. Will be overwritten with the result.

Definition at line 70 of file toeplitz.c.


Variable Documentation

Definition at line 148 of file toeplitz.h.

Definition at line 114 of file toeplitz.h.


Generated on Sun Dec 14 14:21:11 2008 for Multi-GPU symmetric Toeplitz Eigenvalue Extractor by  doxygen 1.5.6