// // $Source: /cvsroot/gambit/gambit/sources/libgambit/dvector.h,v $ // $Date: 2006/01/09 21:56:12 $ // $Revision: 1.2 $ // // DESCRIPTION: // Doubly-partitioned vector class // // This file is part of Gambit // Copyright (c) 2002, The Gambit Project // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // #ifndef LIBGAMBIT_DVECTOR_H #define LIBGAMBIT_DVECTOR_H #include "pvector.h" namespace Gambit { template class DVector : public PVector { private: int sum(int part, const PVector &v) const; void setindex(void); bool Check(const DVector &) const; protected: T ***dvptr; Array dvlen, dvidx; public: DVector(void); DVector(const PVector &sig); DVector(const Vector &val, const PVector &sig); DVector(const DVector &v); virtual ~DVector(); T &operator()(int a, int b, int c); const T &operator()(int a, int b, int c) const; // extract a subvector void CopySubRow(int row, int col, const DVector &v); DVector &operator=(const DVector &v); DVector &operator=(const PVector &v); DVector &operator=(const Vector &v); DVector &operator=(T c); DVector operator+(const DVector &v) const; DVector &operator+=(const DVector &v); DVector operator-(void) const; DVector operator-(const DVector &v) const; DVector &operator-=(const DVector &v); T operator*(const DVector &v) const; DVector &operator*=(const T &c); DVector operator/(const T &c) const; bool operator==(const DVector &v) const; bool operator!=(const DVector &v) const; const Array &DPLengths(void) const; }; } // end namespace Gambit #endif // LIBGAMBIT_DVECTOR_H