Changeset 776b64 for src/linkedcell.cpp


Ignore:
Timestamp:
Oct 27, 2009, 4:11:22 PM (16 years ago)
Author:
Frederik Heber <heber@…>
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, Candidate_v1.7.0, 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:
fb73b8
Parents:
ad37ab
Message:

Huge refactoring to make const what is const (ticket #38), continued.

  • too many changes because of too many cross-references to be able to list them up here.
  • NOTE that "make check" runs fine and did catch several error.
  • note that we had to use const_iterator several times when the map, ... was declared const.
  • at times we changed an allocated LinkedCell LCList(...) into

const LinkedCell *LCList;
LCList = new LinkedCell(...);

  • also mutable (see ticket #5) was used, e.g. for molecule::InternalPointer (PointCloud changes are allowed, because they are just accounting).

Signed-off-by: Frederik Heber <heber@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/linkedcell.cpp

    rad37ab r776b64  
    3333 * \param RADIUS edge length of cells
    3434 */
    35 LinkedCell::LinkedCell(PointCloud *set, double radius)
     35LinkedCell::LinkedCell(const PointCloud * const set, const double radius)
    3636{
    3737  TesselPoint *Walker = NULL;
     
    109109 * \param RADIUS edge length of cells
    110110 */
    111 LinkedCell::LinkedCell(LinkedNodes *set, double radius)
     111LinkedCell::LinkedCell(LinkedNodes *set, const double radius)
    112112{
    113113  class TesselPoint *Walker = NULL;
     
    192192 * \return if all in intervals - true, else -false
    193193 */
    194 bool LinkedCell::CheckBounds()
     194bool LinkedCell::CheckBounds() const
    195195{
    196196  bool status = true;
     
    207207 * \return if all in intervals - true, else -false
    208208 */
    209 bool LinkedCell::CheckBounds(int relative[NDIM])
     209bool LinkedCell::CheckBounds(const int relative[NDIM]) const
    210210{
    211211  bool status = true;
     
    219219 * \return LinkedAtoms pointer to current cell, NULL if LinkedCell::n[] are out of bounds.
    220220 */
    221 LinkedNodes* LinkedCell::GetCurrentCell()
     221const LinkedNodes* LinkedCell::GetCurrentCell() const
    222222{
    223223  if (CheckBounds()) {
     
    233233 * \return LinkedAtoms pointer to current cell, NULL if LinkedCell::n[]+relative[] are out of bounds.
    234234 */
    235 LinkedNodes* LinkedCell::GetRelativeToCurrentCell(int relative[NDIM])
     235const LinkedNodes* LinkedCell::GetRelativeToCurrentCell(const int relative[NDIM]) const
    236236{
    237237  if (CheckBounds(relative)) {
     
    247247 * \return if the atom is also found in this cell - true, else - false
    248248 */
    249 bool LinkedCell::SetIndexToNode(const TesselPoint *Walker)
     249bool LinkedCell::SetIndexToNode(const TesselPoint * const Walker) const
    250250{
    251251  bool status = false;
     
    268268 * \param *upper upper bounds
    269269 */
    270 void LinkedCell::GetNeighbourBounds(int lower[NDIM], int upper[NDIM])
     270void LinkedCell::GetNeighbourBounds(int lower[NDIM], int upper[NDIM]) const
    271271{
    272272  for (int i=0;i<NDIM;i++) {
     
    288288 * \return Vector is inside bounding box - true, else - false
    289289 */
    290 bool LinkedCell::SetIndexToVector(const Vector *x)
     290bool LinkedCell::SetIndexToVector(const Vector * const x) const
    291291{
    292292  bool status = true;
Note: See TracChangeset for help on using the changeset viewer.