eLynx SDK
v3.3.0 C++ image processing API reference |
00001 //============================================================================ 00002 // TransposedMatrix.h Math.Component package 00003 //============================================================================ 00004 // Usage : linear algebra - matrix adapter for transposed matrix 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 __TransposedMatrix_h__ 00019 #define __TransposedMatrix_h__ 00020 00021 #include "IMatrix.h" 00022 00023 namespace eLynx { 00024 namespace Math { 00025 00031 class ExportedByMath TransposedMatrix : public IMatrix { 00032 00033 public: 00034 00037 TransposedMatrix(IMatrix &iMatrix) : _prMatrix(iMatrix) {} 00038 00041 TransposedMatrix(const TransposedMatrix &iOther) : _prMatrix(iOther._prMatrix) {} 00042 00046 TransposedMatrix& operator = (const TransposedMatrix &iOther) 00047 { _prMatrix = iOther._prMatrix; return *this; } 00048 00052 virtual uint32 GetWidth() const { return _prMatrix.GetHeight(); } 00053 00057 virtual uint32 GetHeight() const { return _prMatrix.GetWidth(); } 00058 00063 virtual const double& operator () (uint32 iRow, uint32 iCol) const 00064 { return _prMatrix(iCol, iRow); } 00065 00070 virtual double& operator () (uint32 iRow, uint32 iCol) 00071 { return _prMatrix(iCol, iRow); } 00072 00076 virtual void SwapRows(uint32 iRow1, uint32 iRow2) 00077 { _prMatrix.SwapCols(iRow1, iRow2); } 00078 00082 virtual void SwapCols(uint32 iCol1, uint32 iCol2) 00083 { _prMatrix.SwapRows(iCol1, iCol2); } 00084 00085 private: 00086 00088 IMatrix& _prMatrix; 00089 00090 }; 00091 00092 } // namespace Math 00093 } // namespace eLynx 00094 00095 00096 #endif // __TransposedMatrix_h__ 00097