AbstractLinAlgPack_VectorMutableThyra.hpp

Go to the documentation of this file.
00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 // Moocho: Multi-functional Object-Oriented arCHitecture for Optimization
00005 //                  Copyright (2003) 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 Roscoe A. Bartlett (rabartl@sandia.gov) 
00025 // 
00026 // ***********************************************************************
00027 // @HEADER
00028 
00029 #ifndef ALAP_VECTOR_MUTABLE_Thyra_HPP
00030 #define ALAP_VECTOR_MUTABLE_Thyra_HPP
00031 
00032 #include "AbstractLinAlgPack_VectorMutable.hpp"
00033 #include "AbstractLinAlgPack_VectorApplyOpSerialBase.hpp"
00034 #include "AbstractLinAlgPack_VectorSpaceThyra.hpp"
00035 #include "Thyra_VectorBase.hpp"
00036 
00037 namespace AbstractLinAlgPack {
00038 
00041 class VectorMutableThyra : public VectorMutable, private VectorApplyOpSerialBase {
00042 public:
00043 
00046 
00053   VectorMutableThyra();
00056   VectorMutableThyra( const Teuchos::RCP<Thyra::VectorBase<value_type> >& thyra_vec );
00069   void initialize( const Teuchos::RCP<Thyra::VectorBase<value_type> >& thyra_vec );
00076   Teuchos::RCP<Thyra::VectorBase<value_type> > set_uninitialized();
00082   Teuchos::RCP<const Thyra::VectorBase<value_type> > thyra_vec() const;
00083 
00085 
00088 
00090   const VectorSpace& space() const;
00092   void apply_op(
00093     const RTOpPack::RTOp       &op
00094     ,const size_t              num_vecs
00095     ,const Vector*             vecs[]
00096     ,const size_t              num_targ_vecs
00097     ,VectorMutable*            targ_vecs[]
00098     ,RTOpPack::ReductTarget    *reduct_obj
00099     ,const index_type          first_ele
00100     ,const index_type          sub_dim
00101     ,const index_type          global_offset
00102     ) const;
00104   index_type dim() const;
00106   void get_sub_vector( const Range1D& rng, RTOpPack::SubVector* sub_vec ) const;
00108   void free_sub_vector( RTOpPack::SubVector* sub_vec ) const;
00109 
00111 
00114 
00116   void get_sub_vector( const Range1D& rng, RTOpPack::MutableSubVector* sub_vec );
00118   void commit_sub_vector( RTOpPack::MutableSubVector* sub_vec );
00120   void set_sub_vector( const RTOpPack::SparseSubVector& sub_vec );
00122   void Vp_StMtV(
00123     value_type                       alpha
00124     ,const GenPermMatrixSlice        &P
00125     ,BLAS_Cpp::Transp                P_trans
00126     ,const Vector                    &x
00127     ,value_type                      beta
00128     );
00129 
00130 
00132 
00133 private:
00134 
00135 #ifdef DOXYGEN_COMPILE
00136   Thyra::VectorBase<value_type>                          *thyra_vector;
00137 #else
00138   Teuchos::RCP<Thyra::VectorBase<value_type> >   thyra_vec_;
00139 #endif
00140   VectorSpaceThyra                                       space_;
00141 
00142   // Not defined and not to be called!
00143   //VectorMutableThyra(const VectorMutableThyra&);
00144   VectorMutableThyra& operator=(const VectorMutableThyra&);
00145 
00146 }; // class VectorMutableThyra 
00147 
00148 // ////////////////////////////////
00149 // Inline functions
00150 
00151 inline
00152 Teuchos::RCP<const Thyra::VectorBase<value_type> >
00153 VectorMutableThyra::thyra_vec() const
00154 {
00155   return thyra_vec_;
00156 }
00157 
00158 } // end namespace AbstractLinAlgPack
00159 
00160 #endif  // ALAP_VECTOR_MUTABLE_Thyra_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Wed Apr 13 10:10:57 2011 for MOOCHO (Single Doxygen Collection) by  doxygen 1.6.3