RTOpPack_RTOpTDecl.hpp

00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 //      Thyra: Interfaces and Support Code for the Interoperability of 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 RTOPPACK_RTOP_NEW_T_DECL_HPP
00030 #define RTOPPACK_RTOP_NEW_T_DECL_HPP
00031 
00032 #include "RTOpPack_Types.hpp"
00033 #include "Teuchos_RefCountPtr.hpp"
00034 #include "Teuchos_PrimitiveTypeTraits.hpp"
00035 
00036 namespace RTOpPack {
00037 
00041 
00044 class ReductTarget {
00045 public:
00046   virtual ~ReductTarget() {}
00047 };
00048 
00157 template<class Scalar>
00158 class RTOpT {
00159 public:
00160 
00163 
00165   typedef typename Teuchos::PrimitiveTypeTraits<Scalar>::primitiveType  primitive_value_type;
00166 
00168 
00170   RTOpT( const std::string &op_name_base );
00171 
00174 
00190   virtual void get_reduct_type_num_entries(
00191     int*   num_values
00192     ,int*  num_indexes
00193     ,int*  num_chars
00194     ) const;
00205   virtual Teuchos::RefCountPtr<ReductTarget> reduct_obj_create() const;
00211   virtual void reduce_reduct_objs(
00212     const ReductTarget& in_reduct_obj, ReductTarget* inout_reduct_obj
00213     ) const;
00221   virtual void reduct_obj_reinit( ReductTarget* reduct_obj ) const;
00231   virtual void extract_reduct_obj_state(
00232     const ReductTarget     &reduct_obj
00233     ,int                      num_values
00234     ,primitive_value_type     value_data[]
00235     ,int                      num_indexes
00236     ,index_type               index_data[]
00237     ,int                      num_chars
00238     ,char_type                char_data[]
00239     ) const;
00245   virtual void load_reduct_obj_state(
00246     int                            num_values
00247     ,const primitive_value_type    value_data[]
00248     ,int                           num_indexes
00249     ,const index_type              index_data[]
00250     ,int                           num_chars
00251     ,const char_type               char_data[]
00252     ,ReductTarget               *reduct_obj
00253     ) const;
00254 
00256 
00259 
00261   virtual ~RTOpT();
00271   virtual const char* op_name() const;
00279   virtual RTOpT<Scalar>& operator=(const RTOpT<Scalar>& op);
00288   virtual void get_op_type_num_entries(
00289     int*  num_values
00290     ,int* num_indexes
00291     ,int* num_chars
00292     ) const;
00315   virtual void extract_op_state(
00316     int                             num_values
00317     ,primitive_value_type           value_data[]
00318     ,int                            num_indexes
00319     ,index_type                     index_data[]
00320     ,int                            num_chars
00321     ,char_type                      char_data[]
00322     ) const;
00345   virtual void load_op_state(
00346     int                           num_values
00347     ,const primitive_value_type   value_data[]
00348     ,int                          num_indexes
00349     ,const index_type             index_data[]
00350     ,int                          num_chars
00351     ,const char_type              char_data[]
00352     );
00358   virtual bool coord_invariant() const;
00426   virtual void apply_op(
00427     const int   num_vecs,       const SubVectorT<Scalar>         sub_vecs[]
00428     ,const int  num_targ_vecs,  const MutableSubVectorT<Scalar>  targ_sub_vecs[]
00429     ,ReductTarget *reduct_obj
00430     ) const = 0;
00431 
00433 
00434 private:
00435 
00436   std::string op_name_;
00437 
00438 }; // end class RTOpT
00439 
00440 } // end namespace RTOpPack
00441 
00442 #endif // RTOPPACK_RTOP_NEW_T_DECL_HPP

Generated on Thu Sep 18 12:39:44 2008 for RTOp : Vector Reduction/Transformation Operators by doxygen 1.3.9.1