LMCAS
Lamina Computer Algebra System
Toggle main menu visibility
载入中...
搜索中...
未找到
expr_errors.cpp
浏览该文件的文档.
1
#include "
expr.hpp
"
2
3
#include <string>
4
5
#include "
internal/expr_internal.hpp
"
6
#include "
internal/expr_common.hpp
"
7
namespace
LMCAS
{
8
namespace
{
9
10
using namespace
expr_detail::expr_common
;
11
12
const
char
*
unit_set_error_name
(
CasErrc
code)
noexcept
{
13
switch
(code) {
14
case
CasErrc::DimensionMismatch
: {
15
return
"DimensionMismatch"
;
16
}
17
case
CasErrc::UnitInvalid
: {
18
return
"UnitInvalid"
;
19
}
20
case
CasErrc::UnitStripTypeMismatch
: {
21
return
"UnitStripTypeMismatch"
;
22
}
23
case
CasErrc::SetElementTypeMismatch
: {
24
return
"SetElementTypeMismatch"
;
25
}
26
case
CasErrc::SetOperandTypeMismatch
: {
27
return
"SetOperandTypeMismatch"
;
28
}
29
case
CasErrc::SetElementNotHashable
: {
30
return
"SetElementNotHashable"
;
31
}
32
default
: {
33
return
"InternalInvariant"
;
34
}
35
}
36
}
37
38
const
char
*
equivalence_error_name
(
const
CasError
& error)
noexcept
{
39
if
(error.operation ==
kEquivalentOperation
&&
40
error.code ==
CasErrc::ResourceLimit
) {
41
return
"EqvBudgetExceeded"
;
42
}
43
if
(error.operation ==
kEquivalentProfileOperation
&&
44
error.code ==
CasErrc::UnsupportedExpression
) {
45
return
"EqvRuleDisabled"
;
46
}
47
return
error_name
(error.code);
48
}
49
50
}
51
52
const
char
*
error_name
(
CasErrc
code)
noexcept
{
53
switch
(code) {
54
case
CasErrc::InvalidArgument
: {
55
return
"InvalidArgument"
;
56
}
57
case
CasErrc::ParseError
: {
58
return
"ParseError"
;
59
}
60
case
CasErrc::UnboundSymbol
: {
61
return
"UnboundSymbol"
;
62
}
63
case
CasErrc::DomainError
: {
64
return
"DomainError"
;
65
}
66
case
CasErrc::UnsupportedExpression
: {
67
return
"UnsupportedExpression"
;
68
}
69
case
CasErrc::Inconclusive
: {
70
return
"Inconclusive"
;
71
}
72
case
CasErrc::ResourceLimit
: {
73
return
"ResourceLimit"
;
74
}
75
case
CasErrc::Cancelled
: {
76
return
"Cancelled"
;
77
}
78
case
CasErrc::NumericFailure
: {
79
return
"NumericFailure"
;
80
}
81
case
CasErrc::InternalInvariant
: {
82
return
"InternalInvariant"
;
83
}
84
default
: {
85
return
unit_set_error_name(code);
86
}
87
}
88
}
89
90
const
char
*
error_name
(
const
CasError
& error)
noexcept
{
91
if
(error.operation ==
kSymOperation
&&
92
error.code ==
CasErrc::InvalidArgument
&&
93
error.message.find(
"imaginary unit"
) != std::string::npos) {
94
return
"ImaginaryUnitReserved"
;
95
}
96
if
(error.operation ==
kEvalComplexOperation
&&
97
error.code ==
CasErrc::UnboundSymbol
) {
98
return
"ComplexEvalUnboundSymbol"
;
99
}
100
if
(error.operation ==
kComplexOperation
&&
101
error.code ==
CasErrc::InvalidArgument
) {
102
return
"ComplexTypeMismatch"
;
103
}
104
if
(error.operation ==
kExprSetOperation
&&
105
error.code ==
CasErrc::InvalidArgument
) {
106
return
"SetElementTypeMismatch"
;
107
}
108
if
(error.operation ==
kSolveExprSetOperation
&&
109
error.code ==
CasErrc::Inconclusive
) {
110
return
"SetResultInconclusive"
;
111
}
112
return
equivalence_error_name(error);
113
}
114
115
}
expr.hpp
expr_common.hpp
expr_internal.hpp
LMCAS::anonymous_namespace{expr_errors.cpp}::unit_set_error_name
const char * unit_set_error_name(CasErrc code) noexcept
定义
expr_errors.cpp:12
LMCAS::anonymous_namespace{expr_errors.cpp}::equivalence_error_name
const char * equivalence_error_name(const CasError &error) noexcept
定义
expr_errors.cpp:38
LMCAS::expr_detail::expr_common
定义
expr_facade.cpp:12
LMCAS::expr_detail::expr_common::kSymOperation
constexpr const char * kSymOperation
定义
expr_common.hpp:12
LMCAS::expr_detail::expr_common::kComplexOperation
constexpr const char * kComplexOperation
定义
expr_common.hpp:16
LMCAS
定义
assumption.hpp:11
LMCAS::kEquivalentProfileOperation
constexpr const char * kEquivalentProfileOperation
定义
equivalence_engine.hpp:10
LMCAS::kEvalComplexOperation
constexpr const char * kEvalComplexOperation
定义
expr_internal.hpp:16
LMCAS::CasErrc
CasErrc
定义
result.hpp:12
LMCAS::CasErrc::Inconclusive
@ Inconclusive
定义
result.hpp:24
LMCAS::CasErrc::UnboundSymbol
@ UnboundSymbol
定义
result.hpp:15
LMCAS::CasErrc::InvalidArgument
@ InvalidArgument
定义
result.hpp:13
LMCAS::CasErrc::DimensionMismatch
@ DimensionMismatch
定义
result.hpp:17
LMCAS::CasErrc::SetOperandTypeMismatch
@ SetOperandTypeMismatch
定义
result.hpp:21
LMCAS::CasErrc::UnsupportedExpression
@ UnsupportedExpression
定义
result.hpp:23
LMCAS::CasErrc::InternalInvariant
@ InternalInvariant
定义
result.hpp:28
LMCAS::CasErrc::ResourceLimit
@ ResourceLimit
定义
result.hpp:25
LMCAS::CasErrc::SetElementNotHashable
@ SetElementNotHashable
定义
result.hpp:22
LMCAS::CasErrc::NumericFailure
@ NumericFailure
定义
result.hpp:27
LMCAS::CasErrc::DomainError
@ DomainError
定义
result.hpp:16
LMCAS::CasErrc::Cancelled
@ Cancelled
定义
result.hpp:26
LMCAS::CasErrc::UnitInvalid
@ UnitInvalid
定义
result.hpp:18
LMCAS::CasErrc::SetElementTypeMismatch
@ SetElementTypeMismatch
定义
result.hpp:20
LMCAS::CasErrc::ParseError
@ ParseError
定义
result.hpp:14
LMCAS::CasErrc::UnitStripTypeMismatch
@ UnitStripTypeMismatch
定义
result.hpp:19
LMCAS::kSolveExprSetOperation
constexpr const char * kSolveExprSetOperation
定义
expr_internal.hpp:15
LMCAS::error_name
const char * error_name(CasErrc code) noexcept
定义
expr_errors.cpp:52
LMCAS::kExprSetOperation
constexpr const char * kExprSetOperation
定义
expr_internal.hpp:14
LMCAS::kEquivalentOperation
constexpr const char * kEquivalentOperation
定义
equivalence_engine.hpp:9
LMCAS::CasError
定义
result.hpp:31
src
expr_errors.cpp
生成于
, 为 LMCAS使用
1.18.0