fei_Vector.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_Vector_hpp_
00010 #define _fei_Vector_hpp_
00011 
00012 #include <fei_iosfwd.hpp>
00013 #include <fei_SharedPtr.hpp>
00014 #include <fei_Reducer.hpp>
00015 
00016 namespace fei {
00057   class Vector {
00058   public:
00060     class Factory {
00061     public:
00063       virtual ~Factory(){}
00064 
00066       virtual fei::SharedPtr<fei::Vector>
00067   createVector(fei::SharedPtr<fei::VectorSpace> vecSpace,
00068          int numVectors=1) = 0;
00069 
00071       virtual fei::SharedPtr<fei::Vector>
00072   createVector(fei::SharedPtr<fei::VectorSpace> vecSpace,
00073          bool isSolutionVector,
00074          int numVectors=1) = 0;
00075 
00077       virtual fei::SharedPtr<fei::Vector>
00078   createVector(fei::SharedPtr<fei::MatrixGraph> matrixGraph,
00079          int numVectors=1) = 0;
00080 
00082       virtual fei::SharedPtr<fei::Vector>
00083   createVector(fei::SharedPtr<fei::MatrixGraph> matrixGraph,
00084          bool isSolutionVector,
00085          int numVectors=1) = 0;
00086     };
00087 
00089     virtual ~Vector(){}
00090 
00094     virtual const char* typeName() const = 0;
00095 
00097     virtual int putScalar(double scalar) = 0;
00098 
00102     virtual int sumIn(int numValues, const int* indices, const double* values,
00103           int vectorIndex=0) = 0;
00104 
00108     virtual int copyIn(int numValues, const int* indices, const double* values,
00109            int vectorIndex=0) = 0;
00110 
00116     virtual int copyOut(int numValues, const int* indices, double* values,
00117       int vectorIndex=0) const = 0;
00118 
00121     virtual int update(double a,
00122            const fei::Vector* x,
00123            double b) = 0;
00124 
00129     virtual int scatterToOverlap() = 0;
00130 
00134     virtual int gatherFromOverlap(bool accumulate = true) = 0;
00135 
00137     virtual fei::SharedPtr<fei::VectorSpace> getVectorSpace() const = 0;
00138 
00140     virtual void setVectorSpace(fei::SharedPtr<fei::VectorSpace> vecSpace) = 0;
00141 
00148     virtual int sumInFieldData(int fieldID,
00149              int idType,
00150              int numIDs,
00151              const int* IDs,
00152              const double* data,
00153              int vectorIndex=0) = 0;
00154 
00161     virtual int copyInFieldData(int fieldID,
00162         int idType,
00163         int numIDs,
00164         const int* IDs,
00165         const double* data,
00166         int vectorIndex=0) = 0;
00167 
00173     virtual int copyOutFieldData(int fieldID,
00174          int idType,
00175          int numIDs,
00176          const int* IDs,
00177          double* data,
00178          int vectorIndex=0) = 0;
00179 
00193     virtual int writeToFile(const char* filename,
00194           bool matrixMarketFormat=true) = 0;
00195 
00207     virtual int writeToStream(FEI_OSTREAM& ostrm,
00208             bool matrixMarketFormat=true) = 0;
00209 
00210   };//class Vector
00211 }//namespace fei
00212 
00213 #ifndef _fei_ostream_ops_hpp_
00214 #include <fei_ostream_ops.hpp>
00215 #endif
00216 
00217 #endif // _fei_Vector_hpp_
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends
Generated on Wed Apr 13 10:08:24 2011 for FEI by  doxygen 1.6.3