Thyra_DefaultSpmdMultiVectorDecl.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_Spmd_MULTI_VECTOR_STD_DECL_HPP
00030 #define THYRA_Spmd_MULTI_VECTOR_STD_DECL_HPP
00031 
00032 #include "Thyra_SpmdMultiVectorBaseDecl.hpp"
00033 
00034 namespace Thyra {
00035 
00052 template<class Scalar>
00053 class DefaultSpmdMultiVector : virtual public SpmdMultiVectorBase<Scalar> {
00054 public:
00055 
00057   using SpmdMultiVectorBase<Scalar>::subView;
00059   using SpmdMultiVectorBase<Scalar>::col;
00060 
00063 
00065   DefaultSpmdMultiVector();
00066 
00068   DefaultSpmdMultiVector(
00069     const Teuchos::RefCountPtr<const SpmdVectorSpaceBase<Scalar> >          &spmdRangeSpace
00070     ,const Teuchos::RefCountPtr<const ScalarProdVectorSpaceBase<Scalar> >   &domainSpace
00071     );
00072 
00074   DefaultSpmdMultiVector(
00075     const Teuchos::RefCountPtr<const SpmdVectorSpaceBase<Scalar> >          &spmdRangeSpace
00076     ,const Teuchos::RefCountPtr<const ScalarProdVectorSpaceBase<Scalar> >   &domainSpace
00077     ,const Teuchos::RefCountPtr<Scalar>                                     &localValues
00078     ,const Index                                                            leadingDim
00079     );
00080 
00097   void initialize(
00098     const Teuchos::RefCountPtr<const SpmdVectorSpaceBase<Scalar> >         &spmdRangeSpace
00099     ,const Teuchos::RefCountPtr<const ScalarProdVectorSpaceBase<Scalar> >  &domainSpace
00100     );
00101 
00128   void initialize(
00129     const Teuchos::RefCountPtr<const SpmdVectorSpaceBase<Scalar> >         &spmdRangeSpace
00130     ,const Teuchos::RefCountPtr<const ScalarProdVectorSpaceBase<Scalar> >  &domainSpace
00131     ,const Teuchos::RefCountPtr<Scalar>                                    &localValues
00132     ,const Index                                                           leadingDim
00133     );
00134 
00140   void uninitialize(
00141     Teuchos::RefCountPtr<const SpmdVectorSpaceBase<Scalar> >         *spmdRangeSpace = NULL
00142     ,Teuchos::RefCountPtr<const ScalarProdVectorSpaceBase<Scalar> >  *domainSpace    = NULL
00143     ,Teuchos::RefCountPtr<Scalar>                                    *localValues    = NULL
00144     ,Index                                                           *leadingDim     = NULL
00145     );
00146 
00148 
00152   std::string description() const;
00154 
00158   Teuchos::RefCountPtr< const ScalarProdVectorSpaceBase<Scalar> >
00159   domainScalarProdVecSpc() const;
00161 
00165   Teuchos::RefCountPtr<VectorBase<Scalar> > col(Index j);
00167   Teuchos::RefCountPtr<MultiVectorBase<Scalar> > subView( const Range1D& col_rng );
00169   Teuchos::RefCountPtr<const MultiVectorBase<Scalar> > subView(
00170     const int numCols, const int cols[]
00171     ) const;
00173   Teuchos::RefCountPtr<MultiVectorBase<Scalar> > subView(
00174     const int numCols, const int cols[]
00175     );
00177 
00180 
00182   Teuchos::RefCountPtr<const SpmdVectorSpaceBase<Scalar> > spmdSpace() const;
00184   void getLocalData( Scalar **localValues, Index *leadingDim );
00186   void commitLocalData( Scalar *localValues );
00188   void getLocalData( const Scalar **localValues, Index *leadingDim ) const;
00190   void freeLocalData( const Scalar *localValues ) const;
00192   
00193 private:
00194   
00195   // ///////////////////////////////////////
00196   // Private data members
00197 
00198   Teuchos::RefCountPtr<const SpmdVectorSpaceBase<Scalar> >         spmdRangeSpace_;
00199   Teuchos::RefCountPtr<const ScalarProdVectorSpaceBase<Scalar> >   domainSpace_;
00200   Teuchos::RefCountPtr<Scalar>                                     localValues_;
00201   Index                                                            leadingDim_;
00202   
00203   // ///////////////////////////////////////
00204   // Private member functions
00205 
00206   Teuchos::RefCountPtr<Scalar> createContiguousCopy(
00207     const int numCols, const int cols[]
00208     ) const;
00209   
00210 }; // end class DefaultSpmdMultiVector
00211 
00212 } // end namespace Thyra
00213 
00214 #endif // THYRA_Spmd_MULTI_VECTOR_STD_DECL_HPP

Generated on Thu Sep 18 12:33:02 2008 for Thyra Package Browser (Single Doxygen Collection) by doxygen 1.3.9.1