]> SALOME platform Git repositories - tools/solverlab.git/blob - CDMATH/base/inc/GenericMatrix.hxx
Salome HOME
Reduced test time (fewer meshes)
[tools/solverlab.git] / CDMATH / base / inc / GenericMatrix.hxx
1 /*
2  * GenericMatrix.hxx
3  *
4  *  Created on: 13 April. 2013
5  *      Authors: CDMATH
6  */
7
8 #ifndef GENERICMATRIX_HXX_
9 #define GENERICMATRIX_HXX_
10
11
12 /**
13  * GenericMatrix class is defined by
14  * - number of rows
15  * - number of columns
16  * - values array
17  */
18
19 #include <iostream>
20
21 #include "DoubleTab.hxx"
22
23 class GenericMatrix
24 {
25     public: //----------------------------------------------------------------
26     /**
27      * default constructor
28      */
29         GenericMatrix ( void ) ;
30
31     /**
32      * destructor
33      */
34     virtual ~GenericMatrix ( void ) ;
35
36     /**
37      * return number of rows in this matrix
38      * @return _numberOfRows
39      */
40     int getNumberOfRows ( void ) const ;
41
42     /**
43      * return number of columns in this matrix
44      * @return _numberOfColumns
45      */
46     int getNumberOfColumns ( void ) const ;
47
48     const DoubleTab& getValues( void ) const ;
49
50         DoubleTab getValues( void ) ;
51
52         void setValues(const DoubleTab& values) ;
53
54     virtual double operator ()( int i, int j ) const = 0;
55
56     double max() const;
57
58     double min() const;
59
60     virtual bool isSymmetric(double tol=1e-6) const ;
61
62     bool isSquare() const ;
63
64     bool isSparseMatrix( void ) const ;
65
66     virtual  bool containsPetscMatrix() const { return false; };
67
68     int coefficient(int index) const ;
69
70     void view() const ;
71
72     protected: //----------------------------------------------------------------
73
74     /*
75      * The number of rows.
76      */
77     int _numberOfRows ;
78
79     /*
80      * The number of columns.
81      */
82     int _numberOfColumns ;
83
84     bool _isSparseMatrix ;
85
86     DoubleTab _values ;
87 };
88
89 #endif /* GENERICMATRIX_HXX_ */