Thyra_VectorSpaceBaseDecl.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 
00267 template<class Scalar>
00268 class VectorSpaceBase : virtual public Teuchos::Describable {
00269 public:
00270 
00273 
00279   virtual Index dim() const = 0;
00280 
00299   virtual bool isCompatible( const VectorSpaceBase<Scalar>& vecSpc ) const = 0;
00300 
00308   virtual RCP< const VectorSpaceFactoryBase<Scalar> > smallVecSpcFcty() const = 0;
00309 
00317   virtual Scalar scalarProd(
00318     const VectorBase<Scalar>& x, const VectorBase<Scalar>& y
00319     ) const = 0;
00320 
00335   virtual void scalarProds(
00336     const MultiVectorBase<Scalar>& X,
00337     const MultiVectorBase<Scalar>& Y, Scalar scalar_prods[]
00338     ) const = 0;
00339 
00341 
00344 
00351   virtual bool isEuclidean() const;
00352 
00387   virtual bool hasInCoreView(
00388     const Range1D &rng = Range1D(),
00389     const EViewType viewType = VIEW_TYPE_DETACHED,
00390     const EStrideType strideType = STRIDE_TYPE_NONUNIT
00391     ) const;
00392 
00404   virtual RCP< const VectorSpaceBase<Scalar> > clone() const;
00405 
00407 
00408 #ifndef DOXYGEN_COMPILE
00409 
00410 #ifndef TEMPLATE_FRIENDS_NOT_SUPPORTED
00411 
00414 
00415   friend RCP< VectorBase<Scalar> >
00416   createMember<>( 
00417     const RCP<const VectorSpaceBase<Scalar> > &vs,
00418     const std::string &label
00419     );
00420 
00421   friend RCP< MultiVectorBase<Scalar> >
00422   createMembers<>(
00423     const RCP<const VectorSpaceBase<Scalar> > &vs,
00424     int numMembers, const std::string &label
00425     );
00426 
00427   friend RCP<VectorBase<Scalar> >
00428   createMemberView<>(
00429     const RCP<const VectorSpaceBase<Scalar> > &vs,
00430     const RTOpPack::SubVectorView<Scalar> &raw_v,
00431     const std::string &label
00432     );
00433 
00434   friend RCP<const VectorBase<Scalar> >
00435   createMemberView<>(
00436     const RCP<const VectorSpaceBase<Scalar> > &vs,
00437     const RTOpPack::ConstSubVectorView<Scalar> &raw_v,
00438     const std::string &label
00439     );
00440 
00441   friend RCP<MultiVectorBase<Scalar> >
00442   createMembersView<>(
00443     const RCP<const VectorSpaceBase<Scalar> > &vs,
00444     const RTOpPack::SubMultiVectorView<Scalar> &raw_mv,
00445     const std::string &label
00446     );
00447 
00448   friend RCP<const MultiVectorBase<Scalar> >
00449   createMembersView<>(
00450     const RCP<const VectorSpaceBase<Scalar> > &vs,
00451     const RTOpPack::ConstSubMultiVectorView<Scalar> &raw_mv,
00452     const std::string &label
00453     );
00454 
00456 
00457 #endif // DOXYGEN_COMPILE
00458 
00459 #endif // TEMPLATE_FRIENDS_NOT_SUPPORTED
00460 
00461 #ifndef TEMPLATE_FRIENDS_NOT_SUPPORTED
00462 protected:
00463 #endif
00464 
00467 
00488   virtual RCP< VectorBase<Scalar> > createMember() const = 0;
00489 
00509   virtual RCP< MultiVectorBase<Scalar> >
00510   createMembers(int numMembers) const = 0;
00511 
00537   virtual RCP<VectorBase<Scalar> >
00538   createMemberView( const RTOpPack::SubVectorView<Scalar> &raw_v ) const = 0;
00539 
00560   virtual RCP<const VectorBase<Scalar> >
00561   createMemberView( const RTOpPack::ConstSubVectorView<Scalar> &raw_v ) const = 0;
00562 
00586   virtual RCP<MultiVectorBase<Scalar> >
00587   createMembersView( const RTOpPack::SubMultiVectorView<Scalar> &raw_mv ) const = 0;
00588 
00609   virtual RCP<const MultiVectorBase<Scalar> >
00610   createMembersView( const RTOpPack::ConstSubMultiVectorView<Scalar> &raw_mv ) const = 0;
00611 
00613 
00614 }; // end class VectorSpaceBase
00615 
00616 } // end namespace Thyra
00617 
00618 #endif  // THYRA_VECTOR_SPACE_BASE_DECL_HPP

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