42cf5bc1 |
1 | // Created on: 1997-10-29 |
2 | // Created by: Roman BORISOV |
3 | // Copyright (c) 1997-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _FEmTool_SparseMatrix_HeaderFile |
18 | #define _FEmTool_SparseMatrix_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <MMgt_TShared.hxx> |
24 | #include <Standard_Real.hxx> |
25 | #include <Standard_Integer.hxx> |
26 | #include <Standard_Boolean.hxx> |
27 | #include <math_Vector.hxx> |
28 | class StdFail_NotDone; |
29 | |
30 | |
31 | class FEmTool_SparseMatrix; |
32 | DEFINE_STANDARD_HANDLE(FEmTool_SparseMatrix, MMgt_TShared) |
33 | |
34 | //! Sparse Matrix definition |
35 | class FEmTool_SparseMatrix : public MMgt_TShared |
36 | { |
37 | |
38 | public: |
39 | |
40 | |
41 | Standard_EXPORT virtual void Init (const Standard_Real Value) = 0; |
42 | |
43 | Standard_EXPORT virtual Standard_Real& ChangeValue (const Standard_Integer I, const Standard_Integer J) = 0; |
44 | |
45 | //! To make a Factorization of <me> |
46 | Standard_EXPORT virtual Standard_Boolean Decompose() = 0; |
47 | |
48 | //! Direct Solve of AX = B |
49 | Standard_EXPORT virtual void Solve (const math_Vector& B, math_Vector& X) const = 0; |
50 | |
51 | //! Make Preparation to iterative solve |
52 | Standard_EXPORT virtual Standard_Boolean Prepare() = 0; |
53 | |
54 | //! Iterative solve of AX = B |
55 | Standard_EXPORT virtual void Solve (const math_Vector& B, const math_Vector& Init, math_Vector& X, math_Vector& Residual, const Standard_Real Tolerance = 1.0e-8, const Standard_Integer NbIterations = 50) const = 0; |
56 | |
57 | //! returns the product of a SparseMatrix by a vector. |
58 | //! An exception is raised if the dimensions are different |
59 | Standard_EXPORT virtual void Multiplied (const math_Vector& X, math_Vector& MX) const = 0; |
60 | |
61 | //! returns the row range of a matrix. |
62 | Standard_EXPORT virtual Standard_Integer RowNumber() const = 0; |
63 | |
64 | //! returns the column range of the matrix. |
65 | Standard_EXPORT virtual Standard_Integer ColNumber() const = 0; |
66 | |
67 | |
68 | |
69 | |
92efcf78 |
70 | DEFINE_STANDARD_RTTIEXT(FEmTool_SparseMatrix,MMgt_TShared) |
42cf5bc1 |
71 | |
72 | protected: |
73 | |
74 | |
75 | |
76 | |
77 | private: |
78 | |
79 | |
80 | |
81 | |
82 | }; |
83 | |
84 | |
85 | |
86 | |
87 | |
88 | |
89 | |
90 | #endif // _FEmTool_SparseMatrix_HeaderFile |