Teuchos Package Browser (Single Doxygen Collection) Version of the Day
AlgorithmA.hpp
Go to the documentation of this file.
00001 /*
00002 // @HEADER
00003 // ***********************************************************************
00004 //
00005 //                    Teuchos: Common Tools Package
00006 //                 Copyright (2004) Sandia Corporation
00007 //
00008 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00009 // license for use of this work by or on behalf of the U.S. Government.
00010 //
00011 // This library is free software; you can redistribute it and/or modify
00012 // it under the terms of the GNU Lesser General Public License as
00013 // published by the Free Software Foundation; either version 2.1 of the
00014 // License, or (at your option) any later version.
00015 //
00016 // This library is distributed in the hope that it will be useful, but
00017 // WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019 // Lesser General Public License for more details.
00020 //
00021 // You should have received a copy of the GNU Lesser General Public
00022 // License along with this library; if not, write to the Free Software
00023 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00024 // USA
00025 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
00026 //
00027 // ***********************************************************************
00028 // @HEADER
00029 */
00030 
00031 #include "Teuchos_ParameterListAcceptor.hpp"
00032 #include "Teuchos_VerboseObject.hpp"
00033 
00034 #ifndef TEUCHOS_ALGORITHM_A_HPP
00035 #define TEUCHOS_ALGORITHM_A_HPP
00036 
00037 
00038 void someDumbFunction( std::ostream &out, const std::string &indentSpacer );
00039 
00040 
00041 void someLessDumbFunction( std::ostream &out_arg );
00042 
00043 
00044 // This is a typical numerical class that derives from VerboseObject and does
00045 // outputting.  Note that the use of the OSTab class requires initialization
00046 // using VerboseObject::getOSTab(...) which takes care of the hassles and is
00047 // easy to use.
00048 //
00049 // This class also derives from ParameterListAcceptor and uses helper
00050 // functio  ns to read options for VerboseObject from a parameter sublist.
00051 class AlgorithmA
00052   : public Teuchos::VerboseObject<AlgorithmA>,
00053     public Teuchos::ParameterListAcceptor
00054 {
00055 public:
00056 
00057   // Constructor(s)
00058 
00059   AlgorithmA();
00060 
00061   // Overridden from ParameterListAccpetor
00062 
00063   void setParameterList(Teuchos::RCP<Teuchos::ParameterList> const& paramList);
00064 
00065   Teuchos::RCP<Teuchos::ParameterList> getNonconstParameterList();
00066 
00067   Teuchos::RCP<Teuchos::ParameterList> unsetParameterList();
00068 
00069   Teuchos::RCP<const Teuchos::ParameterList> getParameterList() const;
00070 
00071   Teuchos::RCP<const Teuchos::ParameterList> getValidParameters() const;
00072 
00073   // Other functions
00074 
00075   void doAlgorithm();
00076 
00077 private:
00078 
00079   enum EAlgoType { ALGO_BOB, ALGO_JOHN, ALGO_HARRY };
00080 
00081   static const std::string toString( AlgorithmA::EAlgoType algoType );
00082 
00083   Teuchos::RCP<Teuchos::ParameterList> paramList_;
00084   EAlgoType algoType_;
00085   double algoTol_;
00086   
00087 };
00088 
00089 
00090 #endif // TEUCHOS_ALGORITHM_A_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines