00001 // $Id: APPSPACK_Print.hpp,v 1.9 2003/11/26 16:27:11 tgkolda Exp $ 00002 // $Source: /space/CVS-Acro/acro/packages/appspack/appspack/src/APPSPACK_Print.hpp,v $ 00003 00004 //@HEADER 00005 // ************************************************************************ 00006 // 00007 // APPSPACK: Asynchronous Parallel Pattern Search 00008 // Copyright (2003) Sandia Corporation 00009 // 00010 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive 00011 // license for use of this work by or on behalf of the U.S. Government. 00012 // 00013 // This library is free software; you can redistribute it and/or modify 00014 // it under the terms of the GNU Lesser General Public License as 00015 // published by the Free Software Foundation; either version 2.1 of the 00016 // License, or (at your option) any later version. 00017 // 00018 // This library is distributed in the hope that it will be useful, but 00019 // WITHOUT ANY WARRANTY; without even the implied warranty of 00020 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00021 // Lesser General Public License for more details. 00022 // 00023 // You should have received a copy of the GNU Lesser General Public 00024 // License along with this library; if not, write to the Free Software 00025 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00026 // USA. . 00027 // 00028 // Questions? Contact Tammy Kolda (tgkolda@sandia.gov) 00029 // 00030 // ************************************************************************ 00031 //@HEADER 00032 00038 #ifndef APPSPACK_PRINT_HPP 00039 #define APPSPACK_PRINT_HPP 00040 00041 #include "APPSPACK_Common.hpp" 00042 #include "APPSPACK_Value.hpp" 00043 00044 namespace APPSPACK 00045 { 00046 00047 // forward declaration 00048 namespace Parameter { 00049 class List; 00050 } 00051 00069 class Print 00070 { 00071 00072 public: 00073 00075 Print(Parameter::List& params); 00076 00078 ~Print(); 00079 00081 enum PrintType 00082 { 00084 FinalSolution = 1, 00086 NewBestPoint = 2, 00088 InitialData = 3, 00090 EvaluatedPoints = 4, 00092 NewBestDirections = 5, 00094 UnevaluatedPoints = 6, 00096 Directions = 7 00097 }; 00098 00100 00106 static unsigned int debug; 00107 00109 00112 static int precision; 00113 00115 class PrintablePositiveDouble 00116 { 00117 public: 00118 PrintablePositiveDouble(double d_in, int precision_in = -1) : 00119 d(d_in), 00120 precision(precision_in < 0 ? APPSPACK::Print::precision : precision_in) 00121 {}; 00122 ~PrintablePositiveDouble() {}; 00123 double d; 00124 int precision; 00125 }; 00126 00128 class PrintableDouble 00129 { 00130 public: 00131 PrintableDouble(double d_in, int precision_in = -1) : 00132 d(d_in), 00133 precision(precision_in < 0 ? APPSPACK::Print::precision : precision_in) 00134 {}; 00135 00136 ~PrintableDouble() {}; 00137 double d; 00138 int precision; 00139 }; 00140 00142 static PrintablePositiveDouble formatPositiveDouble(double d, int precision_in = -1); 00143 00145 static PrintableDouble formatDouble(double d, int precision_in = -1); 00146 00148 static bool doPrint(enum PrintType type); 00149 00150 }; 00151 } 00152 00154 ostream& operator<< (ostream& stream, const APPSPACK::Print::PrintablePositiveDouble value); 00156 ostream& operator<< (ostream& stream, const APPSPACK::Print::PrintableDouble value); 00157 00158 00159 #endif 00160
© Sandia Corporation | Site Contact | Privacy and Security
Generated on Wed Dec 14 18:41:04 2005 for APPSPACK 4.0.2 by
1.3.8 written by Dimitri van Heesch,
© 1997-2002