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