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 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_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_kernels.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 
00945   int ReplaceColMap(const Epetra_BlockMap& newmap);
00946 
00947 
00949 
00956   const Epetra_Map& ColMap() const {return((Epetra_Map &) Graph_.ColMap());}
00957   
00959 
00962   const Epetra_Map& DomainMap() const {return((Epetra_Map &)Graph_.DomainMap());}
00963   
00965 
00968   const Epetra_Map& RangeMap() const  {return((Epetra_Map &)Graph_.RangeMap());}
00969   
00971   const Epetra_Import* Importer() const {return(Graph_.Importer());}
00972   
00974   const Epetra_Export* Exporter() const {return(Graph_.Exporter());}
00975   
00977   const Epetra_Comm& Comm() const {return(Epetra_DistObject::Comm());}
00979   
00981 
00982 
00983   int LRID( int GRID_in) const {return(Graph_.LRID(GRID_in));}
00984   
00986   int GRID( int LRID_in) const {return(Graph_.GRID(LRID_in));}
00987   
00989 
00992   int LCID( int GCID_in) const {return(Graph_.LCID(GCID_in));}
00993   
00995 
00998   int GCID( int LCID_in) const {return(Graph_.GCID(LCID_in));}
00999   
01001   bool MyGRID(int GRID_in) const {return(Graph_.MyGRID(GRID_in));}
01002   
01004   bool MyLRID(int LRID_in) const {return(Graph_.MyLRID(LRID_in));}
01005   
01007 
01010   bool MyGCID(int GCID_in) const {return(Graph_.MyGCID(GCID_in));}
01011    
01013 
01016   bool MyLCID(int LCID_in) const {return(Graph_.MyLCID(LCID_in));}
01017 
01019   bool MyGlobalRow(int GID) const {return(Graph_.MyGlobalRow(GID));}
01021   
01022   
01024 
01025 
01027   virtual void Print(ostream& os) const;
01029 
01031 
01032 
01034   const char* Label() const {return(Epetra_Object::Label());}
01035   
01037 
01045   int SetUseTranspose(bool UseTranspose_in) {UseTranspose_ = UseTranspose_in; return(0);}
01046 
01048 
01056   int Apply(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const {
01057     return(Epetra_CrsMatrix::Multiply(Epetra_CrsMatrix::UseTranspose(), X, Y));}
01058   
01060 
01073   int ApplyInverse(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const {
01074     return(Solve(UpperTriangular(), Epetra_CrsMatrix::UseTranspose(), NoDiagonal(), X, Y));}
01075 
01077   bool HasNormInf() const {return(true);}
01078   
01080   bool UseTranspose() const {return(UseTranspose_);}
01081   
01083   const Epetra_Map& OperatorDomainMap() const
01084         {
01085           if (UseTranspose()) return(RangeMap());
01086           else return(DomainMap());
01087         }
01088   
01090   const Epetra_Map& OperatorRangeMap() const
01091         {
01092           if (UseTranspose()) return(DomainMap());
01093           else return(RangeMap());
01094         }
01095 
01097 
01098 
01099 
01101 
01110   int NumMyRowEntries(int MyRow, int& NumEntries) const;
01111 
01113   const Epetra_BlockMap& Map() const { return Epetra_DistObject::Map(); }
01114 
01116   const Epetra_Map& RowMatrixRowMap() const {return(RowMap());}
01117   
01119   const Epetra_Map& RowMatrixColMap() const {return(ColMap());}
01120   
01122   const Epetra_Import* RowMatrixImporter() const {return(Importer());}
01123   
01125   
01127 
01128   
01130 
01135   inline double* operator[] (int Loc) { 
01136     if (StorageOptimized()){ int * ind = Graph().IndexOffset(); return(All_Values_+ind[Loc]);}
01137     else return Values_[Loc];}
01138   inline double* operator[] (int Loc) const {
01139     if (StorageOptimized()){ int * ind = Graph().IndexOffset(); return(All_Values_+ind[Loc]);}
01140     else return Values_[Loc];}
01142   
01144 
01145 
01146 
01159   int ExtractCrsDataPointers(int *& IndexOffset, int *& Indices, double *& Values_in) const {
01160     if (StorageOptimized()) { 
01161       IndexOffset = Graph().IndexOffset();
01162       Indices = Graph().All_Indices();
01163       Values_in  = All_Values(); 
01164       return (0);
01165     } 
01166     else { IndexOffset = 0; Indices = 0; Values_in  = 0; return (-1);} }
01167   
01169 
01179   int SortGhostsAssociatedWithEachProcessor(bool Flag)  {Graph_.SortGhostsAssociatedWithEachProcessor(Flag); return(0);}
01181   
01183 
01184   
01186   const Epetra_Map& ImportMap() const {return((Epetra_Map&) Graph_.ImportMap());}
01187 
01189   int TransformToLocal();
01190 
01192   int TransformToLocal(const Epetra_Map* DomainMap, const Epetra_Map* RangeMap);
01193 
01195 
01196 
01197  protected:
01198   bool Allocated() const {return(Allocated_);}
01199   int SetAllocated(bool Flag) {Allocated_ = Flag; return(0);}
01200   double** Values() const {
01201     if (StorageOptimized()) throw ReportError("This method: double** Values() cannot be called when StorageOptimized()==true", -1);
01202     else return(Values_);}
01203   double* All_Values() const {
01204     if (!StorageOptimized()) throw ReportError("This method: double* All_Values()cannot be called when StorageOptimized()==false", -1);
01205     else return(All_Values_);}
01206   double* Values(int LocalRow) const {
01207     if (StorageOptimized())
01208       if (Graph().StorageOptimized())
01209   return(All_Values_+Graph().IndexOffset()[LocalRow]);
01210       else throw ReportError("This method: double* Values()cannot be called when StorageOptimized()==true and Graph().StorageOptimized()==false", -1);
01211     else return(Values_[LocalRow]);}
01212   
01213   void InitializeDefaults();
01214   int Allocate();
01215 
01216   int InsertValues(int LocalRow, int NumEntries, double* Values, int* Indices);
01217   int InsertValues(int LocalRow, int NumEntries, const double* Values, const int* Indices);
01218 
01219   int InsertOffsetValues(int GlobalRow, int NumEntries, double *Values, int *Indices);
01220   int InsertOffsetValues(int GlobalRow, int NumEntries, const double *Values, const int *Indices);
01221   int ReplaceOffsetValues(int GlobalRow, int NumEntries, const double *Values, const int *Indices);
01222   int SumIntoOffsetValues(int GlobalRow, int NumEntries, const double *Values, const int *Indices);
01223   void UpdateImportVector(int NumVectors) const;
01224   void UpdateExportVector(int NumVectors) const;
01225   void GeneralMV(double * x, double * y) const;
01226   void GeneralMTV(double * x, double * y) const;
01227   void GeneralMM(double ** X, int LDX, double ** Y, int LDY, int NumVectors) const;
01228   void GeneralMTM(double ** X, int LDX, double ** Y, int LDY, int NumVectors) const;
01229   void GeneralSV(bool Upper, bool Trans, bool UnitDiagonal, double * x, double * y) const;
01230   void GeneralSM(bool Upper, bool Trans, bool UnitDiagonal, double ** X, int LDX, double ** Y, int LDY, int NumVectors) const;
01231 
01232   void SetStaticGraph(bool Flag) {StaticGraph_ = Flag;}
01233 
01234   int CheckSizes(const Epetra_SrcDistObject& A);
01235 
01236   int CopyAndPermute(const Epetra_SrcDistObject& Source,
01237                      int NumSameIDs, 
01238                      int NumPermuteIDs,
01239                      int* PermuteToLIDs,
01240                      int* PermuteFromLIDs,
01241                      const Epetra_OffsetIndex * Indexor);
01242   int CopyAndPermuteCrsMatrix(const Epetra_CrsMatrix& A,
01243                               int NumSameIDs, 
01244                               int NumPermuteIDs,
01245                               int* PermuteToLIDs,
01246                               int* PermuteFromLIDs,
01247                               const Epetra_OffsetIndex * Indexor);
01248   int CopyAndPermuteRowMatrix(const Epetra_RowMatrix& A,
01249                               int NumSameIDs, 
01250                               int NumPermuteIDs,
01251                               int* PermuteToLIDs,
01252                               int* PermuteFromLIDs,
01253                               const Epetra_OffsetIndex * Indexor);
01254   
01255   int PackAndPrepare(const Epetra_SrcDistObject& Source,
01256                      int NumExportIDs,
01257                      int* ExportLIDs,
01258                      int& LenExports,
01259                      char*& Exports,
01260                      int& SizeOfPacket,
01261                      int* Sizes,
01262                      bool& VarSizes,
01263                      Epetra_Distributor& Distor);
01264 
01265   int UnpackAndCombine(const Epetra_SrcDistObject& Source, 
01266                        int NumImportIDs,
01267                        int* ImportLIDs, 
01268                        int LenImports,
01269                        char* Imports,
01270                        int& SizeOfPacket, 
01271                        Epetra_Distributor& Distor,
01272                        Epetra_CombineMode CombineMode,
01273                        const Epetra_OffsetIndex * Indexor);
01274 
01276   int SortEntries();
01277 
01279   bool Sorted() const {return(Graph_.Sorted());}
01280 
01282   int MergeRedundantEntries();
01283 
01285   bool NoRedundancies() const {return(Graph_.NoRedundancies());}
01286     
01287   void DeleteMemory();
01288 
01289   Epetra_CrsGraph Graph_;
01290   bool Allocated_;
01291   bool StaticGraph_;
01292   bool UseTranspose_;
01293   bool constructedWithFilledGraph_;
01294   bool matrixFillCompleteCalled_;
01295   bool StorageOptimized_;
01296 
01297   double** Values_;
01298   int* Values_alloc_lengths_;
01299   double* All_Values_;
01300   mutable double NormInf_;
01301   mutable double NormOne_;
01302   mutable double NormFrob_;
01303 
01304   int NumMyRows_;
01305   mutable Epetra_MultiVector* ImportVector_;
01306   mutable Epetra_MultiVector* ExportVector_;
01307 
01308   Epetra_DataAccess CV_;
01309 
01310   bool squareFillCompleteCalled_;
01311 #ifdef Epetra_ENABLE_CASK
01312   caskHandle_t cask;
01313 #endif
01314  private:
01315 
01316   // These are the pre-5.0 versions of solve.  They are still faster that generic 5.0 solves, so we keep them around
01317   int Solve1(bool Upper, bool Trans, bool UnitDiagonal, const Epetra_Vector& x, Epetra_Vector& y) const;
01318   int Solve1(bool Upper, bool Trans, bool UnitDiagonal, const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
01319 
01320 };
01321 #endif /* EPETRA_CRSMATRIX_H */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines