00001 /***************************************************************************** 00002 * Copyright (C) 2011 by Benjamin Hadorn (b_hadorn@bluewin.ch) 00003 ***************************************************************************** 00004 * Project : Zeus Math Library 00005 * Module : IMatrix 00006 * Package : Zeus.ZeusMath.System.Interfaces 00007 * Author : Benjamin Hadorn 00008 * Date : 27.12.2011 00009 * System : Zeus-Framework 00010 ***************************************************************************** 00011 * Licence: * 00012 * This library is free software; you can redistribute it and/or modify * 00013 * it under the terms of the GNU Lesser General Public License as * 00014 * published by the Free Software Foundation; either version * 00015 * 2.1 of the License, or (at your option) any later version. * 00016 * * 00017 * This library is distributed in the hope that it will be useful, * 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00020 * GNU Lesser General Public License for more details. * 00021 * * 00022 * You should have received a copy of the GNU Lesser General Public * 00023 * License along with this library; if not, write to the Free Software * 00024 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA * 00025 *****************************************************************************/ 00026 00027 /***************************************************************************** 00028 * Changes: 00029 * 27.12.2011 bha: created zeus 2.0 00030 *****************************************************************************/ 00031 00032 #ifndef IMatrixHPP 00033 #define IMatrixHPP 00034 00035 #include <zeusbase/System/Interfaces/IValueType.hpp> 00036 00037 #include <zeusmath/Config/PlatformDefines.hpp> 00038 #include <zeusmath/System/Interfaces/IVector.hpp> 00039 00040 00041 BEGIN_NAMESPACE_Zeus 00042 00043 00044 /******************************************************************************/ 00047 /******************************************************************************/ 00048 class IMatrix : public IValueType 00049 { 00050 public: 00051 /**************************************************************************/ 00057 /**************************************************************************/ 00058 virtual void MQUALIFIER assign(const IMatrix& rMatrix) = 0; 00059 00060 /**************************************************************************/ 00065 /**************************************************************************/ 00066 virtual Float MQUALIFIER calcDeterminant() const = 0; 00067 00068 /**************************************************************************/ 00077 /**************************************************************************/ 00078 virtual bool MQUALIFIER calcInverse(IMatrix& rInverseMatrix) const = 0; 00079 00080 /**************************************************************************/ 00085 /**************************************************************************/ 00086 virtual void MQUALIFIER calcTransposed(IMatrix& rTransposedMatrix) const = 0; 00087 00088 /**************************************************************************/ 00096 /**************************************************************************/ 00097 virtual bool MQUALIFIER equals(const IMatrix& rMatrix, Float fPrecision = FLOAT_PRECISION) const = 0; 00098 00099 /**************************************************************************/ 00107 /**************************************************************************/ 00108 virtual Float MQUALIFIER getCell(Int iRow, Int iColumn, bool* pbError = NULL) const = 0; 00109 00110 /**************************************************************************/ 00117 /**************************************************************************/ 00118 virtual bool MQUALIFIER getRow(Int iRow, IVector& rVector) const = 0; 00119 00120 /**************************************************************************/ 00127 /**************************************************************************/ 00128 virtual bool MQUALIFIER getColumn(Int iColumn, IVector& rVector) const = 0; 00129 00130 /**************************************************************************/ 00136 /**************************************************************************/ 00137 virtual bool MQUALIFIER getDiagonalVector(IVector& rDiagVector) const = 0; 00138 00139 /**************************************************************************/ 00143 /**************************************************************************/ 00144 virtual Int MQUALIFIER getRowCount() const = 0; 00145 00146 /**************************************************************************/ 00150 /**************************************************************************/ 00151 virtual Int MQUALIFIER getColumnCount() const = 0; 00152 00153 /**************************************************************************/ 00157 /**************************************************************************/ 00158 virtual void MQUALIFIER initAsIdentityMatrix() = 0; 00159 00160 /**************************************************************************/ 00163 /**************************************************************************/ 00164 virtual void MQUALIFIER initAsZeroMatrix() = 0; 00165 00166 /**************************************************************************/ 00172 /**************************************************************************/ 00173 virtual bool MQUALIFIER invert() = 0; 00174 00175 /**************************************************************************/ 00181 /**************************************************************************/ 00182 virtual bool MQUALIFIER isIdentityMatrix() const = 0; 00183 00184 /**************************************************************************/ 00190 /**************************************************************************/ 00191 virtual bool MQUALIFIER isInvertible() const = 0; 00192 00193 /**************************************************************************/ 00198 /**************************************************************************/ 00199 virtual bool MQUALIFIER isSquaredMatrix() const = 0; 00200 00201 /**************************************************************************/ 00207 /**************************************************************************/ 00208 virtual bool MQUALIFIER isZeroMatrix() const = 0; 00209 00210 /**************************************************************************/ 00220 /**************************************************************************/ 00221 virtual bool MQUALIFIER setCell(Int iRow, Int iColumn, const Float& rValue) = 0; 00222 00223 /**************************************************************************/ 00232 /**************************************************************************/ 00233 virtual bool MQUALIFIER setRow(Int iRow, const IVector& rVector) = 0; 00234 00235 /**************************************************************************/ 00244 /**************************************************************************/ 00245 virtual bool MQUALIFIER setColumn(Int iColumn, const IVector& rVector) = 0; 00246 00247 /**************************************************************************/ 00252 /**************************************************************************/ 00253 virtual void MQUALIFIER setDiagonalValue(const Float& fValue) = 0; 00254 00255 /**************************************************************************/ 00259 /**************************************************************************/ 00260 virtual void MQUALIFIER setDiagonalVector(const IVector& rDiagVector) = 0; 00261 00262 /**************************************************************************/ 00272 /**************************************************************************/ 00273 virtual Retval MQUALIFIER setDimensions(Int iRows, Int iColumns) = 0; 00274 00275 /**************************************************************************/ 00286 /**************************************************************************/ 00287 virtual bool MQUALIFIER swapCells(Int iRow1, Int iColumn1, Int iRow2, Int iColumn2) = 0; 00288 00289 /**************************************************************************/ 00292 /**************************************************************************/ 00293 virtual void MQUALIFIER transpose() = 0; 00294 00295 /**************************************************************************/ 00301 /**************************************************************************/ 00302 virtual Float MQUALIFIER getEntropy() const = 0; 00303 00304 //mathematical operation 00305 /**************************************************************************/ 00309 /**************************************************************************/ 00310 virtual void MQUALIFIER addConstant(Float fConstant) = 0; 00311 00312 /**************************************************************************/ 00317 /**************************************************************************/ 00318 virtual void MQUALIFIER multiplyConstant(Float fConstant) = 0; 00319 00320 /**************************************************************************/ 00323 /**************************************************************************/ 00324 HIDE_ASSIGNMENT_OPERATOR(IMatrix) 00325 }; 00326 00327 END_NAMESPACE_Zeus 00328 00329 00330 #endif 00331