Thyra_DefaultMultiVectorProductVectorSpaceDecl.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_MULTI_VECTOR_PRODUCT_VECTOR_SPACE_DECL_HPP
00030 #define THYRA_MULTI_VECTOR_PRODUCT_VECTOR_SPACE_DECL_HPP
00031 
00032 #include "Thyra_ProductVectorSpaceBase.hpp" // Interface
00033 #include "Thyra_DefaultProductVectorSpace.hpp" // Implementation
00034 #include "Thyra_VectorSpaceDefaultBase.hpp"
00035 
00036 
00037 namespace Thyra {
00038 
00039 
00051 template<class Scalar>
00052 class DefaultMultiVectorProductVectorSpace
00053   : virtual public ProductVectorSpaceBase<Scalar>
00054   , virtual protected VectorSpaceDefaultBase<Scalar>
00055 {
00056 public:
00057 
00060 
00062   DefaultMultiVectorProductVectorSpace();
00063   
00084   void initialize(
00085     const RCP<const VectorSpaceBase<Scalar> > &space,
00086     const int numColumns
00087     );
00088 
00090   RCP<const DefaultProductVectorSpace<Scalar> >
00091   getDefaultProductVectorSpace() const;
00092 
00112   void uninitialize(
00113     RCP<const VectorSpaceBase<Scalar> > *space = 0,
00114     int *numColumns = 0
00115     );
00116     
00118     
00121     
00123   int numBlocks() const;
00125   RCP<const VectorSpaceBase<Scalar> > getBlock(const int k) const; 
00126 
00128 
00131 
00133   Index dim() const;
00135   bool isCompatible( const VectorSpaceBase<Scalar>& vecSpc ) const;
00137   RCP< VectorBase<Scalar> > createMember() const;
00139   Scalar scalarProd( const VectorBase<Scalar>& x, const VectorBase<Scalar>& y ) const;
00143   void scalarProdsImpl(
00144     const MultiVectorBase<Scalar>& X, const MultiVectorBase<Scalar>& Y,
00145     const ArrayView<Scalar> &scalarProds ) const;
00149   bool hasInCoreView( const Range1D& rng, const EViewType viewType,
00150     const EStrideType strideType ) const;
00152   RCP< const VectorSpaceFactoryBase<Scalar> > smallVecSpcFcty() const;
00161   RCP< MultiVectorBase<Scalar> > createMembers(int numMembers) const;
00163   RCP< const VectorSpaceBase<Scalar> > clone() const;
00164 
00166 
00169                                                 
00173   std::string description() const;
00174 
00182   void describe(
00183     Teuchos::FancyOStream &out,
00184     const Teuchos::EVerbosityLevel verbLevel
00185     ) const;
00186 
00188 
00189 private:
00190  
00191   // ///////////////////////////////////
00192   // Private data members
00193 
00194   RCP<const VectorSpaceBase<Scalar> > space_;
00195   int numColumns_;
00196   RCP<const DefaultProductVectorSpace<Scalar> > defaultProdVecSpc_;
00197 
00198   // ///////////////////////////////////
00199   // Private member functions
00200 
00201   void assertInitialized() const;
00202 
00203 };
00204 
00205 
00210 template<class Scalar>
00211 inline
00212 RCP<DefaultMultiVectorProductVectorSpace<Scalar> >
00213 multiVectorProductVectorSpace(
00214   const RCP<const VectorSpaceBase<Scalar> > &space,
00215   const int numColumns
00216   )
00217 {
00218   RCP<DefaultMultiVectorProductVectorSpace<Scalar> >
00219     multiVecProdVecSpace
00220     = Teuchos::rcp(new DefaultMultiVectorProductVectorSpace<Scalar>());
00221   multiVecProdVecSpace->initialize(space,numColumns);
00222   return multiVecProdVecSpace;
00223 }
00224 
00225 
00226 // /////////////////////////////////
00227 // Inline members
00228 
00229 
00230 template<class Scalar>
00231 inline
00232 RCP<const DefaultProductVectorSpace<Scalar> >
00233 DefaultMultiVectorProductVectorSpace<Scalar>::getDefaultProductVectorSpace() const
00234 {
00235   return defaultProdVecSpc_;
00236 }
00237 
00238 
00239 template<class Scalar>
00240 inline
00241 void DefaultMultiVectorProductVectorSpace<Scalar>::assertInitialized() const
00242 {
00243 #ifdef TEUCHOS_DEBUG
00244   TEST_FOR_EXCEPT( is_null(space_) );
00245 #endif
00246 }
00247 
00248 } // namespace Thyra
00249 
00250 #endif // THYRA_MULTI_VECTOR_PRODUCT_VECTOR_SPACE_DECL_HPP

Generated on Wed May 12 21:26:54 2010 for Thyra Operator/Vector Support by  doxygen 1.4.7