Kokkos Node API and Local Linear Algebra Kernels Version of the Day
TsqrFactory.hpp
Go to the documentation of this file.
00001 //@HEADER
00002 // ************************************************************************
00003 // 
00004 //          Kokkos: Node API and Parallel Node Kernels
00005 //              Copyright (2009) 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 __TSQR_Trilinos_TsqrFactory_hpp
00030 #define __TSQR_Trilinos_TsqrFactory_hpp
00031 
00036 
00037 #include <Tsqr_NodeTsqrFactory.hpp>
00038 #include <Teuchos_Comm.hpp>
00039 #include <Tsqr_MessengerBase.hpp>
00040 #include <Tsqr.hpp>
00041 
00042 
00043 namespace TSQR {
00044   namespace Trilinos {
00045 
00082     template<class LO, class S, class NodeTsqrType, class DistTsqrType>
00083     class TsqrFactory {
00084     public:
00085       typedef NodeTsqrType                        node_tsqr_type;
00086       typedef Teuchos::RCP< node_tsqr_type >      node_tsqr_ptr;
00087 
00088       typedef Teuchos::RCP< MessengerBase< S > >  scalar_messenger_ptr;
00089       typedef DistTsqrType                        dist_tsqr_type;
00090       typedef Teuchos::RCP< dist_tsqr_type >      dist_tsqr_ptr;
00091 
00092       typedef Tsqr< LO, S, node_tsqr_type > tsqr_type;
00093       typedef Teuchos::RCP< tsqr_type >     tsqr_ptr;
00094 
00109       virtual void
00110       makeTsqr (const Teuchos::ParameterList& plist,
00111     const scalar_messenger_ptr& messenger,
00112     tsqr_ptr& tsqr) const
00113       {
00114   node_tsqr_ptr nodeTsqr = makeNodeTsqr (plist);
00115   dist_tsqr_ptr distTsqr = makeDistTsqr (messenger, plist);
00116   tsqr = Teuchos::rcp (new tsqr_type (nodeTsqr, distTsqr));
00117       }
00118 
00120       virtual ~TsqrFactory () {};
00121 
00122     private:
00141       virtual node_tsqr_ptr
00142       makeNodeTsqr (const Teuchos::ParameterList& plist) const = 0;
00143 
00159       virtual dist_tsqr_ptr
00160       makeDistTsqr (const scalar_messenger_ptr& messenger,
00161         const Teuchos::ParameterList& plist) const = 0;
00162     };
00163   } // namespace Trilinos
00164 } // namespace TSQR
00165 
00166 #endif // __TSQR_Trilinos_TsqrFactory_hpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends