53 memset(
_depend, 0, 2 *
sizeof(
int));
71 int numLayers = (*occs)[0]->environment().size();
80 Scalar pointValue = ( (*it)->abundance() > 0.0 ) ? 1.0 : 0.0;
81 Sample sample = (*it)->environment();
83 int predictionIndex =
static_cast<int>(pointValue);
91 for (
int layerIndex = 0; layerIndex < numLayers; layerIndex++)
93 int normValue = (int) ((sample[layerIndex] + 1.0) / 2.0 * 253.0) + 1;
97 else if (normValue > 255 ) {
101 _matrix[predictionIndex][layerIndex][normValue]++;
138 int predIndex = (prediction == 1.0);
139 double level = rnd.
get(0.1);
140 int totalExcluded = (int) (
_depend[predIndex] * level);
146 for (n = 0; n <= 255; n++)
148 sum +=
_matrix[predIndex][layerIndex][n];
149 if (sum > totalExcluded)
157 for (n = 255; n >= 0; n--)
159 sum +=
_matrix[predIndex][layerIndex][n];
160 if (sum > totalExcluded)
167 minCutLevel = ( LL / 255.0 * 2 ) - 1.0;
168 maxCutLevel = ( UL / 255.0 * 2 ) - 1.0;
double get(double min, double max)
double Scalar
Type of map values.
void getBioclimRange(Scalar prediction, int layerIndex, Scalar &minCutLevel, Scalar &maxCutLevel) const
int _matrix[2][MAX_ENV_LAYERS][256]
std::vector< OccurrencePtr >::const_iterator const_iterator
void initialize(const OccurrencesPtr &occs)