functions.h
Go to the documentation of this file.
1 
7 #ifndef SYMENGINE_FUNCTIONS_H
8 #define SYMENGINE_FUNCTIONS_H
9 
10 #include <symengine/basic.h>
11 #include <symengine/symengine_casts.h>
12 #include <symengine/constants.h>
13 
14 namespace SymEngine
15 {
16 
17 class Function : public Basic
18 {
19 };
20 
21 class OneArgFunction : public Function
22 {
23 private:
24  RCP<const Basic> arg_;
25 public:
27  OneArgFunction(const RCP<const Basic> &arg) : arg_{arg} {};
29  inline hash_t __hash__() const override
30  {
31  hash_t seed = this->get_type_code();
32  hash_combine<Basic>(seed, *arg_);
33  return seed;
34  }
36  inline RCP<const Basic> get_arg() const
37  {
38  return arg_;
39  }
40  inline vec_basic get_args() const override
41  {
42  return {arg_};
43  }
45  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const = 0;
46 
47  inline RCP<const Basic> create(const vec_basic &b) const
48  {
49  SYMENGINE_ASSERT(b.size() == 1);
50  return create(b[0]);
51  }
52 
57  inline bool __eq__(const Basic &o) const override
58  {
59  return is_same_type(*this, o)
60  and eq(*get_arg(),
61  *down_cast<const OneArgFunction &>(o).get_arg());
62  }
64  inline int compare(const Basic &o) const override
65  {
66  SYMENGINE_ASSERT(is_same_type(*this, o))
67  return get_arg()->__cmp__(
68  *(down_cast<const OneArgFunction &>(o).get_arg()));
69  }
70 };
71 
72 template <class BaseClass>
73 class TwoArgBasic : public BaseClass
74 {
75 private:
76  RCP<const Basic> a_;
77  RCP<const Basic> b_;
78 public:
80  TwoArgBasic(const RCP<const Basic> &a, const RCP<const Basic> &b)
81  : a_{a}, b_{b} {};
83  inline hash_t __hash__() const override
84  {
85  hash_t seed = this->get_type_code();
86  hash_combine<Basic>(seed, *a_);
87  hash_combine<Basic>(seed, *b_);
88  return seed;
89  }
91  inline RCP<const Basic> get_arg1() const
92  {
93  return a_;
94  }
96  inline RCP<const Basic> get_arg2() const
97  {
98  return b_;
99  }
100  inline vec_basic get_args() const override
101  {
102  return {a_, b_};
103  }
105  virtual RCP<const Basic> create(const RCP<const Basic> &a,
106  const RCP<const Basic> &b) const = 0;
107 
108  inline RCP<const Basic> create(const vec_basic &b) const
109  {
110  SYMENGINE_ASSERT(b.size() == 2);
111  return create(b[0], b[1]);
112  }
113 
118  inline bool __eq__(const Basic &o) const override
119  {
120  return is_same_type(*this, o)
121  and eq(*get_arg1(),
122  *down_cast<const TwoArgBasic &>(o).get_arg1())
123  and eq(*get_arg2(),
124  *down_cast<const TwoArgBasic &>(o).get_arg2());
125  }
127  inline int compare(const Basic &o) const override
128  {
129  SYMENGINE_ASSERT(is_same_type(*this, o))
130  const TwoArgBasic &t = down_cast<const TwoArgBasic &>(o);
131  if (neq(*get_arg1(), *(t.get_arg1()))) {
132  return get_arg1()->__cmp__(
133  *(down_cast<const TwoArgBasic &>(o).get_arg1()));
134  } else {
135  return get_arg2()->__cmp__(
136  *(down_cast<const TwoArgBasic &>(o).get_arg2()));
137  }
138  }
139 };
140 
141 typedef TwoArgBasic<Function> TwoArgFunction;
142 
144 {
145 private:
146  vec_basic arg_;
147 
148 public:
150  MultiArgFunction(const vec_basic &arg) : arg_{arg} {};
152  inline hash_t __hash__() const override
153  {
154  hash_t seed = this->get_type_code();
155  for (const auto &a : arg_)
156  hash_combine<Basic>(seed, *a);
157  return seed;
158  }
159  inline vec_basic get_args() const override
160  {
161  return arg_;
162  }
163  inline const vec_basic &get_vec() const
164  {
165  return arg_;
166  }
168  virtual RCP<const Basic> create(const vec_basic &v) const = 0;
173  inline bool __eq__(const Basic &o) const override
174  {
175  return is_same_type(*this, o)
176  and unified_eq(get_vec(),
177  down_cast<const MultiArgFunction &>(o).get_vec());
178  }
180  inline int compare(const Basic &o) const override
181  {
182  SYMENGINE_ASSERT(is_same_type(*this, o))
183  return unified_compare(
184  get_vec(), down_cast<const MultiArgFunction &>(o).get_vec());
185  }
186 };
187 
188 class Sign : public OneArgFunction
189 {
190 public:
191  IMPLEMENT_TYPEID(SYMENGINE_SIGN)
193  Sign(const RCP<const Basic> &arg);
195  bool is_canonical(const RCP<const Basic> &arg) const;
197  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
198 };
199 
201 RCP<const Basic> sign(const RCP<const Basic> &arg);
202 
203 class Floor : public OneArgFunction
204 {
205 public:
206  IMPLEMENT_TYPEID(SYMENGINE_FLOOR)
208  Floor(const RCP<const Basic> &arg);
210  bool is_canonical(const RCP<const Basic> &arg) const;
212  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
213 };
214 
216 RCP<const Basic> floor(const RCP<const Basic> &arg);
217 
218 class Ceiling : public OneArgFunction
219 {
220 public:
221  IMPLEMENT_TYPEID(SYMENGINE_CEILING)
223  Ceiling(const RCP<const Basic> &arg);
225  bool is_canonical(const RCP<const Basic> &arg) const;
227  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
228 };
229 
231 RCP<const Basic> ceiling(const RCP<const Basic> &arg);
232 
233 class Truncate : public OneArgFunction
234 {
235 public:
236  IMPLEMENT_TYPEID(SYMENGINE_TRUNCATE)
238  Truncate(const RCP<const Basic> &arg);
240  bool is_canonical(const RCP<const Basic> &arg) const;
242  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
243 };
244 
246 RCP<const Basic> truncate(const RCP<const Basic> &arg);
247 
248 class Conjugate : public OneArgFunction
249 {
250 public:
251  IMPLEMENT_TYPEID(SYMENGINE_CONJUGATE)
253  Conjugate(const RCP<const Basic> &arg);
255  bool is_canonical(const RCP<const Basic> &arg) const;
257  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
258 };
259 
261 RCP<const Basic> conjugate(const RCP<const Basic> &arg);
262 
263 class TrigBase : public OneArgFunction
264 {
265 public:
267  TrigBase(RCP<const Basic> arg) : OneArgFunction(arg){};
268 };
269 
270 class TrigFunction : public TrigBase
271 {
272 public:
274  TrigFunction(RCP<const Basic> arg) : TrigBase(arg){};
275 };
276 
278 {
279 public:
281  InverseTrigFunction(RCP<const Basic> arg) : TrigBase(arg){};
282 };
283 
286 bool get_pi_shift(const RCP<const Basic> &arg, const Ptr<RCP<const Number>> &n,
287  const Ptr<RCP<const Basic>> &m);
288 
290 bool could_extract_minus(const Basic &arg);
291 
292 bool handle_minus(const RCP<const Basic> &arg,
293  const Ptr<RCP<const Basic>> &rarg);
294 
298 bool inverse_lookup(const umap_basic_basic &d, const RCP<const Basic> &t,
299  const Ptr<RCP<const Basic>> &index);
300 
301 // \return true of conjugate has to be returned finally else false
302 bool trig_simplify(const RCP<const Basic> &arg, unsigned period, bool odd,
303  bool conj_odd, // input
304  const Ptr<RCP<const Basic>> &rarg, int &index,
305  int &sign); // output
306 
308 RCP<const Basic> sqrt(const RCP<const Basic> &arg);
309 
311 RCP<const Basic> cbrt(const RCP<const Basic> &arg);
312 
313 class Sin : public TrigFunction
314 {
315 
316 public:
317  IMPLEMENT_TYPEID(SYMENGINE_SIN)
319  Sin(const RCP<const Basic> &arg);
321  bool is_canonical(const RCP<const Basic> &arg) const;
323  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
324 };
325 
327 RCP<const Basic> sin(const RCP<const Basic> &arg);
328 
329 class Cos : public TrigFunction
330 {
331 
332 public:
333  IMPLEMENT_TYPEID(SYMENGINE_COS)
335  Cos(const RCP<const Basic> &arg);
337  bool is_canonical(const RCP<const Basic> &arg) const;
339  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
340 };
341 
343 RCP<const Basic> cos(const RCP<const Basic> &arg);
344 
345 class Tan : public TrigFunction
346 {
347 
348 public:
349  IMPLEMENT_TYPEID(SYMENGINE_TAN)
351  Tan(const RCP<const Basic> &arg);
353  bool is_canonical(const RCP<const Basic> &arg) const;
355  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
356 };
358 RCP<const Basic> tan(const RCP<const Basic> &arg);
359 
360 class Cot : public TrigFunction
361 {
362 
363 public:
364  IMPLEMENT_TYPEID(SYMENGINE_COT)
366  Cot(const RCP<const Basic> &arg);
368  bool is_canonical(const RCP<const Basic> &arg) const;
370  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
371 };
373 RCP<const Basic> cot(const RCP<const Basic> &arg);
374 
375 class Csc : public TrigFunction
376 {
377 
378 public:
379  IMPLEMENT_TYPEID(SYMENGINE_CSC)
381  Csc(const RCP<const Basic> &arg);
383  bool is_canonical(const RCP<const Basic> &arg) const;
385  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
386 };
388 RCP<const Basic> csc(const RCP<const Basic> &arg);
389 
390 class Sec : public TrigFunction
391 {
392 
393 public:
394  IMPLEMENT_TYPEID(SYMENGINE_SEC)
396  Sec(const RCP<const Basic> &arg);
398  bool is_canonical(const RCP<const Basic> &arg) const;
400  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
401 };
403 RCP<const Basic> sec(const RCP<const Basic> &arg);
404 
405 class ASin : public InverseTrigFunction
406 {
407 
408 public:
409  IMPLEMENT_TYPEID(SYMENGINE_ASIN)
411  ASin(const RCP<const Basic> &arg);
413  bool is_canonical(const RCP<const Basic> &arg) const;
415  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
416 };
417 
419 RCP<const Basic> asin(const RCP<const Basic> &arg);
420 
421 class ACos : public InverseTrigFunction
422 {
423 
424 public:
425  IMPLEMENT_TYPEID(SYMENGINE_ACOS)
427  ACos(const RCP<const Basic> &arg);
429  bool is_canonical(const RCP<const Basic> &arg) const;
431  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
432 };
433 
435 RCP<const Basic> acos(const RCP<const Basic> &arg);
436 
437 class ASec : public InverseTrigFunction
438 {
439 
440 public:
441  IMPLEMENT_TYPEID(SYMENGINE_ASEC)
443  ASec(const RCP<const Basic> &arg);
445  bool is_canonical(const RCP<const Basic> &arg) const;
447  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
448 };
449 
451 RCP<const Basic> asec(const RCP<const Basic> &arg);
452 
453 class ACsc : public InverseTrigFunction
454 {
455 
456 public:
457  IMPLEMENT_TYPEID(SYMENGINE_ACSC)
459  ACsc(const RCP<const Basic> &arg);
461  bool is_canonical(const RCP<const Basic> &arg) const;
463  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
464 };
465 
467 RCP<const Basic> acsc(const RCP<const Basic> &arg);
468 
469 class ATan : public InverseTrigFunction
470 {
471 
472 public:
473  IMPLEMENT_TYPEID(SYMENGINE_ATAN)
475  ATan(const RCP<const Basic> &arg);
477  bool is_canonical(const RCP<const Basic> &arg) const;
479  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
480 };
481 
483 RCP<const Basic> atan(const RCP<const Basic> &arg);
484 
485 class ACot : public InverseTrigFunction
486 {
487 
488 public:
489  IMPLEMENT_TYPEID(SYMENGINE_ACOT)
491  ACot(const RCP<const Basic> &arg);
493  bool is_canonical(const RCP<const Basic> &arg) const;
495  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
496 };
497 
499 RCP<const Basic> acot(const RCP<const Basic> &arg);
500 
501 class ATan2 : public TwoArgFunction
502 {
503 public:
504  IMPLEMENT_TYPEID(SYMENGINE_ATAN2)
506  ATan2(const RCP<const Basic> &num, const RCP<const Basic> &den);
508  bool is_canonical(const RCP<const Basic> &num,
509  const RCP<const Basic> &den) const;
511  inline RCP<const Basic> get_num() const
512  {
513  return get_arg1();
514  }
516  inline RCP<const Basic> get_den() const
517  {
518  return get_arg2();
519  }
521  RCP<const Basic> create(const RCP<const Basic> &a,
522  const RCP<const Basic> &b) const override;
523 };
524 
526 RCP<const Basic> atan2(const RCP<const Basic> &num,
527  const RCP<const Basic> &den);
528 
529 class Log : public OneArgFunction
530 {
531  // Logarithms are taken with the natural base, `e`. To get
532  // a logarithm of a different base `b`, use `log(x, b)`,
533  // which is essentially short-hand for `log(x)/log(b)`.
534 public:
535  IMPLEMENT_TYPEID(SYMENGINE_LOG)
537  Log(const RCP<const Basic> &arg);
539  bool is_canonical(const RCP<const Basic> &arg) const;
541  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
542 };
543 
545 RCP<const Basic> log(const RCP<const Basic> &arg);
547 RCP<const Basic> log(const RCP<const Basic> &arg, const RCP<const Basic> &b);
548 
549 class LambertW : public OneArgFunction
550 {
551  // Lambert W function, defined as the inverse function of
552  // x*exp(x). This function represents the principal branch
553  // of this inverse function, which is multivalued.
554  // For more information, see:
555  // http://en.wikipedia.org/wiki/Lambert_W_function
556 public:
557  IMPLEMENT_TYPEID(SYMENGINE_LAMBERTW)
559  LambertW(const RCP<const Basic> &arg);
561  bool is_canonical(const RCP<const Basic> &arg) const;
563  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
564 };
565 
567 RCP<const Basic> lambertw(const RCP<const Basic> &arg);
568 
569 class Zeta : public TwoArgFunction
570 {
571  // Hurwitz zeta function (or Riemann zeta function).
572  //
573  // For `\operatorname{Re}(a) > 0` and `\operatorname{Re}(s) > 1`, this
574  // function is defined as
575  //
576  // .. math:: \zeta(s, a) = \sum_{n=0}^\infty \frac{1}{(n + a)^s},
577  //
578  // where the standard choice of argument for :math:`n + a` is used.
579  // If no value is passed for :math:`a`, by this function assumes a default
580  // value
581  // of :math:`a = 1`, yielding the Riemann zeta function.
582 public:
584  IMPLEMENT_TYPEID(SYMENGINE_ZETA)
586  Zeta(const RCP<const Basic> &s, const RCP<const Basic> &a);
588  Zeta(const RCP<const Basic> &s);
590  inline RCP<const Basic> get_s() const
591  {
592  return get_arg1();
593  }
595  inline RCP<const Basic> get_a() const
596  {
597  return get_arg2();
598  }
600  bool is_canonical(const RCP<const Basic> &s,
601  const RCP<const Basic> &a) const;
603  RCP<const Basic> create(const RCP<const Basic> &a,
604  const RCP<const Basic> &b) const override;
605 };
606 
608 RCP<const Basic> zeta(const RCP<const Basic> &s, const RCP<const Basic> &a);
609 RCP<const Basic> zeta(const RCP<const Basic> &s);
610 
612 {
613  // See http://en.wikipedia.org/wiki/Dirichlet_eta_function
614 public:
615  IMPLEMENT_TYPEID(SYMENGINE_DIRICHLET_ETA)
617  Dirichlet_eta(const RCP<const Basic> &s);
619  inline RCP<const Basic> get_s() const
620  {
621  return get_arg();
622  }
624  bool is_canonical(const RCP<const Basic> &s) const;
626  RCP<const Basic> rewrite_as_zeta() const;
628  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
630 };
631 
633 RCP<const Basic> dirichlet_eta(const RCP<const Basic> &s);
634 
636 {
637 protected:
638  std::string name_;
639 
640 public:
641  IMPLEMENT_TYPEID(SYMENGINE_FUNCTIONSYMBOL)
643  FunctionSymbol(std::string name, const vec_basic &arg);
644  FunctionSymbol(std::string name, const RCP<const Basic> &arg);
646  hash_t __hash__() const override;
651  bool __eq__(const Basic &o) const override;
652  int compare(const Basic &o) const override;
654  inline const std::string &get_name() const
655  {
656  return name_;
657  }
659  bool is_canonical(const vec_basic &arg) const;
660  RCP<const Basic> create(const vec_basic &x) const override;
661 };
662 
664 RCP<const Basic> function_symbol(std::string name, const RCP<const Basic> &arg);
665 RCP<const Basic> function_symbol(std::string name, const vec_basic &arg);
666 
672 {
673 public:
674  IMPLEMENT_TYPEID(SYMENGINE_FUNCTIONWRAPPER)
675  FunctionWrapper(std::string name, const vec_basic &arg);
676  FunctionWrapper(std::string name, const RCP<const Basic> &arg);
677  RCP<const Basic> create(const vec_basic &v) const override = 0;
678  virtual RCP<const Number> eval(long bits) const = 0;
679  virtual RCP<const Basic> diff_impl(const RCP<const Symbol> &s) const = 0;
680 };
681 
686 class Derivative : public Basic
687 {
688 private:
689  RCP<const Basic> arg_;
690  // The symbols are declared as Basic (and checked by is_canonical() below),
691  // to avoid issues with converting vector<RCP<Symbol>> to
692  // vector<RCP<Basic>>, see [1], [2]. The problem is that even though Symbol
693  // inherits from Basic, vector<RCP<Symbol>> does not inherit from
694  // vector<RCP<Basic>>, so the compiler can't cast the derived type to the
695  // base type when calling functions like unified_eq() that are only
696  // defined for the base type vector<RCP<Basic>>.
697  // [1]
698  // http://stackoverflow.com/questions/14964909/how-to-cast-a-vector-of-shared-ptrs-of-a-derived-class-to-a-vector-of-share-ptrs
699  // [2]
700  // http://stackoverflow.com/questions/114819/getting-a-vectorderived-into-a-function-that-expects-a-vectorbase
702 
703 public:
704  IMPLEMENT_TYPEID(SYMENGINE_DERIVATIVE)
705  Derivative(const RCP<const Basic> &arg, const multiset_basic &x);
706 
707  static RCP<const Derivative> create(const RCP<const Basic> &arg,
708  const multiset_basic &x)
709  {
710  return make_rcp<const Derivative>(arg, x);
711  }
712 
713  hash_t __hash__() const override;
714  bool __eq__(const Basic &o) const override;
715  int compare(const Basic &o) const override;
716  inline RCP<const Basic> get_arg() const
717  {
718  return arg_;
719  }
720  inline const multiset_basic &get_symbols() const
721  {
722  return x_;
723  }
724  vec_basic get_args() const override
725  {
726  vec_basic args = {arg_};
727  args.insert(args.end(), x_.begin(), x_.end());
728  return args;
729  }
730  bool is_canonical(const RCP<const Basic> &arg,
731  const multiset_basic &x) const;
732 };
733 
738 class Subs : public Basic
739 {
740 private:
741  RCP<const Basic> arg_;
742  map_basic_basic dict_;
743 
744 public:
745  IMPLEMENT_TYPEID(SYMENGINE_SUBS)
746  Subs(const RCP<const Basic> &arg, const map_basic_basic &x);
747 
748  static RCP<const Subs> create(const RCP<const Basic> &arg,
749  const map_basic_basic &x)
750  {
751  return make_rcp<const Subs>(arg, x);
752  }
753 
754  hash_t __hash__() const override;
755  bool __eq__(const Basic &o) const override;
756  int compare(const Basic &o) const override;
757  inline const RCP<const Basic> &get_arg() const
758  {
759  return arg_;
760  }
761  inline const map_basic_basic &get_dict() const
762  {
763  return dict_;
764  };
765  virtual vec_basic get_variables() const;
766  virtual vec_basic get_point() const;
767  vec_basic get_args() const override;
768 
769  bool is_canonical(const RCP<const Basic> &arg,
770  const map_basic_basic &x) const;
771 };
772 
774 {
775 public:
777  HyperbolicBase(RCP<const Basic> arg) : OneArgFunction{arg} {};
778 };
779 
781 {
782 public:
784  HyperbolicFunction(RCP<const Basic> arg) : HyperbolicBase{arg} {};
785 };
786 
788 {
789 public:
791  InverseHyperbolicFunction(RCP<const Basic> arg) : HyperbolicBase{arg} {};
792 };
793 
794 class Sinh : public HyperbolicFunction
795 {
797 public:
798  IMPLEMENT_TYPEID(SYMENGINE_SINH)
800  Sinh(const RCP<const Basic> &arg);
802  bool is_canonical(const RCP<const Basic> &arg) const;
804  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
805 };
806 
808 RCP<const Basic> sinh(const RCP<const Basic> &arg);
809 
810 class Csch : public HyperbolicFunction
811 {
813 public:
814  IMPLEMENT_TYPEID(SYMENGINE_CSCH)
816  Csch(const RCP<const Basic> &arg);
818  bool is_canonical(const RCP<const Basic> &arg) const;
820  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
821 };
822 
824 RCP<const Basic> csch(const RCP<const Basic> &arg);
825 
826 class Cosh : public HyperbolicFunction
827 {
829 public:
830  IMPLEMENT_TYPEID(SYMENGINE_COSH)
832  Cosh(const RCP<const Basic> &arg);
834  bool is_canonical(const RCP<const Basic> &arg) const;
836  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
837 };
838 
840 RCP<const Basic> cosh(const RCP<const Basic> &arg);
841 
842 class Sech : public HyperbolicFunction
843 {
845 public:
846  IMPLEMENT_TYPEID(SYMENGINE_SECH)
848  Sech(const RCP<const Basic> &arg);
850  bool is_canonical(const RCP<const Basic> &arg) const;
852  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
853 };
854 
856 RCP<const Basic> sech(const RCP<const Basic> &arg);
857 
858 class Tanh : public HyperbolicFunction
859 {
861 public:
862  IMPLEMENT_TYPEID(SYMENGINE_TANH)
864  Tanh(const RCP<const Basic> &arg);
866  bool is_canonical(const RCP<const Basic> &arg) const;
868  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
869 };
870 
872 RCP<const Basic> tanh(const RCP<const Basic> &arg);
873 
874 class Coth : public HyperbolicFunction
875 {
877 public:
878  IMPLEMENT_TYPEID(SYMENGINE_COTH)
880  Coth(const RCP<const Basic> &arg);
882  bool is_canonical(const RCP<const Basic> &arg) const;
884  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
885 };
886 
888 RCP<const Basic> coth(const RCP<const Basic> &arg);
889 
891 {
893 public:
894  IMPLEMENT_TYPEID(SYMENGINE_ASINH)
896  ASinh(const RCP<const Basic> &arg);
898  bool is_canonical(const RCP<const Basic> &arg) const;
900  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
901 };
902 
904 RCP<const Basic> asinh(const RCP<const Basic> &arg);
905 
907 {
909 public:
910  IMPLEMENT_TYPEID(SYMENGINE_ACSCH)
912  ACsch(const RCP<const Basic> &arg);
914  bool is_canonical(const RCP<const Basic> &arg) const;
916  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
917 };
918 
920 RCP<const Basic> acsch(const RCP<const Basic> &arg);
921 
923 {
925 public:
926  IMPLEMENT_TYPEID(SYMENGINE_ACOSH)
928  ACosh(const RCP<const Basic> &arg);
930  bool is_canonical(const RCP<const Basic> &arg) const;
932  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
933 };
934 
936 RCP<const Basic> acosh(const RCP<const Basic> &arg);
937 
939 {
941 public:
942  IMPLEMENT_TYPEID(SYMENGINE_ATANH)
944  ATanh(const RCP<const Basic> &arg);
946  bool is_canonical(const RCP<const Basic> &arg) const;
948  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
949 };
950 
952 RCP<const Basic> atanh(const RCP<const Basic> &arg);
953 
955 {
957 public:
958  IMPLEMENT_TYPEID(SYMENGINE_ACOTH)
960  ACoth(const RCP<const Basic> &arg);
962  bool is_canonical(const RCP<const Basic> &arg) const;
964  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
965 };
966 
968 RCP<const Basic> acoth(const RCP<const Basic> &arg);
969 
971 {
973 public:
974  IMPLEMENT_TYPEID(SYMENGINE_ASECH)
976  ASech(const RCP<const Basic> &arg);
978  bool is_canonical(const RCP<const Basic> &arg) const;
980  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
981 };
982 
984 RCP<const Basic> asech(const RCP<const Basic> &arg);
985 
987 {
994 public:
996  IMPLEMENT_TYPEID(SYMENGINE_KRONECKERDELTA)
998  KroneckerDelta(const RCP<const Basic> &i, const RCP<const Basic> &j);
1000  bool is_canonical(const RCP<const Basic> &i,
1001  const RCP<const Basic> &j) const;
1003  RCP<const Basic> create(const RCP<const Basic> &a,
1004  const RCP<const Basic> &b) const override;
1005 };
1006 
1008 RCP<const Basic> kronecker_delta(const RCP<const Basic> &i,
1009  const RCP<const Basic> &j);
1010 
1012 {
1020 public:
1021  IMPLEMENT_TYPEID(SYMENGINE_LEVICIVITA)
1023  LeviCivita(const vec_basic &&arg);
1025  bool is_canonical(const vec_basic &arg) const;
1027  RCP<const Basic> create(const vec_basic &arg) const override;
1028 };
1029 
1031 RCP<const Basic> levi_civita(const vec_basic &arg);
1032 
1033 class Erf : public OneArgFunction
1034 {
1035  /* The Gauss error function. This function is defined as:
1036  *
1037  * .. math::
1038  * \mathrm{erf}(x) = \frac{2}{\sqrt{\pi}} \int_0^x e^{-t^2}
1039  *\mathrm{d}t.
1040  **/
1041 public:
1042  IMPLEMENT_TYPEID(SYMENGINE_ERF)
1044  Erf(const RCP<const Basic> &arg) : OneArgFunction(arg)
1045  {
1046  SYMENGINE_ASSIGN_TYPEID()
1047  SYMENGINE_ASSERT(is_canonical(arg))
1048  }
1050  bool is_canonical(const RCP<const Basic> &arg) const;
1052  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
1053 };
1054 
1056 RCP<const Basic> erf(const RCP<const Basic> &arg);
1057 
1058 class Erfc : public OneArgFunction
1059 {
1060  /* The complementary error function. This function is defined as:
1061  *
1062  * .. math::
1063  * \mathrm{erfc}(x) = 1 - \frac{2}{\sqrt{\pi}} \int_0^x e^{-t^2}
1064  * \mathrm{d}t.
1065  **/
1066 public:
1067  IMPLEMENT_TYPEID(SYMENGINE_ERFC)
1069  Erfc(const RCP<const Basic> &arg) : OneArgFunction(arg)
1070  {
1071  SYMENGINE_ASSIGN_TYPEID()
1072  SYMENGINE_ASSERT(is_canonical(arg))
1073  }
1075  bool is_canonical(const RCP<const Basic> &arg) const;
1077  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
1078 };
1079 
1081 RCP<const Basic> erfc(const RCP<const Basic> &arg);
1082 
1083 class Gamma : public OneArgFunction
1084 {
1095 public:
1096  IMPLEMENT_TYPEID(SYMENGINE_GAMMA)
1098  Gamma(const RCP<const Basic> &arg);
1100  bool is_canonical(const RCP<const Basic> &arg) const;
1102  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
1103 };
1104 
1106 RCP<const Basic> gamma(const RCP<const Basic> &arg);
1107 
1109 {
1111 public:
1112  using TwoArgFunction::create;
1113  IMPLEMENT_TYPEID(SYMENGINE_LOWERGAMMA)
1115  LowerGamma(const RCP<const Basic> &s, const RCP<const Basic> &x);
1117  bool is_canonical(const RCP<const Basic> &s,
1118  const RCP<const Basic> &x) const;
1120  RCP<const Basic> create(const RCP<const Basic> &a,
1121  const RCP<const Basic> &b) const override;
1122 };
1123 
1125 RCP<const Basic> lowergamma(const RCP<const Basic> &s,
1126  const RCP<const Basic> &x);
1127 
1129 {
1131 public:
1132  using TwoArgFunction::create;
1133  IMPLEMENT_TYPEID(SYMENGINE_UPPERGAMMA)
1135  UpperGamma(const RCP<const Basic> &s, const RCP<const Basic> &x);
1137  bool is_canonical(const RCP<const Basic> &s,
1138  const RCP<const Basic> &x) const;
1140  RCP<const Basic> create(const RCP<const Basic> &a,
1141  const RCP<const Basic> &b) const override;
1142 };
1143 
1145 RCP<const Basic> uppergamma(const RCP<const Basic> &s,
1146  const RCP<const Basic> &x);
1147 
1148 class LogGamma : public OneArgFunction
1149 {
1154 public:
1155  IMPLEMENT_TYPEID(SYMENGINE_LOGGAMMA)
1157  LogGamma(const RCP<const Basic> &arg) : OneArgFunction(arg)
1158  {
1159  SYMENGINE_ASSIGN_TYPEID()
1160  SYMENGINE_ASSERT(is_canonical(arg))
1161  }
1163  bool is_canonical(const RCP<const Basic> &arg) const;
1164  RCP<const Basic> rewrite_as_gamma() const;
1166  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
1167 };
1168 
1170 RCP<const Basic> loggamma(const RCP<const Basic> &arg);
1171 
1172 class Beta : public TwoArgFunction
1173 {
1180 public:
1181  using TwoArgFunction::create;
1182  IMPLEMENT_TYPEID(SYMENGINE_BETA)
1184  Beta(const RCP<const Basic> &x, const RCP<const Basic> &y)
1185  : TwoArgFunction(x, y)
1186  {
1187  SYMENGINE_ASSIGN_TYPEID()
1188  SYMENGINE_ASSERT(is_canonical(x, y))
1189  }
1191  static RCP<const Beta> from_two_basic(const RCP<const Basic> &x,
1192  const RCP<const Basic> &y);
1194  bool is_canonical(const RCP<const Basic> &s, const RCP<const Basic> &x);
1195  RCP<const Basic> rewrite_as_gamma() const;
1197  RCP<const Basic> create(const RCP<const Basic> &a,
1198  const RCP<const Basic> &b) const override;
1199 };
1200 
1202 RCP<const Basic> beta(const RCP<const Basic> &x, const RCP<const Basic> &y);
1203 
1205 {
1216 public:
1217  using TwoArgFunction::create;
1218  IMPLEMENT_TYPEID(SYMENGINE_POLYGAMMA)
1220  PolyGamma(const RCP<const Basic> &n, const RCP<const Basic> &x)
1221  : TwoArgFunction(n, x)
1222  {
1223  SYMENGINE_ASSIGN_TYPEID()
1224  SYMENGINE_ASSERT(is_canonical(n, x))
1225  }
1226  bool is_canonical(const RCP<const Basic> &n, const RCP<const Basic> &x);
1227  RCP<const Basic> rewrite_as_zeta() const;
1229  RCP<const Basic> create(const RCP<const Basic> &a,
1230  const RCP<const Basic> &b) const override;
1231 };
1232 
1234 RCP<const Basic> polygamma(const RCP<const Basic> &n,
1235  const RCP<const Basic> &x);
1236 
1237 RCP<const Basic> digamma(const RCP<const Basic> &x);
1238 
1239 RCP<const Basic> trigamma(const RCP<const Basic> &x);
1240 
1241 class Abs : public OneArgFunction
1242 {
1245 public:
1246  IMPLEMENT_TYPEID(SYMENGINE_ABS)
1248  Abs(const RCP<const Basic> &arg);
1250  bool is_canonical(const RCP<const Basic> &arg) const;
1252  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
1253 };
1254 
1256 RCP<const Basic> abs(const RCP<const Basic> &arg);
1257 
1258 class Max : public MultiArgFunction
1259 {
1260 public:
1261  IMPLEMENT_TYPEID(SYMENGINE_MAX)
1263  Max(const vec_basic &&arg);
1265  bool is_canonical(const vec_basic &arg) const;
1267  RCP<const Basic> create(const vec_basic &arg) const override;
1268 };
1269 
1271 RCP<const Basic> max(const vec_basic &arg);
1272 
1273 class Min : public MultiArgFunction
1274 {
1275 public:
1276  IMPLEMENT_TYPEID(SYMENGINE_MIN)
1278  Min(const vec_basic &&arg);
1280  bool is_canonical(const vec_basic &arg) const;
1282  RCP<const Basic> create(const vec_basic &arg) const override;
1283 };
1284 
1286 RCP<const Basic> min(const vec_basic &arg);
1287 
1289 RCP<const Basic> trig_to_sqrt(const RCP<const Basic> &arg);
1290 
1292 {
1293 public:
1294  IMPLEMENT_TYPEID(SYMENGINE_UNEVALUATED_EXPR)
1296  UnevaluatedExpr(const RCP<const Basic> &arg);
1298  bool is_canonical(const RCP<const Basic> &arg) const;
1300  RCP<const Basic> create(const RCP<const Basic> &arg) const override;
1301 };
1302 
1303 RCP<const Basic> unevaluated_expr(const RCP<const Basic> &arg);
1304 
1305 } // namespace SymEngine
1306 
1307 #endif
The base class for SymEngine.
#define IMPLEMENT_TYPEID(SYMENGINE_ID)
Inline members and functions.
Definition: basic.h:340
T begin(T... args)
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:1708
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:1388
ACos(const RCP< const Basic > &arg)
ACos Constructor.
Definition: functions.cpp:1382
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2450
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:2627
ACosh(const RCP< const Basic > &arg)
ACosh Constructor.
Definition: functions.cpp:2444
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:1552
ACot(const RCP< const Basic > &arg)
ACot Constructor.
Definition: functions.cpp:1546
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:1718
ACoth(const RCP< const Basic > &arg)
ACoth Constructor.
Definition: functions.cpp:2514
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:2637
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2520
ACsc(const RCP< const Basic > &arg)
ACsc Constructor.
Definition: functions.cpp:1464
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:1470
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:1728
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:2622
ACsch(const RCP< const Basic > &arg)
ACsch Constructor.
Definition: functions.cpp:2400
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2406
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:1723
ASec(const RCP< const Basic > &arg)
ASec Constructor.
Definition: functions.cpp:1424
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:1430
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:2642
ASech(const RCP< const Basic > &arg)
ASech Constructor.
Definition: functions.cpp:2552
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2558
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:1703
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:1346
ASin(const RCP< const Basic > &arg)
ASin Constructor.
Definition: functions.cpp:1340
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:2617
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2360
ASinh(const RCP< const Basic > &arg)
ASinh Constructor.
Definition: functions.cpp:2354
RCP< const Basic > create(const RCP< const Basic > &a, const RCP< const Basic > &b) const override
Definition: functions.cpp:1608
bool is_canonical(const RCP< const Basic > &num, const RCP< const Basic > &den) const
Definition: functions.cpp:1595
ATan2(const RCP< const Basic > &num, const RCP< const Basic > &den)
ATan2 Constructor.
Definition: functions.cpp:1588
RCP< const Basic > get_den() const
Definition: functions.h:516
RCP< const Basic > get_num() const
Definition: functions.h:511
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:1510
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:1713
ATan(const RCP< const Basic > &arg)
ATan Constructor.
Definition: functions.cpp:1504
ATanh(const RCP< const Basic > &arg)
ATanh Constructor.
Definition: functions.cpp:2472
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:2632
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2478
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:3487
Abs(const RCP< const Basic > &arg)
Abs Constructor.
Definition: functions.cpp:3463
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:3469
The lowest unit of symbolic representation.
Definition: basic.h:97
static RCP< const Beta > from_two_basic(const RCP< const Basic > &x, const RCP< const Basic > &y)
return Beta with ordered arguments
Definition: functions.cpp:3242
virtual RCP< const Basic > create(const RCP< const Basic > &a, const RCP< const Basic > &b) const=0
bool is_canonical(const RCP< const Basic > &s, const RCP< const Basic > &x)
Definition: functions.cpp:3251
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:700
Ceiling(const RCP< const Basic > &arg)
Ceiling Constructor.
Definition: functions.cpp:665
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:671
Conjugate(const RCP< const Basic > &arg)
Conjugate constructor.
Definition: functions.cpp:92
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:144
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:98
Cos(const RCP< const Basic > &arg)
Cos Constructor.
Definition: functions.cpp:921
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:1678
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:927
Cosh(const RCP< const Basic > &arg)
Cosh Constructor.
Definition: functions.cpp:2190
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2196
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:2597
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:1059
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:1688
Cot(const RCP< const Basic > &arg)
Cot Constructor.
Definition: functions.cpp:1053
Coth(const RCP< const Basic > &arg)
Coth Constructor.
Definition: functions.cpp:2311
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:2612
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2317
Csc(const RCP< const Basic > &arg)
Csc Constructor.
Definition: functions.cpp:1117
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:1123
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:1698
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:2592
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2153
Csch(const RCP< const Basic > &arg)
Csch Constructor.
Definition: functions.cpp:2147
hash_t __hash__() const override
Definition: functions.cpp:1998
bool __eq__(const Basic &o) const override
Test equality.
Definition: functions.cpp:2008
vec_basic get_args() const override
Returns the list of arguments.
Definition: functions.h:724
multiset_basic x_
The expression to be differentiated.
Definition: functions.h:701
int compare(const Basic &o) const override
Definition: functions.cpp:2017
RCP< const Basic > get_s() const
Definition: functions.h:619
bool is_canonical(const RCP< const Basic > &s) const
Definition: functions.cpp:2842
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const=0
Method to construct classes with canonicalization.
Dirichlet_eta(const RCP< const Basic > &s)
Dirichlet_eta Constructor.
Definition: functions.cpp:2836
RCP< const Basic > rewrite_as_zeta() const
Rewrites in the form of zeta.
Definition: functions.cpp:2851
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:2886
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2874
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:2922
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2910
Floor(const RCP< const Basic > &arg)
Floor Constructor.
Definition: functions.cpp:571
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:606
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:577
int compare(const Basic &o) const override
Structural equality comparator.
Definition: functions.cpp:1895
FunctionSymbol(std::string name, const vec_basic &arg)
FunctionSymbol Constructors.
Definition: functions.cpp:1864
bool is_canonical(const vec_basic &arg) const
Definition: functions.cpp:1871
RCP< const Basic > create(const vec_basic &x) const override
Method to construct classes with canonicalization.
Definition: functions.cpp:1905
hash_t __hash__() const override
Definition: functions.cpp:1876
const std::string & get_name() const
Definition: functions.h:654
bool __eq__(const Basic &o) const override
Definition: functions.cpp:1885
RCP< const Basic > create(const vec_basic &v) const override=0
Method to construct classes with canonicalization.
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2953
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:2968
Gamma(const RCP< const Basic > &arg)
Gamma Constructor.
Definition: functions.cpp:2947
HyperbolicBase(RCP< const Basic > arg)
Constructor.
Definition: functions.h:777
HyperbolicFunction(RCP< const Basic > arg)
Constructor.
Definition: functions.h:784
InverseHyperbolicFunction(RCP< const Basic > arg)
Constructor.
Definition: functions.h:791
InverseTrigFunction(RCP< const Basic > arg)
Constructor.
Definition: functions.h:281
bool is_canonical(const RCP< const Basic > &i, const RCP< const Basic > &j) const
Definition: functions.cpp:2655
virtual RCP< const Basic > create(const RCP< const Basic > &a, const RCP< const Basic > &b) const=0
KroneckerDelta(const RCP< const Basic > &i, const RCP< const Basic > &j)
KroneckerDelta Constructor.
Definition: functions.cpp:2647
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:1841
LambertW(const RCP< const Basic > &arg)
LambertW Constructor.
Definition: functions.cpp:1822
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:1828
bool is_canonical(const vec_basic &arg) const
Definition: functions.cpp:2711
LeviCivita(const vec_basic &&arg)
LeviCivita Constructor.
Definition: functions.cpp:2705
RCP< const Basic > create(const vec_basic &arg) const override
Definition: functions.cpp:2729
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:3221
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:3201
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:1741
Log(const RCP< const Basic > &arg)
Log Constructor.
Definition: functions.cpp:1735
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:1769
virtual RCP< const Basic > create(const RCP< const Basic > &a, const RCP< const Basic > &b) const=0
The lower incomplete gamma function.
LowerGamma(const RCP< const Basic > &s, const RCP< const Basic > &x)
LowerGamma Constructor.
Definition: functions.cpp:3037
bool is_canonical(const RCP< const Basic > &s, const RCP< const Basic > &x) const
Definition: functions.cpp:3044
bool is_canonical(const vec_basic &arg) const
Definition: functions.cpp:3531
RCP< const Basic > create(const vec_basic &arg) const override
Definition: functions.cpp:3550
Max(const vec_basic &&arg)
Max Constructor.
Definition: functions.cpp:3525
bool is_canonical(const vec_basic &arg) const
Definition: functions.cpp:3635
Min(const vec_basic &&arg)
Min Constructor.
Definition: functions.cpp:3629
RCP< const Basic > create(const vec_basic &arg) const override
Definition: functions.cpp:3654
virtual RCP< const Basic > create(const vec_basic &v) const =0
Method to construct classes with canonicalization.
hash_t __hash__() const override
Definition: functions.h:152
bool __eq__(const Basic &o) const override
Definition: functions.h:173
vec_basic get_args() const override
Returns the list of arguments.
Definition: functions.h:159
int compare(const Basic &o) const override
Structural equality comparator.
Definition: functions.h:180
MultiArgFunction(const vec_basic &arg)
Constructor.
Definition: functions.h:150
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const =0
Method to construct classes with canonicalization.
bool __eq__(const Basic &o) const override
Definition: functions.h:57
hash_t __hash__() const override
Definition: functions.h:29
OneArgFunction(const RCP< const Basic > &arg)
The arg in OneArgFunction(arg)
Definition: functions.h:27
vec_basic get_args() const override
Returns the list of arguments.
Definition: functions.h:40
RCP< const Basic > get_arg() const
Definition: functions.h:36
int compare(const Basic &o) const override
Structural equality comparator.
Definition: functions.h:64
virtual RCP< const Basic > create(const RCP< const Basic > &a, const RCP< const Basic > &b) const=0
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:1693
Sec(const RCP< const Basic > &arg)
Sec Constructor.
Definition: functions.cpp:1181
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:1187
Sech(const RCP< const Basic > &arg)
Sech Constructor.
Definition: functions.cpp:2229
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:2602
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2235
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:499
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:522
Sign(const RCP< const Basic > &arg)
Sign constructor.
Definition: functions.cpp:493
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:1673
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:859
Sin(const RCP< const Basic > &arg)
Sin Constructor.
Definition: functions.cpp:853
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2111
Sinh(const RCP< const Basic > &arg)
Sinh Constructor.
Definition: functions.cpp:2105
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:2587
vec_basic get_args() const override
Returns the list of arguments.
Definition: functions.cpp:2093
int compare(const Basic &o) const override
Definition: functions.cpp:2064
hash_t __hash__() const override
Definition: functions.cpp:2045
bool __eq__(const Basic &o) const override
Test equality.
Definition: functions.cpp:2056
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:1683
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:993
Tan(const RCP< const Basic > &arg)
Tan Constructor.
Definition: functions.cpp:987
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2274
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:2607
Tanh(const RCP< const Basic > &arg)
Tanh Constructor.
Definition: functions.cpp:2268
TrigBase(RCP< const Basic > arg)
Constructor.
Definition: functions.h:267
TrigFunction(RCP< const Basic > arg)
Constructor.
Definition: functions.h:274
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:765
Truncate(const RCP< const Basic > &arg)
Truncate Constructor.
Definition: functions.cpp:759
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:794
virtual RCP< const Basic > create(const RCP< const Basic > &a, const RCP< const Basic > &b) const =0
Method to construct classes with canonicalization.
hash_t __hash__() const override
Definition: functions.h:83
RCP< const Basic > get_arg1() const
Definition: functions.h:91
int compare(const Basic &o) const override
Structural equality comparator.
Definition: functions.h:127
RCP< const Basic > b_
a in TwoArgBasic(a, b)
Definition: functions.h:77
RCP< const Basic > get_arg2() const
Definition: functions.h:96
TwoArgBasic(const RCP< const Basic > &a, const RCP< const Basic > &b)
b in TwoArgBasic(a, b)
Definition: functions.h:80
bool __eq__(const Basic &o) const override
Definition: functions.h:118
RCP< const Basic > create(const RCP< const Basic > &arg) const override
Definition: functions.cpp:3745
UnevaluatedExpr(const RCP< const Basic > &arg)
UnevaluatedExpr Constructor.
Definition: functions.cpp:3733
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:3740
UpperGamma(const RCP< const Basic > &s, const RCP< const Basic > &x)
UpperGamma Constructor.
Definition: functions.cpp:3120
virtual RCP< const Basic > create(const RCP< const Basic > &a, const RCP< const Basic > &b) const=0
The upper incomplete gamma function.
bool is_canonical(const RCP< const Basic > &s, const RCP< const Basic > &x) const
Definition: functions.cpp:3127
Zeta(const RCP< const Basic > &s, const RCP< const Basic > &a)
Zeta Constructor.
Definition: functions.cpp:2768
virtual RCP< const Basic > create(const RCP< const Basic > &a, const RCP< const Basic > &b) const=0
Method to construct classes with canonicalization.
RCP< const Basic > get_a() const
Definition: functions.h:595
bool is_canonical(const RCP< const Basic > &s, const RCP< const Basic > &a) const
Definition: functions.cpp:2779
RCP< const Basic > get_s() const
Definition: functions.h:590
T end(T... args)
T insert(T... args)
Main namespace for SymEngine package.
Definition: add.cpp:19
RCP< const Basic > acos(const RCP< const Basic > &arg)
Canonicalize ACos:
Definition: functions.cpp:1402
RCP< const Basic > sec(const RCP< const Basic > &arg)
Canonicalize Sec:
Definition: functions.cpp:1202
RCP< const Basic > polygamma(const RCP< const Basic > &n_, const RCP< const Basic > &x_)
Canonicalize PolyGamma.
Definition: functions.cpp:3397
RCP< const Basic > beta(const RCP< const Basic > &x, const RCP< const Basic > &y)
Canonicalize Beta:
Definition: functions.cpp:3283
RCP< const Basic > zeta(const RCP< const Basic > &s, const RCP< const Basic > &a)
Create a new Zeta instance:
Definition: functions.cpp:2800
RCP< const Basic > max(const vec_basic &arg)
Canonicalize Max:
Definition: functions.cpp:3555
bool eq(const Basic &a, const Basic &b)
Checks equality for a and b
Definition: basic-inl.h:21
RCP< const Basic > coth(const RCP< const Basic > &arg)
Canonicalize Coth:
Definition: functions.cpp:2333
bool get_pi_shift(const RCP< const Basic > &arg, const Ptr< RCP< const Number >> &n, const Ptr< RCP< const Basic >> &x)
Definition: functions.cpp:203
RCP< const Basic > sign(const RCP< const Basic > &arg)
Canonicalize Sign.
Definition: functions.cpp:527
RCP< const Basic > atan2(const RCP< const Basic > &num, const RCP< const Basic > &den)
Canonicalize ATan2:
Definition: functions.cpp:1614
RCP< const Basic > ceiling(const RCP< const Basic > &arg)
Canonicalize Ceiling:
Definition: functions.cpp:705
RCP< const Basic > abs(const RCP< const Basic > &arg)
Canonicalize Abs:
Definition: functions.cpp:3492
RCP< const Basic > acsc(const RCP< const Basic > &arg)
Canonicalize ACsc:
Definition: functions.cpp:1484
bool inverse_lookup(const umap_basic_basic &d, const RCP< const Basic > &t, const Ptr< RCP< const Basic >> &index)
Definition: functions.cpp:480
RCP< const Basic > sech(const RCP< const Basic > &arg)
Canonicalize Sech:
Definition: functions.cpp:2251
RCP< const Basic > gamma(const RCP< const Basic > &arg)
Canonicalize Gamma:
Definition: functions.cpp:3014
RCP< const Basic > asin(const RCP< const Basic > &arg)
Canonicalize ASin:
Definition: functions.cpp:1360
RCP< const Basic > acoth(const RCP< const Basic > &arg)
Canonicalize ACoth:
Definition: functions.cpp:2534
RCP< const Basic > tan(const RCP< const Basic > &arg)
Canonicalize Tan:
Definition: functions.cpp:1007
RCP< const Basic > cosh(const RCP< const Basic > &arg)
Canonicalize Cosh:
Definition: functions.cpp:2212
RCP< const Basic > asec(const RCP< const Basic > &arg)
Canonicalize ASec:
Definition: functions.cpp:1444
RCP< const Basic > acsch(const RCP< const Basic > &arg)
Canonicalize ACsch:
Definition: functions.cpp:2422
bool could_extract_minus(const Basic &arg)
Definition: functions.cpp:325
RCP< const Basic > atan(const RCP< const Basic > &arg)
Canonicalize ATan:
Definition: functions.cpp:1524
RCP< const Basic > asinh(const RCP< const Basic > &arg)
Canonicalize ASinh:
Definition: functions.cpp:2376
RCP< const Basic > tanh(const RCP< const Basic > &arg)
Canonicalize Tanh:
Definition: functions.cpp:2290
RCP< const Basic > cot(const RCP< const Basic > &arg)
Canonicalize Cot:
Definition: functions.cpp:1073
RCP< const Basic > atanh(const RCP< const Basic > &arg)
Canonicalize ATanh:
Definition: functions.cpp:2494
RCP< const Basic > floor(const RCP< const Basic > &arg)
Canonicalize Floor:
Definition: functions.cpp:611
RCP< const Basic > erfc(const RCP< const Basic > &arg)
Canonicalize Erfc:
Definition: functions.cpp:2927
RCP< const Basic > levi_civita(const vec_basic &arg)
Canonicalize LeviCivita:
Definition: functions.cpp:2747
RCP< const Basic > acosh(const RCP< const Basic > &arg)
Canonicalize ACosh:
Definition: functions.cpp:2461
RCP< const Basic > lowergamma(const RCP< const Basic > &s, const RCP< const Basic > &x)
Canonicalize LowerGamma:
Definition: functions.cpp:3070
RCP< const Basic > truncate(const RCP< const Basic > &arg)
Canonicalize Truncate:
Definition: functions.cpp:799
RCP< const Basic > loggamma(const RCP< const Basic > &arg)
Canonicalize LogGamma:
Definition: functions.cpp:3226
RCP< const Basic > cos(const RCP< const Basic > &arg)
Canonicalize Cos:
Definition: functions.cpp:942
RCP< const Basic > log(const RCP< const Basic > &arg)
Returns the Natural Logarithm from argument arg
Definition: functions.cpp:1774
RCP< const Basic > csc(const RCP< const Basic > &arg)
Canonicalize Csc:
Definition: functions.cpp:1138
RCP< const Basic > dirichlet_eta(const RCP< const Basic > &s)
Create a new Dirichlet_eta instance:
Definition: functions.cpp:2861
bool is_same_type(const Basic &a, const Basic &b)
Returns true if a and b are exactly the same type T.
Definition: basic-inl.h:47
RCP< const Basic > csch(const RCP< const Basic > &arg)
Canonicalize Csch:
Definition: functions.cpp:2169
int unified_compare(const T &a, const T &b)
Definition: dict.h:205
bool neq(const Basic &a, const Basic &b)
Checks inequality for a and b
Definition: basic-inl.h:29
RCP< const Basic > min(const vec_basic &arg)
Canonicalize Min:
Definition: functions.cpp:3659
RCP< const Basic > erf(const RCP< const Basic > &arg)
Canonicalize Erf:
Definition: functions.cpp:2891
RCP< const Basic > trig_to_sqrt(const RCP< const Basic > &arg)
Definition: functions.cpp:1246
RCP< const Basic > asech(const RCP< const Basic > &arg)
Canonicalize ASech:
Definition: functions.cpp:2571
RCP< const Basic > lambertw(const RCP< const Basic > &arg)
Create a new LambertW instance:
Definition: functions.cpp:1846
RCP< const Basic > sinh(const RCP< const Basic > &arg)
Canonicalize Sinh:
Definition: functions.cpp:2127
RCP< const Basic > kronecker_delta(const RCP< const Basic > &i, const RCP< const Basic > &j)
Canonicalize KroneckerDelta:
Definition: functions.cpp:2675
RCP< const Basic > acot(const RCP< const Basic > &arg)
Canonicalize ACot:
Definition: functions.cpp:1566
RCP< const Basic > conjugate(const RCP< const Basic > &arg)
Canonicalize Conjugate.
Definition: functions.cpp:149
RCP< const Basic > sin(const RCP< const Basic > &arg)
Canonicalize Sin:
Definition: functions.cpp:874
RCP< const Basic > uppergamma(const RCP< const Basic > &s, const RCP< const Basic > &x)
Canonicalize UpperGamma:
Definition: functions.cpp:3153
T size(T... args)