Thyra_VectorMultiVectorDecl.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_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 VectorMultiVector : virtual public VectorDefaultBase<Scalar> {
00071 public:
00072 
00074   using VectorBase<Scalar>::col;
00075 
00078 
00080   VectorMultiVector();
00081 
00083   VectorMultiVector(
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 
00135   void apply(
00136     const ETransp                     M_trans
00137     ,const MultiVectorBase<Scalar>    &X
00138     ,MultiVectorBase<Scalar>          *Y
00139     ,const Scalar                     alpha
00140     ,const Scalar                     beta
00141     ) const;
00143 
00147   Teuchos::RefCountPtr<VectorBase<Scalar> > col(Index j);
00149   Teuchos::RefCountPtr<MultiVectorBase<Scalar> > clone_mv() const;
00151   Teuchos::RefCountPtr<const MultiVectorBase<Scalar> > subView( const Range1D& col_rng ) const;
00153   Teuchos::RefCountPtr<MultiVectorBase<Scalar> > subView( const Range1D& col_rng );
00155   Teuchos::RefCountPtr<const MultiVectorBase<Scalar> > subView( const int numCols, const int cols[] ) const;
00157   Teuchos::RefCountPtr<MultiVectorBase<Scalar> > subView( const int numCols, const int cols[] );
00159   void applyOp(
00160     const RTOpPack::RTOpT<Scalar>   &primary_op
00161     ,const int                      num_multi_vecs
00162     ,const MultiVectorBase<Scalar>* multi_vecs[]
00163     ,const int                      num_targ_multi_vecs
00164     ,MultiVectorBase<Scalar>*       targ_multi_vecs[]
00165     ,RTOpPack::ReductTarget*        reduct_objs[]
00166     ,const Index                    primary_first_ele
00167     ,const Index                    primary_sub_dim
00168     ,const Index                    primary_global_offset
00169     ,const Index                    secondary_first_ele
00170     ,const Index                    secondary_sub_dim
00171     ) const;
00173   void applyOp(
00174     const RTOpPack::RTOpT<Scalar>   &primary_op
00175     ,const RTOpPack::RTOpT<Scalar>  &secondary_op
00176     ,const int                      num_multi_vecs
00177     ,const MultiVectorBase<Scalar>* multi_vecs[]
00178     ,const int                      num_targ_multi_vecs
00179     ,MultiVectorBase<Scalar>*       targ_multi_vecs[]
00180     ,RTOpPack::ReductTarget         *reduct_obj
00181     ,const Index                    primary_first_ele
00182     ,const Index                    primary_sub_dim
00183     ,const Index                    primary_global_offset
00184     ,const Index                    secondary_first_ele
00185     ,const Index                    secondary_sub_dim
00186     ) const;
00188   void getSubMultiVector(
00189     const Range1D                       &rowRng
00190     ,const Range1D                      &colRng
00191     ,RTOpPack::SubMultiVectorT<Scalar>  *sub_mv
00192     ) const;
00194   void freeSubMultiVector( RTOpPack::SubMultiVectorT<Scalar>* sub_mv ) const;
00196   void getSubMultiVector(
00197     const Range1D                                &rowRng
00198     ,const Range1D                               &colRng
00199     ,RTOpPack::MutableSubMultiVectorT<Scalar>    *sub_mv
00200     );
00202   void commitSubMultiVector( RTOpPack::MutableSubMultiVectorT<Scalar>* sub_mv );
00204 
00208   Teuchos::RefCountPtr< const VectorSpaceBase<Scalar> > space() const;
00210   void applyOp(
00211     const RTOpPack::RTOpT<Scalar>   &op
00212     ,const int                      num_vecs
00213     ,const VectorBase<Scalar>*      vecs[]
00214     ,const int                      num_targ_vecs
00215     ,VectorBase<Scalar>*            targ_vecs[]
00216     ,RTOpPack::ReductTarget         *reduct_obj
00217     ,const Index                    first_ele
00218     ,const Index                    sub_dim
00219     ,const Index                    global_offset
00220     ) const;
00222   void getSubVector( const Range1D& rng, RTOpPack::SubVectorT<Scalar>* sub_vec ) const;
00224   void freeSubVector( RTOpPack::SubVectorT<Scalar>* sub_vec ) const;
00226   void getSubVector( const Range1D& rng, RTOpPack::MutableSubVectorT<Scalar>* sub_vec );
00228   void commitSubVector( RTOpPack::MutableSubVectorT<Scalar>* sub_vec );
00230 
00231 private:
00232   
00233   Teuchos::RefCountPtr<MultiVectorBase<Scalar> > mv_;
00234 
00235 }; // end class VectorMultiVector
00236 
00237 // ///////////////////////////////////////////////////
00238 // Inline members
00239 
00240 template <class Scalar>
00241 inline
00242 Teuchos::RefCountPtr<MultiVectorBase<Scalar> >
00243 VectorMultiVector<Scalar>::mv()
00244 {
00245   return mv_;
00246 }
00247 
00248 template <class Scalar>
00249 inline
00250 Teuchos::RefCountPtr<const MultiVectorBase<Scalar> >
00251 VectorMultiVector<Scalar>::mv() const
00252 {
00253   return mv_;
00254 }
00255 
00256 } // end namespace Thyra
00257 
00258 #endif // THYRA_VECTOR_MULTI_VECTOR_DECL_HPP

Generated on Thu Sep 18 12:39:53 2008 for Thyra ANA Operator/VectorBase Interfaces and Related Software by doxygen 1.3.9.1