MOOCHO (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AbstractLinAlgPack_VectorMutable.hpp
Go to the documentation of this file.
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_HPP
43 #define ALAP_VECTOR_MUTABLE_HPP
44 
46 
47 namespace AbstractLinAlgPack {
48 
72 class VectorMutable : virtual public Vector
73 {
74 public:
75 
80 
83 
89  virtual VectorMutable& operator=(value_type alpha);
90 
96  virtual VectorMutable& operator=(const Vector& v);
97 
100  virtual VectorMutable& operator=(const VectorMutable& v);
101 
118  virtual void set_ele( index_type i, value_type val );
119 
151  virtual vec_mut_ptr_t sub_view( const Range1D& rng );
152 
155  vec_mut_ptr_t sub_view( const index_type& l, const index_type& u );
156 
161  virtual void zero();
162 
168  virtual void axpy( value_type alpha, const Vector& x );
169 
215  virtual void get_sub_vector( const Range1D& rng, RTOpPack::MutableSubVector* sub_vec );
216 
231  virtual void commit_sub_vector( RTOpPack::MutableSubVector* sub_vec );
232 
250  virtual void set_sub_vector( const RTOpPack::SparseSubVector& sub_vec );
251 
262  virtual void Vp_StMtV(
263  value_type alpha
264  ,const GenPermMatrixSlice &P
265  ,BLAS_Cpp::Transp P_trans
266  ,const Vector &x
267  ,value_type beta
268  );
269 
271 
274 
282  vec_ptr_t sub_view( const Range1D& rng ) const;
283 
285 
286 }; // end class VectorMutable
287 
288 inline
290 void Vp_StMtV(
291  VectorMutable *y
292  ,value_type alpha
293  ,const GenPermMatrixSlice &P
294  ,BLAS_Cpp::Transp P_trans
295  ,const Vector &x
296  ,value_type beta = 1.0
297  )
298 {
299  y->Vp_StMtV(alpha,P,P_trans,x,beta);
300 }
301 
302 // ////////////////////////////////////////////////
303 // Inline members
304 
305 inline
308 {
309  return this->sub_view(Range1D(l,u));
310 }
311 
312 } // end namespace AbstractLinAlgPack
313 
314 #endif // ALAP_VECTOR_MUTABLE_HPP
virtual vec_mut_ptr_t sub_view(const Range1D &rng)
Create a mutable abstract view of a vector object.
virtual void set_sub_vector(const RTOpPack::SparseSubVector &sub_vec)
Set a specific sub-vector.
virtual void get_sub_vector(const Range1D &rng, RTOpPack::SubVector *sub_vec) const
Get a non-mutable explicit view of a sub-vector.
Abstract interface for immutable, finite dimensional, coordinate vectors {abstract}.
virtual void commit_sub_vector(RTOpPack::MutableSubVector *sub_vec)
Free a mutable explicit view of a sub-vector.
virtual void set_ele(index_type i, value_type val)
Set a specific element of a vector.
Teuchos::RCP< VectorMutable > vec_mut_ptr_t
. One-based subregion index range class.
virtual void axpy(value_type alpha, const Vector &x)
Adds a linear combination of another vector to this vector object.
void Vp_StMtV(VectorMutable *v_lhs, value_type alpha, const MatrixOp &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2, value_type beta=1.0)
v_lhs = alpha * op(M_rhs1) * v_rhs2 + beta * v_lhs (BLAS xGEMV)
virtual void free_sub_vector(RTOpPack::SubVector *sub_vec) const
Free an explicit view of a sub-vector.
virtual VectorMutable & operator=(value_type alpha)
Assign the elements of this vector to a scalar.
virtual void get_sub_vector(const Range1D &rng, RTOpPack::MutableSubVector *sub_vec)
Get a mutable explicit view of a sub-vector.
Abstract interface for mutable coordinate vectors {abstract}.
virtual void Vp_StMtV(value_type alpha, const GenPermMatrixSlice &P, BLAS_Cpp::Transp P_trans, const Vector &x, value_type beta)
Perform a gather or scatter operation with a vector.
SparseSubVectorT< RTOp_value_type > SparseSubVector
Class for a mutable sub-vector.
Transp
TRANS.
const f_int f_dbl_prec const f_int f_int const f_int f_int const f_dbl_prec & u
Concrete matrix type to represent general permutation (mapping) matrices.