Loading...
Searching...
No Matches
SymEngine::UIntPolyBase< Container, Poly > Class Template Reference
+ Inheritance diagram for SymEngine::UIntPolyBase< Container, Poly >:
+ Collaboration diagram for SymEngine::UIntPolyBase< Container, Poly >:

Public Member Functions

 UIntPolyBase (const RCP< const Basic > &var, Container &&container)
 
RCP< const Basicas_symbolic () const
 
- Public Member Functions inherited from SymEngine::UNonExprPoly< Container, Poly, integer_class >
 UNonExprPoly (const RCP< const Basic > &var, Container &&container)
 
virtual integer_class get_coeff (unsigned int i) const=0
 
virtual integer_class eval (const integer_class &x) const=0
 
std::vector< integer_class > multieval (const std::vector< integer_class > &v) const
 
int get_degree () const
 
integer_class get_lc () const
 
- Public Member Functions inherited from SymEngine::UPolyBase< Container, Poly >
 UPolyBase (const RCP< const Basic > &var, Container &&container)
 
int compare (const Basic &o) const override=0
 
hash_t __hash__ () const override=0
 
virtual int size () const =0
 
bool __eq__ (const Basic &o) const override
 
const RCP< const Basic > & get_var () const
 
const Container & get_poly () const
 
vec_basic get_args () const override
 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.
 
virtual hash_t __hash__ () const =0
 
hash_t hash () const
 
virtual bool __eq__ (const Basic &o) const =0
 Test equality.
 
bool __neq__ (const Basic &o) const
 true if this is not equal to o.
 
int __cmp__ (const Basic &o) const
 Comparison operator.
 
virtual int compare (const Basic &o) const =0
 
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
 
virtual vec_basic get_args () const =0
 Returns the list of arguments.
 
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)
 
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
 

Additional Inherited Members

- Public Types inherited from SymEngine::UNonExprPoly< Container, Poly, integer_class >
typedef integer_class coef_type
 
- Public Types inherited from SymEngine::UPolyBase< Container, Poly >
typedef Container container_type
 
- Static Public Member Functions inherited from SymEngine::UNonExprPoly< Container, Poly, integer_class >
static RCP< const Poly > from_dict (const RCP< const Basic > &var, std::map< unsigned, integer_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)
 
- 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

template<typename Container, typename Poly>
class SymEngine::UIntPolyBase< Container, Poly >

Definition at line 501 of file upolybase.h.

Constructor & Destructor Documentation

◆ UIntPolyBase()

template<typename Container , typename Poly >
SymEngine::UIntPolyBase< Container, Poly >::UIntPolyBase ( const RCP< const Basic > &  var,
Container &&  container 
)
inline

Definition at line 504 of file upolybase.h.

505 : UNonExprPoly<Container, Poly, integer_class>(var,
506 std::move(container))
507 {
508 }
T move(T... args)

Member Function Documentation

◆ as_symbolic()

template<typename Container , typename Poly >
RCP< const Basic > SymEngine::UIntPolyBase< Container, Poly >::as_symbolic ( ) const
inline

Definition at line 510 of file upolybase.h.

511 {
512 auto it = (down_cast<const Poly &>(*this)).begin();
513 auto end = (down_cast<const Poly &>(*this)).end();
514
515 vec_basic args;
516 for (; it != end; ++it) {
517 integer_class m = it->second;
518
519 if (it->first == 0) {
520 args.push_back(integer(m));
521 } else if (it->first == 1) {
522 if (m == 1) {
523 args.push_back(this->get_var());
524 } else {
525 args.push_back(
526 Mul::from_dict(integer(m), {{this->get_var(), one}}));
527 }
528 } else {
529 if (m == 1) {
530 args.push_back(pow(this->get_var(), integer(it->first)));
531 } else {
532 args.push_back(Mul::from_dict(
533 integer(m), {{this->get_var(), integer(it->first)}}));
534 }
535 }
536 }
537 return SymEngine::add(args);
538 }
T begin(T... args)
static RCP< const Basic > from_dict(const RCP< const Number > &coef, map_basic_basic &&d)
Create a Mul from a dict.
Definition: mul.cpp:115
T end(T... args)
RCP< const Basic > add(const RCP< const Basic > &a, const RCP< const Basic > &b)
Adds two objects (safely).
Definition: add.cpp:425
std::enable_if< std::is_integral< T >::value, RCP< constInteger > >::type integer(T i)
Definition: integer.h:197
T pow(T... args)

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