Thyra_SerialVectorBaseDecl.hpp

00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 //    Thyra: Interfaces and Support for Abstract Numerical Algorithms
00005 //                 Copyright (2004) Sandia Corporation
00006 // 
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 // 
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //  
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //  
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00025 // 
00026 // ***********************************************************************
00027 // @HEADER
00028 
00029 #ifndef THYRA_VECTOR_SERIAL_BASE_DECL_HPP
00030 #define THYRA_VECTOR_SERIAL_BASE_DECL_HPP
00031 
00032 #include "Thyra_VectorDefaultBase.hpp"
00033 
00034 namespace Thyra {
00035 
00054 template<class Scalar>
00055 class SerialVectorBase : virtual public VectorDefaultBase<Scalar> {
00056 public:
00057 
00059   using VectorDefaultBase<Scalar>::describe;
00061   using VectorDefaultBase<Scalar>::applyOp;
00062 
00065 
00067   SerialVectorBase();
00068 
00070 
00073 
00095   virtual void getData( Scalar** values, Index* stride ) = 0;
00096 
00113   virtual void commitData( Scalar** values ) = 0;
00114 
00116 
00119 
00147   virtual void getData( const Scalar** values, Index* stride ) const;
00148 
00171   virtual void freeData( const Scalar** values ) const;
00172 
00174 
00177 
00187   void applyOp(
00188     const RTOpPack::RTOpT<Scalar>   &op
00189     ,const int                      num_vecs
00190     ,const VectorBase<Scalar>*      vecs[]
00191     ,const int                      num_targ_vecs
00192     ,VectorBase<Scalar>*            targ_vecs[]
00193     ,RTOpPack::ReductTarget         *reduct_obj
00194     ,const Index                    first_ele
00195     ,const Index                    sub_dim
00196     ,const Index                    global_offset
00197     ) const;
00199   void getSubVector( const Range1D& rng, RTOpPack::SubVectorT<Scalar>* sub_vec ) const;
00201   void freeSubVector( RTOpPack::SubVectorT<Scalar>* sub_vec ) const;
00203   void getSubVector( const Range1D& rng, RTOpPack::MutableSubVectorT<Scalar>* sub_vec );
00205   void commitSubVector( RTOpPack::MutableSubVectorT<Scalar>* sub_vec );
00207   void setSubVector( const RTOpPack::SparseSubVectorT<Scalar>& sub_vec );
00208 
00210 
00211 private:
00212 
00213   // ///////////////////////////////////////
00214   // Private data members
00215   
00216   mutable bool   in_applyOp_;
00217 
00218 }; // end class SerialVectorBase
00219 
00220 } // end namespace Thyra
00221 
00222 #endif // THYRA_VECTOR_SERIAL_BASE_DECL_HPP

Generated on Thu Sep 18 12:39:52 2008 for Thyra ANA Operator/VectorBase Interfaces and Related Software by doxygen 1.3.9.1