Commit 552e99f9598877f97f4b95bfb56e618daaa1fd6a
1 parent
2f6387f4
fixed PCA disagreement
Showing
1 changed file
with
4 additions
and
3 deletions
openbr/plugins/cuda/cudapca.cu
| ... | ... | @@ -60,12 +60,13 @@ namespace br { namespace cuda { namespace pca { |
| 60 | 60 | return; |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | + if (numSteps*stepSize+evIdx >= numEigenvectors) { | |
| 64 | + numSteps--; | |
| 65 | + } | |
| 66 | + | |
| 63 | 67 | float acc = 0; |
| 64 | 68 | for (int i=0; i < numSteps; i++) { |
| 65 | 69 | int ibIdx = i*stepSize + evIdx; |
| 66 | - if (ibIdx >= numSteps*stepSize) { | |
| 67 | - break; | |
| 68 | - } | |
| 69 | 70 | acc += intermediaryBuffer[ibIdx]; |
| 70 | 71 | } |
| 71 | 72 | ... | ... |