Ignore:
Timestamp:
Oct 27, 2009, 4:11:22 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
069034
Parents:
55a71b
Message:

Huge refactoring to make const what is const (ticket #38), continued.

  • too many changes because of too many cross-references to be able to list them up here.
  • NOTE that "make check" runs fine and did catch several error.
  • note that we had to use const_iterator several times when the map, ... was declared const.
  • at times we changed an allocated LinkedCell LCList(...) into

const LinkedCell *LCList;
LCList = new LinkedCell(...);

  • also mutable (see ticket #5) was used, e.g. for molecule::InternalPointer (PointCloud changes are allowed, because they are just accounting).

Signed-off-by: Frederik Heber <heber@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/molecule_graph.cpp

    r55a71b ra9b2a0a  
    102102  double distance, MinDistance, MaxDistance;
    103103  LinkedCell *LC = NULL;
    104   LinkedNodes *List = NULL;
    105   LinkedNodes *OtherList = NULL;
    106104
    107105  BondDistance = bonddistance; // * ((IsAngstroem) ? 1. : 1./AtomicLengthToAngstroem);
     
    131129      for (LC->n[1] = 0; LC->n[1] < LC->N[1]; LC->n[1]++)
    132130        for (LC->n[2] = 0; LC->n[2] < LC->N[2]; LC->n[2]++) {
    133           List = LC->GetCurrentCell();
     131          const LinkedNodes *List = LC->GetCurrentCell();
    134132          //*out << Verbose(2) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << " containing " << List->size() << " points." << endl;
    135133          if (List != NULL) {
    136             for (LinkedNodes::iterator Runner = List->begin(); Runner != List->end(); Runner++) {
     134            for (LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
    137135              Walker = AtomMap[(*Runner)->nr];
    138136              //*out << Verbose(0) << "Current Atom is " << *Walker << "." << endl;
     
    141139                for (n[1] = -1; n[1] <= 1; n[1]++)
    142140                  for (n[2] = -1; n[2] <= 1; n[2]++) {
    143                     OtherList = LC->GetRelativeToCurrentCell(n);
     141                    const LinkedNodes *OtherList = LC->GetRelativeToCurrentCell(n);
    144142                    //*out << Verbose(2) << "Current relative cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << " containing " << List->size() << " points." << endl;
    145143                    if (OtherList != NULL) {
    146                       for (LinkedNodes::iterator OtherRunner = OtherList->begin(); OtherRunner != OtherList->end(); OtherRunner++) {
     144                      for (LinkedNodes::const_iterator OtherRunner = OtherList->begin(); OtherRunner != OtherList->end(); OtherRunner++) {
    147145                        if ((*OtherRunner)->nr > Walker->nr) {
    148146                          OtherWalker = AtomMap[(*OtherRunner)->nr];
Note: See TracChangeset for help on using the changeset viewer.