- Timestamp:
- Nov 8, 2012, 1:13:53 PM (12 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:
- 9fd889
- Parents:
- cf18c5
- git-author:
- Frederik Heber <heber@…> (07/27/12 15:49:06)
- git-committer:
- Frederik Heber <heber@…> (11/08/12 13:13:53)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/Histogram/unittests/HistogramUnitTest.cpp
rcf18c5 r6bed1f 84 84 sampled_values += 1.,2.,3.,4.; 85 85 CPPUNIT_ASSERT_EQUAL( (size_t)4, sampled_values.size() ); 86 histogram = new Histogram(sampled_values, 4);86 histogram = new Histogram(sampled_values, 1., 1.); 87 87 CPPUNIT_ASSERT_EQUAL( (size_t)4+1, histogram->bins.size() ); 88 88 CPPUNIT_ASSERT( histogram->bins.end() != histogram->bins.begin() ); … … 99 99 sampled_values += 1.,2.,3.,4.; 100 100 CPPUNIT_ASSERT_EQUAL( (size_t)4, sampled_values.size() ); 101 histogram = new Histogram(sampled_values, 4);101 histogram = new Histogram(sampled_values, 1., 1.); 102 102 103 103 // check values inside … … 133 133 sampled_values += 1.,2.,3.,4.; 134 134 CPPUNIT_ASSERT_EQUAL( (size_t)4, sampled_values.size() ); 135 histogram = new Histogram(sampled_values, 4);135 histogram = new Histogram(sampled_values, 1., 1.); 136 136 137 137 // check values inside … … 172 172 Histogram::samples_t sampled_values; 173 173 sampled_values += 1.,2.,3.,4.; 174 histogram = new Histogram(sampled_values, 4);174 histogram = new Histogram(sampled_values, 1., 1.); 175 175 176 176 // go through each bin and check against getLowerEnd() … … 189 189 void HistogramTest::isEmpty_Test() 190 190 { 191 histogram = new Histogram( std::vector<double>());191 histogram = new Histogram(1., 1.); 192 192 // test on empty histogramgram 193 193 CPPUNIT_ASSERT( histogram->isEmpty() ); … … 197 197 sampled_values += 1.,2.,3.,4.; 198 198 delete histogram; 199 histogram = new Histogram(sampled_values, 4);199 histogram = new Histogram(sampled_values, 1., 1.); 200 200 CPPUNIT_ASSERT( !histogram->isEmpty() ); 201 201 … … 206 206 void HistogramTest::areaTest() 207 207 { 208 histogram = new Histogram( std::vector<double>());208 histogram = new Histogram(1., 1.); 209 209 // test on empty histogramgram 210 210 CPPUNIT_ASSERT_EQUAL( 0., histogram->area() ); … … 214 214 sampled_values += 1.,2.,3.,4., 4.; 215 215 delete histogram; 216 histogram = new Histogram(sampled_values, 4);216 histogram = new Histogram(sampled_values, 1., 1.); 217 217 CPPUNIT_ASSERT_EQUAL( 5., histogram->area() ); 218 218 Histogram::samples_t more_values; 219 219 more_values += 1.75,2.5,3.; 220 Histogram otherhistogram(more_values, 3);220 Histogram otherhistogram(more_values, 1.75, .625); 221 221 CPPUNIT_ASSERT_EQUAL( 3., otherhistogram.area() ); 222 222 … … 230 230 Histogram::samples_t sampled_values; 231 231 sampled_values += 1.,2.,3.,4.; 232 histogram = new Histogram(sampled_values, 4);232 histogram = new Histogram(sampled_values, 1., 1.); 233 233 Histogram::samples_t more_values; 234 234 more_values += 1.75,2.5,3.; 235 Histogram otherhistogram(more_values, 3);235 Histogram otherhistogram(more_values, 1.75, .625); 236 236 237 237 // check that size increases … … 252 252 Histogram::samples_t sampled_values; 253 253 sampled_values += 1.,2.,3.,4.; 254 histogram = new Histogram(sampled_values, 4);254 histogram = new Histogram(sampled_values, 1., 1.); 255 255 256 256 // add upon larger … … 258 258 Histogram::samples_t more_values; 259 259 more_values += 0.5, 1.25, 2.5,3., 4.2; 260 Histogram otherhistogram(more_values, 5);260 Histogram otherhistogram(more_values, 0.5, .625); 261 261 const double areas = histogram->area() + otherhistogram.area(); 262 262 … … 271 271 Histogram::samples_t more_values; 272 272 more_values += 1.75,2.5,3.; 273 Histogram otherhistogram(more_values, 3);273 Histogram otherhistogram(more_values, 1.75, .625); 274 274 const double areas = histogram->area() + otherhistogram.area(); 275 275 … … 288 288 Histogram::samples_t sampled_values; 289 289 sampled_values += 1.,2.,3.,4.; 290 histogram = new Histogram(sampled_values, 4);290 histogram = new Histogram(sampled_values, 1., 1.); 291 291 292 292 // subtract smaller 293 293 { 294 294 Histogram::samples_t more_values; 295 more_values += 1.75,2.5,3.;296 Histogram otherhistogram(more_values, 3);295 more_values += 0.5, 1.25, 2.5,3., 4.2; 296 Histogram otherhistogram(more_values, 0.5, .625); 297 297 const double difference = otherhistogram.area() - histogram->area(); 298 298 … … 306 306 { 307 307 Histogram::samples_t more_values; 308 more_values += 0.5, 1.25, 2.5,3., 4.2;309 Histogram otherhistogram(more_values, 5);308 more_values += 1.75,2.5,3.; 309 Histogram otherhistogram(more_values, 1.75, .625); 310 310 const double difference = otherhistogram.area() - histogram->area(); 311 311
Note:
See TracChangeset
for help on using the changeset viewer.