Loading...
Searching...
No Matches
nan.cpp
1#include <symengine/nan.h>
3
4namespace SymEngine
5{
6
7NaN::NaN(){SYMENGINE_ASSIGN_TYPEID()}
8
9hash_t NaN::__hash__() const
10{
11 hash_t seed = SYMENGINE_NOT_A_NUMBER;
12 return seed;
13}
14
15bool NaN::__eq__(const Basic &o) const
16{
17 if (is_a<NaN>(o))
18 return true;
19 else
20 return false;
21}
22
23int NaN::compare(const Basic &o) const
24{
25 SYMENGINE_ASSERT(is_a<NaN>(o))
26 return 0;
27}
28
29RCP<const Basic> NaN::conjugate() const
30{
31 return Nan;
32}
33
34RCP<const Number> NaN::add(const Number &other) const
35{
36 return rcp_from_this_cast<Number>();
37}
38
39RCP<const Number> NaN::mul(const Number &other) const
40{
41 return rcp_from_this_cast<Number>();
42}
43
44RCP<const Number> NaN::div(const Number &other) const
45{
46 return rcp_from_this_cast<Number>();
47}
48
49RCP<const Number> NaN::pow(const Number &other) const
50{
51 return rcp_from_this_cast<Number>();
52}
53
54RCP<const Number> NaN::rpow(const Number &other) const
55{
56 return rcp_from_this_cast<Number>();
57}
58
59class EvaluateNaN : public Evaluate
60{
61 virtual RCP<const Basic> sin(const Basic &x) const override
62 {
63 SYMENGINE_ASSERT(is_a<NaN>(x))
64 return Nan;
65 }
66 virtual RCP<const Basic> cos(const Basic &x) const override
67 {
68 SYMENGINE_ASSERT(is_a<NaN>(x))
69 return Nan;
70 }
71 virtual RCP<const Basic> tan(const Basic &x) const override
72 {
73 SYMENGINE_ASSERT(is_a<NaN>(x))
74 return Nan;
75 }
76 virtual RCP<const Basic> cot(const Basic &x) const override
77 {
78 SYMENGINE_ASSERT(is_a<NaN>(x))
79 return Nan;
80 }
81 virtual RCP<const Basic> sec(const Basic &x) const override
82 {
83 SYMENGINE_ASSERT(is_a<NaN>(x))
84 return Nan;
85 }
86 virtual RCP<const Basic> csc(const Basic &x) const override
87 {
88 SYMENGINE_ASSERT(is_a<NaN>(x))
89 return Nan;
90 }
91 virtual RCP<const Basic> asin(const Basic &x) const override
92 {
93 SYMENGINE_ASSERT(is_a<NaN>(x))
94 return Nan;
95 }
96 virtual RCP<const Basic> acos(const Basic &x) const override
97 {
98 SYMENGINE_ASSERT(is_a<NaN>(x))
99 return Nan;
100 }
101 virtual RCP<const Basic> acsc(const Basic &x) const override
102 {
103 SYMENGINE_ASSERT(is_a<NaN>(x))
104 return Nan;
105 }
106 virtual RCP<const Basic> asec(const Basic &x) const override
107 {
108 SYMENGINE_ASSERT(is_a<NaN>(x))
109 return Nan;
110 }
111 virtual RCP<const Basic> atan(const Basic &x) const override
112 {
113 SYMENGINE_ASSERT(is_a<NaN>(x))
114 return Nan;
115 }
116 virtual RCP<const Basic> acot(const Basic &x) const override
117 {
118 SYMENGINE_ASSERT(is_a<NaN>(x))
119 return Nan;
120 }
121 virtual RCP<const Basic> sinh(const Basic &x) const override
122 {
123 SYMENGINE_ASSERT(is_a<NaN>(x))
124 return Nan;
125 }
126 virtual RCP<const Basic> csch(const Basic &x) const override
127 {
128 SYMENGINE_ASSERT(is_a<NaN>(x))
129 return Nan;
130 }
131 virtual RCP<const Basic> cosh(const Basic &x) const override
132 {
133 SYMENGINE_ASSERT(is_a<NaN>(x))
134 return Nan;
135 }
136 virtual RCP<const Basic> sech(const Basic &x) const override
137 {
138 SYMENGINE_ASSERT(is_a<NaN>(x))
139 return Nan;
140 }
141 virtual RCP<const Basic> tanh(const Basic &x) const override
142 {
143 SYMENGINE_ASSERT(is_a<NaN>(x))
144 return Nan;
145 }
146 virtual RCP<const Basic> coth(const Basic &x) const override
147 {
148 SYMENGINE_ASSERT(is_a<NaN>(x))
149 return Nan;
150 }
151 virtual RCP<const Basic> asinh(const Basic &x) const override
152 {
153 SYMENGINE_ASSERT(is_a<NaN>(x))
154 return Nan;
155 }
156 virtual RCP<const Basic> acosh(const Basic &x) const override
157 {
158 SYMENGINE_ASSERT(is_a<NaN>(x))
159 return Nan;
160 }
161 virtual RCP<const Basic> acsch(const Basic &x) const override
162 {
163 SYMENGINE_ASSERT(is_a<NaN>(x))
164 return Nan;
165 }
166 virtual RCP<const Basic> asech(const Basic &x) const override
167 {
168 SYMENGINE_ASSERT(is_a<NaN>(x))
169 return Nan;
170 }
171 virtual RCP<const Basic> atanh(const Basic &x) const override
172 {
173 SYMENGINE_ASSERT(is_a<NaN>(x))
174 return Nan;
175 }
176 virtual RCP<const Basic> acoth(const Basic &x) const override
177 {
178 SYMENGINE_ASSERT(is_a<NaN>(x))
179 return Nan;
180 }
181 virtual RCP<const Basic> abs(const Basic &x) const override
182 {
183 SYMENGINE_ASSERT(is_a<NaN>(x))
184 return Nan;
185 }
186 virtual RCP<const Basic> log(const Basic &x) const override
187 {
188 SYMENGINE_ASSERT(is_a<NaN>(x))
189 return Nan;
190 }
191 virtual RCP<const Basic> gamma(const Basic &x) const override
192 {
193 SYMENGINE_ASSERT(is_a<NaN>(x))
194 return Nan;
195 }
196 virtual RCP<const Basic> exp(const Basic &x) const override
197 {
198 SYMENGINE_ASSERT(is_a<NaN>(x))
199 return Nan;
200 }
201 virtual RCP<const Basic> floor(const Basic &x) const override
202 {
203 SYMENGINE_ASSERT(is_a<NaN>(x))
204 return Nan;
205 }
206 virtual RCP<const Basic> ceiling(const Basic &x) const override
207 {
208 SYMENGINE_ASSERT(is_a<NaN>(x))
209 return Nan;
210 }
211 virtual RCP<const Basic> truncate(const Basic &x) const override
212 {
213 SYMENGINE_ASSERT(is_a<NaN>(x))
214 return Nan;
215 }
216 virtual RCP<const Basic> erf(const Basic &x) const override
217 {
218 SYMENGINE_ASSERT(is_a<NaN>(x))
219 return Nan;
220 }
221 virtual RCP<const Basic> erfc(const Basic &x) const override
222 {
223 SYMENGINE_ASSERT(is_a<NaN>(x))
224 return Nan;
225 }
226};
227
229{
230 static EvaluateNaN evaluate_NaN;
231 return evaluate_NaN;
232}
233
234} // namespace SymEngine
The lowest unit of symbolic representation.
Definition: basic.h:97
A class that will evaluate functions numerically.
Definition: number.h:200
bool __eq__(const Basic &o) const
Definition: nan.cpp:15
RCP< const Number > add(const Number &other) const
Addition.
Definition: nan.cpp:34
hash_t __hash__() const
Definition: nan.cpp:9
RCP< const Number > pow(const Number &other) const
Power.
Definition: nan.cpp:49
virtual RCP< const Basic > conjugate() const
Definition: nan.cpp:29
NaN()
Constructs NaN.
Definition: nan.cpp:7
RCP< const Number > mul(const Number &other) const
Multiplication.
Definition: nan.cpp:39
RCP< const Number > div(const Number &other) const
Division.
Definition: nan.cpp:44
int compare(const Basic &o) const
Definition: nan.cpp:23
virtual Evaluate & get_eval() const
Get Evaluate singleton to evaluate numerically.
Definition: nan.cpp:228
Main namespace for SymEngine package.
Definition: add.cpp:19