* parameter is returned.
*/
bool log_time_differences (const bool flag);
+
+ /**
+ * Set a threshold for the
+ * minimal absolute value of
+ * double values. All numbers
+ * with a smaller absolute value
+ * will be printed as zero.
+ */
+ void threshold_double(const double t);
/**
* Output a constant something
template <typename T>
LogStream & operator << (const T &t);
+ /**
+ * Output double precision
+ * numbers through this
+ * stream. This function
+ * eliminates floating point
+ * numbers smaller than
+ * #double_threshold, which can
+ * be changed using
+ * threshold_double().
+ */
+ LogStream & operator << (const double t);
+
/**
* Treat ostream
* manipulators. This passes on
*/
double last_time;
+ /**
+ * Threshold for printing double
+ * values.
+ */
+ double double_threshold;
+
/**
* Original buffer of
* <tt>std::cerr</tt>. We store
+inline
+LogStream &
+LogStream::operator<< (const double t)
+{
+ // do the work that is common to
+ // the two operator<< functions
+ if (std::fabs(t) > double_threshold)
+ print (t);
+ else
+ print('0');
+
+ return *this;
+}
+
+
+
inline
LogStream &
LogStream::operator<< (std::ostream& (*p) (std::ostream&))
std_out(&std::cerr), file(0), was_endl(true),
std_depth(10000), file_depth(10000),
print_utime(false), diff_utime(false),
- last_time (0.), old_cerr(0)
+ last_time (0.), double_threshold(0.), old_cerr(0)
{
prefixes.push("DEAL:");
std_out->setf(std::ios::showpoint | std::ios::left);
}
+void
+LogStream::threshold_double (const double t)
+{
+ double_threshold = t;
+}
+
+
bool
LogStream::log_execution_time (const bool flag)
{