SymEngine::NaN Class Reference

#include <nan.h>

+ Inheritance diagram for SymEngine::NaN:
+ Collaboration diagram for SymEngine::NaN:

Public Member Functions

void accept (Visitor &v) const override
 
void accept (EvalRealDoubleVisitorFinal &v) const override
 
 NaN ()
 Constructs NaN.
 
hash_t __hash__ () const override
 
bool __eq__ (const Basic &o) const override
 
int compare (const Basic &o) const override
 
bool is_zero () const override
 
bool is_one () const override
 
bool is_minus_one () const override
 
bool is_positive () const override
 
bool is_negative () const override
 
bool is_complex () const override
 
RCP< const Basicconjugate () const override
 
bool is_exact () const override
 return true if the number is an exact representation
 
Evaluateget_eval () const override
 Get Evaluate singleton to evaluate numerically.
 
RCP< const Numberadd (const Number &other) const override
 Addition.
 
RCP< const Numbermul (const Number &other) const override
 Multiplication.
 
RCP< const Numberdiv (const Number &other) const override
 Division.
 
RCP< const Numberpow (const Number &other) const override
 Power.
 
RCP< const Numberrpow (const Number &other) const override
 
- Public Member Functions inherited from SymEngine::Number
bool is_exact_zero () const
 
virtual RCP< const Numbersub (const Number &other) const
 Subtraction.
 
virtual RCP< const Numberrsub (const Number &other) const
 
virtual RCP< const Numberrdiv (const Number &other) const
 
vec_basic get_args () const override
 Returns the list of arguments.
 
virtual bool is_perfect_power (bool is_expected=false) const
 
virtual bool nth_root (const Ptr< RCP< const Number >> &, unsigned long n) const
 
- Public Member Functions inherited from SymEngine::Basic
TypeID get_type_code () const
 
 Basic ()
 Constructor.
 
 Basic (const Basic &)=delete
 Delete the copy constructor and assignment.
 
Basicoperator= (const Basic &)=delete
 Assignment operator in continuation with above.
 
 Basic (Basic &&)=delete
 Delete the move constructor and assignment.
 
Basicoperator= (Basic &&)=delete
 Assignment operator in continuation with above.
 
hash_t hash () const
 
bool __neq__ (const Basic &o) const
 true if this is not equal to o. More...
 
int __cmp__ (const Basic &o) const
 Comparison operator.
 
std::string __str__ () const
 
std::string dumps () const
 Returns a string of the instance serialized.
 
RCP< const Basicsubs (const map_basic_basic &subs_dict) const
 Substitutes 'subs_dict' into 'self'.
 
RCP< const Basicxreplace (const map_basic_basic &subs_dict) const
 
virtual RCP< const Basicexpand_as_exp () const
 expands the special function in terms of exp function
 
RCP< const Basicdiff (const RCP< const Symbol > &x, bool cache=true) const
 
- Public Member Functions inherited from SymEngine::EnableRCPFromThis< Basic >
RCP< Basicrcp_from_this ()
 Get RCP<T> pointer to self (it will cast the pointer to T)
 
RCP< const Basicrcp_from_this () const
 Get RCP<const T> pointer to self (it will cast the pointer to const T)
 
RCP< const T2 > rcp_from_this_cast () const
 Get RCP<T2> pointer to self (it will cast the pointer to T2)
 
unsigned int use_count () const
 

Static Public Attributes

static const TypeID type_code_id = SYMENGINE_NOT_A_NUMBER
 

Additional Inherited Members

- Static Public Member Functions inherited from SymEngine::Basic
static RCP< const Basicloads (const std::string &)
 Creates an instance of a serialized string.
 
- Data Fields inherited from SymEngine::Basic
TypeID type_code_
 

Detailed Description

This serves as a place holder for numeric values that are indeterminate. Most operations on NaN, produce another NaN.

Definition at line 19 of file nan.h.

Member Function Documentation

◆ __eq__()

bool SymEngine::NaN::__eq__ ( const Basic o) const
overridevirtual

Equality comparator

Parameters
o- Object to be compared with
Returns
whether the 2 objects are equal

Implements SymEngine::Basic.

Definition at line 15 of file nan.cpp.

16 {
17  if (is_a<NaN>(o))
18  return true;
19  else
20  return false;
21 }

◆ __hash__()

hash_t SymEngine::NaN::__hash__ ( ) const
overridevirtual
Returns
size of the hash

Implements SymEngine::Basic.

Definition at line 9 of file nan.cpp.

10 {
11  hash_t seed = SYMENGINE_NOT_A_NUMBER;
12  return seed;
13 }

◆ compare()

int SymEngine::NaN::compare ( const Basic o) const
overridevirtual

Returns -1, 0, 1 for this < o, this == o, this > o. This method is used when you want to sort things like x+y+z into canonical order. This function assumes that o is the same type as this. Use __cmp__ if you want general comparison.

Implements SymEngine::Basic.

Definition at line 23 of file nan.cpp.

24 {
25  SYMENGINE_ASSERT(is_a<NaN>(o))
26  return 0;
27 }

◆ conjugate()

RCP< const Basic > SymEngine::NaN::conjugate ( ) const
overridevirtual
Returns
the conjugate if the class is complex

Reimplemented from SymEngine::Number.

Definition at line 29 of file nan.cpp.

30 {
31  return Nan;
32 }

◆ is_complex()

bool SymEngine::NaN::is_complex ( ) const
inlineoverridevirtual
Returns
true if a complex number

Implements SymEngine::Number.

Definition at line 62 of file nan.h.

63  {
64  return false;
65  }

◆ is_minus_one()

bool SymEngine::NaN::is_minus_one ( ) const
inlineoverridevirtual
Returns
true if -1

Implements SymEngine::Number.

Definition at line 47 of file nan.h.

48  {
49  return false;
50  }

◆ is_negative()

bool SymEngine::NaN::is_negative ( ) const
inlineoverridevirtual
Returns
true if negative

Implements SymEngine::Number.

Definition at line 57 of file nan.h.

58  {
59  return false;
60  }

◆ is_one()

bool SymEngine::NaN::is_one ( ) const
inlineoverridevirtual
Returns
true if 1

Implements SymEngine::Number.

Definition at line 42 of file nan.h.

43  {
44  return false;
45  }

◆ is_positive()

bool SymEngine::NaN::is_positive ( ) const
inlineoverridevirtual
Returns
true if positive

Implements SymEngine::Number.

Definition at line 52 of file nan.h.

53  {
54  return false;
55  }

◆ is_zero()

bool SymEngine::NaN::is_zero ( ) const
inlineoverridevirtual
Returns
true if 0

Implements SymEngine::Number.

Definition at line 37 of file nan.h.

38  {
39  return false;
40  }

Field Documentation

◆ type_code_id

const TypeID SymEngine::NaN::type_code_id = SYMENGINE_NOT_A_NUMBER
static

Type_code_id shared by all instances

Definition at line 22 of file nan.h.


The documentation for this class was generated from the following files: