/* Assorted tests on other transcendental functions. */
static unsigned inifcns_consist_trans(void)
{
+ using GiNaC::asin; using GiNaC::acos;
+
unsigned result = 0;
symbol x("x");
ex chk;
arguments where the result exists in closed form and check if it's ok. */
static unsigned inifcns_consist_psi(void)
{
+ using GiNaC::log;
+
unsigned result = 0;
symbol x;
ex e, f;
// Series expansion
static unsigned exam_series1(void)
{
+ using GiNaC::log;
+
unsigned result = 0;
ex e, d;
// Series expansion of Li2((x==2)^2), caring about branch-cut
static unsigned exam_series10(void)
{
+ using GiNaC::log;
+
ex e = Li2(pow(x,2));
ex d = Li2(4) + (-log(3) + I*Pi*csgn(I-I*pow(x,2))) * (x-2)
+ (numeric(-2,3) + log(3)/4 - I*Pi/4*csgn(I-I*pow(x,2))) * pow(x-2,2)
// Series expansion of logarithms around branch points
static unsigned exam_series11(void)
{
+ using GiNaC::log;
+
unsigned result = 0;
ex e, d;
symbol a("a");
// Series expansion of other functions around branch points
static unsigned exam_series12(void)
{
+ using GiNaC::log;
+
unsigned result = 0;
ex e, d;
bool(cuts & 16)));
}
-static unsigned test_tree(const node (*tree_generator)(unsigned=0))
+static unsigned test_tree(const node tree_generator(unsigned))
{
- const int edges = tree_generator().total_edges();
+ const int edges = tree_generator(0).total_edges();
const int vertices = edges+1;
// fill a vector of all possible 2^edges combinations of cuts...
const T foo; return foo.tinfo()==obj.tinfo();
}
-/** Check if ex is a handle to a T, including base classes. */
-template <class T>
-inline bool is_a(const ex &obj)
-{
- return is_a<T>(*obj.bp);
-}
-
-/** Check if ex is a handle to a T, not including base classes. */
-template <class T>
-inline bool is_exactly_a(const ex &obj)
-{
- return is_exactly_a<T>(*obj.bp);
-}
-
-/** Return a reference to the basic-derived class T object embedded in an
- * expression. This is fast but unsafe: the result is undefined if the
- * expression does not contain a T object at its top level. Hence, you
- * should generally check the type of e first.
- *
- * @param e expression
- * @return reference to pseries object
- * @see is_exactly_a<class T>() */
-template <class T>
-inline const T &ex_to(const ex &e)
-{
- GINAC_ASSERT(is_a<T>(e));
- return static_cast<const T &>(*e.bp);
-}
-
} // namespace GiNaC
#endif // ndef __GINAC_BASIC_H__
return bp->map(fcn);
}
+// convenience type checker template functions
+
+/** Check if ex is a handle to a T, including base classes. */
+template <class T>
+inline bool is_a(const ex &obj)
+{
+ return is_a<T>(*obj.bp);
+}
+
+/** Check if ex is a handle to a T, not including base classes. */
+template <class T>
+inline bool is_exactly_a(const ex &obj)
+{
+ return is_exactly_a<T>(*obj.bp);
+}
+
+/** Return a reference to the basic-derived class T object embedded in an
+ * expression. This is fast but unsafe: the result is undefined if the
+ * expression does not contain a T object at its top level. Hence, you
+ * should generally check the type of e first.
+ *
+ * @param e expression
+ * @return reference to object of class T
+ * @see is_exactly_a<class T>() */
+template <class T>
+inline const T &ex_to(const ex &e)
+{
+ GINAC_ASSERT(is_a<T>(e));
+ return static_cast<const T &>(*e.bp);
+}
} // namespace GiNaC
bool function::lookup_remember_table(ex & result) const
{
- return remember_table::remember_tables()[serial].lookup_entry(*this,result);
+ return remember_table::remember_tables()[this->serial].lookup_entry(*this,result);
}
void function::store_remember_table(ex const & result) const
{
- remember_table::remember_tables()[serial].add_entry(*this,result);
+ remember_table::remember_tables()[this->serial].add_entry(*this,result);
}
// public