associated methods ex::pre/postorder_begin/end()) providing tree traversal
with iterators.
* Fixed the LaTeX output of the varidx class.
+* Fixed bugs in series expansion and complex conjugation.
* Symbolic functions without any eval(), evalf() etc. functions now work
properly.
* Added method matrix::rank().
return (new add(s, overall_coeff))->setflag(status_flags::dynallocated);
}
+ex add::conjugate() const
+{
+ exvector *v = 0;
+ for (int i=0; i<nops(); ++i) {
+ if (v) {
+ v->push_back(op(i).conjugate());
+ continue;
+ }
+ ex term = op(i);
+ ex ccterm = term.conjugate();
+ if (are_ex_trivially_equal(term, ccterm))
+ continue;
+ v = new exvector;
+ v->reserve(nops());
+ for (int j=0; j<i; ++j)
+ v->push_back(op(j));
+ v->push_back(ccterm);
+ }
+ if (v) {
+ ex result = add(*v);
+ delete v;
+ return result;
+ }
+ return *this;
+}
+
ex add::eval_ncmul(const exvector & v) const
{
if (seq.empty())
numeric integer_content() const;
ex smod(const numeric &xi) const;
numeric max_coefficient() const;
+ ex conjugate() const;
exvector get_free_indices() const;
ex eval_ncmul(const exvector & v) const;
protected:
inline ex numer_denom(const ex & thisex)
{ return thisex.numer_denom(); }
+inline ex conjugate(const ex & thisex)
+{ return thisex.conjugate(); }
+
inline ex normal(const ex & thisex, int level=0)
{ return thisex.normal(level); }
if (is_exactly_a<numeric>(arg)) {
return ex_to<numeric>(arg).conjugate();
}
- return conjugate(arg).hold();
+ return conjugate_function(arg).hold();
}
static ex conjugate_eval(const ex & arg)
return arg;
}
-REGISTER_FUNCTION(conjugate, eval_func(conjugate_eval).
+REGISTER_FUNCTION(conjugate_function, eval_func(conjugate_eval).
evalf_func(conjugate_evalf).
print_func<print_latex>(conjugate_print_latex).
- conjugate_func(conjugate_conjugate));
+ conjugate_func(conjugate_conjugate).
+ set_name("conjugate","conjugate"));
//////////
// absolute value
namespace GiNaC {
/** Complex conjugate. */
-DECLARE_FUNCTION_1P(conjugate)
+DECLARE_FUNCTION_1P(conjugate_function)
/** Absolute value. */
DECLARE_FUNCTION_1P(abs)
ex symbol::conjugate() const
{
if (this->domain == domain::complex) {
- return GiNaC::conjugate(*this).hold();
+ return GiNaC::conjugate_function(*this).hold();
} else {
return *this;
}