Epetra Package Browser (Single Doxygen Collection) Development
Epetra_CrsGraphData.h
Go to the documentation of this file.
00001 /*
00002 //@HEADER
00003 // ************************************************************************
00004 // 
00005 //               Epetra: Linear Algebra Services Package 
00006 //                 Copyright 2001 Sandia Corporation
00007 // 
00008 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00009 // the U.S. Government retains certain rights in this software.
00010 //
00011 // Redistribution and use in source and binary forms, with or without
00012 // modification, are permitted provided that the following conditions are
00013 // met:
00014 //
00015 // 1. Redistributions of source code must retain the above copyright
00016 // notice, this list of conditions and the following disclaimer.
00017 //
00018 // 2. Redistributions in binary form must reproduce the above copyright
00019 // notice, this list of conditions and the following disclaimer in the
00020 // documentation and/or other materials provided with the distribution.
00021 //
00022 // 3. Neither the name of the Corporation nor the names of the
00023 // contributors may be used to endorse or promote products derived from
00024 // this software without specific prior written permission.
00025 //
00026 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00027 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00028 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00029 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00030 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00031 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00032 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00033 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00034 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00035 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00036 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00037 //
00038 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00039 // 
00040 // ************************************************************************
00041 //@HEADER
00042 */
00043 
00044 #ifndef EPETRA_CRSGRAPHDATA_H
00045 #define EPETRA_CRSGRAPHDATA_H
00046 
00047 #include "Epetra_Data.h"
00048 #include "Epetra_DataAccess.h"
00049 #include "Epetra_BlockMap.h"
00050 #include "Epetra_IntSerialDenseVector.h"
00051 
00052 // include STL vector
00053 #include <vector>
00054 class Epetra_Import;
00055 class Epetra_Export;
00056 
00058 
00063 class Epetra_CrsGraphData : public Epetra_Data {
00064   friend class Epetra_CrsGraph;
00065   friend class Epetra_FECrsGraph;
00066 
00067  private:
00068 
00070 
00071 
00073   Epetra_CrsGraphData(Epetra_DataAccess CV, const Epetra_BlockMap& RowMap, bool StaticProfile);
00074 
00076   Epetra_CrsGraphData(Epetra_DataAccess CV, const Epetra_BlockMap& RowMap, const Epetra_BlockMap& ColMap, bool StaticProfile);
00077 
00079   Epetra_CrsGraphData(const Epetra_CrsGraphData& CrsGraphData);
00080 
00082   ~Epetra_CrsGraphData();
00083 
00085 
00087 
00093   void Print(ostream& os, int level = 3) const;
00094 
00096   Epetra_CrsGraphData& operator=(const Epetra_CrsGraphData& CrsGraphData);
00097   
00099 
00100 
00111   struct EntriesInOneRow
00112   {
00113     public:
00119       std::vector<int> entries_;
00120        
00125       void AddEntry (const int col_num);
00126 
00130       void AddEntries (const int  n_cols,
00131           const int *col_nums);
00132   };
00133   
00135   int MakeImportExport();
00136   
00138   int ReAllocateAndCast(char*& UserPtr, int& Length, const int IntPacketSizeTimesNumTrans);
00139   
00141   
00142   // Defined by CrsGraph::FillComplete and related
00143   Epetra_BlockMap RowMap_;
00144   Epetra_BlockMap ColMap_;
00145   Epetra_BlockMap DomainMap_;
00146   Epetra_BlockMap RangeMap_;
00147   
00148   const Epetra_Import* Importer_;
00149   const Epetra_Export* Exporter_;
00150 
00151   bool HaveColMap_;
00152   bool Filled_;
00153   bool Allocated_;
00154   bool Sorted_;
00155   bool StorageOptimized_;
00156   bool NoRedundancies_;
00157   bool IndicesAreGlobal_;
00158   bool IndicesAreLocal_;
00159   bool IndicesAreContiguous_;
00160   bool LowerTriangular_;
00161   bool UpperTriangular_;
00162   bool NoDiagonal_;
00163   bool GlobalConstantsComputed_;
00164   bool StaticProfile_;
00165   bool SortGhostsAssociatedWithEachProcessor_;
00166 
00167   int IndexBase_;
00168 
00169   int NumGlobalEntries_;
00170   int NumGlobalBlockRows_;
00171   int NumGlobalBlockCols_;
00172   int NumGlobalBlockDiagonals_;
00173   int NumMyEntries_;
00174   int NumMyBlockRows_;
00175   int NumMyBlockCols_;
00176   int NumMyBlockDiagonals_;
00177   
00178   int MaxRowDim_;
00179   int MaxColDim_;
00180   int GlobalMaxRowDim_;
00181   int GlobalMaxColDim_;
00182   int MaxNumNonzeros_;
00183   int GlobalMaxNumNonzeros_;
00184   
00185   int NumGlobalNonzeros_;
00186   int NumGlobalRows_;
00187   int NumGlobalCols_;
00188   int NumGlobalDiagonals_;
00189   int NumMyNonzeros_;
00190   int NumMyRows_;
00191   int NumMyCols_;
00192   int NumMyDiagonals_;
00193 
00194   int MaxNumIndices_;
00195   int GlobalMaxNumIndices_;
00196   
00197   int** Indices_;
00198   std::vector<EntriesInOneRow> SortedEntries_;
00199 
00200   int* TempColIndices_;
00201   int NumTempColIndices_;
00202   Epetra_IntSerialDenseVector NumAllocatedIndicesPerRow_;
00203   Epetra_IntSerialDenseVector NumIndicesPerRow_;
00204   Epetra_IntSerialDenseVector IndexOffset_;
00205   Epetra_IntSerialDenseVector All_Indices_;
00206   Epetra_DataAccess CV_;
00207   
00208 };
00209 
00210 
00211 
00212 #endif /* EPETRA_CRSGRAPHDATA_H */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines