Replace more GenericVector by std::vector for src/training

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2021-03-18 07:43:07 +01:00
parent 72dc51b60e
commit 699f727f3e
4 changed files with 6 additions and 6 deletions

View File

@ -97,7 +97,7 @@ double IntFeatureDist::FeatureDistance(const std::vector<int> &features) const {
// Compute the distance between the given feature vector and the last
// Set feature vector.
double IntFeatureDist::DebugFeatureDistance(const GenericVector<int> &features) const {
double IntFeatureDist::DebugFeatureDistance(const std::vector<int> &features) const {
const int num_test_features = features.size();
const double denominator = total_feature_weight_ + num_test_features;
double misses = denominator;

View File

@ -19,7 +19,7 @@
#ifndef TESSERACT_CLASSIFY_INTFEATUREDIST_H_
#define TESSERACT_CLASSIFY_INTFEATUREDIST_H_
#include "genericvector.h"
#include <vector>
namespace tesseract {
@ -53,7 +53,7 @@ public:
// Compute the distance between the given feature vector and the last
// Set feature vector.
double FeatureDistance(const std::vector<int> &features) const;
double DebugFeatureDistance(const GenericVector<int> &features) const;
double DebugFeatureDistance(const std::vector<int> &features) const;
private:
// Clear all data.

View File

@ -133,7 +133,7 @@ int IntFeatureMap::FindNZFeatureMapping(SampleIterator *it) {
int total_samples = 0;
for (it->Begin(); !it->AtEnd(); it->Next()) {
const TrainingSample &sample = it->GetSample();
GenericVector<int> features;
std::vector<int> features;
feature_space_.IndexAndSortFeatures(sample.features(), sample.num_features(), &features);
int num_features = features.size();
for (int f = 0; f < num_features; ++f)
@ -164,7 +164,7 @@ int IntFeatureMap::FinalizeMapping(SampleIterator *it) {
}
// Prints the map features from the set in human-readable form.
void IntFeatureMap::DebugMapFeatures(const GenericVector<int> &map_features) const {
void IntFeatureMap::DebugMapFeatures(const std::vector<int> &map_features) const {
for (int i = 0; i < map_features.size(); ++i) {
INT_FEATURE_STRUCT f = InverseMapFeature(map_features[i]);
f.print();

View File

@ -116,7 +116,7 @@ public:
}
// Prints the map features from the set in human-readable form.
void DebugMapFeatures(const GenericVector<int> &map_features) const;
void DebugMapFeatures(const std::vector<int> &map_features) const;
private:
void Clear();