eLynx SDK
v3.3.0 C++ image processing API reference |
00001 //============================================================================ 00002 // SingleRowMatrix.h Math.Component package 00003 //============================================================================ 00004 // Usage : linear algebra - matrix-style vector adapter (1 x n 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 #ifdef TRACE_INCLUDES 00019 #pragma message(".include SingleRowMatrix.h") 00020 #endif 00021 00022 #ifndef __SingleRowMatrix_h__ 00023 #define __SingleRowMatrix_h__ 00024 00025 #include "elx/math/IVector.h" 00026 #include "elx/math/IMatrix.h" 00027 00028 namespace eLynx { 00029 namespace Math { 00030 00035 class ExportedByMath SingleRowMatrix : public IMatrix { 00036 00037 public: 00038 00041 SingleRowMatrix(IVector &iVector); 00042 00045 SingleRowMatrix(const SingleRowMatrix &iOther); 00046 00050 SingleRowMatrix& operator = (SingleRowMatrix &iOther); 00051 00054 virtual uint32 GetWidth() const { return _prVector.GetSize(); } 00055 00058 virtual uint32 GetHeight() const { return 1; } 00059 00064 virtual const double& operator () (uint32 iRow, uint32 iCol) const 00065 { return _prVector(iCol); } 00066 00071 virtual double& operator () (uint32 iRow, uint32 iCol) 00072 { return _prVector(iCol); } 00073 00076 virtual void SwapRows(uint32 iRow1, uint32 iRow2) {} 00077 00081 virtual void SwapCols(uint32 iCol1, uint32 iCol2) 00082 { _prVector.SwapValues(iCol1, iCol2); } 00083 00084 private: 00085 00087 void CopyData(const SingleRowMatrix &iOther); 00088 00090 IVector& _prVector; 00091 00092 }; 00093 00094 } // namespace Math 00095 } // namespace eLynx 00096 00097 00098 #endif // __SingleRowMatrix_h__