]> SALOME platform Git repositories - tools/solverlab.git/blob - CDMATH/base/inc/GenericMatrix.hxx
Salome HOME
Renamed test names
[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 #include <vector>
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     virtual double operator ()( int i, int j ) const = 0;
49
50         //returns the array of matrix coefficients
51     virtual std::vector< double > getArray() = 0;
52
53     virtual bool isSymmetric(double tol=1e-6) const ;
54
55     bool isSquare() const ;
56
57     bool isSparseMatrix( void ) const ;
58
59     virtual  bool containsPetscMatrix() const { return false; };
60
61     void view() const ;
62
63     protected: //----------------------------------------------------------------
64
65     /*
66      * The number of rows.
67      */
68     int _numberOfRows ;
69
70     /*
71      * The number of columns.
72      */
73     int _numberOfColumns ;
74
75     bool _isSparseMatrix ;
76
77 };
78
79 #endif /* GENERICMATRIX_HXX_ */