00001 /* @HEADER@ */ 00002 00003 /* @HEADER@ */ 00004 00005 #ifndef Playa_MULTI_VECTOR_OPERATOR_DECL_HPP 00006 #define Playa_MULTI_VECTOR_OPERATOR_DECL_HPP 00007 00008 #include "PlayaDefs.hpp" 00009 #include "PlayaRowAccessibleOp.hpp" 00010 #include "PlayaLinearOpWithSpacesDecl.hpp" 00011 #include "PlayaLinearOperatorDecl.hpp" 00012 #include "PlayaHandleable.hpp" 00013 #include "Teuchos_RefCountPtr.hpp" 00014 #include "PlayaVectorDecl.hpp" 00015 00016 namespace Playa 00017 { 00018 /** 00019 * A MultiVectorOperator is a linear operator whose 00020 * rows or columns are represented as a multivector 00021 */ 00022 template <class Scalar> 00023 class MultiVectorOperator 00024 : public LinearOpWithSpaces<Scalar>, 00025 public RowAccessibleOp<Scalar> 00026 { 00027 public: 00028 00029 /** 00030 * Construct from an array of vectors and a specifier for the 00031 * domain space. 00032 */ 00033 MultiVectorOperator(const Teuchos::Array<Vector<Scalar> >& cols, 00034 const VectorSpace<Scalar>& domain); 00035 00036 /** Virtual dtor */ 00037 virtual ~MultiVectorOperator(){;} 00038 00039 00040 /** 00041 * Apply does an element-by-element multiply between the input 00042 * vector, x, and the diagonal values. 00043 */ 00044 virtual void apply( 00045 Teuchos::ETransp transType, 00046 const Vector<Scalar>& in, 00047 Vector<Scalar> out) const ; 00048 00049 00050 /** Return the kth row */ 00051 void getRow(const int& k, 00052 Teuchos::Array<int>& indices, 00053 Teuchos::Array<Scalar>& values) const ; 00054 00055 private: 00056 00057 Teuchos::Array<Vector<Scalar> > cols_; 00058 }; 00059 00060 /** \relates MultiVectorOperator */ 00061 template <class Scalar> 00062 LinearOperator<Scalar> multiVectorOperator( 00063 const Teuchos::Array<Vector<Scalar> >& cols, 00064 const VectorSpace<Scalar>& domain); 00065 00066 00067 } 00068 00069 #endif