*
* 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
*
* 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
container(const ex & p1, const ex & p2)
{
setflag(get_default_flags());
container(const ex & p1, const ex & p2)
{
setflag(get_default_flags());
this->seq.push_back(p1); this->seq.push_back(p2);
}
container(const ex & p1, const ex & p2, const ex & p3)
{
setflag(get_default_flags());
this->seq.push_back(p1); this->seq.push_back(p2);
}
container(const ex & p1, const ex & p2, const ex & p3)
{
setflag(get_default_flags());
const ex & p4, const ex & p5)
{
setflag(get_default_flags());
const ex & p4, const ex & p5)
{
setflag(get_default_flags());
this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
this->seq.push_back(p4); this->seq.push_back(p5);
}
this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
this->seq.push_back(p4); this->seq.push_back(p5);
}
const ex & p4, const ex & p5, const ex & p6)
{
setflag(get_default_flags());
const ex & p4, const ex & p5, const ex & p6)
{
setflag(get_default_flags());
this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
}
this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
}
this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
this->seq.push_back(p7);
this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
this->seq.push_back(p7);
const ex & p7, const ex & p8)
{
setflag(get_default_flags());
const ex & p7, const ex & p8)
{
setflag(get_default_flags());
this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
this->seq.push_back(p7); this->seq.push_back(p8);
this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
this->seq.push_back(p7); this->seq.push_back(p8);
const ex & p7, const ex & p8, const ex & p9)
{
setflag(get_default_flags());
const ex & p7, const ex & p8, const ex & p9)
{
setflag(get_default_flags());
this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
this->seq.push_back(p7); this->seq.push_back(p8); this->seq.push_back(p9);
this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
this->seq.push_back(p7); this->seq.push_back(p8); this->seq.push_back(p9);
this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
this->seq.push_back(p7); this->seq.push_back(p8); this->seq.push_back(p9);
this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
this->seq.push_back(p7); this->seq.push_back(p8); this->seq.push_back(p9);
const ex & p10, const ex & p11)
{
setflag(get_default_flags());
const ex & p10, const ex & p11)
{
setflag(get_default_flags());
this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
this->seq.push_back(p7); this->seq.push_back(p8); this->seq.push_back(p9);
this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
this->seq.push_back(p7); this->seq.push_back(p8); this->seq.push_back(p9);
const ex & p10, const ex & p11, const ex & p12)
{
setflag(get_default_flags());
const ex & p10, const ex & p11, const ex & p12)
{
setflag(get_default_flags());
this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
this->seq.push_back(p7); this->seq.push_back(p8); this->seq.push_back(p9);
this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
this->seq.push_back(p7); this->seq.push_back(p8); this->seq.push_back(p9);
this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
this->seq.push_back(p7); this->seq.push_back(p8); this->seq.push_back(p9);
this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
this->seq.push_back(p7); this->seq.push_back(p8); this->seq.push_back(p9);
const ex & p13, const ex & p14)
{
setflag(get_default_flags());
const ex & p13, const ex & p14)
{
setflag(get_default_flags());
this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
this->seq.push_back(p7); this->seq.push_back(p8); this->seq.push_back(p9);
this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
this->seq.push_back(p7); this->seq.push_back(p8); this->seq.push_back(p9);
const ex & p13, const ex & p14, const ex & p15)
{
setflag(get_default_flags());
const ex & p13, const ex & p14, const ex & p15)
{
setflag(get_default_flags());
this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
this->seq.push_back(p7); this->seq.push_back(p8); this->seq.push_back(p9);
this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
this->seq.push_back(p7); this->seq.push_back(p8); this->seq.push_back(p9);
this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
this->seq.push_back(p7); this->seq.push_back(p8); this->seq.push_back(p9);
this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
this->seq.push_back(p7); this->seq.push_back(p8); this->seq.push_back(p9);
archive_node::archive_node_cit first = n.find_first("seq");
archive_node::archive_node_cit last = n.find_last("seq");
++last;
archive_node::archive_node_cit first = n.find_first("seq");
archive_node::archive_node_cit last = n.find_last("seq");
++last;
for (archive_node::archive_node_cit i=first; i<last; ++i) {
ex e;
n.find_ex_by_loc(i, e, sym_lst);
for (archive_node::archive_node_cit i=first; i<last; ++i) {
ex e;
n.find_ex_by_loc(i, e, sym_lst);
for (const_iterator i=this->seq.begin(); i!=this->seq.end(); ++i) {
if (newcont) {
newcont->push_back(i->conjugate());
for (const_iterator i=this->seq.begin(); i!=this->seq.end(); ++i) {
if (newcont) {
newcont->push_back(i->conjugate());
const_iterator b = begin();
const_iterator e = end();
for(const_iterator i=b; i!=e; ++i)
const_iterator b = begin();
const_iterator e = end();
for(const_iterator i=b; i!=e; ++i)
const_iterator b = begin();
const_iterator e = end();
for(const_iterator i=b; i!=e; ++i)
const_iterator b = begin();
const_iterator e = end();
for(const_iterator i=b; i!=e; ++i)
virtual ex thiscontainer(const STLT & v) const { return container(v); }
/** Similar to duplicate(), but with a preset sequence (which gets
virtual ex thiscontainer(const STLT & v) const { return container(v); }
/** Similar to duplicate(), but with a preset sequence (which gets
- * deleted). Must be overridden by derived classes. */
- virtual ex thiscontainer(std::auto_ptr<STLT> vp) const { return container(vp); }
+ * pilfered). Must be overridden by derived classes. */
+ virtual ex thiscontainer(STLT && v) const { return container(std::move(v)); }
virtual void printseq(const print_context & c, char openbracket, char delim,
char closebracket, unsigned this_precedence,
virtual void printseq(const print_context & c, char openbracket, char delim,
char closebracket, unsigned this_precedence,
void do_print_python(const print_python & c, unsigned level) const;
void do_print_python_repr(const print_python_repr & c, unsigned level) const;
STLT evalchildren(int level) const;
void do_print_python(const print_python & c, unsigned level) const;
void do_print_python_repr(const print_python_repr & c, unsigned level) const;
STLT evalchildren(int level) const;
- std::auto_ptr<STLT> vp = subschildren(m, options);
- if (vp.get()) {
- ex result(thiscontainer(vp));
+ STLT subsed = subschildren(m, options);
+ if (!subsed.empty()) {
+ ex result(thiscontainer(subsed));
if (is_a<container<C> >(result))
return ex_to<basic>(result).subs_one_level(m, options);
else
if (is_a<container<C> >(result))
return ex_to<basic>(result).subs_one_level(m, options);
else
- // returns a NULL pointer if nothing had to be substituted
- // returns a pointer to a newly created STLT otherwise
- // (and relinquishes responsibility for the STLT)
+ // returns an empty container if nothing had to be substituted
+ // returns a STLT with substituted elements otherwise
if (!are_ex_trivially_equal(*cit, subsed_ex)) {
// copy first part of seq which hasn't changed
if (!are_ex_trivially_equal(*cit, subsed_ex)) {
// copy first part of seq which hasn't changed
- std::auto_ptr<STLT> s(new STLT(this->seq.begin(), cit));
- reserve(*s, this->seq.size());
+ STLT s(this->seq.begin(), cit);
+ this->reserve(s, this->seq.size());