|
Thyra Package Browser (Single Doxygen Collection) Version of the Day
|
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_DEFAULT_MULTI_VECTOR_PRODUCT_VECTOR_SPACE_DECL_HPP 00030 #define THYRA_DEFAULT_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 00083 void initialize( 00084 const RCP<const VectorSpaceBase<Scalar> > &space, 00085 const int numColumns 00086 ); 00087 00089 RCP<const DefaultProductVectorSpace<Scalar> > 00090 getDefaultProductVectorSpace() const; 00091 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 Ordinal 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 { 00215 return Teuchos::rcp(new DefaultMultiVectorProductVectorSpace<Scalar>()); 00216 } 00217 00218 00223 template<class Scalar> 00224 inline 00225 RCP<DefaultMultiVectorProductVectorSpace<Scalar> > 00226 multiVectorProductVectorSpace( 00227 const RCP<const VectorSpaceBase<Scalar> > &space, 00228 const int numColumns 00229 ) 00230 { 00231 RCP<DefaultMultiVectorProductVectorSpace<Scalar> > multiVecProdVecSpace = 00232 multiVectorProductVectorSpace<Scalar>(); 00233 multiVecProdVecSpace->initialize(space,numColumns); 00234 return multiVecProdVecSpace; 00235 } 00236 00237 00238 // ///////////////////////////////// 00239 // Inline members 00240 00241 00242 template<class Scalar> 00243 inline 00244 RCP<const DefaultProductVectorSpace<Scalar> > 00245 DefaultMultiVectorProductVectorSpace<Scalar>::getDefaultProductVectorSpace() const 00246 { 00247 return defaultProdVecSpc_; 00248 } 00249 00250 00251 template<class Scalar> 00252 inline 00253 void DefaultMultiVectorProductVectorSpace<Scalar>::assertInitialized() const 00254 { 00255 #ifdef TEUCHOS_DEBUG 00256 TEST_FOR_EXCEPT( is_null(space_) ); 00257 #endif 00258 } 00259 00260 00261 } // namespace Thyra 00262 00263 00264 #endif // THYRA_DEFAULT_MULTI_VECTOR_PRODUCT_VECTOR_SPACE_DECL_HPP
1.7.4