Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

format C++ code with clang format #490

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions inst/include/population_dynamics/population/population.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,9 @@ struct Population : public FIMSObject<Type> {
inline void CalculateNumbersAA(size_t i_age_year, size_t i_agem1_yearm1,
size_t age) {
// using Z from previous age/year
this->numbers_at_age[i_age_year] = this->numbers_at_age[i_agem1_yearm1] *
(fims::exp(-this->mortality_Z[i_agem1_yearm1]));
this->numbers_at_age[i_age_year] =
this->numbers_at_age[i_agem1_yearm1] *
(fims::exp(-this->mortality_Z[i_agem1_yearm1]));
FIMS_LOG << " z at i_agem1_yearm1 = " << i_agem1_yearm1 << " is "
<< this->mortality_Z[i_agem1_yearm1] << std::endl;
// Plus group calculation
Expand All @@ -253,8 +254,8 @@ struct Population : public FIMSObject<Type> {
* @param i_agem1_yearm1 dimension folded index for age-1 and year-1
* @param age age index
*/
inline void CalculateUnfishedNumbersAA(size_t i_age_year, size_t i_agem1_yearm1,
size_t age) {
inline void CalculateUnfishedNumbersAA(size_t i_age_year,
size_t i_agem1_yearm1, size_t age) {
// using M from previous age/year
this->unfished_numbers_at_age[i_age_year] =
this->unfished_numbers_at_age[i_agem1_yearm1] *
Expand Down Expand Up @@ -306,9 +307,10 @@ struct Population : public FIMSObject<Type> {
* @param age the age who's biomass is being added into total spawning biomass
*/
void CalculateSpawningBiomass(size_t i_age_year, size_t year, size_t age) {
this->spawning_biomass[year] +=
this->proportion_female * this->numbers_at_age[i_age_year] *
this->proportion_mature_at_age[i_age_year] * growth->evaluate(ages[age]);
this->spawning_biomass[year] += this->proportion_female *
this->numbers_at_age[i_age_year] *
this->proportion_mature_at_age[i_age_year] *
growth->evaluate(ages[age]);
FIMS_LOG << " proportion female " << this->proportion_female << " "
<< " mature age " << age << " is "
<< this->proportion_mature_at_age[i_age_year] << " "
Expand Down Expand Up @@ -462,7 +464,8 @@ struct Population : public FIMSObject<Type> {
if (this->fleets[fleet_]->is_survey == false) {
catch_ = (this->fleets[fleet_]->Fmort[year] *
this->fleets[fleet_]->selectivity->evaluate(ages[age])) /
this->mortality_Z[i_age_year] * this->numbers_at_age[i_age_year] *
this->mortality_Z[i_age_year] *
this->numbers_at_age[i_age_year] *
(1 - fims::exp(-(this->mortality_Z[i_age_year])));
} else {
catch_ = (this->fleets[fleet_]->selectivity->evaluate(ages[age])) *
Expand Down Expand Up @@ -622,7 +625,8 @@ struct Population : public FIMSObject<Type> {
Expected recruitment in year 0 is numbers at age 0 in year 0.
*/

this->expected_recruitment[i_age_year] = this->numbers_at_age[i_age_year];
this->expected_recruitment[i_age_year] =
this->numbers_at_age[i_age_year];

} else {
if (a == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ struct DoubleLogisticSelectivity : public SelectivityBase<Type> {
(x) on the ascending limb of the double logistic curve; e.g. age
at which 50% of the fish are selected */
Type slope_asc; /*!<scalar multiplier of difference between quantity of
interest value (x) and median on the ascending limb of the double
logistic curve*/
interest value (x) and median on the ascending limb of the
double logistic curve*/
Type median_desc; /*!< 50% quantile of the value of the quantity of interest
(x) on the descending limb of the double logistic curve; e.g.
age at which 50% of the fish are selected */
Type slope_desc; /*!<scalar multiplier of difference between quantity of
interest value (x) and median on the descending limb of the double
logistic curve */
interest value (x) and median on the descending limb of the
double logistic curve */

DoubleLogisticSelectivity() : SelectivityBase<Type>() {}

Expand Down
Loading