42cf5bc1 |
1 | // Created on: 1996-12-05 |
2 | // Created by: Philippe MANGIN |
3 | // Copyright (c) 1996-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 _BlendFunc_Tensor_HeaderFile |
18 | #define _BlendFunc_Tensor_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <TColStd_Array1OfReal.hxx> |
25 | #include <Standard_Integer.hxx> |
26 | #include <Standard_Real.hxx> |
27 | #include <math_Vector.hxx> |
28 | class Standard_DimensionError; |
29 | class Standard_RangeError; |
30 | class math_Matrix; |
31 | |
32 | |
33 | //! used to store the "gradient of gradient" |
34 | class BlendFunc_Tensor |
35 | { |
36 | public: |
37 | |
38 | DEFINE_STANDARD_ALLOC |
39 | |
40 | |
41 | Standard_EXPORT BlendFunc_Tensor(const Standard_Integer NbRow, const Standard_Integer NbCol, const Standard_Integer NbMat); |
42 | |
43 | //! Initialize all the elements of a Tensor to InitialValue. |
44 | Standard_EXPORT void Init (const Standard_Real InitialValue); |
45 | |
46 | //! accesses (in read or write mode) the value of index <Row>, |
47 | //! <Col> and <Mat> of a Tensor. |
48 | //! An exception is raised if <Row>, <Col> or <Mat> are not |
49 | //! in the correct range. |
50 | const Standard_Real& Value (const Standard_Integer Row, const Standard_Integer Col, const Standard_Integer Mat) const; |
51 | const Standard_Real& operator() (const Standard_Integer Row, const Standard_Integer Col, const Standard_Integer Mat) const |
52 | { |
53 | return Value(Row,Col,Mat); |
54 | } |
55 | |
56 | //! accesses (in read or write mode) the value of index <Row>, |
57 | //! <Col> and <Mat> of a Tensor. |
58 | //! An exception is raised if <Row>, <Col> or <Mat> are not |
59 | //! in the correct range. |
60 | Standard_Real& ChangeValue (const Standard_Integer Row, const Standard_Integer Col, const Standard_Integer Mat); |
61 | Standard_Real& operator() (const Standard_Integer Row, const Standard_Integer Col, const Standard_Integer Mat) |
62 | { |
63 | return ChangeValue(Row,Col,Mat); |
64 | } |
65 | |
66 | Standard_EXPORT void Multiply (const math_Vector& Right, math_Matrix& Product) const; |
67 | |
68 | |
69 | |
70 | |
71 | protected: |
72 | |
73 | |
74 | |
75 | |
76 | |
77 | private: |
78 | |
79 | |
80 | |
81 | TColStd_Array1OfReal Tab; |
82 | Standard_Integer nbrow; |
83 | Standard_Integer nbcol; |
84 | Standard_Integer nbmat; |
85 | Standard_Integer nbmtcl; |
86 | |
87 | |
88 | }; |
89 | |
90 | |
91 | #include <BlendFunc_Tensor.lxx> |
92 | |
93 | |
94 | |
95 | |
96 | |
97 | #endif // _BlendFunc_Tensor_HeaderFile |