// // $Source: /cvsroot/gambit/gambit/sources/libgambit/pvector.h,v $ // $Date: 2006/01/07 05:41:26 $ // $Revision: 1.1 $ // // DESCRIPTION: // 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_PVECTOR_H #define LIBGAMBIT_PVECTOR_H #include "vector.h" namespace Gambit { template class PVector : public Vector { private: int sum(const Array &V) const; void setindex(void); protected: T **svptr; Array svlen; int Check(const PVector &v) const; public: // constructors PVector(void); PVector(const Array &sig); PVector(const Vector &val, const Array &sig); PVector(const PVector &v); virtual ~PVector(); // element access operators T& operator()(int a, int b); const T& operator()(int a, int b) const; // extract a subvector Vector GetRow(int row) const; void GetRow(int row, Vector &v) const; void SetRow(int row, const Vector &v); void CopyRow(int row, const PVector &v); // more operators PVector& operator=(const PVector &v); PVector& operator=(const Vector &v); PVector& operator=(T c); PVector operator+(const PVector &v) const; PVector& operator+=(const PVector &v); PVector operator-(void) const; PVector operator-(const PVector &v) const; PVector& operator-=(const PVector &v); T operator*(const PVector &v) const; PVector operator*(const T &c) const; PVector& operator*=(const T c); PVector operator/(T c); bool operator==(const PVector &v) const; bool operator!=(const PVector &v) const; // parameter access functions const Array& Lengths(void) const; }; } // end namespace Gambit #endif // LIBGAMBIT_PVECTOR_H