eLynx SDK
v3.3.0 C++ image processing API reference |
00001 //============================================================================ 00002 // Matrix.h Math.Component package 00003 //============================================================================ 00004 // Usage : linear algebra - matrix implementation 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 __Matrix_h__ 00019 #define __Matrix_h__ 00020 00021 #include "IMatrix.h" 00022 #include <boost/scoped_array.hpp> 00023 00024 namespace eLynx { 00025 namespace Math { 00026 00031 class ExportedByMath Matrix : public IMatrix { 00032 00033 public: 00034 00039 Matrix(uint32 iHeight, uint32 iWidth); 00040 00043 Matrix(const IMatrix &iMatrix); 00044 00047 Matrix(const Matrix &iOther); 00048 00052 Matrix& operator = (const Matrix &iOther); 00053 00056 virtual uint32 GetWidth() const { return _Width; } 00057 00060 virtual uint32 GetHeight() const { return _Height; } 00061 00067 virtual const double& operator () (uint32 iRow, uint32 iCol) const; 00068 00074 virtual double& operator () (uint32 iRow, uint32 iCol); 00075 00079 virtual void SwapRows(uint32 iRow1, uint32 iRow2); 00080 00084 virtual void SwapCols(uint32 iCol1, uint32 iCol2); 00085 00090 void Resize(uint32 iHeight, uint32 iWidth); 00091 00092 private: 00093 00097 void CopyData(const Matrix &iC); 00098 00100 uint32 _Width; 00101 00103 uint32 _Height; 00104 00106 boost::scoped_array<double> _spMatrix; 00107 00108 }; 00109 00110 } // namespace Math 00111 } // namespace eLynx 00112 00113 00114 #endif // __Matrix_h__ 00115