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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1384 - (hide annotations)
Fri Jan 11 02:29:38 2008 UTC (11 years, 9 months ago) by phornby
Original Path: temp_trunk_copy/paso/src/SparseMatrix.h
File MIME type: text/plain
File size: 3492 byte(s)
Make a temp copy of the trunk before checking in the windows changes


1 ksteube 1313
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 gross 1363 /* Author: lgross@uq.edu.au */
22 ksteube 1313
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 gross 1363 void Paso_SparseMatrix_addRow_CSR_OFFSET0(Paso_SparseMatrix*,double*);
73 ksteube 1313 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_saveHB_CSC(Paso_SparseMatrix *, FILE*);
78     Paso_SparseMatrix* Paso_SparseMatrix_getSubmatrix(Paso_SparseMatrix* A,dim_t,dim_t,index_t*,index_t*);
79     void Paso_SparseMatrix_setValues(Paso_SparseMatrix*,double);
80     void Paso_SparseMatrix_saveMM_CSC(Paso_SparseMatrix *, FILE *);
81 gross 1361
82 ksteube 1313 /*
83     void Paso_SparseMatrix_add(Paso_SparseMatrix*,dim_t,index_t*, dim_t,dim_t,index_t*,dim_t, double*);
84     Paso_SparseMatrix* Paso_SparseMatrix_loadMM_toCSR(char *);
85     */
86    
87     #endif /* #ifndef INC_PASO_SPARSEMATRIX */
88    

  ViewVC Help
Powered by ViewVC 1.1.26