FEI  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
fei_MatrixTraits.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_MatrixTraits_hpp_
10 #define _fei_MatrixTraits_hpp_
11 
12 #include <fei_macros.hpp>
13 
14 namespace fei {
15  class Vector;
16 
44  template<typename T>
45  struct MatrixTraits {
46 
51  static const char* typeName()
52  { return("unsupported"); }
53 
54  static double* getBeginPointer(T* /*mat*/)
55  {
56  return NULL;
57  }
58 
59  static int getOffset(T* /*mat*/, int /*row*/, int /*col*/)
60  {
61  return -1;
62  }
63 
66  static int setValues(T* mat, double scalar)
67  { return(-1); }
68 
72  static int getNumLocalRows(T* mat, int& numRows)
73  { return(-1); }
74 
78  static int getRowLength(T* mat, int row, int& length)
79  { return(-1); }
80 
93  static int copyOutRow(T* mat,
94  int row, int len, double* coefs, int* indices)
95  { return(-1); }
96 
101  static int putValuesIn(T* mat,
102  int numRows, const int* rows,
103  int numCols, const int* cols,
104  const double* const* values,
105  bool sum_into)
106  { return(-1); }
107 
114  static int globalAssemble(T* A)
115  { return(0); }
116 
120  static int matvec(T* A, fei::Vector* x, fei::Vector* y)
121  { return(-1); }
122  };//struct MatrixTraits
123 
124 }//namespace fei
125 
126 #endif // _fei_MatrixTraits_hpp_
127 
static const char * typeName()
static int matvec(T *A, fei::Vector *x, fei::Vector *y)
static int getRowLength(T *mat, int row, int &length)
static int getNumLocalRows(T *mat, int &numRows)
static int setValues(T *mat, double scalar)
static int copyOutRow(T *mat, int row, int len, double *coefs, int *indices)
static int putValuesIn(T *mat, int numRows, const int *rows, int numCols, const int *cols, const double *const *values, bool sum_into)
static int globalAssemble(T *A)