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