MoochoPack_MoochoTrackerConsoleStd.hpp

Go to the documentation of this file.
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 RSQP_TRACK_CONSOLE_STD_H
00030 #define RSQP_TRACK_CONSOLE_STD_H
00031 
00032 #include "MoochoPack_quasi_newton_stats.hpp"
00033 #include "IterationPack_AlgorithmTracker.hpp"
00034 #include "StopWatchPack_stopwatch.hpp"
00035 
00036 namespace MoochoPack {
00037 
00096 class MoochoTrackerConsoleStd
00097   : public IterationPack::AlgorithmTracker
00098 {
00099 public:
00100 
00102   MoochoTrackerConsoleStd(const ostream_ptr_t& o, const ostream_ptr_t& journal_out);
00103 
00105   void set_output_stream(const ostream_ptr_t& o);
00106 
00108   const ostream_ptr_t& get_output_stream() const;
00109 
00112 
00114   void initialize();
00116   void output_iteration(const Algorithm& algo) const;
00118   void output_final(const Algorithm& algo, EAlgoReturn algo_return) const;
00119 
00121 
00122 protected:
00123 
00125   void print_top_header(const NLPAlgoState &s, const NLPAlgo& algo) const;
00126 
00128   void print_header(const NLPAlgoState &s, const NLPAlgo& algo) const;
00129 
00130   std::ostream& o() const
00131   { return *o_; }
00132 
00133 private:
00134 
00135   // ///////////////////////////////////////////
00136   // Private types
00137 
00138   enum { NUM_PRINT_LINES = 10 };
00139   
00140   // ///////////////////////////////////////////
00141   // Private data members
00142 
00143   ostream_ptr_t                       o_;
00144   mutable StopWatchPack::stopwatch    timer_;
00145   mutable int                         printed_lines_;
00146   quasi_newton_stats_iq_member        quasi_newton_stats_;
00147 
00148   // Static formating info.
00149   static int    w_i2_;
00150   static char   ul_i2_[];
00151   static int    w_i4_;
00152   static char   ul_i4_[];
00153   static int    p2_;
00154   static int    w_p2_;
00155   static char   ul_p2_[];
00156   static int    p3_;
00157   static int    w_p3_;
00158   static char   ul_p3_[];
00159 
00160   // ///////////////////////////////////////////
00161   // Private member funcitons
00162 
00163   // Not defined and not to be called
00164   MoochoTrackerConsoleStd();
00165 };  // end class MoochoTrackerConsoleStd
00166 
00167 } // end namespace MoochoPack 
00168 
00169 #endif  // RSQP_TRACK_CONSOLE_STD_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Wed Apr 13 10:11:00 2011 for MOOCHO (Single Doxygen Collection) by  doxygen 1.6.3