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;
static std::ostream & out0()
Return an ostream that writes from node 0.
The RefSCMatrix class is a smart pointer to an SCMatrix specialization.
Definition matrix.h:135
A template class that maintains references counts.
Definition ref.h:361
Computes k-norm of matrix.
Definition elemop.h:499
This class allows printf-like output to be sent to an ostream.
Definition formio.h:97
Contains all MPQC code up to version 3.
Definition mpqcin.h:14
void canonicalize_column_phases(RefSCMatrix &A)
Canonicalize phases of SCMatrix A phases are canonical when the largest-magnitude coefficient in each...
void print_scmat_norms(const RefSCMat &A, const std::string &label, std::ostream &os=ExEnv::out0())
Compute and print out neatly various matrix norms of A.
Definition util.h:22