From 566e84f154aa4a93fe88629ccde44f5b51bca7d1 Mon Sep 17 00:00:00 2001 From: Simon Giraudot Date: Tue, 26 Jun 2018 09:56:11 +0200 Subject: [PATCH] Fix conversion warnings --- .../CGAL/Classification/OpenCV_random_forest_classifier.h | 4 ++-- .../CGAL/Classification/Sum_of_weighted_features_classifier.h | 2 +- .../Classification/Surface_mesh_item_classification.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Classification/include/CGAL/Classification/OpenCV_random_forest_classifier.h b/Classification/include/CGAL/Classification/OpenCV_random_forest_classifier.h index 5b1b74a0285..091396b1b14 100644 --- a/Classification/include/CGAL/Classification/OpenCV_random_forest_classifier.h +++ b/Classification/include/CGAL/Classification/OpenCV_random_forest_classifier.h @@ -158,14 +158,14 @@ public: std::size_t nb_samples = 0; for (std::size_t i = 0; i < ground_truth.size(); ++ i) - if (ground_truth[i] != -1) + if (int(ground_truth[i]) != -1) ++ nb_samples; cv::Mat training_features (int(nb_samples), int(m_features.size()), CV_32FC1); cv::Mat training_labels (int(nb_samples), 1, CV_32FC1); for (std::size_t i = 0, index = 0; i < ground_truth.size(); ++ i) - if (ground_truth[i] != -1) + if (int(ground_truth[i]) != -1) { for (std::size_t f = 0; f < m_features.size(); ++ f) training_features.at(int(index), int(f)) = m_features[f]->value(i); diff --git a/Classification/include/CGAL/Classification/Sum_of_weighted_features_classifier.h b/Classification/include/CGAL/Classification/Sum_of_weighted_features_classifier.h index fa466b940fa..2b159e27934 100644 --- a/Classification/include/CGAL/Classification/Sum_of_weighted_features_classifier.h +++ b/Classification/include/CGAL/Classification/Sum_of_weighted_features_classifier.h @@ -311,7 +311,7 @@ public: std::vector > training_sets (m_labels.size()); std::size_t nb_tot = 0; for (std::size_t i = 0; i < ground_truth.size(); ++ i) - if (ground_truth[i] != -1) + if (int(ground_truth[i]) != -1) { training_sets[std::size_t(ground_truth[i])].push_back (i); ++ nb_tot; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/Surface_mesh_item_classification.cpp b/Polyhedron/demo/Polyhedron/Plugins/Classification/Surface_mesh_item_classification.cpp index 0cc9e700c5f..8c778bc3c58 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/Surface_mesh_item_classification.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/Surface_mesh_item_classification.cpp @@ -202,9 +202,9 @@ void Surface_mesh_item_classification::train BOOST_FOREACH(face_descriptor fd, faces(*(m_mesh->polyhedron()))) { training[fd] = m_training[fd]; - if (training[fd] != -1) + if (training[fd] != std::size_t(-1)) { - nb_label[std::size_t(training[fd])] ++; + nb_label[training[fd]] ++; ++ nb_total; } }