Skip to content

Commit

Permalink
Make Doxygen comment style the same (#518)
Browse files Browse the repository at this point in the history
* change /*! to /** doxygen style

* change some other styles

* doc: document code using the Javadoc style

* fix: **/ to */ IDed by @Bai-Li-NOAA

* change /*! to /** in vignette
IDed by @Bai-Li-NOAA

---------

Co-authored-by: Bai Li - NOAA <59936250+Bai-Li-NOAA@users.noreply.github.com>
  • Loading branch information
k-doering-NOAA and Bai-Li-NOAA committed Nov 15, 2023
1 parent 2478368 commit e5c4588
Show file tree
Hide file tree
Showing 31 changed files with 318 additions and 283 deletions.
14 changes: 7 additions & 7 deletions inst/include/common/data_object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ namespace fims_data_object {
*/
template <typename Type>
struct DataObject : public fims_model_object::FIMSObject<Type> {
static uint32_t id_g; /*!< id of the Data Object >*/
std::vector<Type> data; /*!< vector of the data >*/
size_t dimensions; /*!< dimension of the Data object >*/
size_t imax; /*!<1st dimension of data object >*/
size_t jmax; /*!< 2nd dimension of data object>*/
size_t kmax; /*!< 3rd dimension of data object>*/
size_t lmax; /*!< 4th dimension of data object>*/
static uint32_t id_g; /**< id of the Data Object >*/
std::vector<Type> data; /**< vector of the data >*/
size_t dimensions; /**< dimension of the Data object >*/
size_t imax; /**<1st dimension of data object >*/
size_t jmax; /**< 2nd dimension of data object>*/
size_t kmax; /**< 3rd dimension of data object>*/
size_t lmax; /**< 4th dimension of data object>*/

/**
* Constructs a one-dimensional data object.
Expand Down
2 changes: 1 addition & 1 deletion inst/include/common/def.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! \file def.hpp
/** \file def.hpp
*/

/*
Expand Down
2 changes: 1 addition & 1 deletion inst/include/common/fims_math.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! \file fims_math.hpp
/** \file fims_math.hpp
*/
// note: To document a global C function, typedef, enum or preprocessor
// definition you must first document the file that contains it
Expand Down
18 changes: 9 additions & 9 deletions inst/include/common/information.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! \file information.hpp
/** \file information.hpp
*
* This File is part of the NOAA, National Marine Fisheries Service
* Fisheries Integrated Modeling System project. See LICENSE in the
Expand Down Expand Up @@ -45,38 +45,38 @@ class Information {

// data objects
std::map<uint32_t, std::shared_ptr<fims_data_object::DataObject<Type> > >
data_objects; /*!< map that holds data objects >*/
data_objects; /**< map that holds data objects >*/
typedef typename std::map<
uint32_t, std::shared_ptr<fims_data_object::DataObject<Type> > >::iterator
data_iterator; /**< iterator for the data objects */

// life history modules
std::map<uint32_t, std::shared_ptr<fims_popdy::RecruitmentBase<Type> > >
recruitment_models; /*!<hash map to link each object to its shared
recruitment_models; /**<hash map to link each object to its shared
location in memory*/
typedef typename std::map<
uint32_t, std::shared_ptr<fims_popdy::RecruitmentBase<Type> > >::iterator
recruitment_models_iterator;
/**< iterator for recruitment objects>*/

std::map<uint32_t, std::shared_ptr<fims_popdy::SelectivityBase<Type> > >
selectivity_models; /*!<hash map to link each object to its shared
selectivity_models; /**<hash map to link each object to its shared
location in memory*/
typedef typename std::map<
uint32_t, std::shared_ptr<fims_popdy::SelectivityBase<Type> > >::iterator
selectivity_models_iterator;
/**< iterator for selectivity objects>*/

std::map<uint32_t, std::shared_ptr<fims_popdy::GrowthBase<Type> > >
growth_models; /*!<hash map to link each object to its shared location in
growth_models; /**<hash map to link each object to its shared location in
memory*/
typedef typename std::map<
uint32_t, std::shared_ptr<fims_popdy::GrowthBase<Type> > >::iterator
growth_models_iterator;
/**< iterator for growth objects>*/

std::map<uint32_t, std::shared_ptr<fims_popdy::MaturityBase<Type> > >
maturity_models; /*!<hash map to link each object to its shared location
maturity_models; /**<hash map to link each object to its shared location
in memory*/
typedef typename std::map<
uint32_t, std::shared_ptr<fims_popdy::MaturityBase<Type> > >::iterator
Expand All @@ -85,7 +85,7 @@ class Information {

// fleet modules
std::map<uint32_t, std::shared_ptr<fims_popdy::Fleet<Type> > >
fleets; /*!<hash map to link each object to its shared location in
fleets; /**<hash map to link each object to its shared location in
memory*/
typedef
typename std::map<uint32_t,
Expand All @@ -95,7 +95,7 @@ class Information {

// populations
std::map<uint32_t, std::shared_ptr<fims_popdy::Population<Type> > >
populations; /*!<hash map to link each object to its shared location in
populations; /**<hash map to link each object to its shared location in
memory*/
typedef typename std::map<
uint32_t, std::shared_ptr<fims_popdy::Population<Type> > >::iterator
Expand All @@ -105,7 +105,7 @@ class Information {
// distributions
std::map<uint32_t,
std::shared_ptr<fims_distributions::DistributionsBase<Type> > >
distribution_models; /*!<hash map to link each object to its shared
distribution_models; /**<hash map to link each object to its shared
location in memory*/
typedef typename std::map<
uint32_t,
Expand Down
4 changes: 2 additions & 2 deletions inst/include/common/model.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ template <typename Type>
class Model { // may need singleton
public:
static std::shared_ptr<Model<Type> >
fims_model; /*!< Create a shared fims_model as a pointer to Model*/
fims_model; /**< Create a shared fims_model as a pointer to Model*/
std::shared_ptr<fims_info::Information<Type> >
fims_information; /*!< Create a shared fims_information as a pointer to
fims_information; /**< Create a shared fims_information as a pointer to
Information*/

#ifdef TMB_MODEL
Expand Down
8 changes: 4 additions & 4 deletions inst/include/common/model_object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ namespace fims_model_object {
*/
template <typename Type>
struct FIMSObject {
uint32_t id; /*!< unique identifier assigned for all fims objects */
std::vector<Type*> parameters; /*!< list of estimable parameters */
uint32_t id; /**< unique identifier assigned for all fims objects */
std::vector<Type*> parameters; /**< list of estimable parameters */
std::vector<Type*>
random_effects_parameters; /*!< list of all random effects parameters */
random_effects_parameters; /**< list of all random effects parameters */
std::vector<Type*>
fixed_effects_parameters; /*!< list of fixed effects parameters */
fixed_effects_parameters; /**< list of fixed effects parameters */

virtual ~FIMSObject() {}
/**
Expand Down
2 changes: 1 addition & 1 deletion inst/include/distributions/functors/distributions_base.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! \file distributions_base.hpp
/** \file distributions_base.hpp
* This File is part of the NOAA, National Marine Fisheries Service
* Fisheries Integrated Modeling System project. See LICENSE in the
* source folder for reuse information.
Expand Down
18 changes: 9 additions & 9 deletions inst/include/distributions/functors/tmb_distributions.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! \file tmb_distributions.hpp
/** \file tmb_distributions.hpp
* This File is part of the NOAA, National Marine Fisheries Service
* Fisheries Integrated Modeling System project.
* Refer to the LICENSE file for reuse information.
Expand All @@ -20,9 +20,9 @@ namespace fims_distributions {
*/
template <typename Type>
struct Dnorm : public DistributionsBase<Type> {
Type x; /*!< observation */
Type mean; /*!< mean of the normal distribution */
Type sd; /*!< standard deviation of the normal distribution, must be strictly
Type x; /**< observation */
Type mean; /**< mean of the normal distribution */
Type sd; /**< standard deviation of the normal distribution, must be strictly
positive.*/

Dnorm() : DistributionsBase<Type>() {}
Expand All @@ -48,8 +48,8 @@ template <typename Type>
struct Dmultinom : public DistributionsBase<Type> {
/** EigenVector defined in interface.hpp */
using Vector = typename fims::ModelTraits<Type>::EigenVector;
Vector x; /*!< Vector of length K of integers */
Vector p; /*!< Vector of length K, specifying the probability for the K
Vector x; /**< Vector of length K of integers */
Vector p; /**< Vector of length K, specifying the probability for the K
classes (note, unlike in R these must sum to 1). */

Dmultinom() : DistributionsBase<Type>() {}
Expand All @@ -74,9 +74,9 @@ struct Dmultinom : public DistributionsBase<Type> {
*/
template <typename Type>
struct Dlnorm : public DistributionsBase<Type> {
Type x; /*!< observation */
Type meanlog; /*!< mean of the distribution of log(x) */
Type sdlog; /*!< standard deviation of the distribution of log(x) */
Type x; /**< observation */
Type meanlog; /**< mean of the distribution of log(x) */
Type sdlog; /**< standard deviation of the distribution of log(x) */

Dlnorm() : DistributionsBase<Type>() {}

Expand Down
18 changes: 9 additions & 9 deletions inst/include/interface/rcpp/rcpp_objects/rcpp_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
class DataInterfaceBase : public FIMSRcppInterfaceBase {
public:
Rcpp::NumericVector observed_data; /*!< The data */
Rcpp::NumericVector observed_data; /**< The data */
static uint32_t id_g; /**< static id of the DataInterfaceBase object */
uint32_t id; /**< local id of the DataInterfaceBase object */
// live objects in C++ are objects that have been created and live in memory
Expand All @@ -42,7 +42,7 @@ class DataInterfaceBase : public FIMSRcppInterfaceBase {
virtual ~DataInterfaceBase() {}

/** @brief get the ID of the interface base object
**/
*/
virtual uint32_t get_id() { return this->id; }

/**@brief add_to_fims_tmb dummy method
Expand All @@ -60,9 +60,9 @@ std::map<uint32_t, DataInterfaceBase*> DataInterfaceBase::live_objects;
*/
class AgeCompDataInterface : public DataInterfaceBase {
public:
int amax; /*!< first dimension of the data */
int ymax; /*!< second dimension of the data */
Rcpp::NumericVector age_comp_data; /*!<the age composition data*/
int amax; /**< first dimension of the data */
int ymax; /**< second dimension of the data */
Rcpp::NumericVector age_comp_data; /**<the age composition data*/

/**
* @brief constructor
Expand All @@ -78,7 +78,7 @@ class AgeCompDataInterface : public DataInterfaceBase {
virtual ~AgeCompDataInterface() {}

/** @brief get the ID of the interface base object
**/
*/
virtual uint32_t get_id() { return this->id; }

#ifdef TMB_MODEL
Expand Down Expand Up @@ -127,8 +127,8 @@ class AgeCompDataInterface : public DataInterfaceBase {
*/
class IndexDataInterface : public DataInterfaceBase {
public:
int ymax; /*!< second dimension of the data */
Rcpp::NumericVector index_data; /*!<the age composition data*/
int ymax; /**< second dimension of the data */
Rcpp::NumericVector index_data; /**<the age composition data*/

/**
* @brief constructor
Expand All @@ -141,7 +141,7 @@ class IndexDataInterface : public DataInterfaceBase {
virtual ~IndexDataInterface() {}

/** @brief get the ID of the interface base object
**/
*/
virtual uint32_t get_id() { return this->id; }

#ifdef TMB_MODEL
Expand Down
32 changes: 16 additions & 16 deletions inst/include/interface/rcpp/rcpp_objects/rcpp_fleet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ objects */

virtual ~FleetInterfaceBase() {}

/** @brief get_id method for child fleet interface objects to inherit **/
/** @brief get_id method for child fleet interface objects to inherit */
virtual uint32_t get_id() = 0;
};

Expand All @@ -52,29 +52,29 @@ 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
-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*/
-999; /**< id of index likelihood component*/
int interface_observed_agecomp_data_id_m =
-999; /*!< id of observed agecomp data object*/
-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*/
-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 */
int nages; /*!< number of ages in the fleet data*/
int nyears; /*!< number of years in the fleet data */
double log_q; /*!< log of catchability for the fleet*/
bool is_survey = false; /**< whether this is a survey fleet */
int nages; /**< number of ages in the fleet data*/
int nyears; /**< number of years in the fleet data */
double log_q; /**< log of catchability for the fleet*/
Rcpp::NumericVector
log_Fmort; /*!< log of fishing mortality rate for the fleet*/
bool estimate_F = false; /*!< whether the parameter F should be estimated*/
bool estimate_q = false; /*!< whether the parameter q should be estimated*/
bool random_q = false; /*!< whether q should be a random effect*/
bool random_F = false; /*!< whether F should be a random effect*/
Parameter log_obs_error; /*!< the log of the observation error */
log_Fmort; /**< log of fishing mortality rate for the fleet*/
bool estimate_F = false; /**< whether the parameter F should be estimated*/
bool estimate_q = false; /**< whether the parameter q should be estimated*/
bool random_q = false; /**< whether q should be a random effect*/
bool random_F = false; /**< whether F should be a random effect*/
Parameter log_obs_error; /**< the log of the observation error */

FleetInterface() : FleetInterfaceBase() {}

Expand Down
12 changes: 6 additions & 6 deletions inst/include/interface/rcpp/rcpp_objects/rcpp_growth.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
#include "../../../population_dynamics/growth/growth.hpp"
#include "rcpp_interface_base.hpp"

/****************************************************************
/**
* Growth Rcpp interface *
***************************************************************/
*/

/**
* @brief Rcpp interface that serves as the parent class for
Expand All @@ -40,10 +40,10 @@ objects */

virtual ~GrowthInterfaceBase() {}

/** @brief get_id method for child growth interface objects to inherit **/
/** @brief get_id method for child growth interface objects to inherit */
virtual uint32_t get_id() = 0;

/** @brief evaluate method for child growth interface objects to inherit **/
/** @brief evaluate method for child growth interface objects to inherit */
virtual double evaluate(double age) = 0;
};

Expand Down Expand Up @@ -78,7 +78,7 @@ vectors have been set */
* @param ages Type vector of ages
* @return std::map<T, T>
*
* */
*/
inline std::map<double, double> make_map(std::vector<double> ages,
std::vector<double> weights) {
std::map<double, double> mymap;
Expand All @@ -91,7 +91,7 @@ vectors have been set */
/** @brief Rcpp interface to the EWAAgrowth evaluate method
* you can call from R using
* ewaagrowth.evaluate(age)
* */
*/
virtual double evaluate(double age) {
fims_popdy::EWAAgrowth<double> EWAAGrowth;

Expand Down
10 changes: 5 additions & 5 deletions inst/include/interface/rcpp/rcpp_objects/rcpp_maturity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
#include "../../../population_dynamics/maturity/maturity.hpp"
#include "rcpp_interface_base.hpp"

/****************************************************************
* maturity Rcpp interface *
***************************************************************/
/**
* maturity Rcpp interface
*/

/**
* @brief MaturityInterfaceBase class should be inherited to
* define different Rcpp interfaces for each possible maturity function
* */
*/
class MaturityInterfaceBase : public FIMSRcppInterfaceBase {
public:
static uint32_t id_g; /**< static id of the recruitment interface base*/
Expand All @@ -41,7 +41,7 @@ class MaturityInterfaceBase : public FIMSRcppInterfaceBase {
virtual ~MaturityInterfaceBase() {}

/** @brief get the ID of the interface base object
**/
*/
virtual uint32_t get_id() = 0;

/**
Expand Down
6 changes: 3 additions & 3 deletions inst/include/interface/rcpp/rcpp_objects/rcpp_nll.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @brief NLLInterfaceBase class should be inherited to
* define different Rcpp interfaces for each possible negative log-likelihood
* function
* */
*/
class NLLInterfaceBase : public FIMSRcppInterfaceBase {
public:
static uint32_t id_g; /**< static id of the recruitment interface base*/
Expand All @@ -36,10 +36,10 @@ class NLLInterfaceBase : public FIMSRcppInterfaceBase {
virtual ~NLLInterfaceBase() {}

/** @brief get the ID of the interface base object
**/
*/
virtual uint32_t get_id() = 0;

/** @brief evaluate method for child nll interface objects to inherit **/
/** @brief evaluate method for child nll interface objects to inherit */
virtual double evaluate_nll() = 0;
};

Expand Down
Loading

0 comments on commit e5c4588

Please sign in to comment.