Epetra Package Browser (Single Doxygen Collection) Development
Epetra_CrsMatrix.h
Go to the documentation of this file.
00001 /*
00002 //@HEADER
00003 // ************************************************************************
00004 // 
00005 //               Epetra: Linear Algebra Services Package 
00006 //                 Copyright 2011 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_CRSMATRIX_H
00045 #define EPETRA_CRSMATRIX_H
00046 
00047 #include "Epetra_ConfigDefs.h"
00048 #include "Epetra_DistObject.h" 
00049 #include "Epetra_CompObject.h" 
00050 #include "Epetra_BLAS.h"
00051 #include "Epetra_RowMatrix.h"
00052 #include "Epetra_Operator.h"
00053 #include "Epetra_CrsGraph.h"
00054 
00055 #ifdef Epetra_ENABLE_CASK
00056 #include "cask.h"
00057 #endif
00058 
00059 class Epetra_Map;
00060 class Epetra_Import;
00061 class Epetra_Export;
00062 class Epetra_Vector;
00063 class Epetra_MultiVector;
00064 
00065 // Define this to see a complete dump a an Epetra_CrsMatrix::Multiply(...) call
00066 //#define EPETRA_CRS_MATRIX_TRACE_DUMP_MULTIPLY
00067 
00068 #ifdef EPETRA_CRS_MATRIX_TRACE_DUMP_MULTIPLY
00069 extern bool Epetra_CrsMatrixTraceDumpMultiply;
00070 #endif // EPETRA_CRS_MATRIX_TRACE_DUMP_MULTIPLY
00071 
00073 
00170 class EPETRA_LIB_DLL_EXPORT Epetra_CrsMatrix: public Epetra_DistObject, public Epetra_CompObject, public Epetra_BLAS, public virtual Epetra_RowMatrix {
00171  public:
00172 
00174 
00175 
00176 
00187   Epetra_CrsMatrix(Epetra_DataAccess CV, const Epetra_Map& RowMap, const int* NumEntriesPerRow, bool StaticProfile = false);
00188   
00190 
00202   Epetra_CrsMatrix(Epetra_DataAccess CV, const Epetra_Map& RowMap, int NumEntriesPerRow, bool StaticProfile = false);
00203 
00205 
00218   Epetra_CrsMatrix(Epetra_DataAccess CV, const Epetra_Map& RowMap, const Epetra_Map& ColMap, const int* NumEntriesPerRow, bool StaticProfile = false);
00219   
00221 
00235   Epetra_CrsMatrix(Epetra_DataAccess CV, const Epetra_Map& RowMap, const Epetra_Map& ColMap, int NumEntriesPerRow, bool StaticProfile = false);
00236 
00238 
00244   Epetra_CrsMatrix(Epetra_DataAccess CV, const Epetra_CrsGraph& Graph);
00245   
00247   Epetra_CrsMatrix(const Epetra_CrsMatrix& Matrix);
00248   
00250   virtual ~Epetra_CrsMatrix();
00252   
00254 
00255 
00257   Epetra_CrsMatrix& operator=(const Epetra_CrsMatrix& src);
00258 
00260 
00267   int PutScalar(double ScalarConstant);
00268   
00270 
00277   int Scale(double ScalarConstant);
00278 
00280 
00306   virtual int InsertGlobalValues(int GlobalRow, int NumEntries, const double* Values, const int* Indices);
00307   
00309 
00335   virtual int InsertGlobalValues(int GlobalRow, int NumEntries, double* Values, int* Indices);
00336 
00338 
00350   virtual int ReplaceGlobalValues(int GlobalRow, int NumEntries, const double* Values, const int* Indices);
00351   
00353 
00365   virtual int SumIntoGlobalValues(int GlobalRow, int NumEntries, const double* Values, const int* Indices);
00366 
00368 
00381   int InsertMyValues(int MyRow, int NumEntries, const double* Values, const int* Indices);
00382 
00384 
00397   int InsertMyValues(int MyRow, int NumEntries, double* Values, int* Indices);
00398 
00400 
00412   int ReplaceMyValues(int MyRow, int NumEntries, const double* Values, const int* Indices);
00413 
00415 
00428   int SumIntoMyValues(int MyRow, int NumEntries, const double* Values, const int* Indices);
00429 
00431 
00444   int ReplaceDiagonalValues(const Epetra_Vector& Diagonal);
00445   
00447 
00449 
00450   
00451 
00453   /* This version of FillComplete assumes that the domain and range
00454      distributions are identical to the matrix row distributions.
00455     \param OptimizeDataStorage - (In) If true, storage will be packed for optimal performance.  Depending
00456            on how the matrix was constructed, optimizing the storage may have no impact on performance
00457      or one-time memory use, or may have a large impact.  If the user was careful in allocating memory
00458      for the matrix by setting StaticProfile to true in the matrix constructor, then no extra storage
00459      will be allocated in attempting to optimize storage.  If the user did not set StaticProfile to true,
00460      then optimizing the storage will temporarily use additional memory, will have a noticeable impact
00461      on performance and ultimately reduce the storage associated with the matrix.
00462 
00463      By default storage will be optimized.  If you cannot tolerate the increased temporary memory use,
00464      should set this value to false.
00465 
00466      \return error code, 0 if successful. Returns a positive warning code of 3
00467         if the matrix is rectangular (meaning that the other overloading of
00468         FillComplete should have been called, with differen domain-map and
00469         range-map specified).
00470   */
00471   int FillComplete(bool OptimizeDataStorage = true);
00472 
00474   /* This version of FillComplete requires the explicit specification of the domain
00475      and range distribution maps.  These maps are used for importing and exporting vector
00476      and multi-vector elements that are needed for distributed matrix computations.  For
00477      example, to compute y = Ax in parallel, we would specify the DomainMap as the distribution
00478      of the vector x and the RangeMap as the distribution of the vector y.
00479     \param DomainMap - (In) Map that describes the distribution of vector and multi-vectors in the
00480     matrix domain.
00481     \param RangeMap - (In) Map that describes the distribution of vector and multi-vectors in the
00482     matrix range.
00483 
00484     \param OptimizeDataStorage - (In) If true, storage will be packed for optimal performance.  Depending
00485            on how the matrix was constructed, optimizing the storage may have no impact on performance
00486      or one-time memory use, or may have a large impact.  If the user was careful in allocating memory
00487      for the matrix by setting StaticProfile to true in the matrix constructor, then no extra storage
00488      will be allocated in attempting to optimize storage.  If the user did not set StaticProfile to true,
00489      then optimizing the storage will temporarily use additional memory, will have a noticeable impact
00490      on performance and ultimately reduce the storage associated with the matrix.
00491 
00492      By default storage will be optimized.  If you cannot tolerate the increased temporary memory use,
00493      should set this value to false.
00494 
00495     \return error code, 0 if successful. positive warning code of 2 if it is detected that the
00496     matrix-graph got out of sync since this matrix was constructed (for instance if
00497     graph.FillComplete() was called by another matrix that shares the graph)
00498 
00499     \post IndicesAreLocal()==true
00500     */
00501   int FillComplete(const Epetra_Map& DomainMap, const Epetra_Map& RangeMap, bool OptimizeDataStorage = true);
00502     
00504 
00524   int OptimizeStorage();
00525 
00526   
00528   int MakeDataContiguous() {EPETRA_CHK_ERR(OptimizeStorage()); return(0);}
00530   
00532 
00533   
00535 
00545   int ExtractGlobalRowCopy(int GlobalRow, int Length, int& NumEntries, double* Values, int* Indices) const;
00546 
00548 
00559   int ExtractMyRowCopy(int MyRow, int Length, int& NumEntries, double* Values, int* Indices) const;
00560 
00562 
00570   int ExtractGlobalRowCopy(int GlobalRow, int Length, int& NumEntries, double* Values) const;
00571 
00573 
00581   int ExtractMyRowCopy(int MyRow, int Length, int& NumEntries, double* Values) const;
00582 
00584 
00591   int ExtractDiagonalCopy(Epetra_Vector& Diagonal) const;
00592   
00594 
00605   int ExtractGlobalRowView(int GlobalRow, int& NumEntries, double*& Values, int*& Indices) const;
00606   
00608 
00619   int ExtractMyRowView(int MyRow, int& NumEntries, double*& Values, int*& Indices) const;
00620   
00622 
00629   int ExtractGlobalRowView(int GlobalRow, int& NumEntries, double*& Values) const;
00630 
00632 
00639   int ExtractMyRowView(int MyRow, int& NumEntries, double*& Values) const;
00641   
00643 
00644   
00646 
00655   int Multiply(bool TransA, const Epetra_Vector& x, Epetra_Vector& y) const;
00656   int Multiply1(bool TransA, const Epetra_Vector& x, Epetra_Vector& y) const;
00657 
00658 
00660 
00669   int Multiply(bool TransA, const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
00670   int Multiply1(bool TransA, const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
00671 
00673 
00684   int Solve(bool Upper, bool Trans, bool UnitDiagonal, const Epetra_Vector& x, Epetra_Vector& y) const;
00685   
00687 
00698   int Solve(bool Upper, bool Trans, bool UnitDiagonal, const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
00699   
00701 
00717   int InvRowSums(Epetra_Vector& x) const;
00718 
00720 
00732   int InvRowMaxs(Epetra_Vector& x) const;
00733   
00735 
00743   int LeftScale(const Epetra_Vector& x);
00744   
00746 
00763   int InvColSums(Epetra_Vector& x) const;
00764 
00766 
00778   int InvColMaxs(Epetra_Vector& x) const;
00779 
00781 
00789   int RightScale(const Epetra_Vector& x);
00791   
00793 
00794   
00795   
00797   bool Filled() const {return(Graph_.Filled());}
00798   
00800   bool StorageOptimized() const {return(StorageOptimized_);}
00801   
00803   bool IndicesAreGlobal() const {return(Graph_.IndicesAreGlobal());}
00804   
00806   bool IndicesAreLocal() const {return(Graph_.IndicesAreLocal());}
00807   
00809   bool IndicesAreContiguous() const {return(Graph_.IndicesAreContiguous());}
00810   
00812   bool LowerTriangular() const {return(Graph_.LowerTriangular());}
00813   
00815   bool UpperTriangular() const {return(Graph_.UpperTriangular());}
00816   
00818   bool NoDiagonal() const {return(Graph_.NoDiagonal());}
00819   
00821   
00823 
00824   
00826   /* Returns the quantity \f$ \| A \|_\infty\f$ such that
00827      \f[\| A \|_\infty = \max_{1\lei\lem} \sum_{j=1}^n |a_{ij}| \f]
00828      \warning The NormInf() method will not properly calculate the infinity norm for a matrix that has entries that are
00829      replicated on multiple processors. */ 
00830   double NormInf() const;
00831   
00833   /* Returns the quantity \f$ \| A \|_1\f$ such that
00834      \f[\| A \|_1= \max_{1\lej\len} \sum_{i=1}^m |a_{ij}| \f].
00835      \warning The NormOne() method will not properly calculate the one norm for a matrix that has entries that are
00836      replicated on multiple processors.
00837   */ 
00838   double NormOne() const;
00839 
00841   /* Returns the quantity \f[ \| A \|_{Frobenius} = \sqrt{\sum_{i=1}^m \sum_{j=1}^n\|a_{ij}\|^2}\f]
00842      \warning the NormFrobenius() method will not properly calculate the frobenius norm for a matrix that
00843      has entries which are replicated on multiple processors. In that case, the returned
00844      norm will be larger than the true norm.
00845    */
00846   double NormFrobenius() const;
00847 
00849   /*
00850     Note that if maps are defined such that some nonzeros appear on
00851     multiple processors, then those nonzeros will be counted multiple times.
00852     If the user wishes to assemble a matrix from overlapping submatrices,
00853     they can use Epetra_FECrsMatrix.
00854   */
00855   int NumGlobalNonzeros() const {return(Graph_.NumGlobalNonzeros());}
00856   
00858   int NumGlobalRows() const {return(Graph_.NumGlobalRows());}
00859   
00861   int NumGlobalCols() const {return(Graph_.NumGlobalCols());}
00862   
00864   int NumGlobalDiagonals() const {return(Graph_.NumGlobalDiagonals());}
00865   
00867   int NumMyNonzeros() const {return(Graph_.NumMyNonzeros());}
00868   
00870   int NumMyRows() const {return(Graph_.NumMyRows());}
00871   
00873 
00877   int NumMyCols() const {return(Graph_.NumMyCols());}
00878   
00880 
00883   int NumMyDiagonals() const {return(Graph_.NumMyDiagonals());}
00884   
00886   int NumGlobalEntries(int Row) const {return(Graph_.NumGlobalIndices(Row));}
00887   
00889   int NumAllocatedGlobalEntries(int Row) const{return(Graph_.NumAllocatedGlobalIndices(Row));}
00890   
00892 
00895   int MaxNumEntries() const {return(Graph_.MaxNumIndices());}
00896 
00898 
00901   int GlobalMaxNumEntries() const {return(Graph_.GlobalMaxNumIndices());}
00902   
00904   int NumMyEntries(int Row) const {return(Graph_.NumMyIndices(Row));}
00905   
00907   int NumAllocatedMyEntries(int Row) const {return(Graph_.NumAllocatedMyIndices(Row));}
00908   
00910   int IndexBase() const {return(Graph_.IndexBase());}
00911   
00912   
00914   bool StaticGraph() {return(StaticGraph_);}
00915 
00917   const Epetra_CrsGraph& Graph() const {return(Graph_);}
00918   
00920   const Epetra_Map& RowMap() const {return((Epetra_Map &)Graph_.RowMap());}
00921 
00923 
00929   int ReplaceRowMap(const Epetra_BlockMap& newmap);
00930 
00932 
00936   bool HaveColMap() const {return(Graph_.HaveColMap());}
00937 
00939 
00947   int ReplaceColMap(const Epetra_BlockMap& newmap);
00948 
00949 
00951 
00958   const Epetra_Map& ColMap() const {return((Epetra_Map &) Graph_.ColMap());}
00959   
00961 
00964   const Epetra_Map& DomainMap() const {return((Epetra_Map &)Graph_.DomainMap());}
00965   
00967 
00970   const Epetra_Map& RangeMap() const  {return((Epetra_Map &)Graph_.RangeMap());}
00971   
00973   const Epetra_Import* Importer() const {return(Graph_.Importer());}
00974   
00976   const Epetra_Export* Exporter() const {return(Graph_.Exporter());}
00977   
00979   const Epetra_Comm& Comm() const {return(Epetra_DistObject::Comm());}
00981   
00983 
00984 
00985   int LRID( int GRID_in) const {return(Graph_.LRID(GRID_in));}
00986   
00988   int GRID( int LRID_in) const {return(Graph_.GRID(LRID_in));}
00989   
00991 
00994   int LCID( int GCID_in) const {return(Graph_.LCID(GCID_in));}
00995   
00997 
01000   int GCID( int LCID_in) const {return(Graph_.GCID(LCID_in));}
01001   
01003   bool MyGRID(int GRID_in) const {return(Graph_.MyGRID(GRID_in));}
01004   
01006   bool MyLRID(int LRID_in) const {return(Graph_.MyLRID(LRID_in));}
01007   
01009 
01012   bool MyGCID(int GCID_in) const {return(Graph_.MyGCID(GCID_in));}
01013    
01015 
01018   bool MyLCID(int LCID_in) const {return(Graph_.MyLCID(LCID_in));}
01019 
01021   bool MyGlobalRow(int GID) const {return(Graph_.MyGlobalRow(GID));}
01023   
01024   
01026 
01027 
01029   virtual void Print(ostream& os) const;
01031 
01033 
01034 
01036   const char* Label() const {return(Epetra_Object::Label());}
01037   
01039 
01047   int SetUseTranspose(bool UseTranspose_in) {UseTranspose_ = UseTranspose_in; return(0);}
01048 
01050 
01058   int Apply(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const {
01059     return(Epetra_CrsMatrix::Multiply(Epetra_CrsMatrix::UseTranspose(), X, Y));}
01060   
01062 
01075   int ApplyInverse(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const {
01076     return(Solve(UpperTriangular(), Epetra_CrsMatrix::UseTranspose(), NoDiagonal(), X, Y));}
01077 
01079   bool HasNormInf() const {return(true);}
01080   
01082   bool UseTranspose() const {return(UseTranspose_);}
01083   
01085   const Epetra_Map& OperatorDomainMap() const
01086         {
01087           if (UseTranspose()) return(RangeMap());
01088           else return(DomainMap());
01089         }
01090   
01092   const Epetra_Map& OperatorRangeMap() const
01093         {
01094           if (UseTranspose()) return(DomainMap());
01095           else return(RangeMap());
01096         }
01097 
01099 
01100 
01101 
01103 
01112   int NumMyRowEntries(int MyRow, int& NumEntries) const;
01113 
01115   const Epetra_BlockMap& Map() const { return Epetra_DistObject::Map(); }
01116 
01118   const Epetra_Map& RowMatrixRowMap() const {return(RowMap());}
01119   
01121   const Epetra_Map& RowMatrixColMap() const {return(ColMap());}
01122   
01124   const Epetra_Import* RowMatrixImporter() const {return(Importer());}
01125   
01127   
01129 
01130   
01132 
01137   inline double* operator[] (int Loc) { 
01138     if (StorageOptimized()){ int * ind = Graph().IndexOffset(); return(All_Values_+ind[Loc]);}
01139     else return Values_[Loc];}
01140   inline double* operator[] (int Loc) const {
01141     if (StorageOptimized()){ int * ind = Graph().IndexOffset(); return(All_Values_+ind[Loc]);}
01142     else return Values_[Loc];}
01144   
01146 
01147 
01148 
01161   int ExtractCrsDataPointers(int *& IndexOffset, int *& Indices, double *& Values_in) const {
01162     if (StorageOptimized()) { 
01163       IndexOffset = Graph().IndexOffset();
01164       Indices = Graph().All_Indices();
01165       Values_in  = All_Values(); 
01166       return (0);
01167     } 
01168     else { IndexOffset = 0; Indices = 0; Values_in  = 0; return (-1);} }
01169   
01171 
01181   int SortGhostsAssociatedWithEachProcessor(bool Flag)  {Graph_.SortGhostsAssociatedWithEachProcessor(Flag); return(0);}
01183   
01185 
01186   
01188   const Epetra_Map& ImportMap() const {return((Epetra_Map&) Graph_.ImportMap());}
01189 
01191   int TransformToLocal();
01192 
01194   int TransformToLocal(const Epetra_Map* DomainMap, const Epetra_Map* RangeMap);
01195 
01197 
01198 
01199  protected:
01200   bool Allocated() const {return(Allocated_);}
01201   int SetAllocated(bool Flag) {Allocated_ = Flag; return(0);}
01202   double** Values() const {
01203     if (StorageOptimized()) throw ReportError("This method: double** Values() cannot be called when StorageOptimized()==true", -1);
01204     else return(Values_);}
01205   double* All_Values() const {
01206     if (!StorageOptimized()) throw ReportError("This method: double* All_Values()cannot be called when StorageOptimized()==false", -1);
01207     else return(All_Values_);}
01208   double* Values(int LocalRow) const {
01209     if (StorageOptimized())
01210       if (Graph().StorageOptimized())
01211   return(All_Values_+Graph().IndexOffset()[LocalRow]);
01212       else throw ReportError("This method: double* Values()cannot be called when StorageOptimized()==true and Graph().StorageOptimized()==false", -1);
01213     else return(Values_[LocalRow]);}
01214   
01215   void InitializeDefaults();
01216   int Allocate();
01217 
01218   int InsertValues(int LocalRow, int NumEntries, double* Values, int* Indices);
01219   int InsertValues(int LocalRow, int NumEntries, const double* Values, const int* Indices);
01220 
01221   int InsertOffsetValues(int GlobalRow, int NumEntries, double *Values, int *Indices);
01222   int InsertOffsetValues(int GlobalRow, int NumEntries, const double *Values, const int *Indices);
01223   int ReplaceOffsetValues(int GlobalRow, int NumEntries, const double *Values, const int *Indices);
01224   int SumIntoOffsetValues(int GlobalRow, int NumEntries, const double *Values, const int *Indices);
01225   void UpdateImportVector(int NumVectors) const;
01226   void UpdateExportVector(int NumVectors) const;
01227   void GeneralMV(double * x, double * y) const;
01228   void GeneralMTV(double * x, double * y) const;
01229   void GeneralMM(double ** X, int LDX, double ** Y, int LDY, int NumVectors) const;
01230   void GeneralMTM(double ** X, int LDX, double ** Y, int LDY, int NumVectors) const;
01231   void GeneralSV(bool Upper, bool Trans, bool UnitDiagonal, double * x, double * y) const;
01232   void GeneralSM(bool Upper, bool Trans, bool UnitDiagonal, double ** X, int LDX, double ** Y, int LDY, int NumVectors) const;
01233 
01234   void SetStaticGraph(bool Flag) {StaticGraph_ = Flag;}
01235 
01236   int CheckSizes(const Epetra_SrcDistObject& A);
01237 
01238   int CopyAndPermute(const Epetra_SrcDistObject& Source,
01239                      int NumSameIDs, 
01240                      int NumPermuteIDs,
01241                      int* PermuteToLIDs,
01242                      int* PermuteFromLIDs,
01243                      const Epetra_OffsetIndex * Indexor);
01244   int CopyAndPermuteCrsMatrix(const Epetra_CrsMatrix& A,
01245                               int NumSameIDs, 
01246                               int NumPermuteIDs,
01247                               int* PermuteToLIDs,
01248                               int* PermuteFromLIDs,
01249                               const Epetra_OffsetIndex * Indexor);
01250   int CopyAndPermuteRowMatrix(const Epetra_RowMatrix& A,
01251                               int NumSameIDs, 
01252                               int NumPermuteIDs,
01253                               int* PermuteToLIDs,
01254                               int* PermuteFromLIDs,
01255                               const Epetra_OffsetIndex * Indexor);
01256   
01257   int PackAndPrepare(const Epetra_SrcDistObject& Source,
01258                      int NumExportIDs,
01259                      int* ExportLIDs,
01260                      int& LenExports,
01261                      char*& Exports,
01262                      int& SizeOfPacket,
01263                      int* Sizes,
01264                      bool& VarSizes,
01265                      Epetra_Distributor& Distor);
01266 
01267   int UnpackAndCombine(const Epetra_SrcDistObject& Source, 
01268                        int NumImportIDs,
01269                        int* ImportLIDs, 
01270                        int LenImports,
01271                        char* Imports,
01272                        int& SizeOfPacket, 
01273                        Epetra_Distributor& Distor,
01274                        Epetra_CombineMode CombineMode,
01275                        const Epetra_OffsetIndex * Indexor);
01276 
01278   int SortEntries();
01279 
01281   bool Sorted() const {return(Graph_.Sorted());}
01282 
01284   int MergeRedundantEntries();
01285 
01287   bool NoRedundancies() const {return(Graph_.NoRedundancies());}
01288     
01289   void DeleteMemory();
01290 
01291   Epetra_CrsGraph Graph_;
01292   bool Allocated_;
01293   bool StaticGraph_;
01294   bool UseTranspose_;
01295   bool constructedWithFilledGraph_;
01296   bool matrixFillCompleteCalled_;
01297   bool StorageOptimized_;
01298 
01299   double** Values_;
01300   int* Values_alloc_lengths_;
01301   double* All_Values_;
01302   mutable double NormInf_;
01303   mutable double NormOne_;
01304   mutable double NormFrob_;
01305 
01306   int NumMyRows_;
01307   mutable Epetra_MultiVector* ImportVector_;
01308   mutable Epetra_MultiVector* ExportVector_;
01309 
01310   Epetra_DataAccess CV_;
01311 
01312   bool squareFillCompleteCalled_;
01313 #ifdef Epetra_ENABLE_CASK
01314   caskHandle_t cask;
01315 #endif
01316  private:
01317 
01318   // These are the pre-5.0 versions of solve.  They are still faster that generic 5.0 solves, so we keep them around
01319   int Solve1(bool Upper, bool Trans, bool UnitDiagonal, const Epetra_Vector& x, Epetra_Vector& y) const;
01320   int Solve1(bool Upper, bool Trans, bool UnitDiagonal, const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
01321 
01322 };
01323 #endif /* EPETRA_CRSMATRIX_H */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines