Epetra Package Browser (Single Doxygen Collection) Development
Epetra_RowMatrix.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_ROWMATRIX_H
00045 #define EPETRA_ROWMATRIX_H
00046 
00047 class Epetra_Comm;
00048 class Epetra_Import;
00049 class Epetra_Export;
00050 class Epetra_Vector;
00051 class Epetra_MultiVector;
00052 #include "Epetra_ConfigDefs.h"
00053 #include "Epetra_Operator.h"
00054 #include "Epetra_SrcDistObject.h"
00055 
00056 
00058 
00068 class EPETRA_LIB_DLL_EXPORT Epetra_RowMatrix: public virtual Epetra_Operator, public virtual Epetra_SrcDistObject {
00069       
00070  public:
00072 
00073 
00074     virtual ~Epetra_RowMatrix() {};
00075 
00077   
00079 
00080 
00082 
00090     virtual int NumMyRowEntries(int MyRow, int & NumEntries) const = 0;
00091 
00092 
00094     virtual int MaxNumEntries() const = 0;
00095 
00097 
00111     virtual int ExtractMyRowCopy(int MyRow, int Length, int & NumEntries, double *Values, int * Indices) const = 0;
00112 
00114 
00120     virtual int ExtractDiagonalCopy(Epetra_Vector & Diagonal) const = 0;
00122   
00124 
00125 
00127 
00137     virtual int Multiply(bool TransA, const Epetra_MultiVector& X, Epetra_MultiVector& Y) const = 0;
00138 
00140 
00155     virtual int Solve(bool Upper, bool Trans, bool UnitDiagonal, const Epetra_MultiVector& X, 
00156           Epetra_MultiVector& Y) const = 0;
00157 
00159 
00169     virtual int InvRowSums(Epetra_Vector& x) const = 0;
00170 
00172 
00179     virtual int LeftScale(const Epetra_Vector& x) = 0;
00180 
00182 
00192     virtual int InvColSums(Epetra_Vector& x) const = 0;
00193 
00195 
00202     virtual int RightScale(const Epetra_Vector& x) = 0;
00204   
00206 
00207 
00209     virtual bool Filled() const = 0;
00210 
00212     /* Returns the quantity \f$ \| A \|_\infty\f$ such that
00213        \f[\| A \|_\infty = \max_{1\lei\len} \sum_{i=1}^m |a_{ij}| \f].
00214     */ 
00215     virtual double NormInf() const = 0;
00216 
00218     /* Returns the quantity \f$ \| A \|_1\f$ such that
00219        \f[\| A \|_1= \max_{1\lej\len} \sum_{j=1}^n |a_{ij}| \f].
00220     */ 
00221     virtual double NormOne() const = 0;
00222 
00224     /*
00225       Note that depending on the matrix implementation, it is sometimes
00226       possible to have some nonzeros that appear on multiple processors.
00227       In that case, those nonzeros may be counted multiple times (also
00228       depending on the matrix implementation).
00229     */
00230 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
00231     virtual int NumGlobalNonzeros() const = 0;
00232 #endif
00233     virtual long long NumGlobalNonzeros64() const = 0;
00234 
00236 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
00237     virtual int NumGlobalRows() const = 0;
00238 #endif
00239     virtual long long NumGlobalRows64() const = 0;
00240 
00242 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
00243     virtual int NumGlobalCols() const= 0;
00244 #endif
00245     virtual long long NumGlobalCols64() const= 0;
00246 
00248 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
00249     virtual int NumGlobalDiagonals() const = 0;
00250 #endif
00251     virtual long long NumGlobalDiagonals64() const = 0;
00252     
00254     virtual int NumMyNonzeros() const = 0;
00255 
00257     virtual int NumMyRows() const = 0;
00258 
00260     virtual int NumMyCols() const = 0;
00261 
00263     virtual int NumMyDiagonals() const = 0;
00264 
00266     virtual bool LowerTriangular() const = 0;
00267 
00269     virtual bool UpperTriangular() const = 0;
00270 
00272     virtual const Epetra_Map & RowMatrixRowMap() const = 0;
00273 
00275     virtual const Epetra_Map & RowMatrixColMap() const = 0;
00276 
00278     virtual const Epetra_Import * RowMatrixImporter() const = 0;
00280 };
00281 
00282 #endif /* EPETRA_ROWMATRIX_H */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines