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