14 #ifndef SYMENGINE_ADD_H
15 #define SYMENGINE_ADD_H
83 static RCP<const Basic>
from_dict(
const RCP<const Number> &coef,
94 const RCP<const Basic> &t);
105 const RCP<const Number> &c,
106 const RCP<const Basic> &term);
115 const Ptr<RCP<const Basic>> &b)
const;
124 const Ptr<RCP<const Number>> &coef,
125 const Ptr<RCP<const Basic>> &term);
162 RCP<const Basic>
add(
const RCP<const Basic> &a,
const RCP<const Basic> &b);
171 RCP<const Basic>
add(
const vec_basic &a);
181 RCP<const Basic>
sub(
const RCP<const Basic> &a,
const RCP<const Basic> &b);
The base class for SymEngine.
#define IMPLEMENT_TYPEID(SYMENGINE_ID)
Inline members and functions.
The base class for representing addition in symbolic expressions.
static RCP< const Basic > from_dict(const RCP< const Number > &coef, umap_basic_num &&d)
Create an appropriate instance from dictionary quickly.
bool __eq__(const Basic &o) const override
Test equality.
RCP< const Number > coef_
vec_basic get_args() const override
Returns the arguments of the Add.
static void coef_dict_add_term(const Ptr< RCP< const Number >> &coef, umap_basic_num &d, const RCP< const Number > &c, const RCP< const Basic > &term)
Updates the numerical coefficient and the dictionary.
void as_two_terms(const Ptr< RCP< const Basic >> &a, const Ptr< RCP< const Basic >> &b) const
Converts the Add into a sum of two Basic objects.
bool is_canonical(const RCP< const Number > &coef, const umap_basic_num &dict) const
Checks if a given dictionary and coeffient is in cannonical form.
int compare(const Basic &o) const override
Compares Add objects.
const RCP< const Number > & get_coef() const
static void dict_add_term(umap_basic_num &d, const RCP< const Number > &coef, const RCP< const Basic > &t)
Adds a new term to the expression.
Add(const RCP< const Number > &coef, umap_basic_num &&dict)
Default constructor.
static void as_coef_term(const RCP< const Basic > &self, const Ptr< RCP< const Number >> &coef, const Ptr< RCP< const Basic >> &term)
Converts a Basic self into the form of coefficient * term.
hash_t __hash__() const override
Generates the hash representation.
The lowest unit of symbolic representation.
Main namespace for SymEngine package.
RCP< const Basic > sub(const RCP< const Basic > &a, const RCP< const Basic > &b)
Substracts b from a.
RCP< const Basic > add(const RCP< const Basic > &a, const RCP< const Basic > &b)
Adds two objects (safely).