- ${STLT} s;
- RESERVE(s,seq.size());
- for (${STLT}::const_iterator it=seq.begin(); it!=seq.end(); ++it) {
- s.push_back((*it).diff(y));
- }
- return s;
-}
-
-/* obsolete subschildren
-${STLT} ${CONTAINER}::subschildren(const lst & ls, const lst & lr) const
-{
- ${STLT} s;
- RESERVE(s,seq.size());
- for (${STLT}::const_iterator it=seq.begin(); it!=seq.end(); ++it) {
- s.push_back((*it).subs(ls,lr));
- }
- return s;
-}
-*/
-
-${STLT} * ${CONTAINER}::subschildren(const lst & ls, const lst & lr) const
-{
- // returns a NULL pointer if nothing had to be substituted
- // returns a pointer to a newly created epvector otherwise
- // (which has to be deleted somewhere else)
-
- ${STLT}::const_iterator last=seq.end();
- ${STLT}::const_iterator cit=seq.begin();
- while (cit!=last) {
- const ex & subsed_ex=(*cit).subs(ls,lr);
- if (!are_ex_trivially_equal(*cit,subsed_ex)) {
-
- // something changed, copy seq, subs and return it
- ${STLT} *s=new ${STLT};
- RESERVE(*s,seq.size());
-
- // copy parts of seq which are known not to have changed
- ${STLT}::const_iterator cit2=seq.begin();
- while (cit2!=cit) {
- s->push_back(*cit2);
- ++cit2;
- }
- // copy first changed element
- s->push_back(subsed_ex);
- ++cit2;
- // copy rest
- while (cit2!=last) {
- s->push_back((*cit2).subs(ls,lr));
- ++cit2;
- }
- return s;
- }
- ++cit;
- }
-
- return 0; // nothing has changed
+ ${STLT} s;
+ RESERVE(s,seq.size());
+ for (${STLT}::const_iterator it=seq.begin(); it!=seq.end(); ++it) {
+ s.push_back((*it).diff(y));
+ }
+ return s;
+}
+
+${STLT} * ${CONTAINER}::subschildren(const lst & ls, const lst & lr, bool no_pattern) const
+{
+ // returns a NULL pointer if nothing had to be substituted
+ // returns a pointer to a newly created epvector otherwise
+ // (which has to be deleted somewhere else)
+
+ ${STLT}::const_iterator last=seq.end();
+ ${STLT}::const_iterator cit=seq.begin();
+ while (cit!=last) {
+ const ex & subsed_ex=(*cit).subs(ls,lr,no_pattern);
+ if (!are_ex_trivially_equal(*cit,subsed_ex)) {
+
+ // something changed, copy seq, subs and return it
+ ${STLT} *s=new ${STLT};
+ RESERVE(*s,seq.size());
+
+ // copy parts of seq which are known not to have changed
+ ${STLT}::const_iterator cit2=seq.begin();
+ while (cit2!=cit) {
+ s->push_back(*cit2);
+ ++cit2;
+ }
+ // copy first changed element
+ s->push_back(subsed_ex);
+ ++cit2;
+ // copy rest
+ while (cit2!=last) {
+ s->push_back((*cit2).subs(ls,lr,no_pattern));
+ ++cit2;
+ }
+ return s;
+ }
+ ++cit;
+ }
+
+ return 0; // nothing has changed