33#include <util/misc/formio.h>
34#include <util/ref/ref.h>
35#include <math/scmat/matrix.h>
37#ifndef _chemistry_qc_mbptr12_printscmatnorms_h
38#define _chemistry_qc_mbptr12_printscmatnorms_h
43 template <
class RefSCMat>
44 void print_scmat_norms(
const RefSCMat& A,
const std::string& label, std::ostream& os =
ExEnv::out0())
47 A.element_op(maxabs_op);
48 const double maxabs = maxabs_op->result();
51 A.element_op(onenorm_op);
52 const double onenorm = onenorm_op->result();
55 A.element_op(twonorm_op);
56 const double twonorm = twonorm_op->result();
58 os << indent <<
"Norms of " << label << endl;
59 os << indent <<
"------------------------" << endl;
60 os << indent <<
"||A||_{\\infty} = " <<
scprintf(
"%10.5lf",maxabs) << endl;
61 os << indent <<
"||A||_1 = " <<
scprintf(
"%10.5lf",onenorm) << endl;
62 os << indent <<
"||A||_2 = " <<
scprintf(
"%10.5lf",twonorm) << endl << endl;
static std::ostream & out0()
Return an ostream that writes from node 0.
A template class that maintains references counts.
Definition ref.h:332
Computed k-norm of matrix.
Definition elemop.h:351
This class allows printf like output to put sent to an ostream.
Definition formio.h:96