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

Resolve various warnings due to doxygen, keywords #3228

Merged
merged 5 commits into from
Sep 8, 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
42 changes: 21 additions & 21 deletions src/stan/callbacks/json_writer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class json_writer final : public structured_writer {
/**
* Writes the set of comma separated values in an Eigen (row) vector.
*
* @param[in] v Values in a std::vector
* @param[in] v Values in an `Eigen::Vector`
*/
template <typename Derived>
void write_eigen_vector(const Eigen::DenseBase<Derived>& v) {
Expand Down Expand Up @@ -357,45 +357,45 @@ class json_writer final : public structured_writer {
* @param key Name of the value pair
* @param values vector to write.
*/
void write(const std::string& key, const std::vector<std::string>& v) {
void write(const std::string& key, const std::vector<std::string>& values) {
if (output_ == nullptr) {
return;
}
write_sep();
write_key(key);

*output_ << "[ ";
if (v.size() > 0) {
auto last = v.end();
if (values.size() > 0) {
auto last = values.end();
--last;
for (auto it = v.begin(); it != last; ++it) {
for (auto it = values.begin(); it != last; ++it) {
*output_ << process_string(*it) << ", ";
}
}
*output_ << v.back() << " ]";
*output_ << values.back() << " ]";
}

/**
* Write a key-value pair where the value is a vector to be made a list.
* @param key Name of the value pair
* @param values vector to write.
*/
void write(const std::string& key, const std::vector<double>& v) {
void write(const std::string& key, const std::vector<double>& values) {
if (output_ == nullptr) {
return;
}
write_sep();
write_key(key);

*output_ << "[ ";
if (v.size() > 0) {
auto last = v.end();
if (values.size() > 0) {
auto last = values.end();
--last;
for (auto it = v.begin(); it != last; ++it) {
for (auto it = values.begin(); it != last; ++it) {
write_value(*it);
*output_ << ", ";
}
write_value(v.back());
write_value(values.back());
}
*output_ << " ]";
}
Expand All @@ -405,22 +405,22 @@ class json_writer final : public structured_writer {
* @param key Name of the value pair
* @param values vector to write.
*/
void write(const std::string& key, const std::vector<int>& v) {
void write(const std::string& key, const std::vector<int>& values) {
if (output_ == nullptr) {
return;
}
write_sep();
write_key(key);

*output_ << "[ ";
if (v.size() > 0) {
auto last = v.end();
if (values.size() > 0) {
auto last = values.end();
--last;
for (auto it = v.begin(); it != last; ++it) {
for (auto it = values.begin(); it != last; ++it) {
*output_ << *it << ", ";
}
}
*output_ << v.back() << " ]";
*output_ << values.back() << " ]";
}

/**
Expand All @@ -429,21 +429,21 @@ class json_writer final : public structured_writer {
* @param values vector to write.
*/
void write(const std::string& key,
const std::vector<std::complex<double>>& v) {
const std::vector<std::complex<double>>& values) {
if (output_ == nullptr) {
return;
}
write_sep();
write_key(key);

*output_ << "[ ";
if (v.size() > 0) {
size_t last = v.size() - 1;
if (values.size() > 0) {
size_t last = values.size() - 1;
for (size_t i = 0; i < last; ++i) {
write_complex_value(v[i]);
write_complex_value(values[i]);
*output_ << ", ";
}
write_complex_value(v[last]);
write_complex_value(values[last]);
}
*output_ << " ]";
}
Expand Down
8 changes: 4 additions & 4 deletions src/stan/callbacks/structured_writer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ class structured_writer {
* @param key Name of the value pair
* @param values vector to write.
*/
virtual void write(const std::string& key, const std::vector<double> values) {
}
virtual void write(const std::string& key,
const std::vector<double>& values) {}

/**
* Write a key-value pair where the value is a vector of strings to be made a
Expand All @@ -124,14 +124,14 @@ class structured_writer {
* @param values vector to write.
*/
virtual void write(const std::string& key,
const std::vector<std::complex<double>>& v) {}
const std::vector<std::complex<double>>& values) {}

/**
* Write a key-value pair where the value is a vector to be made a list.
* @param key Name of the value pair
* @param values vector to write.
*/
virtual void write(const std::string& key, const std::vector<int>& v) {}
virtual void write(const std::string& key, const std::vector<int>& values) {}

/**
* Write a key-value pair where the value is an Eigen Matrix.
Expand Down
4 changes: 2 additions & 2 deletions src/stan/model/model_base_crtp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class model_base_crtp : public stan::model::model_base {
Eigen::VectorXd& vars, bool include_tparams = true,
bool include_gqs = true,
std::ostream* msgs = 0) const override {
return static_cast<const M*>(this)->template write_array(
return static_cast<const M*>(this)->write_array(
rng, theta, vars, include_tparams, include_gqs, msgs);
}

Expand Down Expand Up @@ -206,7 +206,7 @@ class model_base_crtp : public stan::model::model_base {
std::vector<int>& theta_i, std::vector<double>& vars,
bool include_tparams = true, bool include_gqs = true,
std::ostream* msgs = 0) const override {
return static_cast<const M*>(this)->template write_array(
return static_cast<const M*>(this)->write_array(
rng, theta, theta_i, vars, include_tparams, include_gqs, msgs);
}

Expand Down
3 changes: 2 additions & 1 deletion src/stan/optimization/bfgs_linesearch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ int WolfLSZoom(Scalar &alpha, XType &newX, Scalar &newF, XType &newDF,
*
* @param x1 Final point, equal to \f$ x_0 + \alpha p \f$.
*
* @param f1 Final point function value, equal to \f$ f(x_0 + \alpha p) \f$.
* @param func_val Final point function value, equal to \f$ f(x_0 + \alpha p)
*\f$.
*
* @param gradx1 Final point gradient, equal to \f$ g(x_0 + \alpha p) \f$.
*
Expand Down
3 changes: 2 additions & 1 deletion src/stan/services/sample/hmc_nuts_unit_e_adapt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ int hmc_nuts_unit_e_adapt(
* @param[in] init An std vector of init var contexts for initialization of each
* chain.
* @param[in] random_seed random seed for the random number generator
* @param[in] chain chain id to advance the pseudo random number generator
* @param[in] init_chain_id chain id to advance the pseudo random number
* generator
* @param[in] init_radius radius to initialize
* @param[in] num_warmup Number of warmup samples
* @param[in] num_samples Number of samples
Expand Down