FEI Version of the Day
fei_Matrix.hpp
00001 /*--------------------------------------------------------------------*/
00002 /*    Copyright 2005 Sandia Corporation.                              */
00003 /*    Under the terms of Contract DE-AC04-94AL85000, there is a       */
00004 /*    non-exclusive license for use of this work by or on behalf      */
00005 /*    of the U.S. Government.  Export of this program may require     */
00006 /*    a license from the United States Government.                    */
00007 /*--------------------------------------------------------------------*/
00008 
00009 #ifndef _fei_Matrix_hpp_
00010 #define _fei_Matrix_hpp_
00011 
00012 #include "fei_iosfwd.hpp"
00013 #include "fei_SharedPtr.hpp"
00014 #include "fei_MatrixGraph.hpp"
00015 #include "fei_defs.h"
00016 
00017 namespace fei {
00030   class Matrix {
00031   public:
00033     class Factory {
00034     public:
00036       virtual ~Factory(){}
00037 
00039       virtual fei::SharedPtr<fei::Matrix>
00040         createMatrix(fei::SharedPtr<fei::MatrixGraph> matrixGraph) = 0;
00041     };
00042 
00044     virtual ~Matrix(){}
00045 
00049     virtual const char* typeName() = 0;
00050 
00053     virtual int parameters(const fei::ParameterSet& paramset) = 0;
00054 
00056     virtual fei::SharedPtr<fei::MatrixGraph> getMatrixGraph() const = 0;
00057 
00059     virtual void setMatrixGraph(fei::SharedPtr<fei::MatrixGraph> matrixGraph) = 0;
00060 
00063     virtual int getGlobalNumRows() const = 0;
00064 
00067     virtual int getLocalNumRows() const = 0;
00068 
00074     virtual int getRowLength(int row, int& length) const = 0;
00075 
00077     virtual int putScalar(double scalar) = 0;
00078 
00088     virtual int copyOutRow(int row, int len, double* coefs, int* indices) const = 0;
00089 
00102     virtual int sumIn(int numRows, const int* rows,
00103                       int numCols, const int* cols,
00104                       const double* const* values,
00105                       int format=0) = 0;
00106 
00119     virtual int copyIn(int numRows, const int* rows,
00120                        int numCols, const int* cols,
00121                        const double* const* values,
00122                       int format=0) = 0;
00123 
00139     virtual int sumInFieldData(int fieldID,
00140                                int idType,
00141                                int rowID,
00142                                int colID,
00143                                const double* const* data,
00144                                int format=0) = 0;
00145 
00163     virtual int sumInFieldData(int fieldID,
00164                                int idType,
00165                                int rowID,
00166                                int colID,
00167                                const double* data,
00168                                int format=0) = 0;
00169 
00179     virtual int sumIn(int blockID, int connectivityID,
00180                       const double* const* values,
00181                       int format=0) = 0;
00182 
00187     virtual int globalAssemble() = 0;
00188 
00191     virtual int multiply(fei::Vector* x,
00192                          fei::Vector* y) = 0;
00193 
00199     virtual int gatherFromOverlap(bool accumulate = true) = 0;
00200 
00216     virtual int writeToFile(const char* filename,
00217                             bool matrixMarketFormat=true) = 0;
00218 
00231     virtual int writeToStream(FEI_OSTREAM& ostrm,
00232                               bool matrixMarketFormat=true) = 0;
00233 
00236     virtual bool usingBlockEntryStorage() = 0;
00237 
00242     virtual void markState() = 0;
00243 
00248     virtual bool changedSinceMark() = 0;
00249 
00250   };//class Matrix
00251 }//namespace fei
00252 
00253 #ifndef _fei_ostream_ops_hpp_
00254 #include <fei_ostream_ops.hpp>
00255 #endif
00256 
00257 #endif // _fei_Matrix_hpp_
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends