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 namespace Thyra {
00036 
00048 
00049 
00055 template<class Scalar>
00056 Teuchos::RefCountPtr<const VectorSpaceBase<Scalar> >
00057 makeHaveOwnership( const Teuchos::RefCountPtr<const VectorSpaceBase<Scalar> > &vs );
00058 
00065 template<class Scalar>
00066 Teuchos::RefCountPtr< VectorBase<Scalar> >
00067 createMember( const Teuchos::RefCountPtr<const VectorSpaceBase<Scalar> > &vs );
00068 
00072 template<class Scalar>
00073 Teuchos::RefCountPtr< VectorBase<Scalar> >
00074 createMember( const VectorSpaceBase<Scalar> &vs );
00075 
00082 template<class Scalar>
00083 Teuchos::RefCountPtr< MultiVectorBase<Scalar> >
00084 createMembers( const Teuchos::RefCountPtr<const VectorSpaceBase<Scalar> > &vs, int numMembers );
00085 
00089 template<class Scalar>
00090 Teuchos::RefCountPtr< MultiVectorBase<Scalar> >
00091 createMembers( const VectorSpaceBase<Scalar> &vs, int numMembers );
00092 
00099 template<class Scalar>
00100 Teuchos::RefCountPtr<VectorBase<Scalar> >
00101 createMemberView( const Teuchos::RefCountPtr<const VectorSpaceBase<Scalar> > &vs, const RTOpPack::SubVectorView<Scalar> &raw_v );
00102 
00106 template<class Scalar>
00107 Teuchos::RefCountPtr<VectorBase<Scalar> >
00108 createMemberView( const VectorSpaceBase<Scalar> &vs, const RTOpPack::SubVectorView<Scalar> &raw_v );
00109 
00116 template<class Scalar>
00117 Teuchos::RefCountPtr<const VectorBase<Scalar> >
00118 createMemberView( const Teuchos::RefCountPtr<const VectorSpaceBase<Scalar> > &vs, const RTOpPack::ConstSubVectorView<Scalar> &raw_v );
00119 
00122 template<class Scalar>
00123 Teuchos::RefCountPtr<const VectorBase<Scalar> >
00124 createMemberView( const VectorSpaceBase<Scalar> &vs, const RTOpPack::ConstSubVectorView<Scalar> &raw_v );
00125 
00132 template<class Scalar>
00133 Teuchos::RefCountPtr<MultiVectorBase<Scalar> >
00134 createMembersView( const Teuchos::RefCountPtr<const VectorSpaceBase<Scalar> > &vs, const RTOpPack::SubMultiVectorView<Scalar> &raw_mv );
00135 
00139 template<class Scalar>
00140 Teuchos::RefCountPtr<MultiVectorBase<Scalar> >
00141 createMembersView( const VectorSpaceBase<Scalar> &vs, const RTOpPack::SubMultiVectorView<Scalar> &raw_mv );
00142 
00149 template<class Scalar>
00150 Teuchos::RefCountPtr<const MultiVectorBase<Scalar> >
00151 createMembersView( const Teuchos::RefCountPtr<const VectorSpaceBase<Scalar> > &vs, const RTOpPack::ConstSubMultiVectorView<Scalar> &raw_mv );
00152 
00156 template<class Scalar>
00157 Teuchos::RefCountPtr<const MultiVectorBase<Scalar> >
00158 createMembersView( const VectorSpaceBase<Scalar> &vs, const RTOpPack::ConstSubMultiVectorView<Scalar> &raw_mv );
00159 
00161 
00213 template<class Scalar>
00214 class VectorSpaceBase : virtual public Teuchos::Describable {
00215 public:
00216 
00219 
00225   virtual Index dim() const = 0;
00226 
00245   virtual bool isCompatible( const VectorSpaceBase<Scalar>& vecSpc ) const = 0;
00246 
00254   virtual Teuchos::RefCountPtr< const VectorSpaceFactoryBase<Scalar> > smallVecSpcFcty() const = 0;
00255 
00267   virtual Scalar scalarProd( const VectorBase<Scalar>& x, const VectorBase<Scalar>& y ) const = 0;
00268 
00287   virtual void scalarProds( const MultiVectorBase<Scalar>& X, const MultiVectorBase<Scalar>& Y, Scalar scalar_prods[] ) const = 0;
00288 
00290 
00293 
00300   virtual bool isEuclidean() const;
00301 
00339   virtual bool hasInCoreView(
00340     const Range1D       &rng            = Range1D()
00341     ,const EViewType    viewType        = VIEW_TYPE_DETACHED
00342     ,const EStrideType  strideType      = STRIDE_TYPE_NONUNIT
00343     ) const;
00344 
00356   virtual Teuchos::RefCountPtr< const VectorSpaceBase<Scalar> > clone() const;
00357 
00359 
00360 #ifndef DOXYGEN_COMPILE
00361 
00362 #ifndef TEMPLATE_FRIENDS_NOT_SUPPORTED
00363 
00366 
00367   friend Teuchos::RefCountPtr< VectorBase<Scalar> >
00368   createMember<>( const Teuchos::RefCountPtr<const VectorSpaceBase<Scalar> > &vs );
00369 
00370   friend Teuchos::RefCountPtr< MultiVectorBase<Scalar> >
00371   createMembers<>( const Teuchos::RefCountPtr<const VectorSpaceBase<Scalar> > &vs, int numMembers );
00372 
00373   friend Teuchos::RefCountPtr<VectorBase<Scalar> >
00374   createMemberView<>( const Teuchos::RefCountPtr<const VectorSpaceBase<Scalar> > &vs, const RTOpPack::SubVectorView<Scalar> &raw_v );
00375 
00376   friend Teuchos::RefCountPtr<const VectorBase<Scalar> >
00377   createMemberView<>( const Teuchos::RefCountPtr<const VectorSpaceBase<Scalar> > &vs, const RTOpPack::ConstSubVectorView<Scalar> &raw_v );
00378 
00379   friend Teuchos::RefCountPtr<MultiVectorBase<Scalar> >
00380   createMembersView<>( const Teuchos::RefCountPtr<const VectorSpaceBase<Scalar> > &vs, const RTOpPack::SubMultiVectorView<Scalar> &raw_mv );
00381 
00382   friend Teuchos::RefCountPtr<const MultiVectorBase<Scalar> >
00383   createMembersView<>( const Teuchos::RefCountPtr<const VectorSpaceBase<Scalar> > &vs, const RTOpPack::ConstSubMultiVectorView<Scalar> &raw_mv );
00384 
00386 
00387 #endif // DOXYGEN_COMPILE
00388 
00389 #endif // TEMPLATE_FRIENDS_NOT_SUPPORTED
00390 
00391 #ifndef TEMPLATE_FRIENDS_NOT_SUPPORTED
00392 protected:
00393 #endif
00394 
00397 
00419   virtual Teuchos::RefCountPtr< VectorBase<Scalar> > createMember() const = 0;
00420 
00440   virtual Teuchos::RefCountPtr< MultiVectorBase<Scalar> > createMembers(int numMembers) const = 0;
00441 
00467   virtual Teuchos::RefCountPtr<VectorBase<Scalar> > createMemberView( const RTOpPack::SubVectorView<Scalar> &raw_v ) const = 0;
00468 
00489   virtual Teuchos::RefCountPtr<const VectorBase<Scalar> > createMemberView( const RTOpPack::ConstSubVectorView<Scalar> &raw_v ) const = 0;
00490 
00514   virtual Teuchos::RefCountPtr<MultiVectorBase<Scalar> > createMembersView( const RTOpPack::SubMultiVectorView<Scalar> &raw_mv ) const = 0;
00515 
00536   virtual Teuchos::RefCountPtr<const MultiVectorBase<Scalar> > createMembersView( const RTOpPack::ConstSubMultiVectorView<Scalar> &raw_mv ) const = 0;
00537 
00539 
00540 }; // end class VectorSpaceBase
00541 
00542 } // end namespace Thyra
00543 
00544 #endif  // THYRA_VECTOR_SPACE_BASE_DECL_HPP

Generated on Thu Sep 18 12:32:11 2008 for Fundamental Thyra ANA Operator/Vector Interfaces by doxygen 1.3.9.1