MoochoPack_MoochoTrackerXMLSummary.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 // 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 Roscoe A. Bartlett (rabartl@sandia.gov) 
00025 // 
00026 // ***********************************************************************
00027 // @HEADER
00028 
00029 #ifndef MOOCHO_TRACKER_XML_SUMMARY_HPP
00030 #define MOOCHO_TRACKER_XML_SUMMARY_HPP
00031 
00032 #include "IterationPack_Algorithm.hpp"
00033 #include "IterationPack_AlgorithmTracker.hpp"
00034 #include "MoochoPack_Types.hpp"
00035 
00036 namespace MoochoPack {
00037 
00038 
00039 using IterationPack::Algorithm;
00040 using IterationPack::EAlgoReturn;
00041 
00045 class MoochoTrackerXMLSummary
00046   : public IterationPack::AlgorithmTracker
00047 {
00048 public:
00049 
00051   MoochoTrackerXMLSummary(
00052     const Teuchos::RCP<std::ostream> &journal_out
00053     ,const std::string xml_filename
00054     ,const std::string problem_name
00055     ,const std::string algorithm_description
00056     );
00057 
00059   //void set_output_stream(const ostream_ptr_t& o);
00060 
00062   //const ostream_ptr_t& get_output_stream() const;
00063 
00065   //   that will be overwritten if there is no
00066   //   exception
00067   void output_pre_file() const;
00068 
00071 
00073   void output_iteration(const Algorithm& algo) const;
00075   void output_final(const Algorithm& algo, EAlgoReturn algo_return) const;
00076   
00078 
00079 protected:
00080 
00082   void open_problem_element( std::ostream& out, const Algorithm& algo) const;
00083   void close_problem_element( std::ostream& out) const;
00084 
00085 private:
00086 
00087   mutable value_type obj_value_;
00088   mutable value_type c_norm_value_;
00089 
00090   std::string xml_filename_;
00091   std::string problem_name_;
00092   std::string algorithm_description_;
00093 
00094   // Not defined and not to be called
00095   MoochoTrackerXMLSummary();
00096 
00097 };  // end class MoochoTrackerXMLSummary
00098 
00099 } // end namespace MoochoPack 
00100 
00101 #endif  // RSQP_TRACK_SUMMARY_STD_H

Generated on Wed May 12 21:32:13 2010 for MoochoPack : Framework for Large-Scale Optimization Algorithms by  doxygen 1.4.7