60static FEATURE ReadFeature(FILE *File,
const FEATURE_DESC_STRUCT *FeatureDesc) {
61 auto Feature =
new FEATURE_STRUCT(FeatureDesc);
62 for (
int i = 0; i < Feature->Type->NumParams; i++) {
65 assert(!std::isnan(Feature->Params[i]));
87 for (
int i = 0; i < NumFeatures; i++) {
104static void WriteFeature(
FEATURE Feature, std::string &str) {
105 for (
int i = 0; i < Feature->Type->NumParams; i++) {
107 assert(!std::isnan(Feature->Params[i]));
109 str +=
" " + std::to_string(Feature->Params[i]);
124 str +=
"" + std::to_string(FeatureSet->
NumFeatures);
126 for (
int i = 0; i < FeatureSet->
NumFeatures; i++) {
127 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