Thyra Package Browser (Single Doxygen Collection) Version of the Day
Thyra_VectorDefaultBase_decl.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_VectorBase.hpp"
00033 #include "Thyra_MultiVectorDefaultBase_decl.hpp"
00034 
00035 
00036 namespace Thyra {
00037 
00038 
00059 template<class Scalar>
00060 class VectorDefaultBase
00061   : virtual public VectorBase<Scalar>,
00062     virtual protected MultiVectorDefaultBase<Scalar>
00063 {
00064 public:
00065 
00068 
00070   virtual std::string description() const;
00071 
00094   virtual void describe(
00095     Teuchos::FancyOStream                &out
00096     ,const Teuchos::EVerbosityLevel      verbLevel
00097     ) const;
00098 
00100 
00103 
00105   virtual RCP< const VectorSpaceBase<Scalar> > range() const;
00109   virtual RCP< const VectorSpaceBase<Scalar> > domain() const;
00110 
00112 
00115 
00117   RCP<MultiVectorBase<Scalar> > clone_mv() const;
00118 
00120 
00123 
00127   RCP<VectorBase<Scalar> > clone_v() const;
00128 
00130 
00131 protected:
00132 
00135 
00137   virtual RCP<VectorBase<Scalar> > nonconstColImpl(Ordinal j);
00139   virtual RCP<const MultiVectorBase<Scalar> >
00140   contigSubViewImpl( const Range1D& col_rng ) const;
00142   virtual RCP<MultiVectorBase<Scalar> >
00143   nonconstContigSubViewImpl( const Range1D& col_rng );
00145   virtual RCP<const MultiVectorBase<Scalar> >
00146   nonContigSubViewImpl( const ArrayView<const int> &cols ) const;
00148   virtual RCP<MultiVectorBase<Scalar> >
00149   nonconstNonContigSubViewImpl( const ArrayView<const int> &cols );
00151   virtual void acquireDetachedMultiVectorViewImpl(
00152     const Range1D &rowRng,
00153     const Range1D &colRng,
00154     RTOpPack::ConstSubMultiVectorView<Scalar> *sub_mv
00155     ) const;
00157   virtual void releaseDetachedMultiVectorViewImpl(
00158     RTOpPack::ConstSubMultiVectorView<Scalar>* sub_mv
00159     ) const;
00161   virtual void acquireNonconstDetachedMultiVectorViewImpl(
00162     const Range1D &rowRng,
00163     const Range1D &colRng,
00164     RTOpPack::SubMultiVectorView<Scalar> *sub_mv
00165     );
00167   virtual void commitNonconstDetachedMultiVectorViewImpl(
00168     RTOpPack::SubMultiVectorView<Scalar>* sub_mv
00169     );
00170 
00172 
00175 
00190   virtual void acquireDetachedVectorViewImpl(
00191     const Range1D& rng, RTOpPack::ConstSubVectorView<Scalar>* sub_vec
00192     ) const;
00200   virtual void releaseDetachedVectorViewImpl(
00201     RTOpPack::ConstSubVectorView<Scalar>* sub_vec
00202     ) const;
00216   virtual void acquireNonconstDetachedVectorViewImpl(
00217     const Range1D& rng, RTOpPack::SubVectorView<Scalar>* sub_vec
00218     );
00225   virtual void commitNonconstDetachedVectorViewImpl(
00226     RTOpPack::SubVectorView<Scalar>* sub_vec
00227     );
00237   virtual void setSubVectorImpl( const RTOpPack::SparseSubVectorT<Scalar>& sub_vec );
00238 
00240 
00243 
00248   bool opSupportedImpl(EOpTransp M_trans) const;
00249 
00253   void applyImpl(
00254     const EOpTransp M_trans,
00255     const MultiVectorBase<Scalar> &X,
00256     const Ptr<MultiVectorBase<Scalar> > &Y,
00257     const Scalar alpha,
00258     const Scalar beta
00259     ) const;
00260 
00262 
00263 private:
00264 
00265   // /////////////////////////////////////
00266   // Private data members
00267 
00268   mutable RCP<const VectorSpaceBase<Scalar> > domain_;
00269   // Above only initialized if *this is used as a MultiVectorBase
00270 
00271   // /////////////////////////////////////
00272   // Private member functions
00273 
00274   void validateColRng( const Range1D &rowRng ) const;
00275   void validateColIndexes( const ArrayView<const int> &cols ) const;
00276 
00277 };
00278 
00279 
00280 } // end namespace Thyra
00281 
00282 
00283 #endif  // THYRA_VECTOR_DEFAULT_BASE_DECL_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines