Skip to content

Commit

Permalink
chore: Adds i=0 in for loops
Browse files Browse the repository at this point in the history
R CMD check was complaining about significant warnings in compiling the
c++ code because i was not initialized.

Close #690
  • Loading branch information
kellijohnson-NOAA committed Dec 5, 2024
1 parent ab77869 commit 5def7e4
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class DnormDistributionsInterface : public DistributionsInterfaceBase {
virtual bool set_distribution_links(std::string input_type, Rcpp::IntegerVector ids){
this->input_type_m = input_type;
this->key_m.resize(ids.size());
for(int i; i<ids.size(); i++){
for(int i=0; i<ids.size(); i++){
this->key_m[i] = ids[i];
}

Expand Down Expand Up @@ -323,7 +323,7 @@ class DlnormDistributionsInterface : public DistributionsInterfaceBase {
virtual bool set_distribution_links(std::string input_type, Rcpp::IntegerVector ids){
this->input_type_m = input_type;
this->key_m.resize(ids.size());
for(int i; i<ids.size(); i++){
for(int i=0; i<ids.size(); i++){
this->key_m[i] = ids[i];
}

Expand Down Expand Up @@ -524,7 +524,7 @@ class DmultinomDistributionsInterface : public DistributionsInterfaceBase {
virtual bool set_distribution_links(std::string input_type, Rcpp::IntegerVector ids){
this->input_type_m = input_type;
this->key_m.resize(ids.size());
for(int i; i<ids.size(); i++){
for(int i=0; i<ids.size(); i++){
this->key_m[i] = ids[i];
}

Expand Down

0 comments on commit 5def7e4

Please sign in to comment.