00001 /***************************************************************************** 00002 * Copyright (C) 2011 by Benjamin Hadorn (b_hadorn@bluewin.ch) 00003 ***************************************************************************** 00004 * Project : Zeus Math Library 00005 * Module : IVector 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 IVectorHPP 00033 #define IVectorHPP 00034 00035 #include <zeusbase/System/Interfaces/IValueType.hpp> 00036 #include <zeusmath/Config/PlatformDefines.hpp> 00037 00038 BEGIN_NAMESPACE_Zeus 00039 00040 /******************************************************************************/ 00044 /******************************************************************************/ 00045 class IVector : public IValueType 00046 { 00047 public: 00048 /*************************************************************************/ 00054 /*************************************************************************/ 00055 virtual void MQUALIFIER assign(const IVector& rVector) = 0; 00056 00057 /*************************************************************************/ 00063 /*************************************************************************/ 00064 virtual void MQUALIFIER assignValues(const Float* apValues, Int iSize) = 0; 00065 00066 /*************************************************************************/ 00073 /*************************************************************************/ 00074 virtual bool MQUALIFIER equals(const IVector& rVector, Float fPrecision = FLOAT_PRECISION) const = 0; 00075 00076 /*************************************************************************/ 00081 /*************************************************************************/ 00082 virtual Float MQUALIFIER getComponent(Int iIndex) const = 0; 00083 00084 /*************************************************************************/ 00088 /*************************************************************************/ 00089 virtual Float* MQUALIFIER getComponents() = 0; 00090 00091 /*************************************************************************/ 00095 /*************************************************************************/ 00096 virtual const Float* MQUALIFIER getComponentsConst() const = 0; 00097 00098 /*************************************************************************/ 00102 /*************************************************************************/ 00103 virtual Int MQUALIFIER getDimension() const = 0; 00104 00105 /**************************************************************************/ 00110 /**************************************************************************/ 00111 virtual Float MQUALIFIER getNorm() const = 0; 00112 00113 /**************************************************************************/ 00118 /**************************************************************************/ 00119 virtual Float MQUALIFIER getNormSquared() const = 0; 00120 00121 /**************************************************************************/ 00126 /**************************************************************************/ 00127 virtual Float MQUALIFIER getLength() const = 0; 00128 00129 /**************************************************************************/ 00134 /**************************************************************************/ 00135 virtual Float MQUALIFIER getLengthSquared() const = 0; 00136 00137 /*************************************************************************/ 00144 /*************************************************************************/ 00145 virtual bool MQUALIFIER setComponent(Int iIndex, Float fValue) = 0; 00146 00147 /*************************************************************************/ 00151 /*************************************************************************/ 00152 virtual void MQUALIFIER setDimension(Int iValue) = 0; 00153 00154 /**************************************************************************/ 00159 /**************************************************************************/ 00160 virtual void MQUALIFIER add(const IVector& rVector) = 0; 00161 00162 /**************************************************************************/ 00167 /**************************************************************************/ 00168 virtual void MQUALIFIER subtract(const IVector& rVector) = 0; 00169 00170 /**************************************************************************/ 00177 /**************************************************************************/ 00178 virtual Float MQUALIFIER calcScalarProduct(const IVector& rVector) const = 0; 00179 00180 /**************************************************************************/ 00186 /**************************************************************************/ 00187 virtual void MQUALIFIER multiply(const Float& f) = 0; 00188 00189 /**************************************************************************/ 00195 /**************************************************************************/ 00196 virtual void MQUALIFIER divide(const Float& f) = 0; 00197 00198 /*************************************************************************/ 00201 /*************************************************************************/ 00202 HIDE_ASSIGNMENT_OPERATOR(IVector) 00203 }; 00204 00205 END_NAMESPACE_Zeus 00206 00207 00208 #endif 00209