Thyra_VectorDefaultBaseDecl.hpp

Go to the documentation of this file.
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_DEFAULT_BASE_DECL_HPP
00030 #define THYRA_VECTOR_DEFAULT_BASE_DECL_HPP
00031 
00032 #include "Thyra_VectorBaseDecl.hpp"
00033 #include "Thyra_MultiVectorDefaultBaseDecl.hpp"
00034 #include "Thyra_SingleRhsLinearOpBaseDecl.hpp"
00035 
00036 namespace Thyra {
00037 
00062 template<class Scalar>
00063 class VectorDefaultBase
00064   : virtual public VectorBase<Scalar>
00065   , virtual protected MultiVectorDefaultBase<Scalar>
00066   , virtual protected SingleRhsLinearOpBase<Scalar>
00067 {
00068 public:
00069 
00071   using MultiVectorDefaultBase<Scalar>::col;
00073   using SingleRhsLinearOpBase<Scalar>::apply;
00074 
00077 
00079   std::string description() const;
00080 
00103   void describe(
00104     Teuchos::FancyOStream                &out
00105     ,const Teuchos::EVerbosityLevel      verbLevel
00106     ) const;
00107 
00109 
00112 
00113   Teuchos::RCP< const VectorSpaceBase<Scalar> > range() const;
00115   Teuchos::RCP< const VectorSpaceBase<Scalar> > domain() const;
00117 
00120 
00121   Teuchos::RCP<VectorBase<Scalar> > col(Index j);
00123   Teuchos::RCP<MultiVectorBase<Scalar> > clone_mv() const;
00125   Teuchos::RCP<const MultiVectorBase<Scalar> > subView( const Range1D& col_rng ) const;
00127   Teuchos::RCP<MultiVectorBase<Scalar> > subView( const Range1D& col_rng );
00129   Teuchos::RCP<const MultiVectorBase<Scalar> > subView( const int numCols, const int cols[] ) const;
00131   Teuchos::RCP<MultiVectorBase<Scalar> > subView( const int numCols, const int cols[] );
00133   void acquireDetachedMultiVectorViewImpl(
00134     const Range1D &rowRng,
00135     const Range1D &colRng,
00136     RTOpPack::ConstSubMultiVectorView<Scalar> *sub_mv
00137     ) const;
00139   void releaseDetachedMultiVectorViewImpl(
00140     RTOpPack::ConstSubMultiVectorView<Scalar>* sub_mv
00141     ) const;
00143   void acquireNonconstDetachedMultiVectorViewImpl(
00144     const Range1D &rowRng,
00145     const Range1D &colRng,
00146     RTOpPack::SubMultiVectorView<Scalar> *sub_mv
00147     );
00149   void commitNonconstDetachedMultiVectorViewImpl(
00150     RTOpPack::SubMultiVectorView<Scalar>* sub_mv
00151     );
00153 
00156 
00158   Teuchos::RCP<VectorBase<Scalar> > clone_v() const;
00173   virtual void acquireDetachedVectorViewImpl(
00174     const Range1D& rng, RTOpPack::ConstSubVectorView<Scalar>* sub_vec
00175     ) const;
00183   virtual void releaseDetachedVectorViewImpl(
00184     RTOpPack::ConstSubVectorView<Scalar>* sub_vec
00185     ) const;
00199   virtual void acquireNonconstDetachedVectorViewImpl(
00200     const Range1D& rng, RTOpPack::SubVectorView<Scalar>* sub_vec
00201     );
00208   virtual void commitNonconstDetachedVectorViewImpl(
00209     RTOpPack::SubVectorView<Scalar>* sub_vec
00210     );
00220   virtual void setSubVector( const RTOpPack::SparseSubVectorT<Scalar>& sub_vec );
00221 
00223 
00224 protected:
00225 
00228 
00233   bool opSupported(ETransp M_trans) const;
00234 
00236   void apply(
00237     const ETransp M_trans,
00238     const VectorBase<Scalar> &x,
00239     VectorBase<Scalar> *y,
00240     const Scalar alpha,
00241     const Scalar beta
00242     ) const;
00243 
00245 
00246 private:
00247 
00248   // /////////////////////////////////////
00249   // Private data members
00250 
00251   Teuchos::RCP<VectorSpaceBase<Scalar> >  domain_; // Only initialized if *this is used as a MultiVectorBase
00252 
00253   // /////////////////////////////////////
00254   // Private member functions
00255 
00256   void validateColRng( const Range1D &rowRng ) const;
00257   void validateColIndexes(  const int numCols, const int cols[] ) const;
00258 
00259 };
00260 
00261 } // end namespace Thyra
00262 
00263 #endif  // THYRA_VECTOR_DEFAULT_BASE_DECL_HPP

Generated on Tue Oct 20 12:47:27 2009 for Thyra Package Browser (Single Doxygen Collection) by doxygen 1.4.7