FEI  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
fei_Matrix.hpp
1 /*--------------------------------------------------------------------*/
2 /* Copyright 2005 Sandia Corporation. */
3 /* Under the terms of Contract DE-AC04-94AL85000, there is a */
4 /* non-exclusive license for use of this work by or on behalf */
5 /* of the U.S. Government. Export of this program may require */
6 /* a license from the United States Government. */
7 /*--------------------------------------------------------------------*/
8 
9 #ifndef _fei_Matrix_hpp_
10 #define _fei_Matrix_hpp_
11 
12 #include "fei_iosfwd.hpp"
13 #include "fei_SharedPtr.hpp"
14 #include "fei_MatrixGraph.hpp"
15 #include "fei_defs.h"
16 
17 namespace fei {
30  class Matrix {
31  public:
33  class Factory {
34  public:
36  virtual ~Factory(){}
37 
41  };
42 
44  virtual ~Matrix(){}
45 
49  virtual const char* typeName() = 0;
50 
53  virtual int parameters(const fei::ParameterSet& paramset) = 0;
54 
57 
59  virtual void setMatrixGraph(fei::SharedPtr<fei::MatrixGraph> matrixGraph) = 0;
60 
63  virtual int getGlobalNumRows() const = 0;
64 
67  virtual int getLocalNumRows() const = 0;
68 
74  virtual int getRowLength(int row, int& length) const = 0;
75 
77  virtual int putScalar(double scalar) = 0;
78 
88  virtual int copyOutRow(int row, int len, double* coefs, int* indices) const = 0;
89 
102  virtual int sumIn(int numRows, const int* rows,
103  int numCols, const int* cols,
104  const double* const* values,
105  int format=0) = 0;
106 
119  virtual int copyIn(int numRows, const int* rows,
120  int numCols, const int* cols,
121  const double* const* values,
122  int format=0) = 0;
123 
139  virtual int sumInFieldData(int fieldID,
140  int idType,
141  int rowID,
142  int colID,
143  const double* const* data,
144  int format=0) = 0;
145 
163  virtual int sumInFieldData(int fieldID,
164  int idType,
165  int rowID,
166  int colID,
167  const double* data,
168  int format=0) = 0;
169 
179  virtual int sumIn(int blockID, int connectivityID,
180  const double* const* values,
181  int format=0) = 0;
182 
187  virtual int globalAssemble() = 0;
188 
191  virtual int multiply(fei::Vector* x,
192  fei::Vector* y) = 0;
193 
199  virtual void setCommSizes() = 0;
200 
206  virtual int gatherFromOverlap(bool accumulate = true) = 0;
207 
223  virtual int writeToFile(const char* filename,
224  bool matrixMarketFormat=true) = 0;
225 
238  virtual int writeToStream(FEI_OSTREAM& ostrm,
239  bool matrixMarketFormat=true) = 0;
240 
243  virtual bool usingBlockEntryStorage() = 0;
244 
249  virtual void markState() = 0;
250 
255  virtual bool changedSinceMark() = 0;
256 
257  virtual double* getBeginPointer() { return NULL; }
258  virtual int getOffset(int row, int col) { return -1; }
259 
260  };//class Matrix
261 }//namespace fei
262 
263 #ifndef _fei_ostream_ops_hpp_
264 #include <fei_ostream_ops.hpp>
265 #endif
266 
267 #endif // _fei_Matrix_hpp_
virtual int multiply(fei::Vector *x, fei::Vector *y)=0
virtual const char * typeName()=0
virtual bool usingBlockEntryStorage()=0
virtual void setMatrixGraph(fei::SharedPtr< fei::MatrixGraph > matrixGraph)=0
virtual void markState()=0
virtual void setCommSizes()=0
virtual int writeToFile(const char *filename, bool matrixMarketFormat=true)=0
virtual int sumIn(int numRows, const int *rows, int numCols, const int *cols, const double *const *values, int format=0)=0
virtual int getRowLength(int row, int &length) const =0
virtual int sumInFieldData(int fieldID, int idType, int rowID, int colID, const double *const *data, int format=0)=0
virtual fei::SharedPtr< fei::MatrixGraph > getMatrixGraph() const =0
virtual bool changedSinceMark()=0
virtual int getGlobalNumRows() const =0
virtual int globalAssemble()=0
virtual int copyIn(int numRows, const int *rows, int numCols, const int *cols, const double *const *values, int format=0)=0
virtual fei::SharedPtr< fei::Matrix > createMatrix(fei::SharedPtr< fei::MatrixGraph > matrixGraph)=0
virtual int gatherFromOverlap(bool accumulate=true)=0
virtual int putScalar(double scalar)=0
virtual ~Matrix()
Definition: fei_Matrix.hpp:44
virtual int getLocalNumRows() const =0
virtual int parameters(const fei::ParameterSet &paramset)=0
virtual int copyOutRow(int row, int len, double *coefs, int *indices) const =0
virtual int writeToStream(FEI_OSTREAM &ostrm, bool matrixMarketFormat=true)=0