MOOCHO/Thyra Adapter Software  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
AbstractLinAlgPack_VectorMutableThyra.hpp
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Moocho: Multi-functional Object-Oriented arCHitecture for Optimization
5 // Copyright (2003) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov)
38 //
39 // ***********************************************************************
40 // @HEADER
41 
42 #ifndef ALAP_VECTOR_MUTABLE_Thyra_HPP
43 #define ALAP_VECTOR_MUTABLE_Thyra_HPP
44 
45 #include "AbstractLinAlgPack_VectorMutable.hpp"
46 #include "AbstractLinAlgPack_VectorApplyOpSerialBase.hpp"
47 #include "AbstractLinAlgPack_VectorSpaceThyra.hpp"
48 #include "Thyra_VectorBase.hpp"
49 
50 namespace AbstractLinAlgPack {
51 
55 public:
56 
59 
96 
98 
101 
103  const VectorSpace& space() const;
105  void apply_op(
106  const RTOpPack::RTOp &op
107  ,const size_t num_vecs
108  ,const Vector* vecs[]
109  ,const size_t num_targ_vecs
110  ,VectorMutable* targ_vecs[]
111  ,RTOpPack::ReductTarget *reduct_obj
112  ,const index_type first_ele
113  ,const index_type sub_dim
114  ,const index_type global_offset
115  ) const;
117  index_type dim() const;
119  void get_sub_vector( const Range1D& rng, RTOpPack::SubVector* sub_vec ) const;
121  void free_sub_vector( RTOpPack::SubVector* sub_vec ) const;
122 
124 
127 
129  void get_sub_vector( const Range1D& rng, RTOpPack::MutableSubVector* sub_vec );
131  void commit_sub_vector( RTOpPack::MutableSubVector* sub_vec );
133  void set_sub_vector( const RTOpPack::SparseSubVector& sub_vec );
135  void Vp_StMtV(
136  value_type alpha
137  ,const GenPermMatrixSlice &P
138  ,BLAS_Cpp::Transp P_trans
139  ,const Vector &x
140  ,value_type beta
141  );
142 
143 
145 
146 private:
147 
148 #ifdef DOXYGEN_COMPILE
149  Thyra::VectorBase<value_type> *thyra_vector;
150 #else
152 #endif
153  VectorSpaceThyra space_;
154 
155  // Not defined and not to be called!
156  //VectorMutableThyra(const VectorMutableThyra&);
157  VectorMutableThyra& operator=(const VectorMutableThyra&);
158 
159 }; // class VectorMutableThyra
160 
161 // ////////////////////////////////
162 // Inline functions
163 
164 inline
167 {
168  return thyra_vec_;
169 }
170 
171 } // end namespace AbstractLinAlgPack
172 
173 #endif // ALAP_VECTOR_MUTABLE_Thyra_HPP
void set_sub_vector(const RTOpPack::SparseSubVector &sub_vec)
VectorSpace adapter subclass for Thyra::VectorSpaceBase<value_type> .
void get_sub_vector(const Range1D &rng, RTOpPack::SubVector *sub_vec) const
VectorMutable adapter subclass for Thyra::VectorBase.
void commit_sub_vector(RTOpPack::MutableSubVector *sub_vec)
void apply_op(const RTOpPack::RTOp &op, const size_t num_vecs, const Vector *vecs[], const size_t num_targ_vecs, VectorMutable *targ_vecs[], RTOpPack::ReductTarget *reduct_obj, const index_type first_ele, const index_type sub_dim, const index_type global_offset) const
void Vp_StMtV(value_type alpha, const GenPermMatrixSlice &P, BLAS_Cpp::Transp P_trans, const Vector &x, value_type beta)
void free_sub_vector(RTOpPack::SubVector *sub_vec) const
Teuchos::RCP< Thyra::VectorBase< value_type > > set_uninitialized()
Set to uninitialized and return smart pointer to the internal Thyra::VectorBase object.
Teuchos::RCP< const Thyra::VectorBase< value_type > > thyra_vec() const
Return a (converted) smart pointer to the internal smart pointer to the Thyra::VectorBase object...
Transp
void initialize(const Teuchos::RCP< Thyra::VectorBase< value_type > > &thyra_vec)
Initalize given a smart pointer to a Thyra::Vetor object.