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 
00059   using SpmdMultiVectorBase<Scalar>::subView;
00061   using SpmdMultiVectorBase<Scalar>::col;
00062 
00065 
00067   DefaultSpmdMultiVector();
00068 
00070   DefaultSpmdMultiVector(
00071     const Teuchos::RCP<const SpmdVectorSpaceBase<Scalar> > &spmdRangeSpace,
00072     const Teuchos::RCP<const ScalarProdVectorSpaceBase<Scalar> > &domainSpace
00073     );
00074 
00076   DefaultSpmdMultiVector(
00077     const Teuchos::RCP<const SpmdVectorSpaceBase<Scalar> > &spmdRangeSpace,
00078     const Teuchos::RCP<const ScalarProdVectorSpaceBase<Scalar> > &domainSpace,
00079     const Teuchos::RCP<Scalar> &localValues,
00080     const Index leadingDim
00081     );
00082 
00099   void initialize(
00100     const Teuchos::RCP<const SpmdVectorSpaceBase<Scalar> > &spmdRangeSpace,
00101     const Teuchos::RCP<const ScalarProdVectorSpaceBase<Scalar> > &domainSpace
00102     );
00103 
00130   void initialize(
00131     const Teuchos::RCP<const SpmdVectorSpaceBase<Scalar> > &spmdRangeSpace,
00132     const Teuchos::RCP<const ScalarProdVectorSpaceBase<Scalar> > &domainSpace,
00133     const Teuchos::RCP<Scalar> &localValues,
00134     const Index leadingDim
00135     );
00136 
00142   void uninitialize(
00143     Teuchos::RCP<const SpmdVectorSpaceBase<Scalar> > *spmdRangeSpace = NULL,
00144     Teuchos::RCP<const ScalarProdVectorSpaceBase<Scalar> > *domainSpace = NULL,
00145     Teuchos::RCP<Scalar> *localValues = NULL,
00146     Index *leadingDim = NULL
00147     );
00148 
00150 
00154   Teuchos::RCP< const ScalarProdVectorSpaceBase<Scalar> >
00155   domainScalarProdVecSpc() const;
00157 
00161   Teuchos::RCP<VectorBase<Scalar> > col(Index j);
00163   Teuchos::RCP<MultiVectorBase<Scalar> > subView( const Range1D& col_rng );
00165   Teuchos::RCP<const MultiVectorBase<Scalar> > subView(
00166     const int numCols, const int cols[]
00167     ) const;
00169   Teuchos::RCP<MultiVectorBase<Scalar> > subView(
00170     const int numCols, const int cols[]
00171     );
00173 
00176 
00178   Teuchos::RCP<const SpmdVectorSpaceBase<Scalar> > spmdSpace() const;
00180   void getLocalData( Scalar **localValues, Index *leadingDim );
00182   void commitLocalData( Scalar *localValues );
00184   void getLocalData( const Scalar **localValues, Index *leadingDim ) const;
00186   void freeLocalData( const Scalar *localValues ) const;
00188   
00189 private:
00190   
00191   // ///////////////////////////////////////
00192   // Private data members
00193 
00194   Teuchos::RCP<const SpmdVectorSpaceBase<Scalar> > spmdRangeSpace_;
00195   Teuchos::RCP<const ScalarProdVectorSpaceBase<Scalar> > domainSpace_;
00196   Teuchos::RCP<Scalar> localValues_;
00197   Index leadingDim_;
00198   
00199   // ///////////////////////////////////////
00200   // Private member functions
00201 
00202   Teuchos::RCP<Scalar> createContiguousCopy(
00203     const int numCols, const int cols[]
00204     ) const;
00205   
00206 }; // end class DefaultSpmdMultiVector
00207 
00208 
00209 } // end namespace Thyra
00210 
00211 
00212 #endif // THYRA_Spmd_MULTI_VECTOR_STD_DECL_HPP

Generated on Tue Oct 20 12:46:58 2009 for Thyra Operator/Vector Support by doxygen 1.4.7