17 template <
typename SCALAR =
double>
46 template <
int NUM_PRECISION = 12>
49 std::cout <<
"NLOC Summary of iteration " << iterations.back() << std::endl;
50 std::cout <<
"==============================" << std::endl;
52 std::cout << std::setprecision(NUM_PRECISION) <<
"interm. cost:\t" << intermediateCosts.back() << std::endl;
53 std::cout << std::setprecision(NUM_PRECISION) <<
"final cost:\t" << finalCosts.back() << std::endl;
54 std::cout << std::setprecision(NUM_PRECISION) <<
"total cost:\t" << totalCosts.back() << std::endl;
55 std::cout << std::setprecision(NUM_PRECISION) <<
"total merit:\t" << merits.back() << std::endl;
56 std::cout << std::setprecision(NUM_PRECISION) <<
"tot. defect L1:\t" << defect_l1_norms.back() << std::endl;
57 std::cout << std::setprecision(NUM_PRECISION) <<
"tot. defect L2:\t" << defect_l2_norms.back() << std::endl;
58 std::cout << std::setprecision(NUM_PRECISION) <<
"box cstr.err:\t" << e_box_norms.back() << std::endl;
59 std::cout << std::setprecision(NUM_PRECISION) <<
"gen cstr.err:\t" << e_gen_norms.back() << std::endl;
60 std::cout << std::setprecision(NUM_PRECISION) <<
"total lx norm:\t" << lx_norms.back() << std::endl;
61 std::cout << std::setprecision(NUM_PRECISION) <<
"total lu norm:\t" << lu_norms.back() << std::endl;
62 std::cout << std::setprecision(NUM_PRECISION) <<
"step-size:\t" << stepSizes.back() << std::endl;
63 std::cout <<
" ===========" << std::endl;
64 std::cout << std::endl;
71 std::cout <<
"Logging NLOC summary to Matlab" << std::endl;
72 matFile_.open(fileName +
".mat");
74 matFile_.put(
"iterations", iterations);
75 matFile_.put(
"defect_l1_norms", defect_l1_norms);
76 matFile_.put(
"defect_l2_norms", defect_l2_norms);
77 matFile_.put(
"box_constr_norms", e_box_norms);
78 matFile_.put(
"gen_constr_norms", e_gen_norms);
79 matFile_.put(
"lx_norms", lx_norms);
80 matFile_.put(
"lu_norms", lu_norms);
81 matFile_.put(
"intermediateCosts", intermediateCosts);
82 matFile_.put(
"finalCosts", finalCosts);
83 matFile_.put(
"totalCosts", totalCosts);
84 matFile_.put(
"merits", merits);
85 matFile_.put(
"stepSizes", stepSizes);
86 matFile_.put(
"smallestEigenvalues", smallestEigenvalues);
void printSummaryLastIteration()
print summary of the last iteration with desired numeric precision
Definition: NLOCResults.hpp:47
std::vector< SCALAR > merits
Definition: NLOCResults.hpp:37
std::vector< size_t > iterations
log of the iterations
Definition: NLOCResults.hpp:21
std::vector< SCALAR > defect_l2_norms
Definition: NLOCResults.hpp:25
std::vector< SCALAR > totalCosts
Definition: NLOCResults.hpp:36
Definition: NLOCResults.hpp:18
std::vector< SCALAR > intermediateCosts
costs and merits
Definition: NLOCResults.hpp:34
std::vector< SCALAR > finalCosts
Definition: NLOCResults.hpp:35
void logToMatlab(const std::string &fileName)
Definition: NLOCResults.hpp:68
std::vector< SCALAR > e_box_norms
Definition: NLOCResults.hpp:26
std::vector< SCALAR > stepSizes
step size
Definition: NLOCResults.hpp:40
std::vector< SCALAR > lx_norms
step update norms
Definition: NLOCResults.hpp:30
std::vector< SCALAR > smallestEigenvalues
smallest eigenvalues
Definition: NLOCResults.hpp:43
std::vector< SCALAR > defect_l1_norms
different overall defect norms
Definition: NLOCResults.hpp:24
a dummy class which is created for compatibility reasons if the MATLAB flag is not set...
Definition: matlab.hpp:17
std::vector< SCALAR > e_gen_norms
Definition: NLOCResults.hpp:27
std::vector< SCALAR > lu_norms
Definition: NLOCResults.hpp:31