* Implementation of GiNaC's initially known functions. */
/*
- * GiNaC Copyright (C) 1999-2004 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2005 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
}
REGISTER_FUNCTION(conjugate_function, eval_func(conjugate_eval).
- evalf_func(conjugate_evalf).
- print_func<print_latex>(conjugate_print_latex).
- conjugate_func(conjugate_conjugate).
- set_name("conjugate","conjugate"));
+ evalf_func(conjugate_evalf).
+ print_func<print_latex>(conjugate_print_latex).
+ conjugate_func(conjugate_conjugate).
+ set_name("conjugate","conjugate"));
//////////
// absolute value
return factorial(x).hold();
}
+static void factorial_print_dflt_latex(const ex & x, const print_context & c)
+{
+ if (is_exactly_a<symbol>(x) ||
+ is_exactly_a<constant>(x) ||
+ is_exactly_a<function>(x)) {
+ x.print(c); c.s << "!";
+ } else {
+ c.s << "("; x.print(c); c.s << ")!";
+ }
+}
+
static ex factorial_conjugate(const ex & x)
{
return factorial(x);
REGISTER_FUNCTION(factorial, eval_func(factorial_eval).
evalf_func(factorial_evalf).
+ print_func<print_dflt>(factorial_print_dflt_latex).
+ print_func<print_latex>(factorial_print_dflt_latex).
conjugate_func(factorial_conjugate));
//////////