Epetra_IntVector.h

Go to the documentation of this file.
00001 
00002 //@HEADER
00003 /*
00004 ************************************************************************
00005 
00006               Epetra: Linear Algebra Services Package 
00007                 Copyright (2001) Sandia Corporation
00008 
00009 Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00010 license for use of this work by or on behalf of the U.S. Government.
00011 
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 2.1 of the
00015 License, or (at your option) any later version.
00016  
00017 This library is distributed in the hope that it will be useful, but
00018 WITHOUT ANY WARRANTY; without even the implied warranty of
00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00025 USA
00026 Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00027 
00028 ************************************************************************
00029 */
00030 //@HEADER
00031 
00032 #ifndef EPETRA_INTVECTOR_H
00033 #define EPETRA_INTVECTOR_H
00034 
00035 #include "Epetra_DistObject.h"
00036 #include "Epetra_BlockMap.h"
00037 #include "Epetra_Distributor.h"
00038 class Epetra_Map;
00039 
00041 
00110 //=========================================================================
00111 class Epetra_IntVector : public Epetra_DistObject {
00112 
00113   public:
00114 
00116 
00117 
00118 
00134   Epetra_IntVector(const Epetra_BlockMap& Map, bool zeroOut = true);
00135 
00137   
00138   Epetra_IntVector(const Epetra_IntVector& Source);
00139   
00141 
00153   Epetra_IntVector(Epetra_DataAccess CV, const Epetra_BlockMap& Map, int *V);
00154 
00156   virtual ~Epetra_IntVector ();
00158   
00159 
00161 
00162 
00163   int PutValue(int Value);
00165   
00166 
00168 
00169 
00170 
00172 
00178   int ExtractCopy(int *V) const;
00179   
00181 
00187   int ExtractView(int **V) const;
00189 
00191 
00192 
00193 
00196   int MaxValue();
00197  
00199 
00202   int MinValue();
00203 
00205   
00207 
00208 
00210 
00216   Epetra_IntVector& operator = (const Epetra_IntVector& Source);
00217   
00219 
00222     int& operator [] (int index) { return Values_[index]; }
00224 
00227     const int& operator [] (int index) const { return Values_[index]; }
00229     
00231 
00232 
00234   int * Values() const {return(Values_);};
00235 
00237   int MyLength() const {return(Map().NumMyPoints());};
00238 
00240   int GlobalLength() const {return(Map().NumGlobalPoints());};
00242 
00244 
00245 
00247   virtual void Print(ostream & os) const;
00249  private:
00250 
00251   int AllocateForCopy();
00252   int DoCopy(int * V);
00253   int AllocateForView();
00254   int DoView(int * V);
00255 
00256    // Routines to implement Epetra_DistObject virtual methods
00257   int CheckSizes(const Epetra_SrcDistObject& A);
00258 
00259   int CopyAndPermute(const Epetra_SrcDistObject & Source,
00260                      int NumSameIDs, 
00261                      int NumPermuteIDs,
00262                      int * PermuteToLIDs,
00263                      int * PermuteFromLIDs,
00264                      const Epetra_OffsetIndex * Indexor);
00265 
00266   int PackAndPrepare(const Epetra_SrcDistObject & Source,
00267                      int NumExportIDs,
00268                      int * ExportLIDs,
00269                      int & LenExports,
00270                      char * & Exports,
00271                      int & SizeOfPacket,
00272                      int * Sizes,
00273                      bool& VarSizes,
00274                      Epetra_Distributor & Distor);
00275   
00276   int UnpackAndCombine(const Epetra_SrcDistObject & Source,
00277                        int NumImportIDs,
00278                        int * ImportLIDs, 
00279                        int LenImports, 
00280                        char * Imports,
00281                        int & SizeOfPacket, 
00282                        Epetra_Distributor & Distor,
00283                        Epetra_CombineMode CombineMode,
00284                        const Epetra_OffsetIndex * Indexor);
00285 
00286   int * Values_;
00287   bool UserAllocated_;
00288   bool Allocated_;
00289 };
00290 
00291 #endif /* EPETRA_INTVECTOR_H */

Generated on Wed May 12 21:41:05 2010 for Epetra Package Browser (Single Doxygen Collection) by  doxygen 1.4.7