Epetra_BasicDirectory.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_BASICDIRECTORY_H
00033 #define EPETRA_BASICDIRECTORY_H
00034 
00035 #include "Epetra_Object.h"
00036 #include "Epetra_Directory.h"
00037 #include "Epetra_Map.h"
00038 
00040 
00050 class Epetra_BasicDirectory: public virtual Epetra_Directory {
00051     
00052   public:
00053 
00055 
00056 
00057   Epetra_BasicDirectory(const Epetra_BlockMap & Map );
00058   
00060   
00061   Epetra_BasicDirectory(const Epetra_BasicDirectory& Directory);
00062   
00064   
00065   virtual ~Epetra_BasicDirectory(void);
00067   
00069 
00070 
00071 
00099   int GetDirectoryEntries( const Epetra_BlockMap& Map,
00100          const int NumEntries,
00101          const int * GlobalEntries,
00102          int * Procs,
00103          int * LocalEntries,
00104          int * EntrySizes,
00105          bool high_rank_sharing_procs=false) const;
00106 
00108 
00110   bool GIDsAllUniquelyOwned() const;
00112 
00114 
00115 
00116   virtual void Print(ostream & os) const;
00118 
00119  private:
00120   Epetra_BasicDirectory& operator=(const Epetra_BasicDirectory& src);
00121 
00122   void create_ProcListArrays();
00123 
00124   void addProcToList(int proc, int LID);
00125 
00127   int Generate(const Epetra_BlockMap& Map);
00128 
00130   const Epetra_Map & DirectoryMap() const {return(*DirectoryMap_);};
00131 
00132   Epetra_Map* DirectoryMap_;
00133 
00134   //ProcList_ is a list containing the associated processor for each
00135   //directory entry. If any directory entry has more than one associated
00136   //processor, then the corresponding ProcList_ entry will be the lowest-
00137   //numbered of those processors. In that case, refer to ProcListLists_
00138   //for more info.
00139 
00140   int * ProcList_;
00141 
00142   //ProcListLists_ will usually be unallocated, and set to NULL. But if
00143   //at least one directory entry is associcated with more than one proc,
00144   //then ProcListLists_ is a list of lists -- it holds, for each
00145   //directory-entry, a list of processors.
00146   //But even then, it will have a NULL list for all directory entries that
00147   //are associated with only one processor.
00148   //
00149   //Each list's length will be stored in ProcListLens_.
00150   //Example:
00151   //
00152   //if (numProcLists_ > 0) {
00153   //  int entry_LID = DirectoryMap_->LID(GID);
00154   //
00155   //  for(int i=0; i<ProcListLens_[entry_LID]; ++i) {
00156   //    cout << "entry "<<GID<<" associated with proc "
00157   //          <<ProcListLists_[entry_LID][i]<<endl;
00158   //  }
00159   //}
00160   int** ProcListLists_;
00161   int* ProcListLens_;
00162   int numProcLists_;
00163 
00164   //true if any directory entry appears on multiple processors
00165   bool entryOnMultipleProcs_;
00166 
00167   int * LocalIndexList_;
00168   int * SizeList_;
00169   bool SizeIsConst_;
00170 
00171   int * AllMinGIDs_;
00172   
00173 
00174 };
00175 
00176 #endif /* EPETRA_BASICDIRECTORY_H */

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