00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #include "NOX_LineSearch_Utils_Printing.H"
00043 #include "NOX_Utils.H"
00044 #include "NOX_Common.H"
00045
00046 NOX::LineSearch::Utils::Printing::
00047 Printing(const Teuchos::RCP<NOX::Utils>& u) :
00048 NOX::Utils(*u)
00049 {
00050
00051 }
00052
00053 NOX::LineSearch::Utils::Printing::~Printing()
00054 {
00055
00056 }
00057
00058 void NOX::LineSearch::Utils::Printing::
00059 reset(const Teuchos::RCP<NOX::Utils>& u)
00060 {
00061 NOX::Utils* tmp = this;
00062 tmp = u.get();
00063 }
00064
00065 void NOX::LineSearch::Utils::Printing::
00066 printOpeningRemarks(const string& lineSearchName) const
00067 {
00068 if (this->isPrintType(NOX::Utils::InnerIteration))
00069 {
00070 this->out() << "\n" << NOX::Utils::fill(72) << "\n"
00071 << "-- " << lineSearchName << " -- \n";
00072 }
00073 }
00074
00075
00076 void NOX::LineSearch::Utils::Printing::
00077 printStep(int n, double step, double oldf, double newf, const string s,
00078 bool unscaleF) const
00079 {
00080 if (isPrintType(NOX::Utils::InnerIteration))
00081 {
00082 this->out() << setw(3) << n << ":";
00083 this->out() << NOX::Utils::fill(1,' ') << "step = " << sciformat(step);
00084 if (unscaleF == true) {
00085 this->out() << NOX::Utils::fill(1,' ') << "old f = "
00086 << sciformat(sqrt(2. * oldf));
00087 this->out() << NOX::Utils::fill(1,' ') << "new f = "
00088 << sciformat(sqrt(2. * newf));
00089 }
00090 else {
00091 this->out() << NOX::Utils::fill(1,' ') << "old f = " << sciformat(oldf);
00092 this->out() << NOX::Utils::fill(1,' ') << "new f = " << sciformat(newf);
00093 }
00094 if (!s.empty())
00095 {
00096 this->out() << " " << s << "\n";
00097 this->out() << NOX::Utils::fill(72);
00098 }
00099 this->out() << endl;
00100 }
00101 }