BeBOP Optimized Sparse Kernel Interface Library
1.0.1h
|
00001 /* 00002 * file : spmv_vbr.h 00003 * desc : Implementation of variable block row format. 00004 * C-wrappers for SPARSKIT's Fortran routines. 00005 */ 00006 00007 #if !defined(INC_SPMV_VBR_H) 00008 #define INC_SPMV_VBR_H 00009 00010 #define ZERO_BASED_INDEXING 00011 00012 #if !defined(INC_SPMV_H) 00013 typedef struct tagSparseMatrixCSR SparseMatrixCSR; 00014 #endif 00015 00016 typedef struct tagSparseMatrixVBR 00017 { 00018 int m, n; /* true matrix dimensions */ 00019 int nnz; /* # of non-zeros */ 00020 00021 int mb, nb; /* # of block rows, cols */ 00022 00023 int *ia; /* length nr+1 */ 00024 int *ja; /* length ia[nr]-1 */ 00025 int *ka; /* length ia[nr]-1 (?) */ 00026 int *kvstr; /* length nr+1 */ 00027 int *kvstc; /* length nc+1 */ 00028 double *a; /* length nnz */ 00029 } SparseMatrixVBR; 00030 00031 extern void spmv_alloc_vbr (SparseMatrixVBR * B, int m, int n, int nnz, 00032 int mb, int nb, int num_blocks); 00033 00034 extern void spmv_convert_csr2vbr (const SparseMatrixCSR * A, 00035 SparseMatrixVBR * B); 00036 00037 extern void spmv_convert_csr2vbr_autoblock (int threshold, 00038 const SparseMatrixCSR * A, 00039 SparseMatrixVBR * B); 00040 00041 extern void spmv_destroy_vbr (SparseMatrixVBR * B); 00042 00043 extern void spmv_vbr (const SparseMatrixVBR * B, const double *x, double *y); 00044 00045 extern void spmv_convert_csr2vbr_conformal (const SparseMatrixCSR * A, 00046 double threshold, 00047 SparseMatrixVBR * B); 00048 00049 /* 00050 * SPARSKIT Fortran routines 00051 */ 00052 #if defined(F77_EXTERN_UNDERSCORES) 00053 #define csrvbr csrvbr_ 00054 #define vbrmv vbrmv_ 00055 #endif 00056 00057 extern void csrvbr (const int *n, 00058 const int *ptr, const int *ind, const double *val, 00059 int *nr, int *nc, int *kvstr, int *kvstc, 00060 int *ib, int *jb, int *kb, double *b, 00061 int *job, int *iwk, const int *nkmax, const int *nzmax, 00062 int *ierr); 00063 00064 extern void vbrmv (const int *nr, const int *nc, 00065 const int *ia, const int *ja, const int *ka, 00066 const double *a, const int *kvstr, const int *kvstc, 00067 const double *x, double *b); 00068 00069 00070 #endif 00071 00072 /* eof */