From 6580da42e12528e0259a08f323cb0751648a3aae Mon Sep 17 00:00:00 2001 From: Kirill Date: Fri, 18 Sep 2020 00:34:46 +0300 Subject: [PATCH] Neightbors -> Neighbors (#958) --- .../bf_knn_classification_predict_result.cpp | 2 +- .../bf_knn_classification_predict_result.h | 2 +- algorithms/kernel/k_nearest_neighbors/bf_knn_impl.i | 2 +- ...knn_classification_predict_dense_default_batch_container.h | 2 +- .../kdtree_knn_classification_predict_result.cpp | 2 +- .../kdtree_knn_classification_predict_result.h | 2 +- .../cpp/source/k_nearest_neighbors/bf_knn_dense_batch.cpp | 2 +- .../daal/examples/knn_classification/BFKNNDenseBatch.java | 2 +- .../k_nearest_neighbors/bf_knn_classification_model.h | 2 +- .../k_nearest_neighbors/kdtree_knn_classification_model.h | 2 +- .../algorithms/bf_knn_classification/ResultsToComputeId.java | 4 ++-- .../kdtree_knn_classification/ResultsToComputeId.java | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/algorithms/kernel/k_nearest_neighbors/bf_knn_classification_predict_result.cpp b/algorithms/kernel/k_nearest_neighbors/bf_knn_classification_predict_result.cpp index de32577f8c4..f78d2e25f36 100755 --- a/algorithms/kernel/k_nearest_neighbors/bf_knn_classification_predict_result.cpp +++ b/algorithms/kernel/k_nearest_neighbors/bf_knn_classification_predict_result.cpp @@ -82,7 +82,7 @@ services::Status Result::checkImpl(const daal::algorithms::Input * input, const DAAL_CHECK(par, services::ErrorNullParameterNotSupported); const size_t nRows = (static_cast(input))->getNumberOfRows(); - if (par->resultsToCompute & computeIndicesOfNeightbors) + if (par->resultsToCompute & computeIndicesOfNeighbors) { DAAL_CHECK_STATUS(s, data_management::checkNumericTable(get(indices).get(), indicesStr(), data_management::packed_mask, 0, par->k, nRows)); } diff --git a/algorithms/kernel/k_nearest_neighbors/bf_knn_classification_predict_result.h b/algorithms/kernel/k_nearest_neighbors/bf_knn_classification_predict_result.h index bf54c642727..15ec47480d3 100755 --- a/algorithms/kernel/k_nearest_neighbors/bf_knn_classification_predict_result.h +++ b/algorithms/kernel/k_nearest_neighbors/bf_knn_classification_predict_result.h @@ -57,7 +57,7 @@ DAAL_EXPORT services::Status Result::allocate(const daal::algorithms::Input * in set(prediction, data_management::HomogenNumericTable::create(1, nRows, data_management::NumericTableIface::doAllocate, &s)); } - if (s.ok() && (par->resultsToCompute & computeIndicesOfNeightbors)) + if (s.ok() && (par->resultsToCompute & computeIndicesOfNeighbors)) { set(indices, data_management::HomogenNumericTable::create(par->k, nRows, data_management::NumericTableIface::doAllocate, &s)); } diff --git a/algorithms/kernel/k_nearest_neighbors/bf_knn_impl.i b/algorithms/kernel/k_nearest_neighbors/bf_knn_impl.i index 9c6995bad14..bf72369eb9f 100644 --- a/algorithms/kernel/k_nearest_neighbors/bf_knn_impl.i +++ b/algorithms/kernel/k_nearest_neighbors/bf_knn_impl.i @@ -239,7 +239,7 @@ protected: daal::algorithms::internal::qSort(k, kDistances + i * k, kIndexes + i * k); } - if (resultsToCompute & computeIndicesOfNeightbors) + if (resultsToCompute & computeIndicesOfNeighbors) { daal::internal::WriteOnlyRows indexesBlock(indicesTable, startTestIdx, blockSize); DAAL_CHECK_BLOCK_STATUS(indexesBlock); diff --git a/algorithms/kernel/k_nearest_neighbors/kdtree_knn_classification_predict_dense_default_batch_container.h b/algorithms/kernel/k_nearest_neighbors/kdtree_knn_classification_predict_dense_default_batch_container.h index e6a85c508d5..30145981fce 100755 --- a/algorithms/kernel/k_nearest_neighbors/kdtree_knn_classification_predict_dense_default_batch_container.h +++ b/algorithms/kernel/k_nearest_neighbors/kdtree_knn_classification_predict_dense_default_batch_container.h @@ -61,7 +61,7 @@ services::Status BatchContainer::compute() data_management::NumericTablePtr indices; data_management::NumericTablePtr distances; - if (par->resultsToCompute & computeIndicesOfNeightbors) + if (par->resultsToCompute & computeIndicesOfNeighbors) { indices = result->get(prediction::indices); } diff --git a/algorithms/kernel/k_nearest_neighbors/kdtree_knn_classification_predict_result.cpp b/algorithms/kernel/k_nearest_neighbors/kdtree_knn_classification_predict_result.cpp index 21a4bd62d2d..1af0019e153 100755 --- a/algorithms/kernel/k_nearest_neighbors/kdtree_knn_classification_predict_result.cpp +++ b/algorithms/kernel/k_nearest_neighbors/kdtree_knn_classification_predict_result.cpp @@ -82,7 +82,7 @@ services::Status Result::checkImpl(const daal::algorithms::Input * input, const DAAL_CHECK(par, services::ErrorNullParameterNotSupported); const size_t nRows = (static_cast(input))->getNumberOfRows(); - if (par->resultsToCompute & computeIndicesOfNeightbors) + if (par->resultsToCompute & computeIndicesOfNeighbors) { DAAL_CHECK_STATUS(s, data_management::checkNumericTable(get(indices).get(), indicesStr(), data_management::packed_mask, 0, par->k, nRows)); } diff --git a/algorithms/kernel/k_nearest_neighbors/kdtree_knn_classification_predict_result.h b/algorithms/kernel/k_nearest_neighbors/kdtree_knn_classification_predict_result.h index 9262040dc5a..87d30d4cc7c 100755 --- a/algorithms/kernel/k_nearest_neighbors/kdtree_knn_classification_predict_result.h +++ b/algorithms/kernel/k_nearest_neighbors/kdtree_knn_classification_predict_result.h @@ -57,7 +57,7 @@ DAAL_EXPORT services::Status Result::allocate(const daal::algorithms::Input * in data_management::HomogenNumericTable::create(1, nRows, data_management::NumericTableIface::doAllocate, 0, &s)); } - if (s.ok() && (par->resultsToCompute & computeIndicesOfNeightbors)) + if (s.ok() && (par->resultsToCompute & computeIndicesOfNeighbors)) { set(indices, data_management::HomogenNumericTable::create(par->k, nRows, data_management::NumericTableIface::doAllocate, 0, &s)); } diff --git a/examples/cpp/source/k_nearest_neighbors/bf_knn_dense_batch.cpp b/examples/cpp/source/k_nearest_neighbors/bf_knn_dense_batch.cpp index da327a31050..7a534f27c95 100755 --- a/examples/cpp/source/k_nearest_neighbors/bf_knn_dense_batch.cpp +++ b/examples/cpp/source/k_nearest_neighbors/bf_knn_dense_batch.cpp @@ -113,7 +113,7 @@ void testModel() algorithm.input.set(classifier::prediction::data, testData); algorithm.input.set(classifier::prediction::model, trainingResult->get(classifier::training::model)); algorithm.parameter().nClasses = nClasses; - algorithm.parameter().resultsToCompute = bf_knn_classification::computeDistances | bf_knn_classification::computeIndicesOfNeightbors; + algorithm.parameter().resultsToCompute = bf_knn_classification::computeDistances | bf_knn_classification::computeIndicesOfNeighbors; /* Compute prediction results */ algorithm.compute(); diff --git a/examples/java/com/intel/daal/examples/knn_classification/BFKNNDenseBatch.java b/examples/java/com/intel/daal/examples/knn_classification/BFKNNDenseBatch.java index 8e67fd86c8e..d8843d4fae1 100644 --- a/examples/java/com/intel/daal/examples/knn_classification/BFKNNDenseBatch.java +++ b/examples/java/com/intel/daal/examples/knn_classification/BFKNNDenseBatch.java @@ -124,7 +124,7 @@ private static void testModel() { kNearestNeighborsPredict.input.set(NumericTableInputId.data, testData); kNearestNeighborsPredict.input.set(ModelInputId.model, model); kNearestNeighborsPredict.parameter.setNClasses(nClasses); - kNearestNeighborsPredict.parameter.setResultsToCompute(ResultsToComputeId.computeDistances | ResultsToComputeId.computeIndicesOfNeightbors); + kNearestNeighborsPredict.parameter.setResultsToCompute(ResultsToComputeId.computeDistances | ResultsToComputeId.computeIndicesOfNeighbors); /* Compute prediction results */ PredictionResult predictionResult = kNearestNeighborsPredict.compute(); diff --git a/include/algorithms/k_nearest_neighbors/bf_knn_classification_model.h b/include/algorithms/k_nearest_neighbors/bf_knn_classification_model.h index fdbe5981448..65c711c007b 100755 --- a/include/algorithms/k_nearest_neighbors/bf_knn_classification_model.h +++ b/include/algorithms/k_nearest_neighbors/bf_knn_classification_model.h @@ -58,7 +58,7 @@ enum DataUseInModel */ enum ResultToComputeId { - computeIndicesOfNeightbors = 0x00000001ULL, /*!< The flag to compute indices of nearest neighbors */ + computeIndicesOfNeighbors = 0x00000001ULL, /*!< The flag to compute indices of nearest neighbors */ computeDistances = 0x00000002ULL /*!< The flag to compute distances to nearest neighbors */ }; /** diff --git a/include/algorithms/k_nearest_neighbors/kdtree_knn_classification_model.h b/include/algorithms/k_nearest_neighbors/kdtree_knn_classification_model.h index bb8d0872afb..e7fd2445728 100755 --- a/include/algorithms/k_nearest_neighbors/kdtree_knn_classification_model.h +++ b/include/algorithms/k_nearest_neighbors/kdtree_knn_classification_model.h @@ -62,7 +62,7 @@ enum DataUseInModel */ enum ResultToComputeId { - computeIndicesOfNeightbors = 0x00000001ULL, /*!< The flag to compute indices of nearest neighbors */ + computeIndicesOfNeighbors = 0x00000001ULL, /*!< The flag to compute indices of nearest neighbors */ computeDistances = 0x00000002ULL /*!< The flag to compute distances to nearest neighbors */ }; diff --git a/lang_interface/java/com/intel/daal/algorithms/bf_knn_classification/ResultsToComputeId.java b/lang_interface/java/com/intel/daal/algorithms/bf_knn_classification/ResultsToComputeId.java index 040a42c8d54..34a869a79aa 100644 --- a/lang_interface/java/com/intel/daal/algorithms/bf_knn_classification/ResultsToComputeId.java +++ b/lang_interface/java/com/intel/daal/algorithms/bf_knn_classification/ResultsToComputeId.java @@ -28,9 +28,9 @@ */ public final class ResultsToComputeId { - public static final long computeIndicesOfNeightbors = 0x0000000000000001L; + public static final long computeIndicesOfNeighbors = 0x0000000000000001L; /*!< The flag to compute indices of nearest neighbors */ - public static final long computeDistances = 0x0000000000000002L; + public static final long computeDistances = 0x0000000000000002L; /*!< The flag to compute distances to nearest neighbors */ } /** @} */ diff --git a/lang_interface/java/com/intel/daal/algorithms/kdtree_knn_classification/ResultsToComputeId.java b/lang_interface/java/com/intel/daal/algorithms/kdtree_knn_classification/ResultsToComputeId.java index cb9ff831164..3df73eb33f1 100644 --- a/lang_interface/java/com/intel/daal/algorithms/kdtree_knn_classification/ResultsToComputeId.java +++ b/lang_interface/java/com/intel/daal/algorithms/kdtree_knn_classification/ResultsToComputeId.java @@ -28,7 +28,7 @@ */ public final class ResultsToComputeId { - public static final long computeIndicesOfNeightbors = 0x0000000000000001L; + public static final long computeIndicesOfNeighbors = 0x0000000000000001L; /*!< The flag to compute indices of nearest neighbors */ public static final long computeDistances = 0x0000000000000002L; /*!< The flag to compute distances to nearest neighbors */