eLynx SDK
v3.3.0 C++ image processing API reference |
00001 //============================================================================ 00002 // SubMatrix.h Math.Component package 00003 //============================================================================ 00004 // Usage : linear algebra - submatrix of the matrix adapter 00005 //---------------------------------------------------------------------------- 00006 // Copyright (C) 2006 by eLynx project 00007 // 00008 // This library is free software; you can redistribute it and/or 00009 // modify it under the terms of the GNU Library General Public 00010 // License as published by the Free Software Foundation; either 00011 // version 2 of the License, or (at your option) any later version. 00012 // 00013 // This library is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00016 // See the GNU Library General Public License for more details. 00017 //---------------------------------------------------------------------------- 00018 #ifndef __SubMatrix_h__ 00019 #define __SubMatrix_h__ 00020 00021 #include "IMatrix.h" 00022 00023 namespace eLynx { 00024 namespace Math { 00025 00030 class ExportedByMath SubMatrix : public IMatrix { 00031 00032 public: 00033 00041 SubMatrix(IMatrix &iMatrix, 00042 uint32 iRow1, uint32 iNRows, uint32 iCol1, uint32 iNCols); 00043 00046 SubMatrix(const SubMatrix &iOther); 00047 00051 SubMatrix& operator = (const SubMatrix &iOther); 00052 00054 virtual uint32 GetWidth() const { return _NCols; } 00055 00057 virtual uint32 GetHeight() const { return _NRows; } 00058 00063 virtual const double& operator () (uint32 iRow, uint32 iCol) const; 00064 00069 virtual double& operator () (uint32 iRow, uint32 iCol); 00070 00074 virtual void SwapRows(uint32 iRow1, uint32 iRow2); 00075 00079 virtual void SwapCols(uint32 iCol1, uint32 iCol2); 00080 00081 private: 00082 00085 void CopyData(const SubMatrix &iC); 00086 00088 IMatrix &_prMatrix; 00089 00091 uint32 _Row1; 00092 00094 uint32 _NRows; 00095 00097 uint32 _Col1; 00098 00100 uint32 _NCols; 00101 00102 }; 00103 00104 } // namespace Math 00105 } // namespace eLynx 00106 00107 00108 #endif // __SubMatrix_h__ 00109 00110