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
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  virtual inline vec_basic get_args() const
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  virtual inline bool __eq__(const Basic &o) const
58  {
59  return is_same_type(*this, o)
60  and eq(*get_arg(),
61  *down_cast<const OneArgFunction &>(o).get_arg());
62  }
64  virtual inline int compare(const Basic &o) const
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
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  virtual inline vec_basic get_args() const
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  virtual inline bool __eq__(const Basic &o) const
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  virtual inline int compare(const Basic &o) const
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
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  virtual inline vec_basic get_args() const
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  virtual inline bool __eq__(const Basic &o) const
174  {
175  return is_same_type(*this, o)
176  and unified_eq(get_vec(),
177  down_cast<const MultiArgFunction &>(o).get_vec());
178  }
180  virtual inline int compare(const Basic &o) const
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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(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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &a,
522  const RCP<const Basic> &b) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &a,
604  const RCP<const Basic> &b) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual hash_t __hash__() const;
651  virtual bool __eq__(const Basic &o) const;
652  virtual int compare(const Basic &o) const;
654  inline const std::string &get_name() const
655  {
656  return name_;
657  }
659  bool is_canonical(const vec_basic &arg) const;
660  virtual RCP<const Basic> create(const vec_basic &x) const;
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  virtual RCP<const Basic> create(const vec_basic &v) const = 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  virtual hash_t __hash__() const;
714  virtual bool __eq__(const Basic &o) const;
715  virtual int compare(const Basic &o) const;
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  virtual vec_basic get_args() const
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  virtual hash_t __hash__() const;
755  virtual bool __eq__(const Basic &o) const;
756  virtual int compare(const Basic &o) const;
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  virtual vec_basic get_args() const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &a,
1004  const RCP<const Basic> &b) const;
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  virtual RCP<const Basic> create(const vec_basic &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &a,
1121  const RCP<const Basic> &b) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &a,
1141  const RCP<const Basic> &b) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &a,
1198  const RCP<const Basic> &b) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &a,
1230  const RCP<const Basic> &b) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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  virtual RCP<const Basic> create(const vec_basic &arg) const;
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  virtual RCP<const Basic> create(const vec_basic &arg) const;
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  virtual RCP<const Basic> create(const RCP<const Basic> &arg) const;
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)
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:1665
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:1345
ACos(const RCP< const Basic > &arg)
ACos Constructor.
Definition: functions.cpp:1339
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:2584
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2407
ACosh(const RCP< const Basic > &arg)
ACosh Constructor.
Definition: functions.cpp:2401
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:1509
ACot(const RCP< const Basic > &arg)
ACot Constructor.
Definition: functions.cpp:1503
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:1675
ACoth(const RCP< const Basic > &arg)
ACoth Constructor.
Definition: functions.cpp:2471
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:2594
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2477
ACsc(const RCP< const Basic > &arg)
ACsc Constructor.
Definition: functions.cpp:1421
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:1427
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:1685
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:2579
ACsch(const RCP< const Basic > &arg)
ACsch Constructor.
Definition: functions.cpp:2357
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2363
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:1680
ASec(const RCP< const Basic > &arg)
ASec Constructor.
Definition: functions.cpp:1381
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:1387
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:2599
ASech(const RCP< const Basic > &arg)
ASech Constructor.
Definition: functions.cpp:2509
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2515
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:1660
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:1303
ASin(const RCP< const Basic > &arg)
ASin Constructor.
Definition: functions.cpp:1297
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2317
ASinh(const RCP< const Basic > &arg)
ASinh Constructor.
Definition: functions.cpp:2311
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:2574
bool is_canonical(const RCP< const Basic > &num, const RCP< const Basic > &den) const
Definition: functions.cpp:1552
virtual RCP< const Basic > create(const RCP< const Basic > &a, const RCP< const Basic > &b) const
Definition: functions.cpp:1565
ATan2(const RCP< const Basic > &num, const RCP< const Basic > &den)
ATan2 Constructor.
Definition: functions.cpp:1545
RCP< const Basic > get_den() const
Definition: functions.h:516
RCP< const Basic > get_num() const
Definition: functions.h:511
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:1670
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:1467
ATan(const RCP< const Basic > &arg)
ATan Constructor.
Definition: functions.cpp:1461
ATanh(const RCP< const Basic > &arg)
ATanh Constructor.
Definition: functions.cpp:2429
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2435
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:2589
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:3444
Abs(const RCP< const Basic > &arg)
Abs Constructor.
Definition: functions.cpp:3420
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:3426
The lowest unit of symbolic representation.
Definition: basic.h:95
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:3199
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:3208
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:657
Ceiling(const RCP< const Basic > &arg)
Ceiling Constructor.
Definition: functions.cpp:622
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:628
Conjugate(const RCP< const Basic > &arg)
Conjugate constructor.
Definition: functions.cpp:49
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:101
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:55
Cos(const RCP< const Basic > &arg)
Cos Constructor.
Definition: functions.cpp:878
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:1635
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:884
Cosh(const RCP< const Basic > &arg)
Cosh Constructor.
Definition: functions.cpp:2147
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:2554
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2153
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:1645
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:1016
Cot(const RCP< const Basic > &arg)
Cot Constructor.
Definition: functions.cpp:1010
Coth(const RCP< const Basic > &arg)
Coth Constructor.
Definition: functions.cpp:2268
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:2569
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2274
Csc(const RCP< const Basic > &arg)
Csc Constructor.
Definition: functions.cpp:1074
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:1080
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:1655
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2110
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:2549
Csch(const RCP< const Basic > &arg)
Csch Constructor.
Definition: functions.cpp:2104
virtual vec_basic get_args() const
Returns the list of arguments.
Definition: functions.h:724
virtual int compare(const Basic &o) const
Definition: functions.cpp:1974
multiset_basic x_
The expression to be differentiated.
Definition: functions.h:701
virtual hash_t __hash__() const
Definition: functions.cpp:1955
virtual bool __eq__(const Basic &o) const
Test equality.
Definition: functions.cpp:1965
RCP< const Basic > get_s() const
Definition: functions.h:619
bool is_canonical(const RCP< const Basic > &s) const
Definition: functions.cpp:2799
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:2793
RCP< const Basic > rewrite_as_zeta() const
Rewrites in the form of zeta.
Definition: functions.cpp:2808
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2831
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:2843
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:2879
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2867
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:563
Floor(const RCP< const Basic > &arg)
Floor Constructor.
Definition: functions.cpp:528
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:534
virtual int compare(const Basic &o) const
Structural equality comparator.
Definition: functions.cpp:1852
FunctionSymbol(std::string name, const vec_basic &arg)
FunctionSymbol Constructors.
Definition: functions.cpp:1821
bool is_canonical(const vec_basic &arg) const
Definition: functions.cpp:1828
const std::string & get_name() const
Definition: functions.h:654
virtual RCP< const Basic > create(const vec_basic &x) const
Method to construct classes with canonicalization.
Definition: functions.cpp:1862
virtual hash_t __hash__() const
Definition: functions.cpp:1833
virtual bool __eq__(const Basic &o) const
Definition: functions.cpp:1842
virtual RCP< const Basic > create(const vec_basic &v) const =0
Method to construct classes with canonicalization.
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2910
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:2925
Gamma(const RCP< const Basic > &arg)
Gamma Constructor.
Definition: functions.cpp:2904
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:2612
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:2604
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:1798
LambertW(const RCP< const Basic > &arg)
LambertW Constructor.
Definition: functions.cpp:1779
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:1785
virtual RCP< const Basic > create(const vec_basic &arg) const
Definition: functions.cpp:2686
bool is_canonical(const vec_basic &arg) const
Definition: functions.cpp:2668
LeviCivita(const vec_basic &&arg)
LeviCivita Constructor.
Definition: functions.cpp:2662
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:3178
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:3158
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:1698
Log(const RCP< const Basic > &arg)
Log Constructor.
Definition: functions.cpp:1692
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:1726
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:2994
bool is_canonical(const RCP< const Basic > &s, const RCP< const Basic > &x) const
Definition: functions.cpp:3001
bool is_canonical(const vec_basic &arg) const
Definition: functions.cpp:3488
virtual RCP< const Basic > create(const vec_basic &arg) const
Definition: functions.cpp:3507
Max(const vec_basic &&arg)
Max Constructor.
Definition: functions.cpp:3482
bool is_canonical(const vec_basic &arg) const
Definition: functions.cpp:3592
Min(const vec_basic &&arg)
Min Constructor.
Definition: functions.cpp:3586
virtual RCP< const Basic > create(const vec_basic &arg) const
Definition: functions.cpp:3611
virtual bool __eq__(const Basic &o) const
Definition: functions.h:173
virtual RCP< const Basic > create(const vec_basic &v) const =0
Method to construct classes with canonicalization.
virtual int compare(const Basic &o) const
Structural equality comparator.
Definition: functions.h:180
virtual vec_basic get_args() const
Returns the list of arguments.
Definition: functions.h:159
hash_t __hash__() const
Definition: functions.h:152
MultiArgFunction(const vec_basic &arg)
Constructor.
Definition: functions.h:150
virtual bool __eq__(const Basic &o) const
Definition: functions.h:57
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const =0
Method to construct classes with canonicalization.
virtual vec_basic get_args() const
Returns the list of arguments.
Definition: functions.h:40
OneArgFunction(const RCP< const Basic > &arg)
The arg in OneArgFunction(arg)
Definition: functions.h:27
hash_t __hash__() const
Definition: functions.h:29
virtual int compare(const Basic &o) const
Structural equality comparator.
Definition: functions.h:64
RCP< const Basic > get_arg() const
Definition: functions.h:36
virtual RCP< const Basic > create(const RCP< const Basic > &a, const RCP< const Basic > &b) const=0
Sec(const RCP< const Basic > &arg)
Sec Constructor.
Definition: functions.cpp:1138
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:1650
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:1144
Sech(const RCP< const Basic > &arg)
Sech Constructor.
Definition: functions.cpp:2186
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:2559
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2192
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:456
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:479
Sign(const RCP< const Basic > &arg)
Sign constructor.
Definition: functions.cpp:450
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:816
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:1630
Sin(const RCP< const Basic > &arg)
Sin Constructor.
Definition: functions.cpp:810
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2068
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:2544
Sinh(const RCP< const Basic > &arg)
Sinh Constructor.
Definition: functions.cpp:2062
virtual bool __eq__(const Basic &o) const
Test equality.
Definition: functions.cpp:2013
virtual hash_t __hash__() const
Definition: functions.cpp:2002
virtual int compare(const Basic &o) const
Definition: functions.cpp:2021
virtual vec_basic get_args() const
Returns the list of arguments.
Definition: functions.cpp:2050
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:950
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:1640
Tan(const RCP< const Basic > &arg)
Tan Constructor.
Definition: functions.cpp:944
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:2564
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:2231
Tanh(const RCP< const Basic > &arg)
Tanh Constructor.
Definition: functions.cpp:2225
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:722
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:751
Truncate(const RCP< const Basic > &arg)
Truncate Constructor.
Definition: functions.cpp:716
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
Definition: functions.h:83
RCP< const Basic > get_arg1() const
Definition: functions.h:91
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
virtual int compare(const Basic &o) const
Structural equality comparator.
Definition: functions.h:127
virtual bool __eq__(const Basic &o) const
Definition: functions.h:118
virtual RCP< const Basic > create(const RCP< const Basic > &arg) const
Definition: functions.cpp:3702
UnevaluatedExpr(const RCP< const Basic > &arg)
UnevaluatedExpr Constructor.
Definition: functions.cpp:3690
bool is_canonical(const RCP< const Basic > &arg) const
Definition: functions.cpp:3697
UpperGamma(const RCP< const Basic > &s, const RCP< const Basic > &x)
UpperGamma Constructor.
Definition: functions.cpp:3077
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:3084
Zeta(const RCP< const Basic > &s, const RCP< const Basic > &a)
Zeta Constructor.
Definition: functions.cpp:2725
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:2736
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:1359
RCP< const Basic > sec(const RCP< const Basic > &arg)
Canonicalize Sec:
Definition: functions.cpp:1159
bool inverse_lookup(umap_basic_basic &d, const RCP< const Basic > &t, const Ptr< RCP< const Basic >> &index)
Definition: functions.cpp:437
RCP< const Basic > polygamma(const RCP< const Basic > &n_, const RCP< const Basic > &x_)
Canonicalize PolyGamma.
Definition: functions.cpp:3354
RCP< const Basic > beta(const RCP< const Basic > &x, const RCP< const Basic > &y)
Canonicalize Beta:
Definition: functions.cpp:3240
RCP< const Basic > zeta(const RCP< const Basic > &s, const RCP< const Basic > &a)
Create a new Zeta instance:
Definition: functions.cpp:2757
RCP< const Basic > max(const vec_basic &arg)
Canonicalize Max:
Definition: functions.cpp:3512
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:2290
bool get_pi_shift(const RCP< const Basic > &arg, const Ptr< RCP< const Number >> &n, const Ptr< RCP< const Basic >> &x)
Definition: functions.cpp:160
RCP< const Basic > sign(const RCP< const Basic > &arg)
Canonicalize Sign.
Definition: functions.cpp:484
RCP< const Basic > atan2(const RCP< const Basic > &num, const RCP< const Basic > &den)
Canonicalize ATan2:
Definition: functions.cpp:1571
RCP< const Basic > ceiling(const RCP< const Basic > &arg)
Canonicalize Ceiling:
Definition: functions.cpp:662
RCP< const Basic > abs(const RCP< const Basic > &arg)
Canonicalize Abs:
Definition: functions.cpp:3449
RCP< const Basic > acsc(const RCP< const Basic > &arg)
Canonicalize ACsc:
Definition: functions.cpp:1441
RCP< const Basic > sech(const RCP< const Basic > &arg)
Canonicalize Sech:
Definition: functions.cpp:2208
RCP< const Basic > gamma(const RCP< const Basic > &arg)
Canonicalize Gamma:
Definition: functions.cpp:2971
RCP< const Basic > asin(const RCP< const Basic > &arg)
Canonicalize ASin:
Definition: functions.cpp:1317
RCP< const Basic > acoth(const RCP< const Basic > &arg)
Canonicalize ACoth:
Definition: functions.cpp:2491
RCP< const Basic > tan(const RCP< const Basic > &arg)
Canonicalize Tan:
Definition: functions.cpp:964
RCP< const Basic > cosh(const RCP< const Basic > &arg)
Canonicalize Cosh:
Definition: functions.cpp:2169
RCP< const Basic > asec(const RCP< const Basic > &arg)
Canonicalize ASec:
Definition: functions.cpp:1401
RCP< const Basic > acsch(const RCP< const Basic > &arg)
Canonicalize ACsch:
Definition: functions.cpp:2379
bool could_extract_minus(const Basic &arg)
Definition: functions.cpp:282
RCP< const Basic > atan(const RCP< const Basic > &arg)
Canonicalize ATan:
Definition: functions.cpp:1481
RCP< const Basic > asinh(const RCP< const Basic > &arg)
Canonicalize ASinh:
Definition: functions.cpp:2333
RCP< const Basic > tanh(const RCP< const Basic > &arg)
Canonicalize Tanh:
Definition: functions.cpp:2247
RCP< const Basic > cot(const RCP< const Basic > &arg)
Canonicalize Cot:
Definition: functions.cpp:1030
RCP< const Basic > atanh(const RCP< const Basic > &arg)
Canonicalize ATanh:
Definition: functions.cpp:2451
RCP< const Basic > floor(const RCP< const Basic > &arg)
Canonicalize Floor:
Definition: functions.cpp:568
RCP< const Basic > erfc(const RCP< const Basic > &arg)
Canonicalize Erfc:
Definition: functions.cpp:2884
RCP< const Basic > levi_civita(const vec_basic &arg)
Canonicalize LeviCivita:
Definition: functions.cpp:2704
RCP< const Basic > acosh(const RCP< const Basic > &arg)
Canonicalize ACosh:
Definition: functions.cpp:2418
RCP< const Basic > lowergamma(const RCP< const Basic > &s, const RCP< const Basic > &x)
Canonicalize LowerGamma:
Definition: functions.cpp:3027
RCP< const Basic > truncate(const RCP< const Basic > &arg)
Canonicalize Truncate:
Definition: functions.cpp:756
RCP< const Basic > loggamma(const RCP< const Basic > &arg)
Canonicalize LogGamma:
Definition: functions.cpp:3183
RCP< const Basic > cos(const RCP< const Basic > &arg)
Canonicalize Cos:
Definition: functions.cpp:899
RCP< const Basic > log(const RCP< const Basic > &arg)
Returns the Natural Logarithm from argument arg
Definition: functions.cpp:1731
RCP< const Basic > csc(const RCP< const Basic > &arg)
Canonicalize Csc:
Definition: functions.cpp:1095
RCP< const Basic > dirichlet_eta(const RCP< const Basic > &s)
Create a new Dirichlet_eta instance:
Definition: functions.cpp:2818
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:2126
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:3616
RCP< const Basic > erf(const RCP< const Basic > &arg)
Canonicalize Erf:
Definition: functions.cpp:2848
RCP< const Basic > trig_to_sqrt(const RCP< const Basic > &arg)
Definition: functions.cpp:1203
RCP< const Basic > asech(const RCP< const Basic > &arg)
Canonicalize ASech:
Definition: functions.cpp:2528
RCP< const Basic > lambertw(const RCP< const Basic > &arg)
Create a new LambertW instance:
Definition: functions.cpp:1803
RCP< const Basic > sinh(const RCP< const Basic > &arg)
Canonicalize Sinh:
Definition: functions.cpp:2084
RCP< const Basic > kronecker_delta(const RCP< const Basic > &i, const RCP< const Basic > &j)
Canonicalize KroneckerDelta:
Definition: functions.cpp:2632
RCP< const Basic > acot(const RCP< const Basic > &arg)
Canonicalize ACot:
Definition: functions.cpp:1523
RCP< const Basic > conjugate(const RCP< const Basic > &arg)
Canonicalize Conjugate.
Definition: functions.cpp:106
RCP< const Basic > sin(const RCP< const Basic > &arg)
Canonicalize Sin:
Definition: functions.cpp:831
RCP< const Basic > uppergamma(const RCP< const Basic > &s, const RCP< const Basic > &x)
Canonicalize UpperGamma:
Definition: functions.cpp:3110
T size(T... args)