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 #488

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
6 changes: 4 additions & 2 deletions inst/include/common/information.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,11 @@ class Information {
<< std::endl;
// set index data
if (f->fleet_observed_index_data_id_m != -999) {
uint32_t observed_index_id = static_cast<uint32_t>(f->fleet_observed_index_data_id_m);
uint32_t observed_index_id =
static_cast<uint32_t>(f->fleet_observed_index_data_id_m);
data_iterator it = this->data_objects.find(observed_index_id);
FIMS_LOG << "Input fleet index id = " << observed_index_id << "." << std::endl;
FIMS_LOG << "Input fleet index id = " << observed_index_id << "."
<< std::endl;

if (it != this->data_objects.end()) {
f->observed_index_data = (*it).second;
Expand Down
19 changes: 13 additions & 6 deletions inst/include/interface/rcpp/rcpp_objects/rcpp_fleet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,17 @@ std::map<uint32_t, FleetInterfaceBase*> FleetInterfaceBase::live_objects;
*
*/
class FleetInterface : public FleetInterfaceBase {
int interface_agecomp_likelihood_id_m = -999; /*!< id of agecomp likelihood component. The "interface_" prefix indicates it belongs to the FleetInterface class, and the "_m" postfix signifies that it's a member variable. */
int interface_index_likelihood_id_m = -999; /*!< id of index likelihood component*/
int interface_observed_agecomp_data_id_m = -999; /*!< id of observed agecomp data object*/
int interface_observed_index_data_id_m = -999; /*!< id of observed index data object*/
int interface_selectivity_id_m = -999; /*!< id of selectivity component*/
int interface_agecomp_likelihood_id_m =
-999; /*!< id of agecomp likelihood component. The "interface_" prefix
indicates it belongs to the FleetInterface class, and the "_m"
postfix signifies that it's a member variable. */
int interface_index_likelihood_id_m =
-999; /*!< id of index likelihood component*/
int interface_observed_agecomp_data_id_m =
-999; /*!< id of observed agecomp data object*/
int interface_observed_index_data_id_m =
-999; /*!< id of observed index data object*/
int interface_selectivity_id_m = -999; /*!< id of selectivity component*/

public:
bool is_survey = false; /*!< whether this is a survey fleet */
Expand Down Expand Up @@ -139,7 +145,8 @@ class FleetInterface : public FleetInterfaceBase {
fleet->nyears = this->nyears;
fleet->fleet_agecomp_likelihood_id_m = interface_agecomp_likelihood_id_m;
fleet->fleet_index_likelihood_id_m = interface_index_likelihood_id_m;
fleet->fleet_observed_agecomp_data_id_m = interface_observed_agecomp_data_id_m;
fleet->fleet_observed_agecomp_data_id_m =
interface_observed_agecomp_data_id_m;
fleet->fleet_observed_index_data_id_m = interface_observed_index_data_id_m;
fleet->fleet_selectivity_id_m = interface_selectivity_id_m;
fleet->log_obs_error = this->log_obs_error.value_m;
Expand Down
8 changes: 6 additions & 2 deletions inst/include/population_dynamics/fleet/fleet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,17 @@ struct Fleet : public FIMSObject<Type> {

// This likelihood index is not currently being used as only one likelihood
// distribution is available. These are for a future update M2+.
int fleet_index_likelihood_id_m = -999; /*!<id of index likelihood component. The "fleet_" prefix indicates it belongs to the Fleet struct, and the "_m" postfix signifies that it's a member variable.*/
int fleet_index_likelihood_id_m =
-999; /*!<id of index likelihood component. The "fleet_" prefix indicates
it belongs to the Fleet struct, and the "_m" postfix signifies
that it's a member variable.*/
std::shared_ptr<fims::DistributionsBase<Type>>
index_likelihood; /*!< index likelihood component*/

// This likelihood index is not currently being used as only one likelihood
// distribution is available. These are for a future update M2+.
int fleet_agecomp_likelihood_id_m = -999; /*!< id of agecomp likelihood component*/
int fleet_agecomp_likelihood_id_m =
-999; /*!< id of agecomp likelihood component*/
std::shared_ptr<fims::DistributionsBase<Type>>
agecomp_likelihood; /*!< agecomp likelihood component*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ namespace fims {
*/
template <typename Type>
struct LogisticMaturity : public MaturityBase<Type> {
Type median; /*!< 50% quantile of the value of the quantity of interest (x); e.g.
age at which 50% of the fish are mature */
Type median; /*!< 50% quantile of the value of the quantity of interest (x);
e.g. age at which 50% of the fish are mature */
Type slope; /*!<scalar multiplier of difference between quantity of interest
value (x) and median */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ namespace fims {
*/
template <typename Type>
struct DoubleLogisticSelectivity : public SelectivityBase<Type> {
Type median_asc; /*!< 50% quantile of the value of the quantity of interest (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*/
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.
Type median_asc; /*!< 50% quantile of the value of the quantity of interest
(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*/
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 */
Type slope_desc; /*!<scalar multiplier of difference between quantity of
interest value (x) and median on the descending limb of the double
logistic curve */

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

Expand All @@ -48,7 +48,7 @@ struct DoubleLogisticSelectivity : public SelectivityBase<Type> {
*/
virtual const Type evaluate(const Type &x) {
return fims::double_logistic<Type>(median_asc, slope_asc, median_desc,
slope_desc, x);
slope_desc, x);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ namespace fims {
*/
template <typename Type>
struct LogisticSelectivity : public SelectivityBase<Type> {
Type median; /*!< 50% quantile of the value of the quantity of interest (x); e.g.
age at which 50% of the fish are selected */
Type median; /*!< 50% quantile of the value of the quantity of interest (x);
e.g. age at which 50% of the fish are selected */
Type slope; /*!<scalar multiplier of difference between quantity of interest
value (x) and median */

Expand Down
Loading