47 double Utils::chopVal_ = 1.0e-16;
51 if (std::fabs(x) < chopVal_)
return 0;
57 typedef std::string::size_type size_type;
58 const size_type len = str.length();
62 size_type first_non_white = 0;
65 isWhiteSpace(str[first_non_white]) && first_non_white < len ;
70 size_type last_non_white = 0;
72 last_non_white = len-1 ;
73 isWhiteSpace(str[last_non_white]) && (last_non_white != 0);
78 if( first_non_white > last_non_white )
79 return std::string(
"");
80 return str.substr(first_non_white,last_non_white-first_non_white+1);
86 std::sprintf(s,
"%d", x);
87 return std::string(s);
93 std::sprintf(s,
"%lld", x);
94 return std::string(s);
100 std::sprintf(s,
"%d", x);
101 return std::string(s);
107 std::sprintf(s,
"%g", x);
108 return std::string(s);
119 if( numProcs_in > 0 ) {
120 procRank = procRank_in;
121 numProcs = numProcs_in;
128 int maxProcOrder = 1;
129 double tmp = numProcs;
130 for(
int i = 0; i < 10; ++i, tmp *= 0.1 ) {
137 std::ostringstream parallelExtension;
140 << std::right << std::setw(maxProcOrder)
144 << std::right << std::setw(maxProcOrder)
146 return parallelExtension.str();