0023830: BRepExtrema_DistShapeShape does not find intersection of face with edge
[occt.git] / src / math / math_Matrix.lxx
1 // Copyright (c) 1997-1999 Matra Datavision
2 // Copyright (c) 1999-2012 OPEN CASCADE SAS
3 //
4 // The content of this file is subject to the Open CASCADE Technology Public
5 // License Version 6.5 (the "License"). You may not use the content of this file
6 // except in compliance with the License. Please obtain a copy of the License
7 // at http://www.opencascade.org and read it completely before using this file.
8 //
9 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
10 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
11 //
12 // The Original Code and all software distributed under the License is
13 // distributed on an "AS IS" basis, without warranty of any kind, and the
14 // Initial Developer hereby disclaims all such warranties, including without
15 // limitation, any warranties of merchantability, fitness for a particular
16 // purpose or non-infringement. Please see the License for the specific terms
17 // and conditions governing the rights and limitations under the License.
18
19
20 // lpa le 29/10/91
21
22 #include <Standard_DimensionError.hxx>
23 #include <math_Vector.hxx>
24
25 inline Standard_OStream& operator<<(Standard_OStream& o,
26                                     const math_Matrix& mat)
27 {
28   mat.Dump(o);
29   return o;
30 }
31
32 inline math_Matrix operator* (const Standard_Real Left,
33                               const math_Matrix& Right) 
34 {
35   return Right.Multiplied(Left);
36 }
37
38
39
40 inline Standard_Real& math_Matrix::Value(const Standard_Integer Row, 
41                                          const Standard_Integer Col)const
42 {
43   Standard_RangeError_Raise_if(((Row < LowerRowIndex) || 
44                                 (Row > UpperRowIndex) ||
45                                 (Col < LowerColIndex) || 
46                                 (Col > UpperColIndex)), " ");
47
48   return Array(Row, Col);
49 }
50
51 inline Standard_Integer math_Matrix::RowNumber() const 
52          { return UpperRowIndex - LowerRowIndex + 1; }
53
54      // returns the row range of a matrix.
55
56 inline Standard_Integer math_Matrix::ColNumber() const 
57          { return UpperColIndex - LowerColIndex + 1; }
58  
59      // returns the column range of a matrix.
60
61
62
63
64 inline Standard_Integer math_Matrix::LowerRow() const { return LowerRowIndex; }
65
66      // returns the value of the Lower index of the row range of a matrix.
67
68 inline Standard_Integer math_Matrix::UpperRow () const { return UpperRowIndex;  }
69
70      // returns the value of the Upper index of the row range of a matrix.
71
72 inline Standard_Integer math_Matrix::LowerCol() const { return LowerColIndex; }
73
74      // returns the value of the Lower index of the column range of a matrix.
75
76 inline Standard_Integer math_Matrix::UpperCol()  const { return UpperColIndex;  }
77
78      // returns the value of the Upper index of the column range of a matrix.
79
80 inline void math_Matrix::SetLower (const Standard_Integer LowerRow,
81                                    const Standard_Integer LowerCol) 
82 {
83   SetLowerRow(LowerRow);
84   SetLowerCol(LowerCol);
85 }