FEI Version of the Day
fei_MatrixTraits.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_MatrixTraits_hpp_
00010 #define _fei_MatrixTraits_hpp_
00011 
00012 #include <fei_macros.hpp>
00013 
00014 namespace fei {
00015   class Vector;
00016 
00044   template<typename T>
00045   struct MatrixTraits {
00046 
00051     static const char* typeName()
00052       { return("unsupported"); }
00053 
00054     static double* getBeginPointer(T* /*mat*/)
00055       {
00056         return NULL;
00057       }
00058 
00059     static int getOffset(T* /*mat*/, int /*row*/, int /*col*/)
00060       {
00061         return -1;
00062       }
00063 
00066     static int setValues(T* mat, double scalar)
00067       { return(-1); }
00068 
00072     static int getNumLocalRows(T* mat, int& numRows)
00073       { return(-1); }
00074 
00078     static int getRowLength(T* mat, int row, int& length)
00079       { return(-1); }
00080 
00093     static int copyOutRow(T* mat,
00094           int row, int len, double* coefs, int* indices)
00095       { return(-1); }
00096 
00101     static int putValuesIn(T* mat,
00102                            int numRows, const int* rows,
00103                            int numCols, const int* cols,
00104                            const double* const* values,
00105                            bool sum_into)
00106       { return(-1); }
00107 
00114     static int globalAssemble(T* A)
00115     { return(0); }
00116 
00120     static int matvec(T* A, fei::Vector* x, fei::Vector* y)
00121     { return(-1); }
00122   };//struct MatrixTraits
00123 
00124 }//namespace fei
00125 
00126 #endif // _fei_MatrixTraits_hpp_
00127 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends