Changeset 4a6ef3


Ignore:
Timestamp:
Jul 12, 2017, 7:10:32 PM (7 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Action_Thermostats, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_StructOpt_integration_tests, AutomationFragmentation_failures, Candidate_v1.6.1, ChemicalSpaceEvaluator, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Exclude_Hydrogens_annealWithBondGraph, Fix_Verbose_Codepatterns, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, Gui_displays_atomic_force_velocity, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, PythonUI_with_named_parameters, Recreated_GuiChecks, StoppableMakroAction, TremoloParser_IncreasedPrecision
Children:
d1134d
Parents:
e0b960
git-author:
Frederik Heber <frederik.heber@…> (05/19/17 14:29:09)
git-committer:
Frederik Heber <frederik.heber@…> (07/12/17 19:10:32)
Message:

Moved AlwaysTruePredicate from BoostGraphCreatorUnitTest into BreadthFirstSearchGatherer.

Location:
src/Graph
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Graph/BreadthFirstSearchGatherer.hpp

    re0b960 r4a6ef3  
    2121#include "types.hpp"
    2222
     23class bond;
    2324struct BoostGraphCreator;
    2425
     
    5455  { return distance_map; }
    5556
     57  /** This is a default predicate which returns always true.
     58   *
     59   * \return true
     60   */
     61  static bool AlwaysTruePredicate(const bond &_bond) { return true; }
     62
    5663private:
    5764  //!> typedef for a vector of BFS discovery distances
  • src/Graph/unittests/BoostGraphCreatorUnitTest.cpp

    re0b960 r4a6ef3  
    4545#include "Atom/atom.hpp"
    4646#include "Graph/BoostGraphCreator.hpp"
     47#include "Graph/BreadthFirstSearchGatherer.hpp"
    4748#include "molecule.hpp"
    4849#include "Element/periodentafel.hpp"
     
    149150};
    150151
    151 static bool AlwaysTruePredicate(const bond &_bond) { return true; }
    152 
    153152/** Tests whether createFromMolecule() works.
    154153 */
    155154void BoostGraphCreatorTest::createFromMoleculeTest()
    156155{
    157   BGCreator->createFromMolecule(*TestMolecule, AlwaysTruePredicate);
     156  BGCreator->createFromMolecule(*TestMolecule, BreadthFirstSearchGatherer::AlwaysTruePredicate);
    158157
    159158  CPPUNIT_ASSERT_EQUAL ((size_t)6, BGCreator->getNumVertices());
     
    167166  std::vector<atom *> atoms;
    168167  std::copy(TestMolecule->begin(), TestMolecule->end(), std::back_inserter(atoms));
    169   BGCreator->createFromAtoms(atoms, AlwaysTruePredicate);
     168  BGCreator->createFromAtoms(atoms, BreadthFirstSearchGatherer::AlwaysTruePredicate);
    170169
    171170  CPPUNIT_ASSERT_EQUAL ((size_t)6, BGCreator->getNumVertices());
Note: See TracChangeset for help on using the changeset viewer.