Commit 9bef85eaf7d5ab0a544d7d036cfd9181d5ad5383

Authored by David Mayerich
1 parent 777fef6c

Put parenthesis around (std::min) in order to deal with a Windows macro error

Showing 2 changed files with 4 additions and 1 deletions   Show diff stats
@@ -339,6 +339,8 @@ class envi: @@ -339,6 +339,8 @@ class envi:
339 outmask[i[0][0:idx], i[1][0:idx]] = self.mask[i[0][0:idx], i[1][0:idx]] 339 outmask[i[0][0:idx], i[1][0:idx]] = self.mask[i[0][0:idx], i[1][0:idx]]
340 return outmask 340 return outmask
341 341
  342 + def close(self):
  343 + self.file.close()
342 344
343 def __del__(self): 345 def __del__(self):
344 self.file.close() 346 self.file.close()
345 \ No newline at end of file 347 \ No newline at end of file
@@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
7 #include <cstring> 7 #include <cstring>
8 #include <complex> 8 #include <complex>
9 #include <utility> 9 #include <utility>
  10 +#include <algorithm>
10 11
11 //CUDA 12 //CUDA
12 //#ifdef CUDA_FOUND 13 //#ifdef CUDA_FOUND
@@ -1863,7 +1864,7 @@ public: @@ -1863,7 +1864,7 @@ public:
1863 size_t ratio_i; 1864 size_t ratio_i;
1864 T* temp_spec = (T*) malloc(Z() * sizeof(T)); //allocate space to hold a single pixel 1865 T* temp_spec = (T*) malloc(Z() * sizeof(T)); //allocate space to hold a single pixel
1865 while(xy < XY){ //while there are unprocessed spectra 1866 while(xy < XY){ //while there are unprocessed spectra
1866 - bs = min(XY - xy, nS); //calculate the number of spectra to include in the batch 1867 + bs = (std::min)(XY - xy, nS); //calculate the number of spectra to include in the batch
1867 for(s = 0; s < bs; s++){ //for each spectrum in the batch 1868 for(s = 0; s < bs; s++){ //for each spectrum in the batch
1868 pixel(temp_spec, xy + s); //read a pixel from disk 1869 pixel(temp_spec, xy + s); //read a pixel from disk
1869 memcpy(&batch[s * S], temp_spec, S * sizeof(T)); 1870 memcpy(&batch[s * S], temp_spec, S * sizeof(T));