Ignore:
Timestamp:
Aug 30, 2025, 2:41:40 PM (2 months ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Candidate_v1.7.0, stable
Children:
5a255af
Parents:
d56114
git-author:
Frederik Heber <frederik.heber@…> (08/15/25 19:06:31)
git-committer:
Frederik Heber <frederik.heber@…> (08/30/25 14:41:40)
Message:

FIX: fixes several issues in QtHomologyList related to plotting.

  • the curve was added twice: once through the signal from QSeisCurveRegistry and the second time through a direct call. The latter is now removed.
  • We now plot all potentials (not just harmonic bond) by using default xvalues for constant. The harmonic bond was plotted because the bond length appeared twice in the exemplary water molecule while the harmonic angle appears only once. This is also fixed.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/Views/Qt4/QtHomologyList.cpp

    rd56114 r476781  
    220220      std::vector<double> xvalues;
    221221      std::vector<double> yvalues;
    222       for (TrainingData::OutputVector_t::const_iterator outputiter = outputs.begin();
    223           outputiter != outputs.end(); ++outputiter)
    224         yvalues.push_back((*outputiter)[0]);
    225222
    226223      // go through each potential
     
    234231        // then we need to sample the potential
    235232        HomologyGraph dummy;
     233
    236234        xvalues.clear();
     235        yvalues.clear();
     236        for (TrainingData::OutputVector_t::const_iterator outputiter = outputs.begin();
     237            outputiter != outputs.end(); ++outputiter)
     238          yvalues.push_back((*outputiter)[0]);
    237239        for (TrainingData::InputVector_t::const_iterator inputiter = inputs.begin();
    238240            inputiter != inputs.end(); ++inputiter) {
     
    244246            average += (*coordinator)(args);
    245247          }
     248          const size_t index =  xvalues.size();
    246249          if (specificargs.size() > 1) {
    247             const size_t index =  xvalues.size();
    248250            xvalues.push_back(average/(double)specificargs.size());
    249             yvalues[index] *= 1./(double)specificargs.size();
     251          } else if (specificargs.size() == 1) {
     252            xvalues.push_back(average);
     253          } else {
     254            xvalues.push_back(index/0.1);
    250255          }
    251256        }
     
    284289          else
    285290            delete curve;
    286           // couple to QSeisPlotPage
    287           widget->addCurve(potentialname);
    288291        }
    289292      }
Note: See TracChangeset for help on using the changeset viewer.