Skip to content

Commit 3cbe674

Browse files
committed
fix initializer warning with arma::vec
apparently different versions of gcc were raising warnings with the assignment of values in neighbors. The recommended fix was to use an initializer list, which is explained in the arma doc below. https://arma.sourceforge.net/docs.html#element_initialisation
1 parent 24b605a commit 3cbe674

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ThinImageCpp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ void count246(const arma::mat &img, uvec checkList, vec &toWhite)
203203
for(int i = 0; i < checkList.n_elem; i++)
204204
{
205205
cell = checkList[i];
206-
neighbors << img[cell - 1] << img[cell + n] << img[cell + 1];
206+
neighbors = { img[cell - 1], img[cell + n], img[cell + 1] };
207207
if(any(neighbors == 1))
208208
toWhite[i] = 1;
209209
}

0 commit comments

Comments
 (0)