From 564889852328cc07d9ac8cdf0781b74000e0b040 Mon Sep 17 00:00:00 2001 From: Matthew Gretton-Dann Date: Thu, 18 Jun 2020 14:57:15 +0100 Subject: [PATCH] Tidy up some comments The clangformat auto-applied patch produced some untidily formatted comments. This commit tidies up the ones I spotted. --- src/Bitmap.cpp | 4 +-- src/CovidSim.cpp | 70 ++++++++++++------------------------------------ src/Dist.cpp | 6 +---- src/Kernels.cpp | 4 +-- src/Rand.cpp | 6 +---- src/Sweep.cpp | 36 +++++++++---------------- 6 files changed, 33 insertions(+), 93 deletions(-) diff --git a/src/Bitmap.cpp b/src/Bitmap.cpp index 8dd59fb43..bd583c0c8 100644 --- a/src/Bitmap.cpp +++ b/src/Bitmap.cpp @@ -10,9 +10,7 @@ #include "Model.h" #include "Param.h" -//// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** -/////// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** / **** BITMAP -/// stuff. +//// **** BITMAP stuff. #ifdef _WIN32 // HAVI avi; diff --git a/src/CovidSim.cpp b/src/CovidSim.cpp index 67e2bb492..561ac3465 100644 --- a/src/CovidSim.cpp +++ b/src/CovidSim.cpp @@ -69,12 +69,8 @@ int GetInputParameter3(FILE *, const char *, const char *, void *, int, int, int void SetICDF(double *icdf, double startValue); -///// ***** ///// ***** ///// ***** ///// ***** ///// ***** ///// ***** ///// ***** ///// ***** -//////// ***** ///// ***** ///// ***** ///// ***** ///// -///// ***** ///// ***** ///// ***** ///// ***** ///// ***** GLOBAL VARIABLES (some structures in -/// CovidSim.h file and some containers) - memory allocated later. -///// ***** ///// ***** ///// ***** ///// ***** ///// ***** ///// ***** ///// ***** ///// ***** -//////// ***** ///// ***** ///// ***** ///// ***** ///// +//// **** GLOBAL VARIABLES (some structures in CovidSim.h file and some containers) +//// **** - memory allocated later. Param P; Person *Hosts; @@ -374,10 +370,7 @@ int main(int argc, char *argv[]) "[/R:R0scaling] SetupSeed1 SetupSeed2 RunSeed1 RunSeed2\n", argv[0]); - //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// - ///**** //// **** //// **** //// **** //// **** / **** SET UP OMP / THREADS / **** //// **** - /////// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** - /////// **** //// **** //// **** + //// **** SET UP OMP / THREADS #ifdef _OPENMP P.NumThreads = omp_get_max_threads(); @@ -406,10 +399,7 @@ int main(int argc, char *argv[]) sprintf(PreParamFile, ".." DIRECTORY_SEPARATOR "Pre_%s", ParamFile); } - //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// - ///**** //// **** //// **** //// **** //// **** / **** READ IN PARAMETERS, DATA ETC. / **** //// - ///**** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** - /////// **** //// **** //// **** + //// **** READ IN PARAMETERS, DATA ETC. P.NumRealisations = GotNR; ReadParams(ParamFile, PreParamFile); @@ -425,10 +415,7 @@ int main(int argc, char *argv[]) ReadAirTravel(AirTravelFile); } - //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// - ///**** //// **** //// **** //// **** //// **** / **** INITIALIZE / **** //// **** //// **** //// - ///**** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** - /////// **** + //// **** INITIALIZE ///// initialize model (for all realisations). SetupModel(DensityFile, NetworkFile, SchoolFile, RegDemogFile); @@ -443,10 +430,7 @@ int main(int argc, char *argv[]) // print out number of calls to random number generator - //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// - ///**** //// **** //// **** //// **** //// **** / **** RUN MODEL / **** //// **** //// **** //// - ///**** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** - /////// **** + //// **** RUN MODEL P.NRactE = P.NRactNE = 0; for (i = 0; (i < P.NumRealisations) && (P.NRactNE < P.NumNonExtinctRealisations); i++) @@ -2237,11 +2221,7 @@ void ReadParams(char *ParamFile, char *PreParamFile) } } - ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** - //////// **** ///// **** ///// **** - ///// **** DIGITAL CONTACT TRACING - ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** - //////// **** ///// **** ///// **** + //// **** DIGITAL CONTACT TRACING // New code for digital contact tracing - ggilani: 09/03/20 if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Include digital contact tracing", "%i", @@ -2400,11 +2380,7 @@ void ReadParams(char *ParamFile, char *PreParamFile) P.ScalingFactorPlaceDigitalContacts = 1; } - ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** - //////// **** ///// **** ///// **** - ///// **** PLACE CLOSURE - ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** - //////// **** ///// **** ///// **** + //// **** PLACE CLOSURE if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Trigger incidence per cell for place closure", "%i", @@ -2538,11 +2514,7 @@ void ReadParams(char *ParamFile, char *PreParamFile) P.PlaceCloseByAdminUnit = 0; } - ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** - //////// **** ///// **** ///// **** - ///// **** SOCIAL DISTANCING - ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** - //////// **** ///// **** ///// **** + //// **** SOCIAL DISTANCING if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Trigger incidence per cell for social distancing", "%i", @@ -2668,11 +2640,7 @@ void ReadParams(char *ParamFile, char *PreParamFile) (void *)&(P.AirportCloseDuration), 1, 1, 0)) P.AirportCloseDuration = USHRT_MAX / P.TimeStepsPerDay; - ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** - //////// **** ///// **** ///// **** - ///// **** HOUSEHOLD QUARANTINE - ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** - //////// **** ///// **** ///// **** + //// **** HOUSEHOLD QUARANTINE if (P.DoHouseholds) { @@ -2748,11 +2716,7 @@ void ReadParams(char *ParamFile, char *PreParamFile) P.CaseIsolationHouseEffectiveness = P.CaseIsolationEffectiveness; } - ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** - //////// **** ///// **** ///// **** - ///// **** VARIABLE EFFICACIES OVER TIME - ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** ///// **** - //////// **** ///// **** ///// **** + //// **** VARIABLE EFFICACIES OVER TIME if (!GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Vary efficacies over time", "%i", (void *)&(P.VaryEfficaciesOverTime), 1, 1, 0)) @@ -5104,7 +5068,7 @@ void SaveResults(void) ERR_CRITICAL("Unable to open output file\n"); fprintf(dat, "t"); - /////// ****** /////// ****** /////// ****** COLNAMES + //// **** COLNAMES //// prevalence for (i = 0; i < P.NumAdunits; i++) fprintf(dat, "\tMild_%s", AdUnits[i].ad_name); @@ -5161,7 +5125,7 @@ void SaveResults(void) fprintf(dat, "\n"); - /////// ****** /////// ****** /////// ****** Populate table. + //// **** Populate table. for (i = 0; i < P.NumSamples; i++) { fprintf(dat, "%.10f", TimeSeries[i].t); @@ -5785,7 +5749,7 @@ void SaveSummaryResults(void) //// calculates and saves summary results (called ERR_CRITICAL("Unable to open output file\n"); fprintf(dat, "t"); - /////// ****** /////// ****** /////// ****** COLNAMES + //// **** COLNAMES //// prevalance for (i = 0; i < NUM_AGE_GROUPS; i++) fprintf(dat, "\tMild_%i", i); @@ -5854,7 +5818,7 @@ void SaveSummaryResults(void) //// calculates and saves summary results (called fprintf(dat, "\n"); - /////// ****** /////// ****** /////// ****** Populate table. + //// **** Populate table. for (i = 0; i < P.NumSamples; i++) { for (j = 0; j < NUM_AGE_GROUPS; j++) @@ -5990,7 +5954,7 @@ void SaveSummaryResults(void) //// calculates and saves summary results (called ERR_CRITICAL("Unable to open output file\n"); fprintf(dat, "t"); - /////// ****** /////// ****** /////// ****** COLNAMES + //// **** COLNAMES //// prevalance for (i = 0; i < P.NumAdunits; i++) fprintf(dat, "\tMild_%s", AdUnits[i].ad_name); @@ -6059,7 +6023,7 @@ void SaveSummaryResults(void) //// calculates and saves summary results (called fprintf(dat, "\n"); - /////// ****** /////// ****** /////// ****** Populate table. + //// **** Populate table. for (i = 0; i < P.NumSamples; i++) { for (j = 0; j < P.NumAdunits; j++) diff --git a/src/Dist.cpp b/src/Dist.cpp index 723cdcfc8..090e94d83 100644 --- a/src/Dist.cpp +++ b/src/Dist.cpp @@ -9,11 +9,7 @@ double sinx[361], cosx[361], asin2sqx[1001]; -//// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** -/////// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** / **** DISTANCE -/// FUNCTIONS (return distance-squared, which is input for every Kernel function) / **** //// **** -/////// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// -///**** //// **** //// **** //// **** //// **** //// **** //// **** +//// **** DISTANC FUNCTIONS (return distance-squared, which is input for every Kernel function) double periodic_xy(double x, double y) { diff --git a/src/Kernels.cpp b/src/Kernels.cpp index d7c9d59e6..f69468c82 100644 --- a/src/Kernels.cpp +++ b/src/Kernels.cpp @@ -68,9 +68,7 @@ void InitKernel(double norm) } } -//// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** -/////// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** / **** KERNEL -/// DEFINITIONS +//// **** KERNEL DEFINITIONS double ExpKernel(double r2) { diff --git a/src/Rand.cpp b/src/Rand.cpp index 26a3b0cf0..be86314d4 100644 --- a/src/Rand.cpp +++ b/src/Rand.cpp @@ -16,11 +16,7 @@ int32_t *Xcg1, *Xcg2; int **SamplingQueue = nullptr; -///////////// ********* ///////////// ********* ///////////// ********* ///////////// ********* -//////////////// ********* ///////////// ********* -/////////////////////// NEIL rand_lib code (with some Gemma rand lib also) -///////////// ********* ///////////// ********* ///////////// ********* ///////////// ********* -//////////////// ********* ///////////// ********* +//// **** NEIL rand_lib code (with some Gemma rand lib also) double ranf(void) { diff --git a/src/Sweep.cpp b/src/Sweep.cpp index c08b965e9..7c40e1d67 100644 --- a/src/Sweep.cpp +++ b/src/Sweep.cpp @@ -303,9 +303,9 @@ void InfectSweep(double t, ///(and therefore number of new infections to) i) their house; ii) their place(s); iii) other /// spatial cells. / Each force of infection includes infectiousness and susceptibility /// components. / Infectiousness is (broadly) a function of 1 person (their age, treatment status, - ///places, no. people in their household etc.) / Susceptibility is (broadly) a function of 2 - /// people (a person's susceptibility TO ANOTHER PERSON / potential infector) / After loop 1a) over - /// infectious people, spatial infections are doled out. + /// places, no. people in their household etc.) / Susceptibility is (broadly) a function of 2 + /// people (a person's susceptibility TO ANOTHER PERSON / potential infector) / After loop 1a) + /// over infectious people, spatial infections are doled out. int n; //// number of people you could potentially infect in your place group, then number of /// potential spatial infections doled out by cell on other cells. @@ -462,9 +462,9 @@ void InfectSweep(double t, // 1= household // 2..NUM_PLACE_TYPES+1 = within-class/work-group place based // transmission NUM_PLACE_TYPES+2..2*NUM_PLACE_TYPES+1 = - // between-class/work-group place based transmission 2*NUM_PLACE_TYPES+2 - // = "spatial" transmission (spatially local random mixing) - // bits >4 store the generation of infection + // between-class/work-group place based transmission 2*NUM_PLACE_TYPES+2 = + // "spatial" transmission (spatially local random mixing) bits >4 store the + // generation of infection short int infect_type = 1 + INFECT_TYPE_MASK * (1 + si->infect_type / INFECT_TYPE_MASK); @@ -1820,9 +1820,7 @@ int TreatSweep(double t) /// microcells that are within this admin unit (and around this microcell) to be treated, /// using the flags set to avoid duplication. - //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** - /////// **** //// **** //// **** / **** //// **** //// **** //// **** TREATMENT / **** //// - ///**** //// **** //// **** //// **** //// **** //// **** //// **** + //// **** TREATMENT if ((Mcells[b].treat == 2) && (ts >= Mcells[b].treat_end_time)) { @@ -1911,9 +1909,7 @@ int TreatSweep(double t) } } - //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** - /////// **** //// **** //// **** / **** //// **** //// **** //// **** VACCINATION / **** - /////// **** //// **** //// **** //// **** //// **** //// **** //// **** + //// **** VACCINATION //// vaccinates proportion VaccProp of people in microcell (or at least adds them to /// geovacc_queue). @@ -2010,9 +2006,7 @@ int TreatSweep(double t) } } - //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** - /////// **** //// **** //// **** / **** //// **** //// **** //// **** PLACE CLOSURE / **** - /////// **** //// **** //// **** //// **** //// **** //// **** //// **** + //// **** PLACE CLOSURE ///// note that here f2 bool asks whether trigger lower than stop threshold. A few blocks /// down meaning changes to almost the opposite: asking whether trigger has exceeded @@ -2124,9 +2118,7 @@ int TreatSweep(double t) } } - //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** - /////// **** //// **** //// **** / **** //// **** //// **** //// **** MOVEMENT RESTRICTIONS - //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** + //// **** MOVEMENT RESTRICTIONS if ((Mcells[b].moverest == 2) && (ts >= Mcells[b].move_end_time)) { @@ -2207,9 +2199,7 @@ int TreatSweep(double t) } } - //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** - /////// **** //// **** //// **** / **** //// **** //// **** //// **** SOCIAL DISTANCING / - ///**** //// **** //// **** //// **** //// **** //// **** //// **** //// **** + //// **** SOCIAL DISTANCING if (P.DoGlobalTriggers) f2 = (global_trig < P.SocDistCellIncStopThresh); @@ -2295,9 +2285,7 @@ int TreatSweep(double t) } } - //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** - /////// **** //// **** //// **** / **** //// **** //// **** //// **** KEY-WORKER PROPHYLAXIS - //// **** //// **** //// **** //// **** //// **** //// **** //// **** //// **** + //// **** KEY-WORKER PROPHYLAXIS if ((Mcells[b].keyworkerproph == 2) && (ts >= Mcells[b].keyworkerproph_end_time)) {