3 * Interface to GiNaC's constant types and some special constants. */
15 /** This class holds constants, symbols with specific numerical value. Each
16 * object of this class must either provide their own function to evaluate it
17 * to class numeric or provide the constant as a numeric (if it's an exact
19 class constant : public basic
24 // default constructor, destructor, copy constructor assignment operator and helpers
27 constant(constant const & other);
28 // constant const & operator=(constant const & other); /* it's pervert! */
30 void copy(constant const & other);
31 void destroy(bool call_parent);
35 constant(string const & initname, ex (*efun)()=0);
36 constant(string const & initname, numeric const & initnumber);
38 // functions overriding virtual functions from bases classes
40 basic * duplicate() const;
41 void printraw(ostream & os) const;
42 void print(ostream & os, unsigned upper_precedence=0) const;
43 void printcsrc(ostream & os, unsigned type, unsigned upper_precedence=0) const;
44 ex evalf(int level=0) const;
45 ex diff(symbol const & s) const;
47 int compare_same_type(basic const & other) const;
48 bool is_equal_same_type(basic const & other) const;
50 // new virtual functions which can be overridden by derived classes
53 // non-virtual functions in this class
63 unsigned serial; //!< unique serial number for comparision
64 static unsigned next_serial;
69 extern const constant some_constant;
70 extern type_info const & typeid_constant;
72 // extern const numeric I;
73 extern const constant Pi;
74 extern const constant Catalan;
75 extern const constant EulerGamma;
77 #endif // ndef _CONSTANT_H_