2 #ifndef _math_scmat_util_h
3 #define _math_scmat_util_h
5 #include <math/scmat/elemop.h>
6 #include <math/scmat/block.h>
13 scmat_perform_op_on_blocks(
const Ref<SCElementOp>& op,
14 const Ref<SCMatrixBlockList> &blocklist);
21 template <
class RefSCMat>
25 A.element_op(maxabs_op);
26 const double maxabs = maxabs_op->result();
29 A.element_op(onenorm_op);
30 const double onenorm = onenorm_op->result();
33 A.element_op(twonorm_op);
34 const double twonorm = twonorm_op->result();
36 os << indent <<
"Norms of " << label << std::endl;
37 os << indent <<
"------------------------" << std::endl;
38 os << indent <<
"||A||_{\\infty} = " <<
scprintf(
"%10.5lf",maxabs) << std::endl;
39 os << indent <<
"||A||_1 = " <<
scprintf(
"%10.5lf",onenorm) << std::endl;
40 os << indent <<
"||A||_2 = " <<
scprintf(
"%10.5lf",twonorm) << std::endl << std::endl;