Thyra_DefaultMultiVectorProductVectorSpaceDecl.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_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 scalarProds( const MultiVectorBase<Scalar>& X, const MultiVectorBase<Scalar>& Y, Scalar scalar_prods[] ) const;
00147   bool hasInCoreView(const Range1D& rng, const EViewType viewType, const EStrideType strideType) const;
00149   RCP< const VectorSpaceFactoryBase<Scalar> > smallVecSpcFcty() const;
00158   RCP< MultiVectorBase<Scalar> > createMembers(int numMembers) const;
00160   RCP< const VectorSpaceBase<Scalar> > clone() const;
00161 
00163 
00166                                                 
00170   std::string description() const;
00171 
00179   void describe(
00180     Teuchos::FancyOStream &out,
00181     const Teuchos::EVerbosityLevel verbLevel
00182     ) const;
00183 
00185 
00186 private:
00187  
00188   // ///////////////////////////////////
00189   // Private data members
00190 
00191   RCP<const VectorSpaceBase<Scalar> > space_;
00192   int numColumns_;
00193   RCP<const DefaultProductVectorSpace<Scalar> > defaultProdVecSpc_;
00194 
00195   // ///////////////////////////////////
00196   // Private member functions
00197 
00198   void assertInitialized() const;
00199 
00200 };
00201 
00202 
00207 template<class Scalar>
00208 inline
00209 RCP<DefaultMultiVectorProductVectorSpace<Scalar> >
00210 multiVectorProductVectorSpace(
00211   const RCP<const VectorSpaceBase<Scalar> > &space,
00212   const int numColumns
00213   )
00214 {
00215   RCP<DefaultMultiVectorProductVectorSpace<Scalar> >
00216     multiVecProdVecSpace
00217     = Teuchos::rcp(new DefaultMultiVectorProductVectorSpace<Scalar>());
00218   multiVecProdVecSpace->initialize(space,numColumns);
00219   return multiVecProdVecSpace;
00220 }
00221 
00222 
00223 // /////////////////////////////////
00224 // Inline members
00225 
00226 
00227 template<class Scalar>
00228 inline
00229 RCP<const DefaultProductVectorSpace<Scalar> >
00230 DefaultMultiVectorProductVectorSpace<Scalar>::getDefaultProductVectorSpace() const
00231 {
00232   return defaultProdVecSpc_;
00233 }
00234 
00235 
00236 template<class Scalar>
00237 inline
00238 void DefaultMultiVectorProductVectorSpace<Scalar>::assertInitialized() const
00239 {
00240 #ifdef TEUCHOS_DEBUG
00241   TEST_FOR_EXCEPT( is_null(space_) );
00242 #endif
00243 }
00244 
00245 } // namespace Thyra
00246 
00247 #endif // THYRA_MULTI_VECTOR_PRODUCT_VECTOR_SPACE_DECL_HPP

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