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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1417 - (show annotations)
Mon Feb 25 04:45:48 2008 UTC (11 years, 6 months ago) by gross
File MIME type: text/plain
File size: 3605 byte(s)
some more work on the transport solver.
1
2 /* $Id: SparseMatrix.h 1306 2007-09-18 05:51:09Z ksteube $ */
3
4 /*******************************************************
5 *
6 * Copyright 2007 by University of Queensland
7 *
8 * http://esscc.uq.edu.au
9 * Primary Business: Queensland, Australia
10 * Licensed under the Open Software License version 3.0
11 * http://www.opensource.org/licenses/osl-3.0.php
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 } Paso_SparseMatrix;
60
61 /* interfaces: */
62
63 Paso_SparseMatrix* Paso_SparseMatrix_alloc(Paso_SparseMatrixType,Paso_Pattern*,dim_t,dim_t);
64 Paso_SparseMatrix* Paso_SparseMatrix_getReference(Paso_SparseMatrix*);
65 void Paso_SparseMatrix_free(Paso_SparseMatrix*);
66 void Paso_SparseMatrix_MatrixVector_CSC_OFFSET0(double alpha, Paso_SparseMatrix* A, double* in, double beta, double* out);
67 void Paso_SparseMatrix_MatrixVector_CSC_OFFSET1(double alpha, Paso_SparseMatrix* A, double* in, double beta, double* out);
68 void Paso_SparseMatrix_MatrixVector_CSR_OFFSET0(double alpha, Paso_SparseMatrix* A, double* in, double beta, double* out);
69 void Paso_SparseMatrix_MatrixVector_CSR_OFFSET1(double alpha, Paso_SparseMatrix* A, double* in, double beta, double* out);
70 void Paso_SparseMatrix_copy(Paso_SparseMatrix*,double*);
71 void Paso_SparseMatrix_addAbsRow_CSR_OFFSET0(Paso_SparseMatrix*,double*);
72 void Paso_SparseMatrix_addRow_CSR_OFFSET0(Paso_SparseMatrix*,double*);
73 void Paso_SparseMatrix_nullifyRowsAndCols_CSC_BLK1(Paso_SparseMatrix* A, double* mask_row, double* mask_col, double main_diagonal_value);
74 void Paso_SparseMatrix_nullifyRowsAndCols_CSR_BLK1(Paso_SparseMatrix* A, double* mask_row, double* mask_col, double main_diagonal_value);
75 void Paso_SparseMatrix_nullifyRowsAndCols_CSC(Paso_SparseMatrix* A, double* mask_row, double* mask_col, double main_diagonal_value);
76 void Paso_SparseMatrix_nullifyRowsAndCols_CSR(Paso_SparseMatrix* A, double* mask_row, double* mask_col, double main_diagonal_value);
77 void Paso_SparseMatrix_nullifyRows_CSR_BLK1(Paso_SparseMatrix* A, double* mask_row, double main_diagonal_value);
78 void Paso_SparseMatrix_saveHB_CSC(Paso_SparseMatrix *, FILE*);
79 Paso_SparseMatrix* Paso_SparseMatrix_getSubmatrix(Paso_SparseMatrix* A,dim_t,dim_t,index_t*,index_t*);
80 void Paso_SparseMatrix_setValues(Paso_SparseMatrix*,double);
81 void Paso_SparseMatrix_saveMM_CSC(Paso_SparseMatrix *, FILE *);
82
83 /*
84 void Paso_SparseMatrix_add(Paso_SparseMatrix*,dim_t,index_t*, dim_t,dim_t,index_t*,dim_t, double*);
85 Paso_SparseMatrix* Paso_SparseMatrix_loadMM_toCSR(char *);
86 */
87
88 #endif /* #ifndef INC_PASO_SPARSEMATRIX */
89

  ViewVC Help
Powered by ViewVC 1.1.26