SG++-Doxygen-Documentation
|
Singleton class to facilitate debugging output. More...
#include <Printer.hpp>
Public Member Functions | |
void | disableStatusPrinting () |
Disable the printStatus... More... | |
void | enableStatusPrinting () |
Enable the printStatus... More... | |
double | getLastDurationSecs () const |
size_t | getLineLengthLimit () |
MutexType & | getMutex () |
std::ostream * | getStream () const |
int | getVerbosity () const |
bool | isStatusPrintingEnabled () |
void | printIterativeGridGenerator (const IterativeGridGenerator &gridGen) const |
Print a grid (grid points and function values). More... | |
void | printSLE (SLE &system) const |
Print a system of linear equations. More... | |
void | printStatusBegin (const std::string &msg) |
Call at the beginning of a time-consuming operation. More... | |
void | printStatusEnd (const std::string &msg="") |
Call at the end of a time-consuming operation. More... | |
void | printStatusIdentation () |
Internal function printing the indentation. More... | |
void | printStatusNewLine () |
End the last status update and place the cursor in a newline. More... | |
void | printStatusUpdate (const std::string &msg) |
Call for printing status updates on the operation. More... | |
void | setLineLengthLimit (size_t lineLengthLimit) |
void | setStream (std::ostream *stream) |
void | setVerbosity (int level) |
Static Public Member Functions | |
static Printer & | getInstance () |
Static Public Attributes | |
static const int | DEFAULT_VERBOSITY = 0 |
default verbosity More... | |
Protected Attributes | |
bool | cursorInClearLine |
is current line empty? (false if there's an old status update) More... | |
std::string | indentation |
indentation More... | |
int | indentationLevel |
current indentation level (can be less than statusLevel) More... | |
double | lastDuration |
length of last operation in seconds More... | |
size_t | lastMsgLength |
length of the last status message in characters More... | |
size_t | lineLengthLimit |
maximum length of lines, 0 if unbounded More... | |
MutexType | mutex |
internal mutex More... | |
int | statusLevel |
current status level More... | |
bool | statusPrintingEnabled |
whether status printing is enabled More... | |
std::ostream * | stream |
stream used for printing (default std::cout) More... | |
int | verbose |
verbosity level More... | |
std::stack< base::SGppStopwatch > | watches |
stack of stop watches (started at time of printStatusBegin() calls) More... | |
Static Protected Attributes | |
static const char | INDENTATION_CHAR = ' ' |
static const size_t | INDENTATION_LENGTH = 4 |
Singleton class to facilitate debugging output.
Use with the sgpp::printer instance.
The status printing functions won't print anything if
void sgpp::optimization::Printer::disableStatusPrinting | ( | ) |
Disable the printStatus...
functions. (They're enabled by default.)
References sgpp::optimization::MutexType::lock().
Referenced by sgpp::datadriven::OperationInverseRosenblattTransformation1DBspline::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DModBspline::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DPoly::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DPolyBoundary::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DBsplineBoundary::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DModPoly::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DModPolyClenshawCurtis::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DBsplineClenshawCurtis::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DPolyClenshawCurtis::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DModBsplineClenshawCurtis::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DPolyClenshawCurtisBoundary::doTransformation1D(), sgpp::optimization::IterativeGridGeneratorLinearSurplus::generate(), sgpp::optimization::optimizer::MultiStart::optimize(), sgpp::optimization::optimizer::LevenbergMarquardt::optimize(), sgpp::optimization::optimizer::AdaptiveNewton::optimize(), sgpp::optimization::optimizer::Newton::optimize(), and sgpp::datadriven::BoHyperparameterOptimizer::run().
void sgpp::optimization::Printer::enableStatusPrinting | ( | ) |
Enable the printStatus...
functions. (They're enabled by default.)
References sgpp::optimization::MutexType::lock().
Referenced by sgpp::optimization::IterativeGridGeneratorLinearSurplus::generate(), sgpp::optimization::optimizer::MultiStart::optimize(), sgpp::optimization::optimizer::LevenbergMarquardt::optimize(), sgpp::optimization::optimizer::AdaptiveNewton::optimize(), and sgpp::optimization::optimizer::Newton::optimize().
|
static |
Referenced by BSplineCoefficientGridFunction(), BSplineTensorCoefficientGridFunction(), sgpp::combigrid::calculateInterpolationCoefficientsForConvertedExpUniformBoundaryCombigird(), sgpp::optimization::OperationMultipleHierarchisationFundamentalSpline::doDehierarchisation(), sgpp::optimization::OperationMultipleHierarchisationModFundamentalSpline::doDehierarchisation(), sgpp::optimization::OperationMultipleHierarchisationFundamentalSpline::doHierarchisation(), sgpp::optimization::OperationMultipleHierarchisationModFundamentalSpline::doHierarchisation(), sgpp::datadriven::OperationInverseRosenblattTransformation1DModBspline::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DModPoly::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DBspline::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DPoly::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DBsplineBoundary::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DPolyBoundary::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DPolyClenshawCurtisBoundary::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DBsplineClenshawCurtis::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DModBsplineClenshawCurtis::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DModPolyClenshawCurtis::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DPolyClenshawCurtis::doTransformation1D(), sgpp::combigrid::FullGridPCESummationStrategy< V >::eval(), sgpp::optimization::IterativeGridGeneratorSOO::generate(), sgpp::optimization::IterativeGridGeneratorLinearSurplus::generate(), sgpp::optimization::IterativeGridGeneratorRitterNovak::generate(), sgpp::optimization::optimizer::CMAES::optimize(), sgpp::optimization::optimizer::Rprop::optimize(), sgpp::optimization::optimizer::AdaptiveGradientDescent::optimize(), sgpp::optimization::optimizer::BFGS::optimize(), sgpp::optimization::optimizer::GradientDescent::optimize(), sgpp::optimization::optimizer::NelderMead::optimize(), sgpp::optimization::optimizer::LogBarrier::optimize(), sgpp::optimization::optimizer::DifferentialEvolution::optimize(), sgpp::optimization::optimizer::NLCG::optimize(), sgpp::optimization::optimizer::MultiStart::optimize(), sgpp::optimization::optimizer::SquaredPenalty::optimize(), sgpp::optimization::optimizer::AugmentedLagrangian::optimize(), sgpp::optimization::optimizer::LevenbergMarquardt::optimize(), sgpp::optimization::optimizer::AdaptiveNewton::optimize(), sgpp::optimization::optimizer::Newton::optimize(), sgpp::datadriven::BoHyperparameterOptimizer::run(), sgpp::optimization::sle_solver::GaussianElimination::solve(), sgpp::optimization::sle_solver::Gmmpp::solve(), sgpp::optimization::sle_solver::Eigen::solve(), sgpp::optimization::sle_solver::Armadillo::solve(), sgpp::optimization::sle_solver::UMFPACK::solve(), sgpp::optimization::sle_solver::Auto::solve(), and sgpp::optimization::sle_solver::BiCGStab::solve().
double sgpp::optimization::Printer::getLastDurationSecs | ( | ) | const |
Referenced by setVerbosity().
size_t sgpp::optimization::Printer::getLineLengthLimit | ( | ) |
Referenced by setVerbosity().
MutexType & sgpp::optimization::Printer::getMutex | ( | ) |
Referenced by sgpp::optimization::optimizer::MultiStart::optimize(), and setVerbosity().
std::ostream * sgpp::optimization::Printer::getStream | ( | ) | const |
Referenced by setVerbosity().
|
inline |
References verbose.
bool sgpp::optimization::Printer::isStatusPrintingEnabled | ( | ) |
References sgpp::optimization::MutexType::lock().
Referenced by sgpp::optimization::optimizer::MultiStart::optimize(), sgpp::optimization::optimizer::LevenbergMarquardt::optimize(), sgpp::optimization::optimizer::AdaptiveNewton::optimize(), and sgpp::optimization::optimizer::Newton::optimize().
void sgpp::optimization::Printer::printIterativeGridGenerator | ( | const IterativeGridGenerator & | gridGen | ) | const |
Print a grid (grid points and function values).
gridGen | grid to be printed |
References sgpp::optimization::IterativeGridGenerator::getFunctionValues(), sgpp::optimization::IterativeGridGenerator::getGrid(), sgpp::base::HashGridStorage::getSize(), sgpp::base::Grid::getStorage(), python.utils.sg_projections::gridStorage, and python.statsfileInfo::i.
Referenced by setVerbosity().
void sgpp::optimization::Printer::printSLE | ( | SLE & | system | ) | const |
Print a system of linear equations.
system | system to be printed |
References sgpp::optimization::SLE::getDimension(), sgpp::optimization::SLE::getMatrixEntry(), python.statsfileInfo::i, and python.utils.statsfile2gnuplot::j.
Referenced by setVerbosity().
void sgpp::optimization::Printer::printStatusBegin | ( | const std::string & | msg | ) |
Call at the beginning of a time-consuming operation.
Locks and unlocks an OpenMP mutex.
msg | short description of the operation |
References sgpp::optimization::MutexType::lock().
Referenced by sgpp::optimization::OperationMultipleHierarchisationFundamentalSpline::doDehierarchisation(), sgpp::optimization::OperationMultipleHierarchisationModFundamentalSpline::doDehierarchisation(), sgpp::optimization::OperationMultipleHierarchisationFundamentalSpline::doHierarchisation(), sgpp::optimization::OperationMultipleHierarchisationModFundamentalSpline::doHierarchisation(), sgpp::optimization::IterativeGridGeneratorSOO::generate(), sgpp::optimization::IterativeGridGeneratorLinearSurplus::generate(), sgpp::optimization::IterativeGridGeneratorRitterNovak::generate(), sgpp::optimization::optimizer::CMAES::optimize(), sgpp::optimization::optimizer::Rprop::optimize(), sgpp::optimization::optimizer::AdaptiveGradientDescent::optimize(), sgpp::optimization::optimizer::BFGS::optimize(), sgpp::optimization::optimizer::GradientDescent::optimize(), sgpp::optimization::optimizer::NelderMead::optimize(), sgpp::optimization::optimizer::LogBarrier::optimize(), sgpp::optimization::optimizer::DifferentialEvolution::optimize(), sgpp::optimization::optimizer::NLCG::optimize(), sgpp::optimization::optimizer::MultiStart::optimize(), sgpp::optimization::optimizer::AugmentedLagrangian::optimize(), sgpp::optimization::optimizer::SquaredPenalty::optimize(), sgpp::optimization::optimizer::LevenbergMarquardt::optimize(), sgpp::optimization::optimizer::AdaptiveNewton::optimize(), sgpp::optimization::optimizer::Newton::optimize(), sgpp::optimization::sle_solver::GaussianElimination::solve(), sgpp::optimization::sle_solver::Gmmpp::solve(), sgpp::optimization::sle_solver::Eigen::solve(), sgpp::optimization::sle_solver::Armadillo::solve(), sgpp::optimization::sle_solver::UMFPACK::solve(), sgpp::optimization::sle_solver::Auto::solve(), and sgpp::optimization::sle_solver::BiCGStab::solve().
void sgpp::optimization::Printer::printStatusEnd | ( | const std::string & | msg = "" | ) |
Call at the end of a time-consuming operation.
Locks and unlocks an OpenMP mutex.
Retrieve the running time of the operation with getLastDurationSecs() (also works with nested calls of printStatusBegin()).
msg | short description of the result, e.g. "success" or "error" (optional) |
References sgpp::optimization::MutexType::lock(), and sgpp::base::SGppStopwatch::stop().
Referenced by sgpp::optimization::OperationMultipleHierarchisationFundamentalSpline::doDehierarchisation(), sgpp::optimization::OperationMultipleHierarchisationModFundamentalSpline::doDehierarchisation(), sgpp::optimization::OperationMultipleHierarchisationFundamentalSpline::doHierarchisation(), sgpp::optimization::OperationMultipleHierarchisationModFundamentalSpline::doHierarchisation(), sgpp::optimization::IterativeGridGeneratorSOO::generate(), sgpp::optimization::IterativeGridGeneratorLinearSurplus::generate(), sgpp::optimization::IterativeGridGeneratorRitterNovak::generate(), sgpp::optimization::optimizer::CMAES::optimize(), sgpp::optimization::optimizer::Rprop::optimize(), sgpp::optimization::optimizer::AdaptiveGradientDescent::optimize(), sgpp::optimization::optimizer::BFGS::optimize(), sgpp::optimization::optimizer::GradientDescent::optimize(), sgpp::optimization::optimizer::NelderMead::optimize(), sgpp::optimization::optimizer::LogBarrier::optimize(), sgpp::optimization::optimizer::DifferentialEvolution::optimize(), sgpp::optimization::optimizer::NLCG::optimize(), sgpp::optimization::optimizer::MultiStart::optimize(), sgpp::optimization::optimizer::AugmentedLagrangian::optimize(), sgpp::optimization::optimizer::SquaredPenalty::optimize(), sgpp::optimization::optimizer::LevenbergMarquardt::optimize(), sgpp::optimization::optimizer::AdaptiveNewton::optimize(), sgpp::optimization::optimizer::Newton::optimize(), sgpp::optimization::sle_solver::GaussianElimination::solve(), sgpp::optimization::sle_solver::Armadillo::solve(), sgpp::optimization::sle_solver::Eigen::solve(), sgpp::optimization::sle_solver::UMFPACK::solve(), sgpp::optimization::sle_solver::Auto::solve(), and sgpp::optimization::sle_solver::BiCGStab::solve().
void sgpp::optimization::Printer::printStatusIdentation | ( | ) |
Internal function printing the indentation.
References python.statsfileInfo::i.
void sgpp::optimization::Printer::printStatusNewLine | ( | ) |
End the last status update and place the cursor in a newline.
Referenced by sgpp::optimization::sle_solver::Gmmpp::solve(), sgpp::optimization::sle_solver::Armadillo::solve(), sgpp::optimization::sle_solver::Eigen::solve(), sgpp::optimization::sle_solver::UMFPACK::solve(), and sgpp::optimization::sle_solver::Auto::solve().
void sgpp::optimization::Printer::printStatusUpdate | ( | const std::string & | msg | ) |
Call for printing status updates on the operation.
The last status is erased, if printStatusNewLine has not been called before. Locks and unlocks an OpenMP mutex.
msg | status message |
References sgpp::optimization::MutexType::lock().
Referenced by sgpp::optimization::IterativeGridGeneratorSOO::generate(), sgpp::optimization::IterativeGridGeneratorLinearSurplus::generate(), sgpp::optimization::IterativeGridGeneratorRitterNovak::generate(), sgpp::optimization::optimizer::CMAES::optimize(), sgpp::optimization::optimizer::AdaptiveGradientDescent::optimize(), sgpp::optimization::optimizer::Rprop::optimize(), sgpp::optimization::optimizer::BFGS::optimize(), sgpp::optimization::optimizer::GradientDescent::optimize(), sgpp::optimization::optimizer::NelderMead::optimize(), sgpp::optimization::optimizer::LogBarrier::optimize(), sgpp::optimization::optimizer::DifferentialEvolution::optimize(), sgpp::optimization::optimizer::NLCG::optimize(), sgpp::optimization::optimizer::MultiStart::optimize(), sgpp::optimization::optimizer::AugmentedLagrangian::optimize(), sgpp::optimization::optimizer::SquaredPenalty::optimize(), sgpp::optimization::optimizer::LevenbergMarquardt::optimize(), sgpp::optimization::optimizer::AdaptiveNewton::optimize(), sgpp::optimization::optimizer::Newton::optimize(), sgpp::optimization::sle_solver::Gmmpp::solve(), sgpp::optimization::sle_solver::GaussianElimination::solve(), sgpp::optimization::sle_solver::Armadillo::solve(), sgpp::optimization::sle_solver::Eigen::solve(), sgpp::optimization::sle_solver::UMFPACK::solve(), sgpp::optimization::sle_solver::Auto::solve(), and sgpp::optimization::sle_solver::BiCGStab::solve().
void sgpp::optimization::Printer::setLineLengthLimit | ( | size_t | lineLengthLimit | ) |
lineLengthLimit | maximum length of lines, 0 if unbounded |
Referenced by setVerbosity().
void sgpp::optimization::Printer::setStream | ( | std::ostream * | stream | ) |
stream | stream used for printing (default std::cout) |
Referenced by setVerbosity().
|
inline |
level | new verbosity level |
References getLastDurationSecs(), getLineLengthLimit(), getMutex(), getStream(), level, lineLengthLimit, printIterativeGridGenerator(), printSLE(), setLineLengthLimit(), setStream(), stream, and verbose.
Referenced by BSplineCoefficientGridFunction(), BSplineTensorCoefficientGridFunction(), sgpp::combigrid::calculateInterpolationCoefficientsForConvertedExpUniformBoundaryCombigird(), and sgpp::combigrid::FullGridPCESummationStrategy< V >::eval().
|
protected |
is current line empty? (false if there's an old status update)
|
static |
default verbosity
|
protected |
indentation
|
staticprotected |
|
staticprotected |
|
protected |
current indentation level (can be less than statusLevel)
|
protected |
length of last operation in seconds
|
protected |
length of the last status message in characters
|
protected |
maximum length of lines, 0 if unbounded
Referenced by setVerbosity().
|
protected |
internal mutex
|
protected |
current status level
|
protected |
whether status printing is enabled
|
protected |
stream used for printing (default std::cout)
Referenced by setVerbosity().
|
protected |
verbosity level
Referenced by python.uq.operations.forcePositivity.findIntersections.IntersectionCandidates::findIntersections(), getVerbosity(), and setVerbosity().
|
protected |
stack of stop watches (started at time of printStatusBegin() calls)