本文整理汇总了C++中Journalist::Printf方法的典型用法代码示例。如果您正苦于以下问题:C++ Journalist::Printf方法的具体用法?C++ Journalist::Printf怎么用?C++ Journalist::Printf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Journalist
的用法示例。
在下文中一共展示了Journalist::Printf方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PrintImpl
void CompoundVector::PrintImpl(const Journalist& jnlst,
EJournalLevel level,
EJournalCategory category,
const std::string& name,
Index indent,
const std::string& prefix) const
{
DBG_START_METH("CompoundVector::PrintImpl", dbg_verbosity);
jnlst.Printf(level, category, "\n");
jnlst.PrintfIndented(level, category, indent,
"%sCompoundVector \"%s\" with %d components:\n",
prefix.c_str(), name.c_str(), NComps());
for (Index i=0; i<NComps(); i++) {
jnlst.Printf(level, category, "\n");
jnlst.PrintfIndented(level, category, indent,
"%sComponent %d:\n", prefix.c_str(), i+1);
if (ConstComp(i)) {
DBG_ASSERT(name.size()<200);
char buffer[256];
Snprintf(buffer, 255, "%s[%2d]", name.c_str(), i);
std::string term_name = buffer;
ConstComp(i)->Print(&jnlst, level, category, term_name,
indent+1, prefix);
}
else {
jnlst.PrintfIndented(level, category, indent,
"%sComponent %d is not yet set!\n",
prefix.c_str(), i+1);
}
}
}
示例2: ReportException
/** Method to report the exception to a journalist */
void ReportException(const Journalist& jnlst,
EJournalLevel level = J_ERROR) const
{
jnlst.Printf(level, J_MAIN,
"Exception of type: %s in file \"%s\" at line %d:\n Exception message: %s\n",
type_.c_str(), file_name_.c_str(), line_number_, msg_.c_str());
}
示例3: PrintImpl
void MultiVectorMatrix::PrintImpl(const Journalist& jnlst,
EJournalLevel level,
EJournalCategory category,
const std::string& name,
Index indent,
const std::string& prefix) const
{
jnlst.Printf(level, category, "\n");
jnlst.PrintfIndented(level, category, indent,
"%sMultiVectorMatrix \"%s\" with %d columns:\n",
prefix.c_str(), name.c_str(), NCols());
for (Index i=0; i<NCols(); i++) {
if (ConstVec(i)) {
DBG_ASSERT(name.size()<200);
char buffer[256];
Snprintf(buffer, 255, "%s[%2d]", name.c_str(), i);
std::string term_name = buffer;
ConstVec(i)->Print(&jnlst, level, category, term_name,
indent+1, prefix);
}
else {
jnlst.PrintfIndented(level, category, indent,
"%sVector in column %d is not yet set!\n",
prefix.c_str(), i);
}
}
}
示例4: PrintImpl
void DenseSymMatrix::PrintImpl(const Journalist& jnlst,
EJournalLevel level,
EJournalCategory category,
const std::string& name,
Index indent,
const std::string& prefix) const
{
jnlst.Printf(level, category, "\n");
jnlst.PrintfIndented(level, category, indent,
"%sDenseSymMatrix \"%s\" of dimension %d (only lower triangular part printed):\n",
prefix.c_str(), name.c_str(), Dim());
if (initialized_) {
for (Index j=0; j<NCols(); j++) {
for (Index i=j; i<NRows(); i++) {
jnlst.PrintfIndented(level, category, indent,
"%s%s[%5d,%5d]=%23.16e\n",
prefix.c_str(), name.c_str(), i, j, values_[i+NRows()*j]);
}
}
}
else {
jnlst.PrintfIndented(level, category, indent,
"The matrix has not yet been initialized!\n");
}
}
示例5: PrintImpl
void DenseGenMatrix::PrintImpl(const Journalist& jnlst,
EJournalLevel level,
EJournalCategory category,
const std::string& name,
Index indent,
const std::string& prefix) const
{
jnlst.Printf(level, category, "\n");
jnlst.PrintfIndented(level, category, indent,
"%sDenseGenMatrix \"%s\" with %d rows and %d columns:\n",
prefix.c_str(), name.c_str(), NRows(), NCols());
if (initialized_) {
for (Index j=0; j<NCols(); j++) {
for (Index i=0; i<NRows(); i++) {
jnlst.PrintfIndented(level, category, indent,
"%s%s[%5d,%5d]=%23.16e\n",
prefix.c_str(), name.c_str(), i, j, values_[i+NRows()*j]);
}
}
}
else {
jnlst.PrintfIndented(level, category, indent,
"The matrix has not yet been initialized!\n");
}
}
示例6: PrintImpl
void CompoundSymMatrix::PrintImpl(const Journalist& jnlst,
EJournalLevel level,
EJournalCategory category,
const std::string& name,
Index indent,
const std::string& prefix) const
{
jnlst.Printf(level, category, "\n");
jnlst.PrintfIndented(level, category, indent,
"%sCompoundSymMatrix \"%s\" with %d rows and columns components:\n",
prefix.c_str(), name.c_str(), NComps_Dim());
for (Index irow = 0; irow < NComps_Dim(); irow++ ) {
for (Index jcol = 0; jcol <= irow; jcol++ ) {
jnlst.PrintfIndented(level, category, indent,
"%sComponent for row %d and column %d:\n",
prefix.c_str(), irow, jcol);
if (ConstComp(irow,jcol)) {
DBG_ASSERT(name.size()<200);
char buffer[256];
sprintf(buffer, "%s[%d][%d]", name.c_str(), irow, jcol);
std::string term_name = buffer;
ConstComp(irow,jcol)->Print(&jnlst, level, category, term_name,
indent+1, prefix);
}
else {
jnlst.PrintfIndented(level, category, indent,
"%sThis component has not been set.\n",
prefix.c_str());
}
}
}
}
示例7: print_copyright_message
void IpoptAlgorithm::print_copyright_message(const Journalist& jnlst)
{
jnlst.Printf(J_INSUPPRESSIBLE, J_MAIN,
"\n******************************************************************************\n"
"This program contains Ipopt, a library for large-scale nonlinear optimization.\n"
" Ipopt is released as open source code under the Eclipse Public License (EPL).\n"
" For more information visit http://projects.coin-or.org/Ipopt\n"
"******************************************************************************\n\n");
copyright_message_printed = true;
}
示例8: PrintImpl
void ZeroMatrix::PrintImpl(const Journalist& jnlst,
EJournalLevel level,
EJournalCategory category,
const std::string& name,
Index indent,
const std::string& prefix) const
{
jnlst.Printf(level, category, "\n");
jnlst.PrintfIndented(level, category, indent,
"%sZeroMatrix \"%s\" with %d row and %d column components:\n",
prefix.c_str(), name.c_str(), NRows(), NCols());
}
示例9: Print
void PiecewisePenalty::Print(const Journalist& jnlst)
{
// DBG_START_METH("FilterLineSearch::Filter::Print", dbg_verbosity);
jnlst.Printf(J_DETAILED, J_LINE_SEARCH,
"The current piecewise penalty has %d entries.\n",PiecewisePenalty_list_.size());
jnlst.Printf(J_DETAILED, J_LINE_SEARCH,
"We only allow %d entries.\n", max_piece_number_);
jnlst.Printf(J_DETAILED, J_LINE_SEARCH,
"The min piecewise penalty is %d .\n", min_piece_penalty_);
if (!jnlst.ProduceOutput(J_DETAILED, J_LINE_SEARCH)) {
return;
}
std::vector<PiecewisePenEntry>::iterator iter;
Index count = 0;
for (iter = PiecewisePenalty_list_.begin(); iter != PiecewisePenalty_list_.end();
iter++) {
if (count % 10 == 0) {
jnlst.Printf(J_DETAILED, J_LINE_SEARCH,
" pen_r barrier_obj infeasi\n");
}
count++;
jnlst.Printf(J_DETAILED, J_LINE_SEARCH, "%5d ", count);
jnlst.Printf(J_DETAILED, J_LINE_SEARCH, "%23.16e %23.16e %23.16e \n", iter->pen_r,
iter->barrier_obj, iter->infeasi);
}
}
示例10: PrintImpl
void TransposeMatrix::PrintImpl(const Journalist& jnlst,
EJournalLevel level,
EJournalCategory category,
const std::string& name,
Index indent,
const std::string& prefix) const
{
jnlst.Printf(level, category, "\n");
jnlst.PrintfIndented(level, category, indent,
"%sTransposeMatrix \"%s\" of the following matrix\n",
prefix.c_str(), name.c_str());
std::string new_name = name+"^T";
orig_matrix_->Print(&jnlst, level, category, new_name,
indent+1, prefix);
}
示例11: Print
void Filter::Print(const Journalist& jnlst)
{
DBG_START_METH("FilterLineSearch::Filter::Print", dbg_verbosity);
jnlst.Printf(J_DETAILED, J_LINE_SEARCH,
"The current filter has %d entries.\n", filter_list_.size());
if (!jnlst.ProduceOutput(J_VECTOR, J_LINE_SEARCH)) {
return;
}
std::list<FilterEntry*>::iterator iter;
Index count = 0;
for (iter = filter_list_.begin(); iter != filter_list_.end();
iter++) {
if (count % 10 == 0) {
jnlst.Printf(J_VECTOR, J_LINE_SEARCH,
" phi theta iter\n");
}
count++;
jnlst.Printf(J_VECTOR, J_LINE_SEARCH, "%5d ", count);
for (Index i=0; i<dim_; i++) {
jnlst.Printf(J_VECTOR, J_LINE_SEARCH, "%23.16e ", (*iter)->val(i));
}
jnlst.Printf(J_VECTOR, J_LINE_SEARCH, "%5d\n",(*iter)->iter());
}
}
示例12: PrintImpl
void DiagMatrix::PrintImpl(const Journalist& jnlst,
EJournalLevel level,
EJournalCategory category,
const std::string& name,
Index indent,
const std::string& prefix) const
{
jnlst.Printf(level, category, "\n");
jnlst.PrintfIndented(level, category, indent,
"%sDiagMatrix \"%s\" with %d rows and columns, and with diagonal elements:\n",
prefix.c_str(), name.c_str(), Dim());
if (IsValid(diag_)) {
diag_->Print(&jnlst, level, category, name, indent+1, prefix);
}
else {
jnlst.PrintfIndented(level, category, indent,
"%sDiagonal elements not set!\n", prefix.c_str());
}
}
示例13: PrintImpl
void SumSymMatrix::PrintImpl(const Journalist& jnlst,
EJournalLevel level,
EJournalCategory category,
const std::string& name,
Index indent,
const std::string& prefix) const
{
jnlst.Printf(level, category, "\n");
jnlst.PrintfIndented(level, category, indent,
"%sSumSymMatrix \"%s\" of dimension %d with %d terms:\n",
prefix.c_str(), name.c_str(), Dim(), NTerms());
for (Index iterm=0; iterm<NTerms(); iterm++) {
jnlst.PrintfIndented(level, category, indent,
"%sTerm %d with factor %23.16e and the following matrix:\n",
prefix.c_str(), iterm, factors_[iterm]);
char buffer[256];
sprintf(buffer, "Term: %d", iterm);
std::string name = buffer;
matrices_[iterm]->Print(&jnlst, level, category, name, indent+1, prefix);
}
}
示例14: PrintImpl
void SymScaledMatrix::PrintImpl(const Journalist& jnlst,
EJournalLevel level,
EJournalCategory category,
const std::string& name,
Index indent,
const std::string& prefix) const
{
jnlst.Printf(level, category, "\n");
jnlst.PrintfIndented(level, category, indent,
"%sSymScaledMatrix \"%s\" of dimension %d x %d:\n",
prefix.c_str(), name.c_str(), NRows(), NCols());
owner_space_->RowColScaling()->Print(&jnlst, level, category,
name+"_row_col_scaling",
indent+1, prefix);
if (IsValid(matrix_)) {
matrix_->Print(&jnlst, level, category, name+"_unscaled_matrix",
indent+1, prefix);
}
else {
jnlst.PrintfIndented(level, category, indent,
"%sunscaled matrix is NULL\n", prefix.c_str());
}
}
示例15:
void
TimingStatistics::PrintAllTimingStatistics(
Journalist& jnlst,
EJournalLevel level,
EJournalCategory category) const
{
if (!jnlst.ProduceOutput(level, category))
return;
jnlst.Printf(level, category,
"OverallAlgorithm....................: %10.3f (sys: %10.3f wall: %10.3f)\n",
OverallAlgorithm_.TotalCpuTime(),
OverallAlgorithm_.TotalSysTime(),
OverallAlgorithm_.TotalWallclockTime());
jnlst.Printf(level, category,
" PrintProblemStatistics.............: %10.3f (sys: %10.3f wall: %10.3f)\n",
PrintProblemStatistics_.TotalCpuTime(),
PrintProblemStatistics_.TotalSysTime(),
PrintProblemStatistics_.TotalWallclockTime());
jnlst.Printf(level, category,
" InitializeIterates.................: %10.3f (sys: %10.3f wall: %10.3f)\n",
InitializeIterates_.TotalCpuTime(),
InitializeIterates_.TotalSysTime(),
InitializeIterates_.TotalWallclockTime());
jnlst.Printf(level, category,
" UpdateHessian......................: %10.3f (sys: %10.3f wall: %10.3f)\n",
UpdateHessian_.TotalCpuTime(),
UpdateHessian_.TotalSysTime(),
UpdateHessian_.TotalWallclockTime());
jnlst.Printf(level, category,
" OutputIteration....................: %10.3f (sys: %10.3f wall: %10.3f)\n",
OutputIteration_.TotalCpuTime(),
OutputIteration_.TotalSysTime(),
OutputIteration_.TotalWallclockTime());
jnlst.Printf(level, category,
" UpdateBarrierParameter.............: %10.3f (sys: %10.3f wall: %10.3f)\n",
UpdateBarrierParameter_.TotalCpuTime(),
UpdateBarrierParameter_.TotalSysTime(),
UpdateBarrierParameter_.TotalWallclockTime());
jnlst.Printf(level, category,
" ComputeSearchDirection.............: %10.3f (sys: %10.3f wall: %10.3f)\n",
ComputeSearchDirection_.TotalCpuTime(),
ComputeSearchDirection_.TotalSysTime(),
ComputeSearchDirection_.TotalWallclockTime());
jnlst.Printf(level, category,
" ComputeAcceptableTrialPoint........: %10.3f (sys: %10.3f wall: %10.3f)\n",
ComputeAcceptableTrialPoint_.TotalCpuTime(),
ComputeAcceptableTrialPoint_.TotalSysTime(),
ComputeAcceptableTrialPoint_.TotalWallclockTime());
jnlst.Printf(level, category,
" AcceptTrialPoint...................: %10.3f (sys: %10.3f wall: %10.3f)\n",
AcceptTrialPoint_.TotalCpuTime(),
AcceptTrialPoint_.TotalSysTime(),
AcceptTrialPoint_.TotalWallclockTime());
jnlst.Printf(level, category,
" CheckConvergence...................: %10.3f (sys: %10.3f wall: %10.3f)\n",
CheckConvergence_.TotalCpuTime(),
CheckConvergence_.TotalSysTime(),
CheckConvergence_.TotalWallclockTime());
jnlst.Printf(level, category,
"PDSystemSolverTotal.................: %10.3f (sys: %10.3f wall: %10.3f)\n",
PDSystemSolverTotal_.TotalCpuTime(),
PDSystemSolverTotal_.TotalSysTime(),
PDSystemSolverTotal_.TotalWallclockTime());
jnlst.Printf(level, category,
" PDSystemSolverSolveOnce............: %10.3f (sys: %10.3f wall: %10.3f)\n",
PDSystemSolverSolveOnce_.TotalCpuTime(),
PDSystemSolverSolveOnce_.TotalSysTime(),
PDSystemSolverSolveOnce_.TotalWallclockTime());
jnlst.Printf(level, category,
" ComputeResiduals...................: %10.3f (sys: %10.3f wall: %10.3f)\n",
ComputeResiduals_.TotalCpuTime(),
ComputeResiduals_.TotalSysTime(),
ComputeResiduals_.TotalWallclockTime());
jnlst.Printf(level, category,
" StdAugSystemSolverMultiSolve.......: %10.3f (sys: %10.3f wall: %10.3f)\n",
StdAugSystemSolverMultiSolve_.TotalCpuTime(),
StdAugSystemSolverMultiSolve_.TotalSysTime(),
StdAugSystemSolverMultiSolve_.TotalWallclockTime());
jnlst.Printf(level, category,
" LinearSystemScaling................: %10.3f (sys: %10.3f wall: %10.3f)\n",
LinearSystemScaling_.TotalCpuTime(),
LinearSystemScaling_.TotalSysTime(),
LinearSystemScaling_.TotalWallclockTime());
jnlst.Printf(level, category,
" LinearSystemSymbolicFactorization..: %10.3f (sys: %10.3f wall: %10.3f)\n",
LinearSystemSymbolicFactorization_.TotalCpuTime(),
LinearSystemSymbolicFactorization_.TotalSysTime(),
LinearSystemSymbolicFactorization_.TotalWallclockTime());
jnlst.Printf(level, category,
" LinearSystemFactorization..........: %10.3f (sys: %10.3f wall: %10.3f)\n",
LinearSystemFactorization_.TotalCpuTime(),
LinearSystemFactorization_.TotalSysTime(),
LinearSystemFactorization_.TotalWallclockTime());
jnlst.Printf(level, category,
" LinearSystemBackSolve..............: %10.3f (sys: %10.3f wall: %10.3f)\n",
LinearSystemBackSolve_.TotalCpuTime(),
LinearSystemBackSolve_.TotalSysTime(),
LinearSystemBackSolve_.TotalWallclockTime());
//.........这里部分代码省略.........