Changeset 19832d for src/Graph


Ignore:
Timestamp:
Mar 16, 2024, 10:22:50 AM (20 months ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Candidate_v1.7.0, stable
Children:
c099dc
Parents:
9782e20
git-author:
Frederik Heber <frederik.heber@…> (03/16/24 09:40:05)
git-committer:
Frederik Heber <frederik.heber@…> (03/16/24 10:22:50)
Message:

BondGraph: returns 1. instead of -1. on miss.

  • when the symmetric matrix did not have an entry or the matrix itself was null, then we returned -1.
  • This was often ued in following computations and ended us finding the atom on the "other" side of a bonded atom than expected.
  • Now, we return always 1. as this is a distance than should be always useful and can be brought to correct lengths in an optimization run.
Location:
src/Graph
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Graph/BondGraph.cpp

    r9782e20 r19832d  
    125125    int secondZ) const
    126126{
     127  // returns 1. as an at least useful length
    127128  int firstIndex = firstZ-1;
    128129  int secondIndex = secondZ-1;
    129130  double return_length;
    130131  if ((firstIndex < 0) || (firstIndex >= (int)BondLengthMatrix->Matrix[0].size()))
    131     return -1.;
     132    return 1.;
    132133  if ((secondIndex < 0) || (secondIndex >= (int)BondLengthMatrix->Matrix[0][firstIndex].size()))
    133     return -1.;
     134    return 1.;
    134135  if (BondLengthMatrix == NULL) {
    135     return_length = -1.;
     136    return_length = 1.;
    136137  } else {
    137138    return_length = BondLengthMatrix->Matrix[0][firstIndex][secondIndex];
  • src/Graph/BondGraph.hpp

    r9782e20 r19832d  
    415415
    416416  /** Returns the BondLengthMatrix entry for a given index pair.
     417   *
     418   * \note This will return a bond length of 1. if we cannot find an entry.
     419   *
    417420   * \param firstelement index/atom number of first element (row index)
    418421   * \param secondelement index/atom number of second element (column index)
Note: See TracChangeset for help on using the changeset viewer.