Skip to content

Commit

Permalink
Update fims_vector.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
msupernaw authored and ChristineStawitz-NOAA committed Nov 7, 2023
1 parent 69ab198 commit 6d4b460
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions inst/include/common/fims_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,20 @@ class Vector{
this->vec_m = other;
}

#ifdef TMB_MODEL

Vector(const tmbutils::vector<Type>& other){
this->vec_m.resize(other.size());
for(size_t i =0; i < this->vec_m.size(); i++){
this->vec_m[i] = other[i];
}
}


#endif



inline Type& operator[](size_t n){
return this->vec_m[n];
}
Expand Down Expand Up @@ -234,7 +248,7 @@ class Vector{
CppAD::vector<Type> get_cppad_vector() const{
CppAD::vector<Type> ret;
ret.resize(this->vec_m.size());
for(int i =0; i < this->vec_m.size(); i++){
for(size_t i =0; i < this->vec_m.size(); i++){
ret[i] = this->vec_m[i];
}
return ret;
Expand All @@ -243,7 +257,7 @@ class Vector{
tmbutils::vector<Type> get_tmb_vector() const{
tmbutils::vector<Type> ret;
ret.resize(this->vec_m.size());
for(int i =0; i < this->vec_m.size(); i++){
for(size_t i =0; i < this->vec_m.size(); i++){
ret[i] = this->vec_m[i];
}
return ret;
Expand Down

0 comments on commit 6d4b460

Please sign in to comment.