0030686: Visualization, SelectMgr_ViewerSelector - sorting issues of transformation...
[occt.git] / src / math / math_Matrix.lxx
1 // Copyright (c) 1997-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 //
4 // This file is part of Open CASCADE Technology software library.
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
11 //
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
14
15 // lpa le 29/10/91
16
17 #include <Standard_DimensionError.hxx>
18 #include <math_Vector.hxx>
19
20 inline Standard_OStream& operator<<(Standard_OStream& o,
21                                     const math_Matrix& mat)
22 {
23   mat.Dump(o);
24   return o;
25 }
26
27 inline math_Matrix operator* (const Standard_Real Left,
28                               const math_Matrix& Right) 
29 {
30   return Right.Multiplied(Left);
31 }
32
33
34
35 inline Standard_Real& math_Matrix::Value(const Standard_Integer Row, 
36                                          const Standard_Integer Col)const
37 {
38   Standard_RangeError_Raise_if(((Row < LowerRowIndex) || 
39                                 (Row > UpperRowIndex) ||
40                                 (Col < LowerColIndex) || 
41                                 (Col > UpperColIndex)), " ");
42
43   return Array(Row, Col);
44 }
45
46 inline Standard_Integer math_Matrix::RowNumber() const 
47          { return UpperRowIndex - LowerRowIndex + 1; }
48
49      // returns the row range of a matrix.
50
51 inline Standard_Integer math_Matrix::ColNumber() const 
52          { return UpperColIndex - LowerColIndex + 1; }
53  
54      // returns the column range of a matrix.
55
56
57
58
59 inline Standard_Integer math_Matrix::LowerRow() const { return LowerRowIndex; }
60
61      // returns the value of the Lower index of the row range of a matrix.
62
63 inline Standard_Integer math_Matrix::UpperRow () const { return UpperRowIndex;  }
64
65      // returns the value of the Upper index of the row range of a matrix.
66
67 inline Standard_Integer math_Matrix::LowerCol() const { return LowerColIndex; }
68
69      // returns the value of the Lower index of the column range of a matrix.
70
71 inline Standard_Integer math_Matrix::UpperCol()  const { return UpperColIndex;  }
72
73      // returns the value of the Upper index of the column range of a matrix.
74
75 inline void math_Matrix::SetLower (const Standard_Integer LowerRow,
76                                    const Standard_Integer LowerCol) 
77 {
78   SetLowerRow(LowerRow);
79   SetLowerCol(LowerCol);
80 }