Thyra_DefaultVectorMultiVectorDecl.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_VECTOR_MULTI_VECTOR_DECL_HPP
00030 #define THYRA_VECTOR_MULTI_VECTOR_DECL_HPP
00031 
00032 #include "Thyra_VectorDefaultBaseDecl.hpp"
00033 
00034 namespace Thyra {
00035 
00069 template<class Scalar>
00070 class DefaultVectorMultiVector : virtual public VectorDefaultBase<Scalar> {
00071 public:
00072 
00074   //using VectorBase<Scalar>::col;
00075 
00078 
00080   DefaultVectorMultiVector();
00081 
00083   DefaultVectorMultiVector(
00084     const Teuchos::RefCountPtr<MultiVectorBase<Scalar> > &mv
00085     );
00086 
00099   void initialize(
00100     const Teuchos::RefCountPtr<MultiVectorBase<Scalar> > &mv
00101     );
00102 
00110   void uninitialize(
00111     Teuchos::RefCountPtr<MultiVectorBase<Scalar> > *mv = NULL
00112     );
00113 
00115   Teuchos::RefCountPtr<MultiVectorBase<Scalar> > mv();
00116 
00118   Teuchos::RefCountPtr<const MultiVectorBase<Scalar> > mv() const;
00119 
00121 
00125   Teuchos::RefCountPtr< const VectorSpaceBase<Scalar> > range() const;
00127   Teuchos::RefCountPtr< const VectorSpaceBase<Scalar> > domain() const;
00129   bool opSupported(ETransp M_trans) const;
00131   void apply(
00132     const ETransp                     M_trans
00133     ,const MultiVectorBase<Scalar>    &X
00134     ,MultiVectorBase<Scalar>          *Y
00135     ,const Scalar                     alpha
00136     ,const Scalar                     beta
00137     ) const;
00139 
00143   Teuchos::RefCountPtr<VectorBase<Scalar> > col(Index j);
00145   Teuchos::RefCountPtr<MultiVectorBase<Scalar> > clone_mv() const;
00147   Teuchos::RefCountPtr<const MultiVectorBase<Scalar> > subView( const Range1D& col_rng ) const;
00149   Teuchos::RefCountPtr<MultiVectorBase<Scalar> > subView( const Range1D& col_rng );
00151   Teuchos::RefCountPtr<const MultiVectorBase<Scalar> > subView( const int numCols, const int cols[] ) const;
00153   Teuchos::RefCountPtr<MultiVectorBase<Scalar> > subView( const int numCols, const int cols[] );
00155   void applyOp(
00156     const RTOpPack::RTOpT<Scalar>   &primary_op
00157     ,const int                      num_multi_vecs
00158     ,const MultiVectorBase<Scalar>* multi_vecs[]
00159     ,const int                      num_targ_multi_vecs
00160     ,MultiVectorBase<Scalar>*       targ_multi_vecs[]
00161     ,RTOpPack::ReductTarget*        reduct_objs[]
00162     ,const Index                    primary_first_ele
00163     ,const Index                    primary_sub_dim
00164     ,const Index                    primary_global_offset
00165     ,const Index                    secondary_first_ele
00166     ,const Index                    secondary_sub_dim
00167     ) const;
00169   void applyOp(
00170     const RTOpPack::RTOpT<Scalar>   &primary_op
00171     ,const RTOpPack::RTOpT<Scalar>  &secondary_op
00172     ,const int                      num_multi_vecs
00173     ,const MultiVectorBase<Scalar>* multi_vecs[]
00174     ,const int                      num_targ_multi_vecs
00175     ,MultiVectorBase<Scalar>*       targ_multi_vecs[]
00176     ,RTOpPack::ReductTarget         *reduct_obj
00177     ,const Index                    primary_first_ele
00178     ,const Index                    primary_sub_dim
00179     ,const Index                    primary_global_offset
00180     ,const Index                    secondary_first_ele
00181     ,const Index                    secondary_sub_dim
00182     ) const;
00184   void acquireDetachedView(
00185     const Range1D                       &rowRng
00186     ,const Range1D                      &colRng
00187     ,RTOpPack::ConstSubMultiVectorView<Scalar>  *sub_mv
00188     ) const;
00190   void releaseDetachedView( RTOpPack::ConstSubMultiVectorView<Scalar>* sub_mv ) const;
00192   void acquireDetachedView(
00193     const Range1D                                &rowRng
00194     ,const Range1D                               &colRng
00195     ,RTOpPack::SubMultiVectorView<Scalar>    *sub_mv
00196     );
00198   void commitDetachedView( RTOpPack::SubMultiVectorView<Scalar>* sub_mv );
00200 
00204   Teuchos::RefCountPtr< const VectorSpaceBase<Scalar> > space() const;
00206   void applyOp(
00207     const RTOpPack::RTOpT<Scalar>   &op
00208     ,const int                      num_vecs
00209     ,const VectorBase<Scalar>*      vecs[]
00210     ,const int                      num_targ_vecs
00211     ,VectorBase<Scalar>*            targ_vecs[]
00212     ,RTOpPack::ReductTarget         *reduct_obj
00213     ,const Index                    first_ele
00214     ,const Index                    sub_dim
00215     ,const Index                    global_offset
00216     ) const;
00218   void acquireDetachedView( const Range1D& rng, RTOpPack::ConstSubVectorView<Scalar>* sub_vec ) const;
00220   void releaseDetachedView( RTOpPack::ConstSubVectorView<Scalar>* sub_vec ) const;
00222   void acquireDetachedView( const Range1D& rng, RTOpPack::SubVectorView<Scalar>* sub_vec );
00224   void commitDetachedView( RTOpPack::SubVectorView<Scalar>* sub_vec );
00226 
00227 private:
00228   
00229   Teuchos::RefCountPtr<MultiVectorBase<Scalar> > mv_;
00230 
00231 }; // end class DefaultVectorMultiVector
00232 
00233 // ///////////////////////////////////////////////////
00234 // Inline members
00235 
00236 template <class Scalar>
00237 inline
00238 Teuchos::RefCountPtr<MultiVectorBase<Scalar> >
00239 DefaultVectorMultiVector<Scalar>::mv()
00240 {
00241   return mv_;
00242 }
00243 
00244 template <class Scalar>
00245 inline
00246 Teuchos::RefCountPtr<const MultiVectorBase<Scalar> >
00247 DefaultVectorMultiVector<Scalar>::mv() const
00248 {
00249   return mv_;
00250 }
00251 
00252 } // end namespace Thyra
00253 
00254 #endif // THYRA_VECTOR_MULTI_VECTOR_DECL_HPP

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