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_MPI_VECTOR_STD_DECL_HPP 00030 #define THYRA_MPI_VECTOR_STD_DECL_HPP 00031 00032 #include "Thyra_MPIVectorBaseDecl.hpp" 00033 00034 namespace Thyra { 00035 00052 template<class Scalar> 00053 class MPIVectorStd : virtual public MPIVectorBase<Scalar> { 00054 public: 00055 00058 00059 00061 MPIVectorStd(); 00062 00064 MPIVectorStd( 00065 const Teuchos::RefCountPtr<const MPIVectorSpaceBase<Scalar> > &mpiSpace 00066 ,const Teuchos::RefCountPtr<Scalar> &localValues 00067 ,const Index stride 00068 ); 00069 00094 void initialize( 00095 const Teuchos::RefCountPtr<const MPIVectorSpaceBase<Scalar> > &mpiSpace 00096 ,const Teuchos::RefCountPtr<Scalar> &localValues 00097 ,const Index stride 00098 ); 00099 00105 void uninitialize( 00106 Teuchos::RefCountPtr<const MPIVectorSpaceBase<Scalar> > *mpiSpace = NULL 00107 ,Teuchos::RefCountPtr<Scalar> *localValues = NULL 00108 ,Index *stride = NULL 00109 ); 00110 00112 00115 00117 Teuchos::RefCountPtr<Scalar> getRCPtr(); 00119 Teuchos::RefCountPtr<const Scalar> getRCPtr() const; 00121 Scalar* getPtr(); 00123 const Scalar* getPtr() const; 00125 Index getStride() const; 00126 00128 00132 std::string description() const; 00134 00137 00139 Teuchos::RefCountPtr<const MPIVectorSpaceBase<Scalar> > mpiSpace() const; 00141 void getLocalData( Scalar** localValues, Index* stride ); 00143 void commitLocalData( Scalar* localValues ); 00145 void getLocalData( const Scalar** localValues, Index* stride ) const; 00147 void freeLocalData( const Scalar* localValues ) const; 00148 00150 00151 private: 00152 00153 // /////////////////////////////////////// 00154 // Private data members 00155 00156 Teuchos::RefCountPtr<const MPIVectorSpaceBase<Scalar> > mpiSpace_; 00157 Teuchos::RefCountPtr<Scalar> localValues_; 00158 Index stride_; 00159 00160 }; // end class MPIVectorStd 00161 00162 // ///////////////////////////////////////////////////// 00163 // Inline members 00164 00165 template<class Scalar> 00166 inline 00167 Teuchos::RefCountPtr<Scalar> MPIVectorStd<Scalar>::getRCPtr() 00168 { 00169 return localValues_; 00170 } 00171 00172 template<class Scalar> 00173 inline 00174 Teuchos::RefCountPtr<const Scalar> MPIVectorStd<Scalar>::getRCPtr() const 00175 { 00176 return localValues_; 00177 } 00178 00179 template<class Scalar> 00180 inline 00181 Scalar* MPIVectorStd<Scalar>::getPtr() 00182 { 00183 return localValues_.get(); 00184 } 00185 00186 template<class Scalar> 00187 inline 00188 const Scalar* MPIVectorStd<Scalar>::getPtr() const 00189 { 00190 return localValues_.get(); 00191 } 00192 00193 template<class Scalar> 00194 inline 00195 Index MPIVectorStd<Scalar>::getStride() const 00196 { 00197 return stride_; 00198 } 00199 00200 } // end namespace Thyra 00201 00202 #endif // THYRA_MPI_VECTOR_STD_DECL_HPP
1.3.9.1