|
From: <got...@us...> - 2009-09-28 17:38:08
|
Revision: 387
http://scstudio.svn.sourceforge.net/scstudio/?rev=387&view=rev
Author: gotthardp
Date: 2009-09-28 17:38:00 +0000 (Mon, 28 Sep 2009)
Log Message:
-----------
Fix output of "inf" time intervals.
Modified Paths:
--------------
trunk/src/data/time.h
Property Changed:
----------------
trunk/src/check/realizability/
trunk/tests/universal_boundedness/
Property changes on: trunk/src/check/realizability
___________________________________________________________________
Added: svn:ignore
+ CMakeFiles
cmake_install.cmake
CTestTestfile.cmake
*.dir
Makefile
*.vcproj
Modified: trunk/src/data/time.h
===================================================================
--- trunk/src/data/time.h 2009-09-28 13:52:36 UTC (rev 386)
+++ trunk/src/data/time.h 2009-09-28 17:38:00 UTC (rev 387)
@@ -31,6 +31,7 @@
#include<cctype>
#include<cstring>
#include<string>
+#include <limits>
#if defined(_MSC_VER)
// Visual C++ does not support functions declared using exception specification.
@@ -513,10 +514,23 @@
return (right>left)?right:left;
}
-
};
// end of MscIntervalCouple class
+template<class P>
+std::ostream&
+operator<<(std::ostream& os, const MscIntervalCouple<P>& value)
+{
+ if(value.get_value() == std::numeric_limits<P>::infinity())
+ os << "inf";
+ else if(value.get_value() == -std::numeric_limits<P>::infinity())
+ os << "-inf";
+ else
+ os << value.get_value();
+
+ return os;
+}
+
/**
* @brief class representing Interval
*/
@@ -629,7 +643,7 @@
throw MscIntervalStringConversionError(this->to_string()+std::string(" is not valid interval."));
}
- MscIntervalCouple<T> get_begin() const
+ const MscIntervalCouple<T>& get_begin() const
{
return m_begin;
}
@@ -928,9 +942,9 @@
os << "(";
os
- << interval.get_begin_value()
+ << interval.get_begin()
<< ","
- << interval.get_end_value();
+ << interval.get_end();
if (interval.get_end_closed())
os << "]";
@@ -941,7 +955,7 @@
{
os
<< "["
- << interval.get_begin_value()
+ << interval.get_begin()
<< "]";
}
Property changes on: trunk/tests/universal_boundedness
___________________________________________________________________
Added: svn:ignore
+ CMakeFiles
cmake_install.cmake
CTestTestfile.cmake
*.dir
Makefile
*.vcproj
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|