NiHu  2.0
fmm_timer.cpp
Go to the documentation of this file.
1 
7 #include "fmm_timer.h"
8 
9 #include <iomanip>
10 #include <sstream>
11 
12 namespace NiHu
13 {
14 namespace fmm
15 {
16 
17 std::ostream &fmm_timer::print(std::ostream &os) const
18 {
19  // save state flags of os
20  std::ios_base::fmtflags flags = os.flags();
21 
22  os << std::fixed << std::setprecision(1);
23 
24  size_t nLevel = m_times.size();
25  for (size_t iLevel = 0; iLevel < nLevel; ++iLevel)
26  {
27  os << "Level #" << std::setw(2) << iLevel << ": "
28  << "M2M (" << std::setw(10) << m_times[iLevel][M2M] << "), "
29  << "M2L (" << std::setw(10) << m_times[iLevel][M2L] << "), "
30  << "L2L (" << std::setw(10) << m_times[iLevel][L2L] << ")" << std::endl;
31  }
32 
33  os << "P2P (" << m_times[0][P2P] << "), "
34  << "P2M (" << m_times[0][P2M] << "), "
35  << "P2L (" << m_times[0][P2L] << "), "
36  << "L2P (" << m_times[0][L2P] << "), "
37  << "M2P (" << m_times[0][M2P] << ")" << std::endl;
38 
39  // restore state flags of os
40  os.flags(flags);
41 
42  return os;
43 }
44 
45 } // end of namespace fmm
46 } // end namespace NiHu
NiHu::fmm::fmm_timer::M2L
@ M2L
index of M2L operation
Definition: fmm_timer.h:33
NiHu::fmm::fmm_timer::P2M
@ P2M
index of P2M operation
Definition: fmm_timer.h:35
NiHu::fmm::fmm_timer::L2L
@ L2L
index of L2L operation
Definition: fmm_timer.h:31
NiHu::fmm::fmm_timer::M2M
@ M2M
index of M2M operation
Definition: fmm_timer.h:29
NiHu::fmm::fmm_timer::P2L
@ P2L
index of P2L operation
Definition: fmm_timer.h:37
NiHu::fmm::fmm_timer::P2P
@ P2P
index of P2P operation
Definition: fmm_timer.h:43
NiHu::fmm::fmm_timer::M2P
@ M2P
index of M2P operation
Definition: fmm_timer.h:41
NiHu::fmm::fmm_timer::print
std::ostream & print(std::ostream &os=std::cout) const
inserter into output stream
Definition: fmm_timer.cpp:17
NiHu::fmm::fmm_timer::L2P
@ L2P
index of L2P operation
Definition: fmm_timer.h:39
fmm_timer.h
Interface of the class NiHu::fmm::fmm_timer.