Thyra_DefaultSpmdMultiVectorDecl.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_Spmd_MULTI_VECTOR_STD_DECL_HPP
00030 #define THYRA_Spmd_MULTI_VECTOR_STD_DECL_HPP
00031 
00032 #include "Thyra_SpmdMultiVectorBaseDecl.hpp"
00033 
00034 
00035 namespace Thyra {
00036 
00037 
00054 template<class Scalar>
00055 class DefaultSpmdMultiVector : virtual public SpmdMultiVectorBase<Scalar> {
00056 public:
00057 
00060 
00062   DefaultSpmdMultiVector();
00063 
00065   DefaultSpmdMultiVector(
00066     const RCP<const SpmdVectorSpaceBase<Scalar> > &spmdRangeSpace,
00067     const RCP<const ScalarProdVectorSpaceBase<Scalar> > &domainSpace
00068     );
00069 
00071   DefaultSpmdMultiVector(
00072     const RCP<const SpmdVectorSpaceBase<Scalar> > &spmdRangeSpace,
00073     const RCP<const ScalarProdVectorSpaceBase<Scalar> > &domainSpace,
00074     const ArrayRCP<Scalar> &localValues,
00075     const Index leadingDim
00076     );
00077 
00094   void initialize(
00095     const RCP<const SpmdVectorSpaceBase<Scalar> > &spmdRangeSpace,
00096     const RCP<const ScalarProdVectorSpaceBase<Scalar> > &domainSpace
00097     );
00098 
00125   void initialize(
00126     const RCP<const SpmdVectorSpaceBase<Scalar> > &spmdRangeSpace,
00127     const RCP<const ScalarProdVectorSpaceBase<Scalar> > &domainSpace,
00128     const ArrayRCP<Scalar> &localValues,
00129     const Index leadingDim
00130     );
00131 
00137   void uninitialize(
00138     RCP<const SpmdVectorSpaceBase<Scalar> > *spmdRangeSpace = NULL,
00139     RCP<const ScalarProdVectorSpaceBase<Scalar> > *domainSpace = NULL,
00140     ArrayRCP<Scalar> *localValues = NULL,
00141     Index *leadingDim = NULL
00142     );
00143 
00145 
00149   RCP< const ScalarProdVectorSpaceBase<Scalar> >
00150   domainScalarProdVecSpc() const;
00152 
00156   RCP<VectorBase<Scalar> > nonconstColImpl(Index j);
00158   RCP<MultiVectorBase<Scalar> >
00159   nonconstContigSubViewImpl( const Range1D& colRng );
00161   RCP<const MultiVectorBase<Scalar> >
00162   nonContigSubViewImpl( const ArrayView<const int> &cols ) const;
00164   RCP<MultiVectorBase<Scalar> >
00165   nonconstNonContigSubViewImpl( const ArrayView<const int> &cols );
00167 
00170 
00172   RCP<const SpmdVectorSpaceBase<Scalar> > spmdSpace() const;
00174   void getLocalData( Scalar **localValues, Index *leadingDim );
00176   void commitLocalData( Scalar *localValues );
00178   void getLocalData( const Scalar **localValues, Index *leadingDim ) const;
00180   void freeLocalData( const Scalar *localValues ) const;
00182   
00183 private:
00184   
00185   // ///////////////////////////////////////
00186   // Private data members
00187 
00188   RCP<const SpmdVectorSpaceBase<Scalar> > spmdRangeSpace_;
00189   RCP<const ScalarProdVectorSpaceBase<Scalar> > domainSpace_;
00190   ArrayRCP<Scalar> localValues_;
00191   Index leadingDim_;
00192   
00193   // ///////////////////////////////////////
00194   // Private member functions
00195 
00196   ArrayRCP<Scalar> createContiguousCopy(
00197     const ArrayView<const int> &cols
00198     ) const;
00199   
00200 }; // end class DefaultSpmdMultiVector
00201 
00202 
00203 } // end namespace Thyra
00204 
00205 
00206 #endif // THYRA_Spmd_MULTI_VECTOR_STD_DECL_HPP

Generated on Wed May 12 21:26:54 2010 for Thyra Operator/Vector Support by  doxygen 1.4.7