Ignore:
Timestamp:
Apr 7, 2010, 3:45:38 PM (16 years ago)
Author:
Tillmann Crueger <crueger@…>
Children:
0f55b2
Parents:
770138
Message:

Made data internal data-structure of vector class private

  • Replaced occurences of access to internals with operator
  • moved Vector-class into LinAlg-Module
  • Reworked Vector to allow clean modularization
  • Added Plane class to describe arbitrary planes in 3d space
File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/linkedcell.cpp

    r770138 r71910a  
    5454  Walker = set->GetPoint();
    5555  for (int i=0;i<NDIM;i++) {
    56     max.x[i] = Walker->node->x[i];
    57     min.x[i] = Walker->node->x[i];
     56    max[i] = Walker->node->at(i);
     57    min[i] = Walker->node->at(i);
    5858  }
    5959  set->GoToFirst();
     
    6161    Walker = set->GetPoint();
    6262    for (int i=0;i<NDIM;i++) {
    63       if (max.x[i] < Walker->node->x[i])
    64         max.x[i] = Walker->node->x[i];
    65       if (min.x[i] > Walker->node->x[i])
    66         min.x[i] = Walker->node->x[i];
     63      if (max[i] < Walker->node->at(i))
     64        max[i] = Walker->node->at(i);
     65      if (min[i] > Walker->node->at(i))
     66        min[i] = Walker->node->at(i);
    6767    }
    6868    set->GoToNext();
     
    7272  // 2. find then number of cells per axis
    7373  for (int i=0;i<NDIM;i++) {
    74     N[i] = (int)floor((max.x[i] - min.x[i])/RADIUS)+1;
     74    N[i] = static_cast<int>(floor((max[i] - min[i])/RADIUS)+1);
    7575  }
    7676  Log() << Verbose(2) << "Number of cells per axis are " << N[0] << ", " << N[1] << " and " << N[2] << "." << endl;
     
    9494    Walker = set->GetPoint();
    9595    for (int i=0;i<NDIM;i++) {
    96       n[i] = (int)floor((Walker->node->x[i] - min.x[i])/RADIUS);
     96      n[i] = static_cast<int>(floor((Walker->node->at(i) - min[i])/RADIUS));
    9797    }
    9898    index = n[0] * N[1] * N[2] + n[1] * N[2] + n[2];
     
    128128  LinkedNodes::iterator Runner = set->begin();
    129129  for (int i=0;i<NDIM;i++) {
    130     max.x[i] = (*Runner)->node->x[i];
    131     min.x[i] = (*Runner)->node->x[i];
     130    max[i] = (*Runner)->node->at(i);
     131    min[i] = (*Runner)->node->at(i);
    132132  }
    133133  for (LinkedNodes::iterator Runner = set->begin(); Runner != set->end(); Runner++) {
    134134    Walker = *Runner;
    135135    for (int i=0;i<NDIM;i++) {
    136       if (max.x[i] < Walker->node->x[i])
    137         max.x[i] = Walker->node->x[i];
    138       if (min.x[i] > Walker->node->x[i])
    139         min.x[i] = Walker->node->x[i];
     136      if (max[i] < Walker->node->at(i))
     137        max[i] = Walker->node->at(i);
     138      if (min[i] > Walker->node->at(i))
     139        min[i] = Walker->node->at(i);
    140140    }
    141141  }
     
    144144  // 2. find then number of cells per axis
    145145  for (int i=0;i<NDIM;i++) {
    146     N[i] = (int)floor((max.x[i] - min.x[i])/RADIUS)+1;
     146    N[i] = static_cast<int>(floor((max[i] - min[i])/RADIUS)+1);
    147147  }
    148148  Log() << Verbose(2) << "Number of cells per axis are " << N[0] << ", " << N[1] << " and " << N[2] << "." << endl;
     
    165165    Walker = *Runner;
    166166    for (int i=0;i<NDIM;i++) {
    167       n[i] = (int)floor((Walker->node->x[i] - min.x[i])/RADIUS);
     167      n[i] = static_cast<int>(floor((Walker->node->at(i) - min[i])/RADIUS));
    168168    }
    169169    index = n[0] * N[1] * N[2] + n[1] * N[2] + n[2];
     
    252252  bool status = false;
    253253  for (int i=0;i<NDIM;i++) {
    254     n[i] = (int)floor((Walker->node->x[i] - min.x[i])/RADIUS);
     254    n[i] = static_cast<int>(floor((Walker->node->at(i) - min[i])/RADIUS));
    255255  }
    256256  index = n[0] * N[1] * N[2] + n[1] * N[2] + n[2];
     
    293293  bool status = true;
    294294  for (int i=0;i<NDIM;i++) {
    295     n[i] = (int)floor((x->x[i] - min.x[i])/RADIUS);
    296     if (max.x[i] < x->x[i])
     295    n[i] = static_cast<int>(floor((x->at(i) - min[i])/RADIUS));
     296    if (max[i] < x->at(i))
    297297      status = false;
    298     if (min.x[i] > x->x[i])
     298    if (min[i] > x->at(i))
    299299      status = false;
    300300  }
Note: See TracChangeset for help on using the changeset viewer.