Changeset 6b5228 for src/Parser/Parameters
- Timestamp:
- Oct 17, 2011, 4:52:28 PM (13 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- ec0acc
- Parents:
- 39fa96
- git-author:
- Frederik Heber <heber@…> (10/04/11 08:35:42)
- git-committer:
- Frederik Heber <heber@…> (10/17/11 16:52:28)
- Location:
- src/Parser/Parameters
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/Parameters/ContinuousParameter.hpp
r39fa96 r6b5228 30 30 virtual ~ContinuousParameter(); 31 31 32 // comparator 33 bool operator==(const ContinuousParameter<T> &_instance) const; 34 bool operator!=(const ContinuousParameter<T> &_instance) const 35 { return !((*this)==(_instance)); } 36 32 37 Parameter* clone() const; 33 38 -
src/Parser/Parameters/ContinuousParameter_impl.hpp
r39fa96 r6b5228 42 42 {}; 43 43 44 /** Compares this continuous value against another \a _instance. 45 * 46 * @param _instance other value to compare to 47 * @return true - if contained ContinuousValue and name are the same, false - else 48 */ 49 template <class T> 50 bool ContinuousParameter<T>::operator==(const ContinuousParameter<T> &_instance) const 51 { 52 bool status = true; 53 status = status && 54 (*dynamic_cast<const ContinuousValue<T> *>(this) == dynamic_cast<const ContinuousValue<T> &>(_instance)); 55 status = status && (Parameter::getName() == _instance.Parameter::getName()); 56 return status; 57 } 58 44 59 /** Creates a clone of this Parameter instance. 45 60 * -
src/Parser/Parameters/DiscreteParameter.hpp
r39fa96 r6b5228 32 32 virtual ~DiscreteParameter(); 33 33 34 // comparator 35 bool operator==(const DiscreteParameter<T> &_instance) const; 36 bool operator!=(const DiscreteParameter<T> &_instance) const 37 { return !((*this)==(_instance)); } 38 34 39 Parameter* clone() const; 35 40 -
src/Parser/Parameters/DiscreteParameter_impl.hpp
r39fa96 r6b5228 44 44 {}; 45 45 46 /** Compares this discrete value against another \a _instance. 47 * 48 * @param _instance other value to compare to 49 * @return true - if contained DiscreteValue and name are the same, false - else 50 */ 51 template <class T> 52 bool DiscreteParameter<T>::operator==(const DiscreteParameter<T> &_instance) const 53 { 54 bool status = true; 55 status = status && 56 (*dynamic_cast<const DiscreteValue<T> *>(this) == dynamic_cast<const DiscreteValue<T> &>(_instance)); 57 status = status && (Parameter::getName() == _instance.Parameter::getName()); 58 return status; 59 } 60 46 61 /** Creates a clone of this Parameter instance. 47 62 * -
src/Parser/Parameters/unittests/ContinuousParameterUnitTest.cpp
r39fa96 r6b5228 51 51 /************************************ tests ***********************************/ 52 52 53 /** Unit test for comparator. 54 * 55 */ 56 void ContinuousParameterTest::comparatorTest() 57 { 58 // create instance 59 ContinuousParameter<int> test("intParam", *ValidRange); 60 ContinuousParameter<int> samenamedsamevalued("intParam", *ValidRange); 61 ContinuousParameter<int> samenamedelsevalued("intParam", *ValidRange); 62 ContinuousParameter<int> elsenamedsamevalued("int2Param", *ValidRange); 63 ContinuousParameter<int> elsenamedelsevalued("int2Param", *ValidRange); 64 test.setValue(1); 65 samenamedsamevalued.setValue(1); 66 samenamedelsevalued.setValue(2); 67 elsenamedsamevalued.setValue(1); 68 elsenamedelsevalued.setValue(2); 69 70 CPPUNIT_ASSERT( test == samenamedsamevalued ); 71 CPPUNIT_ASSERT( test != samenamedelsevalued ); 72 CPPUNIT_ASSERT( test != elsenamedsamevalued ); 73 CPPUNIT_ASSERT( test != elsenamedelsevalued ); 74 } 75 53 76 /** Unit test for clone. 54 77 * -
src/Parser/Parameters/unittests/ContinuousParameterUnitTest.hpp
r39fa96 r6b5228 22 22 { 23 23 CPPUNIT_TEST_SUITE( ContinuousParameterTest ) ; 24 CPPUNIT_TEST ( comparatorTest ); 24 25 CPPUNIT_TEST ( cloneTest ); 25 26 CPPUNIT_TEST_SUITE_END(); … … 29 30 void tearDown(); 30 31 32 void comparatorTest(); 31 33 void cloneTest(); 32 34 -
src/Parser/Parameters/unittests/DiscreteParameterUnitTest.cpp
r39fa96 r6b5228 53 53 /************************************ tests ***********************************/ 54 54 55 /** Unit test for comparator. 56 * 57 */ 58 void DiscreteParameterTest::comparatorTest() 59 { 60 // create instance 61 DiscreteParameter<int> test("intParam", ValidValues); 62 DiscreteParameter<int> samenamedsamevalued("intParam", ValidValues); 63 DiscreteParameter<int> samenamedelsevalued("intParam", ValidValues); 64 DiscreteParameter<int> elsenamedsamevalued("int2Param", ValidValues); 65 DiscreteParameter<int> elsenamedelsevalued("int2Param", ValidValues); 66 test.setValue(1); 67 samenamedsamevalued.setValue(1); 68 samenamedelsevalued.setValue(2); 69 elsenamedsamevalued.setValue(1); 70 elsenamedelsevalued.setValue(2); 71 72 CPPUNIT_ASSERT( test == samenamedsamevalued ); 73 CPPUNIT_ASSERT( test != samenamedelsevalued ); 74 CPPUNIT_ASSERT( test != elsenamedsamevalued ); 75 CPPUNIT_ASSERT( test != elsenamedelsevalued ); 76 } 77 55 78 /** Unit test for clone. 56 79 * -
src/Parser/Parameters/unittests/DiscreteParameterUnitTest.hpp
r39fa96 r6b5228 20 20 { 21 21 CPPUNIT_TEST_SUITE( DiscreteParameterTest ) ; 22 CPPUNIT_TEST ( comparatorTest ); 22 23 CPPUNIT_TEST ( cloneTest ); 23 24 CPPUNIT_TEST_SUITE_END(); … … 27 28 void tearDown(); 28 29 30 void comparatorTest(); 29 31 void cloneTest(); 30 32
Note:
See TracChangeset
for help on using the changeset viewer.