MOOCHO/Thyra Adapter Software Version of the Day
AbstractLinAlgPack_MultiVectorMutableThyra.hpp
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 // Redistribution and use in source and binary forms, with or without
00011 // modification, are permitted provided that the following conditions are
00012 // met:
00013 //
00014 // 1. Redistributions of source code must retain the above copyright
00015 // notice, this list of conditions and the following disclaimer.
00016 //
00017 // 2. Redistributions in binary form must reproduce the above copyright
00018 // notice, this list of conditions and the following disclaimer in the
00019 // documentation and/or other materials provided with the distribution.
00020 //
00021 // 3. Neither the name of the Corporation nor the names of the
00022 // contributors may be used to endorse or promote products derived from
00023 // this software without specific prior written permission.
00024 //
00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00036 //
00037 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov) 
00038 // 
00039 // ***********************************************************************
00040 // @HEADER
00041 
00042 #ifndef ALAP_MULTI_VECTOR_MUTABLE_Thyra_HPP
00043 #define ALAP_MULTI_VECTOR_MUTABLE_Thyra_HPP
00044 
00045 #include "AbstractLinAlgPack_MultiVectorMutable.hpp"
00046 #include "AbstractLinAlgPack_MatrixOpThyra.hpp"
00047 #include "Thyra_MultiVectorBase.hpp"
00048 
00049 namespace AbstractLinAlgPack {
00050 
00053 class MultiVectorMutableThyra
00054   :virtual public MultiVectorMutable
00055   ,virtual public MatrixOpThyra
00056 {
00057 public:
00058 
00061 
00069   MultiVectorMutableThyra();
00072   MultiVectorMutableThyra( const Teuchos::RCP<Thyra::MultiVectorBase<value_type> >& thyra_multi_vec );
00086   void initialize( const Teuchos::RCP<Thyra::MultiVectorBase<value_type> >& thyra_multi_vec );
00096   Teuchos::RCP<Thyra::MultiVectorBase<value_type> > set_uninitialized();
00099   Teuchos::RCP<const Thyra::MultiVectorBase<value_type> > thyra_multi_vec() const;
00100 
00102 
00105 
00107   void initialize( const Teuchos::RCP<const Thyra::LinearOpBase<value_type> >& thyra_linear_op );
00108 
00110 
00113 
00115   mat_mut_ptr_t clone();
00117   MatrixOp& operator=(const MatrixOp& mwo_rhs);
00119   void Vp_StMtV(
00120     VectorMutable* v_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1
00121     ,const Vector& v_rhs2, value_type beta
00122     ) const;
00124   bool Mp_StMtM(
00125     MatrixOp* mwo_lhs, value_type alpha
00126     ,BLAS_Cpp::Transp trans_rhs1
00127     ,const MatrixOp& mwo_rhs2, BLAS_Cpp::Transp trans_rhs2
00128     ,value_type beta
00129     ) const;
00130 
00132 
00135 
00137   access_by_t access_by() const;
00139   void apply_op(
00140     EApplyBy apply_by, const RTOpPack::RTOp& primary_op
00141     ,const size_t num_multi_vecs,      const MultiVector*   multi_vecs[]
00142     ,const size_t num_targ_multi_vecs, MultiVectorMutable*  targ_multi_vecs[]
00143     ,RTOpPack::ReductTarget* reduct_objs[]
00144     ,const index_type primary_first_ele,   const index_type primary_sub_dim, const index_type primary_global_offset
00145     ,const index_type secondary_first_ele, const index_type secondary_sub_dim
00146     ) const;
00148   void apply_op(
00149     EApplyBy apply_by, const RTOpPack::RTOp& primary_op, const RTOpPack::RTOp& secondary_op
00150     ,const size_t num_multi_vecs,      const MultiVector*   multi_vecs[]
00151     ,const size_t num_targ_multi_vecs, MultiVectorMutable*  targ_multi_vecs[]
00152     ,RTOpPack::ReductTarget *reduct_obj
00153     ,const index_type primary_first_ele, const index_type primary_sub_dim, const index_type primary_global_offset
00154     ,const index_type secondary_first_ele, const index_type secondary_sub_dim
00155     ) const;
00156 
00158 
00161 
00163   vec_mut_ptr_t col(index_type j);
00165   vec_mut_ptr_t row(index_type i);
00167   vec_mut_ptr_t diag(int k);
00169   multi_vec_mut_ptr_t mv_sub_view(const Range1D& row_rng, const Range1D& col_rng);
00170 
00172 
00173 private:
00174 
00176   Teuchos::RCP<Thyra::MultiVectorBase<value_type> > cast_thyra_multi_vec();
00177   
00178 }; // end class MultiVectorMutableThyra
00179 
00180 } // end namespace AbstractLinAlgPack
00181 
00182 #endif // ALAP_MULTI_VECTOR_MUTABLE_Thyra_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends