61static FEATURE ReadFeature(FILE *File,
const FEATURE_DESC_STRUCT *FeatureDesc) {
62 auto Feature =
new FEATURE_STRUCT(FeatureDesc);
63 for (
int i = 0;
i < Feature->Type->NumParams;
i++) {
66 assert(!std::isnan(Feature->Params[
i]));
88 for (
int i = 0;
i < NumFeatures;
i++) {
105static void WriteFeature(
FEATURE Feature, std::string &str) {
106 for (
int i = 0;
i < Feature->Type->NumParams;
i++) {
108 assert(!std::isnan(Feature->Params[
i]));
110 std::stringstream stream;
112 stream.imbue(std::locale::classic());
115 stream << Feature->Params[
i];
116 str +=
" " + stream.str();
131 str +=
"" + std::to_string(FeatureSet->
NumFeatures);
134 WriteFeature(FeatureSet->
Features[
i], str);
int tfscanf(FILE *stream, const char *format,...)
FEATURE_SET ReadFeatureSet(FILE *File, const FEATURE_DESC_STRUCT *FeatureDesc)
bool AddFeature(FEATURE_SET FeatureSet, FEATURE Feature)
void WriteFeatureSet(FEATURE_SET FeatureSet, std::string &str)
std::vector< FEATURE_STRUCT * > Features