close Warning: Can't synchronize with repository "(default)" (/var/svn/tolp does not appear to be a Subversion repository.). Look in the Trac log for more information.

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#773 closed defect (fixed)

Incremental index by name in Append

Reported by: Jorge Owned by: Víctor de Buen Remiro
Priority: normal Milestone: Mantainance
Component: SetAlgebra Version: 2.0.1
Severity: minor Keywords:
Cc:

Description

It would be desirable if after doing SetIndexByName on a Set the following invocation to does not invalidate the index Append and keep the Set indexed.

Change History (4)

comment:1 Changed 15 years ago by Víctor de Buen Remiro

Status: newaccepted
Summary: IndexByName property permanentIncremental index by name in Append

comment:2 Changed 15 years ago by Víctor de Buen Remiro

Milestone: Manteinance
Type: enhancementdefect

Current behaviour is incoherent due Append does no remove the index nor increment it. In this example, after the call to Append function HasIndexByName returns True but it cannot find the new element.

  Set s = {[[
   Real a = 1;
   Real b = 2;
   Real c = 3;
   Real d = 4;
   Real e = 5;
   Real f = 6 ]]};

  Real ok.1 = SetIndexByName(s);
  Real ok.idx.1 = FindIndexByName(s,"c")==3;

  Set Append(s, {[[ Real g = 7 ]]});
  Real ok.2 = HasIndexByName(s);
  Real ok.idx.2 = FindIndexByName(s,"g")==7;

comment:3 Changed 15 years ago by Víctor de Buen Remiro

Resolution: fixed
Status: acceptedclosed

(In [1600]) Fixes #773

comment:4 Changed 15 years ago by Víctor de Buen Remiro

There is a new optiaonal argument

  Set Append(Set set1, Set set2, [Real incrementalIndexByName=False])

If incrementalIndexByName is true, then the index of names will be incremented if original set had an index and new elements are compatible with old ones; or created if set was null.

If incrementalIndexByNameis false and set had an index, then it will be removed.

Note: See TracTickets for help on using tickets.