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.
 
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< Container, Poly >
 URatPolyBase (const RCP< const Basic > &var, Container &&container)
 
RCP< const Basicas_symbolic () const
 
- Public Member Functions inherited from SymEngine::UNonExprPoly< Container, Poly, rational_class >
 UNonExprPoly (const RCP< const Basic > &var, Container &&container)
 
virtual rational_class get_coeff (unsigned int i) 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< Container, Poly >
 UPolyBase (const RCP< const Basic > &var, Container &&container)
 
bool __eq__ (const Basic &o) const
 
const RCP< const Basic > & get_var () const
 
const Container & get_poly () const
 
vec_basic get_args () const
 Returns the list of arguments.
 
- 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
 
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_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< Container, Poly, rational_class >
typedef rational_class coef_type
 
- Public Types inherited from SymEngine::UPolyBase< Container, Poly >
typedef Container 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< Container, Poly, rational_class >
static RCP< const Poly > from_dict (const RCP< const Basic > &var, std::map< unsigned, rational_class > &&d)
 
- Static Public Member Functions inherited from SymEngine::UPolyBase< Container, Poly >
static RCP< const Poly > from_container (const RCP< const Basic > &var, Container &&d)
 
- Data Fields inherited from SymEngine::Basic
TypeID type_code_
 

Detailed Description

Definition at line 38 of file uratpoly.h.

Member Function Documentation

◆ __hash__()

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

Implements SymEngine::UPolyBase< Container, Poly >.

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 }

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: