SymEngine::URatPoly Class Reference
+ Inheritance diagram for SymEngine::URatPoly:
+ Collaboration diagram for SymEngine::URatPoly:

Public Member Functions

virtual void accept (Visitor &v) const
 
virtual void accept (EvalRealDoubleVisitorFinal &v) const
 
 URatPoly (const RCP< const Basic > &var, URatDict &&dict)
 Constructor of URatPoly class. More...
 
hash_t __hash__ () const
 
- Public Member Functions inherited from SymEngine::USymEnginePoly< URatDict, URatPolyBase, URatPoly >
 USymEnginePoly (const RCP< const Basic > &var, URatDict &&dict)
 
int compare (const Basic &o) const
 
bool is_canonical (const URatDict &dict) const
 
Cf eval (const Cf &x) const
 
const std::map< Key, Cf > & get_dict () const
 
Cf get_coeff (Key x) const
 
iterator begin () const
 
iterator end () const
 
r_iterator obegin () const
 
r_iterator oend () const
 
int size () const
 
- Public Member Functions inherited from SymEngine::URatPolyBase< URatDict, URatPoly >
 URatPolyBase (const RCP< const Basic > &var, URatDict &&container)
 
RCP< const Basicas_symbolic () const
 
- Public Member Functions inherited from SymEngine::UNonExprPoly< URatDict, URatPoly, rational_class >
 UNonExprPoly (const RCP< const Basic > &var, URatDict &&container)
 
virtual rational_class get_coeff (unsigned int i) const=0
 
virtual rational_class eval (const rational_class &x) const=0
 
std::vector< rational_class > multieval (const std::vector< rational_class > &v) const
 
int get_degree () const
 
rational_class get_lc () const
 
- Public Member Functions inherited from SymEngine::UPolyBase< URatDict, URatPoly >
 UPolyBase (const RCP< const Basic > &var, URatDict &&container)
 
virtual int compare (const Basic &o) const=0
 
virtual hash_t __hash__ () const=0
 
virtual int size () const=0
 
bool __eq__ (const Basic &o) const
 
const RCP< const Basic > & get_var () const
 
const URatDictget_poly () const
 
vec_basic get_args () const
 Returns the list of arguments. More...
 
- Public Member Functions inherited from SymEngine::Basic
TypeID get_type_code () const
 
 Basic ()
 Constructor. More...
 
 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.
 
virtual hash_t __hash__ () const =0
 
hash_t hash () const
 
virtual bool __eq__ (const Basic &o) const =0
 Test equality. More...
 
bool __neq__ (const Basic &o) const
 true if this is not equal to o. More...
 
int __cmp__ (const Basic &o) const
 Comparison operator. More...
 
virtual int compare (const Basic &o) const =0
 
std::string __str__ () const
 
std::string dumps () const
 Returns a string of the instance serialized. More...
 
RCP< const Basicsubs (const map_basic_basic &subs_dict) const
 Substitutes 'subs_dict' into 'self'. More...
 
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 More...
 
virtual vec_basic get_args () const =0
 Returns the list of arguments. More...
 
virtual void accept (Visitor &v) const =0
 
virtual void accept (EvalRealDoubleVisitorFinal &v) const =0
 
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) More...
 
RCP< const Basicrcp_from_this () const
 Get RCP<const T> pointer to self (it will cast the pointer to const T) More...
 
RCP< const T2 > rcp_from_this_cast () const
 Get RCP<T2> pointer to self (it will cast the pointer to T2) More...
 
unsigned int use_count () const
 

Static Public Attributes

static const TypeID type_code_id = SYMENGINE_URATPOLY
 

Additional Inherited Members

- Public Types inherited from SymEngine::USymEnginePoly< URatDict, URatPolyBase, URatPoly >
using Cf = typename URatPolyBase< URatDict, URatPoly >::coef_type
 
using Key = typename Container::key_type
 
typedef std::map< Key, Cf >::const_iterator iterator
 
typedef std::map< Key, Cf >::const_reverse_iterator r_iterator
 
- Public Types inherited from SymEngine::UNonExprPoly< URatDict, URatPoly, rational_class >
typedef rational_class coef_type
 
- Public Types inherited from SymEngine::UPolyBase< URatDict, URatPoly >
typedef URatDict container_type
 
- Static Public Member Functions inherited from SymEngine::USymEnginePoly< URatDict, URatPolyBase, URatPoly >
static RCP< const URatPolyfrom_vec (const RCP< const Basic > &var, const std::vector< Cf > &v)
 
static URatDict container_from_dict (const RCP< const Basic > &var, std::map< Key, Cf > &&d)
 
static enable_if_t< is_a_UPoly< FromPoly >::value, RCP< const URatPoly > > from_poly (const FromPoly &p)
 
- Static Public Member Functions inherited from SymEngine::UNonExprPoly< URatDict, URatPoly, rational_class >
static RCP< const URatPolyfrom_dict (const RCP< const Basic > &var, std::map< unsigned, rational_class > &&d)
 
- Static Public Member Functions inherited from SymEngine::UPolyBase< URatDict, URatPoly >
static RCP< const URatPolyfrom_container (const RCP< const Basic > &var, URatDict &&d)
 
- Static Public Member Functions inherited from SymEngine::Basic
static RCP< const Basicloads (const std::string &)
 Creates an instance of a serialized string. More...
 
- Data Fields inherited from SymEngine::Basic
TypeID type_code_
 

Detailed Description

Definition at line 38 of file uratpoly.h.

Constructor & Destructor Documentation

◆ URatPoly()

SymEngine::URatPoly::URatPoly ( const RCP< const Basic > &  var,
URatDict &&  dict 
)

Constructor of URatPoly class.

Definition at line 6 of file uratpoly.cpp.

7 : USymEnginePoly(
8 var, std::move(dict)){SYMENGINE_ASSIGN_TYPEID()
9 SYMENGINE_ASSERT(is_canonical(get_poly()))}
T move(T... args)

Member Function Documentation

◆ __hash__()

hash_t SymEngine::URatPoly::__hash__ ( ) const
virtual
Returns
size of the hash

Implements SymEngine::UPolyBase< URatDict, URatPoly >.

Definition at line 11 of file uratpoly.cpp.

12{
13 hash_t seed = SYMENGINE_URATPOLY;
14
15 seed += get_var()->hash();
16 for (const auto &it : get_poly().dict_) {
17 hash_t temp = SYMENGINE_URATPOLY;
18 hash_combine<unsigned int>(temp, it.first);
19 hash_combine<long long int>(temp, mp_get_si(get_num(it.second)));
20 hash_combine<long long int>(temp, mp_get_si(get_den(it.second)));
21 seed += temp;
22 }
23 return seed;
24}

◆ accept() [1/2]

virtual void SymEngine::URatPoly::accept ( EvalRealDoubleVisitorFinal v) const
virtual

Implements SymEngine::Basic.

◆ accept() [2/2]

virtual void SymEngine::URatPoly::accept ( Visitor v) const
virtual

Implements SymEngine::Basic.

Field Documentation

◆ type_code_id

const TypeID SymEngine::URatPoly::type_code_id = SYMENGINE_URATPOLY
static

Type_code_id shared by all instances

Definition at line 41 of file uratpoly.h.


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