/[escript]/trunk/paso/src/SparseMatrix.h
ViewVC logotype

Contents of /trunk/paso/src/SparseMatrix.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2489 - (show annotations)
Tue Jun 23 06:00:25 2009 UTC (10 years, 2 months ago) by artak
File MIME type: text/plain
File size: 4088 byte(s)
void *solver; is added to Paso_SpaseMatrix struct. Paso_MKL will need this.
1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2008 by University of Queensland
5 * Earth Systems Science Computational Center (ESSCC)
6 * http://www.uq.edu.au/esscc
7 *
8 * Primary Business: Queensland, Australia
9 * Licensed under the Open Software License version 3.0
10 * http://www.opensource.org/licenses/osl-3.0.php
11 *
12 *******************************************************/
13
14
15 /**************************************************************/
16
17 /* Paso: SparseMatrix and SystemVector */
18
19 /**************************************************************/
20
21 /* Author: lgross@uq.edu.au */
22
23 /**************************************************************/
24
25 #ifndef INC_PASO_SPARSEMATRIX
26 #define INC_PASO_SPARSEMATRIX
27
28 #include "Common.h"
29 #include "Pattern.h"
30 #include "Options.h"
31 #include "Paso.h"
32
33 /**************************************************************/
34
35 /* this struct holds a stiffness matrix: */
36
37 #define MATRIX_FORMAT_DEFAULT 0
38 #define MATRIX_FORMAT_CSC 1
39 #define MATRIX_FORMAT_SYM 2
40 #define MATRIX_FORMAT_BLK1 4
41 #define MATRIX_FORMAT_OFFSET1 8
42 #define MATRIX_FORMAT_TRILINOS_CRS 16
43
44 typedef int Paso_SparseMatrixType;
45
46 typedef struct Paso_SparseMatrix {
47 Paso_SparseMatrixType type;
48 dim_t reference_counter;
49
50 dim_t row_block_size;
51 dim_t col_block_size;
52 dim_t block_size;
53
54 dim_t numRows;
55 dim_t numCols;
56 Paso_Pattern* pattern;
57 dim_t len;
58 double *val; /* this is used for classical CSR or CSC */
59 void* solver;
60 } Paso_SparseMatrix;
61
62 /* interfaces: */
63
64 Paso_SparseMatrix* Paso_SparseMatrix_alloc(Paso_SparseMatrixType,Paso_Pattern*,dim_t,dim_t);
65 Paso_SparseMatrix* Paso_SparseMatrix_getReference(Paso_SparseMatrix*);
66 void Paso_SparseMatrix_free(Paso_SparseMatrix*);
67 void Paso_SparseMatrix_MatrixVector_CSC_OFFSET0(const double alpha, const Paso_SparseMatrix* A, const double* in, const double beta, double* out);
68 void Paso_SparseMatrix_MatrixVector_CSC_OFFSET1(const double alpha, const Paso_SparseMatrix* A, const double* in, const double beta, double* out);
69 void Paso_SparseMatrix_MatrixVector_CSR_OFFSET0(const double alpha, const Paso_SparseMatrix* A, const double* in, const double beta, double* out);
70 void Paso_SparseMatrix_MatrixVector_CSR_OFFSET1(const double alpha, const Paso_SparseMatrix* A, const double* in, const double beta, double* out);
71 void Paso_SparseMatrix_copy(Paso_SparseMatrix*,double*);
72 void Paso_SparseMatrix_addAbsRow_CSR_OFFSET0(Paso_SparseMatrix*,double*);
73 void Paso_SparseMatrix_addRow_CSR_OFFSET0(Paso_SparseMatrix*,double*);
74 void Paso_SparseMatrix_nullifyRowsAndCols_CSC_BLK1(Paso_SparseMatrix* A, double* mask_row, double* mask_col, double main_diagonal_value);
75 void Paso_SparseMatrix_nullifyRowsAndCols_CSR_BLK1(Paso_SparseMatrix* A, double* mask_row, double* mask_col, double main_diagonal_value);
76 void Paso_SparseMatrix_nullifyRowsAndCols_CSC(Paso_SparseMatrix* A, double* mask_row, double* mask_col, double main_diagonal_value);
77 void Paso_SparseMatrix_nullifyRowsAndCols_CSR(Paso_SparseMatrix* A, double* mask_row, double* mask_col, double main_diagonal_value);
78 void Paso_SparseMatrix_nullifyRows_CSR_BLK1(Paso_SparseMatrix* A, double* mask_row, double main_diagonal_value);
79 void Paso_SparseMatrix_saveHB_CSC(Paso_SparseMatrix *, FILE*);
80 Paso_SparseMatrix* Paso_SparseMatrix_getSubmatrix(Paso_SparseMatrix* A,dim_t,dim_t,index_t*,index_t*);
81 void Paso_SparseMatrix_setValues(Paso_SparseMatrix*,double);
82 void Paso_SparseMatrix_saveMM_CSC(Paso_SparseMatrix *, FILE *);
83 void Paso_SparseMatrix_MatrixVector_CSR_OFFSET0_stripe(const double alpha, const dim_t nRows, const dim_t row_block_size, const dim_t col_block_size, const index_t* ptr, const index_t* index, const double* val, const double* in, const double beta, double* out);
84 Paso_SparseMatrix* Paso_SparseMatrix_loadMM_toCSR( char *fileName_p );
85 void Paso_SparseMatrix_saveMM(Paso_SparseMatrix * A_p, char * fileName_p);
86
87 /*
88 void Paso_SparseMatrix_add(Paso_SparseMatrix*,dim_t,index_t*, dim_t,dim_t,index_t*,dim_t, double*);
89 Paso_SparseMatrix* Paso_SparseMatrix_loadMM_toCSR(char *);
90 */
91
92 #endif /* #ifndef INC_PASO_SPARSEMATRIX */
93

  ViewVC Help
Powered by ViewVC 1.1.26