Thyra_DefaultColumnwiseMultiVectorDecl.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 TSF_MULTI_VECTOR_COlS_DECL_HPP
00030 #define TSF_MULTI_VECTOR_COlS_DECL_HPP
00031 
00032 #include "Thyra_MultiVectorDefaultBaseDecl.hpp"
00033 #include "Thyra_VectorSpaceBaseDecl.hpp"
00034 #include "Thyra_VectorBaseDecl.hpp"
00035 #include "Thyra_SingleRhsLinearOpBaseDecl.hpp"
00036 
00037 namespace Thyra {
00038 
00051 template<class Scalar>
00052 class DefaultColumnwiseMultiVector
00053   : virtual public MultiVectorDefaultBase<Scalar>
00054   , virtual protected SingleRhsLinearOpBase<Scalar>
00055 {
00056 public:
00057 
00059   using SingleRhsLinearOpBase<Scalar>::apply;
00061   using MultiVectorDefaultBase<Scalar>::col; // Inject *all* functions!
00063   using MultiVectorDefaultBase<Scalar>::subView; // Inject *all* functions!
00064 
00067 
00075   DefaultColumnwiseMultiVector();
00076 
00078   DefaultColumnwiseMultiVector(
00079     const Teuchos::RCP<VectorBase<Scalar> > &col_vec
00080     );
00081 
00083   DefaultColumnwiseMultiVector(
00084     const Teuchos::RCP<const VectorSpaceBase<Scalar> >          &range
00085     ,const Teuchos::RCP<const VectorSpaceBase<Scalar> >         &domain
00086     ,const Teuchos::RCP<VectorBase<Scalar> >                    col_vecs[] = NULL
00087     );
00088   
00105   void initialize(
00106     const Teuchos::RCP<VectorBase<Scalar> > &col_vec
00107     );
00108 
00141   void initialize(
00142     const Teuchos::RCP<const VectorSpaceBase<Scalar> >          &range
00143     ,const Teuchos::RCP<const VectorSpaceBase<Scalar> >         &domain
00144     ,const Teuchos::RCP<VectorBase<Scalar> >                    col_vecs[] = NULL
00145     );
00146 
00148   void set_uninitialized();
00149 
00151 
00155   Teuchos::RCP<const VectorSpaceBase<Scalar> > range() const;
00157   Teuchos::RCP<const VectorSpaceBase<Scalar> > domain() const;
00159 
00163   Teuchos::RCP<VectorBase<Scalar> > col(Index j);
00165   Teuchos::RCP<MultiVectorBase<Scalar> > subView( const Range1D& col_rng );
00167 
00168 protected:
00169 
00172 
00177   bool opSupported(ETransp M_trans) const;
00178 
00195   void apply(
00196     const ETransp                M_trans
00197     ,const VectorBase<Scalar>    &x
00198     ,VectorBase<Scalar>          *y
00199     ,const Scalar                alpha
00200     ,const Scalar                beta
00201     ) const;
00202 
00204 
00205 private:
00206   
00207   Teuchos::RCP<const VectorSpaceBase<Scalar> > range_;
00208   Teuchos::RCP<const VectorSpaceBase<Scalar> > domain_;
00209   std::vector< Teuchos::RCP<VectorBase<Scalar> > > col_vecs_;
00210   int num_cols_;
00211   
00212 }; // end class DefaultColumnwiseMultiVector
00213 
00214 } // end namespace Thyra
00215 
00216 #endif // TSF_MULTI_VECTOR_COlS_DECL_HPP

Generated on Tue Oct 20 12:47:25 2009 for Thyra Package Browser (Single Doxygen Collection) by doxygen 1.4.7