Thyra_VectorSpaceBase_decl.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_VECTOR_SPACE_BASE_DECL_HPP
00030 #define THYRA_VECTOR_SPACE_BASE_DECL_HPP
00031 
00032 #include "Thyra_OperatorVectorTypes.hpp"
00033 #include "Teuchos_Describable.hpp"
00034 
00035 
00036 namespace Thyra {
00037 
00038 
00044 template<class Scalar>
00045 RCP<const VectorSpaceBase<Scalar> >
00046 makeHaveOwnership( const RCP<const VectorSpaceBase<Scalar> > &vs );
00047 
00048 
00056 template<class Scalar>
00057 RCP< VectorBase<Scalar> >
00058 createMember(
00059   const RCP<const VectorSpaceBase<Scalar> > &vs,
00060   const std::string &label=""
00061   );
00062 
00063 
00068 template<class Scalar>
00069 RCP< VectorBase<Scalar> >
00070 createMember( const VectorSpaceBase<Scalar> &vs, const std::string &label="" );
00071 
00072 
00080 template<class Scalar>
00081 RCP< MultiVectorBase<Scalar> >
00082 createMembers(
00083   const RCP<const VectorSpaceBase<Scalar> > &vs, int numMembers,
00084   const std::string &label=""
00085   );
00086 
00087 
00092 template<class Scalar>
00093 RCP< MultiVectorBase<Scalar> >
00094 createMembers(
00095   const VectorSpaceBase<Scalar> &vs, int numMembers,
00096   const std::string &label=""
00097   );
00098 
00099 
00107 template<class Scalar>
00108 RCP<VectorBase<Scalar> >
00109 createMemberView(
00110   const RCP<const VectorSpaceBase<Scalar> > &vs,
00111   const RTOpPack::SubVectorView<Scalar> &raw_v,
00112   const std::string &label=""
00113   );
00114 
00115 
00120 template<class Scalar>
00121 RCP<VectorBase<Scalar> >
00122 createMemberView(
00123   const VectorSpaceBase<Scalar> &vs,
00124   const RTOpPack::SubVectorView<Scalar> &raw_v,
00125   const std::string &label=""
00126   );
00127 
00128 
00136 template<class Scalar>
00137 RCP<const VectorBase<Scalar> >
00138 createMemberView(
00139   const RCP<const VectorSpaceBase<Scalar> > &vs,
00140   const RTOpPack::ConstSubVectorView<Scalar> &raw_v,
00141   const std::string &label=""
00142   );
00143 
00144 
00149 template<class Scalar>
00150 RCP<const VectorBase<Scalar> >
00151 createMemberView(
00152   const VectorSpaceBase<Scalar> &vs,
00153   const RTOpPack::ConstSubVectorView<Scalar> &raw_v,
00154   const std::string &label=""
00155   );
00156 
00157 
00165 template<class Scalar>
00166 RCP<MultiVectorBase<Scalar> >
00167 createMembersView(
00168   const RCP<const VectorSpaceBase<Scalar> > &vs,
00169   const RTOpPack::SubMultiVectorView<Scalar> &raw_mv,
00170   const std::string &label=""
00171   );
00172 
00173 
00178 template<class Scalar>
00179 RCP<MultiVectorBase<Scalar> >
00180 createMembersView(
00181   const VectorSpaceBase<Scalar> &vs,
00182   const RTOpPack::SubMultiVectorView<Scalar> &raw_mv,
00183   const std::string &label=""
00184   );
00185 
00186 
00194 template<class Scalar>
00195 RCP<const MultiVectorBase<Scalar> >
00196 createMembersView(
00197   const RCP<const VectorSpaceBase<Scalar> > &vs,
00198   const RTOpPack::ConstSubMultiVectorView<Scalar> &raw_mv,
00199   const std::string &label=""
00200   );
00201 
00202 
00207 template<class Scalar>
00208 RCP<const MultiVectorBase<Scalar> >
00209 createMembersView(
00210   const VectorSpaceBase<Scalar> &vs,
00211   const RTOpPack::ConstSubMultiVectorView<Scalar> &raw_mv,
00212   const std::string &label=""
00213   );
00214 
00215 
00269 template<class Scalar>
00270 class VectorSpaceBase : virtual public Teuchos::Describable {
00271 public:
00272 
00275 
00281   virtual Index dim() const = 0;
00282 
00306   virtual bool isCompatible( const VectorSpaceBase<Scalar>& vecSpc ) const = 0;
00307 
00315   virtual RCP< const VectorSpaceFactoryBase<Scalar> > smallVecSpcFcty() const = 0;
00316 
00329   virtual Scalar scalarProd(
00330     const VectorBase<Scalar>& x, const VectorBase<Scalar>& y
00331     ) const = 0;
00332 
00358   void scalarProds(
00359     const MultiVectorBase<Scalar>& X, const MultiVectorBase<Scalar>& Y,
00360     const ArrayView<Scalar> &scalarProds_out
00361     ) const
00362     {
00363       scalarProdsImpl(X, Y, scalarProds_out);
00364     }
00365 
00367 
00370 
00377   virtual bool isEuclidean() const;
00378 
00423   virtual bool hasInCoreView(
00424     const Range1D &rng = Range1D(),
00425     const EViewType viewType = VIEW_TYPE_DETACHED,
00426     const EStrideType strideType = STRIDE_TYPE_NONUNIT
00427     ) const;
00428 
00440   virtual RCP< const VectorSpaceBase<Scalar> > clone() const;
00441 
00443 
00444 #ifndef DOXYGEN_COMPILE
00445 
00446 #ifndef TEMPLATE_FRIENDS_NOT_SUPPORTED
00447 
00450 
00451   friend RCP< VectorBase<Scalar> >
00452   createMember<>( 
00453     const RCP<const VectorSpaceBase<Scalar> > &vs,
00454     const std::string &label
00455     );
00456 
00457   friend RCP< MultiVectorBase<Scalar> >
00458   createMembers<>(
00459     const RCP<const VectorSpaceBase<Scalar> > &vs,
00460     int numMembers, const std::string &label
00461     );
00462 
00463   friend RCP<VectorBase<Scalar> >
00464   createMemberView<>(
00465     const RCP<const VectorSpaceBase<Scalar> > &vs,
00466     const RTOpPack::SubVectorView<Scalar> &raw_v,
00467     const std::string &label
00468     );
00469 
00470   friend RCP<const VectorBase<Scalar> >
00471   createMemberView<>(
00472     const RCP<const VectorSpaceBase<Scalar> > &vs,
00473     const RTOpPack::ConstSubVectorView<Scalar> &raw_v,
00474     const std::string &label
00475     );
00476 
00477   friend RCP<MultiVectorBase<Scalar> >
00478   createMembersView<>(
00479     const RCP<const VectorSpaceBase<Scalar> > &vs,
00480     const RTOpPack::SubMultiVectorView<Scalar> &raw_mv,
00481     const std::string &label
00482     );
00483 
00484   friend RCP<const MultiVectorBase<Scalar> >
00485   createMembersView<>(
00486     const RCP<const VectorSpaceBase<Scalar> > &vs,
00487     const RTOpPack::ConstSubMultiVectorView<Scalar> &raw_mv,
00488     const std::string &label
00489     );
00490 
00492 
00493 #endif // DOXYGEN_COMPILE
00494 
00495 #endif // TEMPLATE_FRIENDS_NOT_SUPPORTED
00496 
00497 #ifndef TEMPLATE_FRIENDS_NOT_SUPPORTED
00498 protected:
00499 #endif
00500 
00503 
00529   virtual RCP< VectorBase<Scalar> > createMember() const = 0;
00530 
00557   virtual RCP< MultiVectorBase<Scalar> >
00558   createMembers(int numMembers) const = 0;
00559 
00591   virtual RCP<VectorBase<Scalar> >
00592   createMemberView( const RTOpPack::SubVectorView<Scalar> &raw_v ) const = 0;
00593 
00615   virtual RCP<const VectorBase<Scalar> >
00616   createMemberView( const RTOpPack::ConstSubVectorView<Scalar> &raw_v ) const = 0;
00617 
00649   virtual RCP<MultiVectorBase<Scalar> >
00650   createMembersView( const RTOpPack::SubMultiVectorView<Scalar> &raw_mv ) const = 0;
00651 
00679   virtual RCP<const MultiVectorBase<Scalar> >
00680   createMembersView(
00681     const RTOpPack::ConstSubMultiVectorView<Scalar> &raw_mv ) const = 0;
00682 
00684 
00685 protected:
00686 
00690   virtual void scalarProdsImpl(
00691     const MultiVectorBase<Scalar>& X, const MultiVectorBase<Scalar>& Y,
00692     const ArrayView<Scalar> &scalarProds
00693     ) const = 0;
00694 
00695 public:
00696 
00699 
00701   void scalarProds(
00702     const MultiVectorBase<Scalar>& X, const MultiVectorBase<Scalar>& Y,
00703     Scalar scalarProds[]
00704     ) const;
00705 
00707 
00708 };
00709 
00710 
00711 } // end namespace Thyra
00712 
00713 
00714 #endif  // THYRA_VECTOR_SPACE_BASE_DECL_HPP

Generated on Wed May 12 21:26:35 2010 for Fundamental Thyra ANA Operator/Vector Interfaces by  doxygen 1.4.7