00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <config.h>
00024 #include "Checked_Number.defs.hh"
00025
00026 namespace Parma_Polyhedra_Library {
00027
00028 Minus_Infinity MINUS_INFINITY;
00029 Plus_Infinity PLUS_INFINITY;
00030 Not_A_Number NOT_A_NUMBER;
00031
00032 void
00033 throw_result_exception(Result r) {
00034 switch (r) {
00035 case V_LT:
00036 throw std::logic_error("Exact result is less than computed one.");
00037 case V_LE:
00038 throw std::logic_error("Exact result is less than or equal to "
00039 "computed one.");
00040 case V_GT:
00041 throw std::logic_error("Exact result is greater than computed one.");
00042 case V_GE:
00043 throw std::logic_error("Exact result is greater than or equal to "
00044 "computed one.");
00045 case V_NE:
00046 throw std::logic_error("Exact result is less than or greater than "
00047 "computed one.");
00048 case V_LGE:
00049 throw std::logic_error("Exact result is less than, greater than or "
00050 "equal to computed one.");
00051 case VC_MINUS_INFINITY:
00052 throw std::overflow_error("Minus infinity.");
00053 case V_NEG_OVERFLOW:
00054 throw std::overflow_error("Negative overflow.");
00055 case V_UNKNOWN_NEG_OVERFLOW:
00056 throw std::overflow_error("Unknown result due to negative overflow.");
00057 case VC_PLUS_INFINITY:
00058 throw std::overflow_error("Plus infinity.");
00059 case V_POS_OVERFLOW:
00060 throw std::overflow_error("Positive overflow.");
00061 case V_UNKNOWN_POS_OVERFLOW:
00062 throw std::overflow_error("Unknown result due to positive overflow.");
00063 case V_CVT_STR_UNK:
00064 throw std::domain_error("Invalid numeric string.");
00065 case V_DIV_ZERO:
00066 throw std::domain_error("Division by zero.");
00067 case V_INF_ADD_INF:
00068 throw std::domain_error("Infinities addition.");
00069 case V_INF_DIV_INF:
00070 throw std::domain_error("Infinities division.");
00071 case V_INF_MOD:
00072 throw std::domain_error("Remainder of division of infinity.");
00073 case V_INF_MUL_ZERO:
00074 throw std::domain_error("Multiplication of infinity and zero.");
00075 case V_INF_SUB_INF:
00076 throw std::domain_error("Subtraction of infinities.");
00077 case V_MOD_ZERO:
00078 throw std::domain_error("Remainder of division by zero.");
00079 case V_SQRT_NEG:
00080 throw std::domain_error("Square root of negative number.");
00081 case V_UNORD_COMP:
00082 throw std::domain_error("Unordered comparison.");
00083 default:
00084 throw std::logic_error("Unexpected result.");
00085 }
00086 }
00087
00088 }
00089