11 CSGObject::set_generic<ST>();
18 CSGObject::set_generic<ST>();
61 for (i=0; i<num_vec; i++)
66 get_feature_vector(i, len, free_vec);
68 ST* decompressed=apply_to_string(vec, len);
70 free_feature_vector(vec, i, free_vec);
72 cleanup_feature_vector(i);
74 set_feature_vector(i, decompressed, len);
82 uint64_t compressed_size=((int32_t*) f)[0];
83 uint64_t uncompressed_size=((int32_t*) f)[1];
85 int32_t offs=
CMath::ceil(2.0*
sizeof(int32_t)/
sizeof(ST));
86 ASSERT(uint64_t(len)==uint64_t(offs)+compressed_size)
88 len=uncompressed_size;
89 uncompressed_size*=
sizeof(ST);
90 ST* vec=SG_MALLOC(ST, len);
91 compressor->decompress((uint8_t*) (&f[offs]), compressed_size,
92 (uint8_t*) vec, uncompressed_size);
94 ASSERT(uncompressed_size==((uint64_t) len)*
sizeof(ST))
Template class StringFeatures implements a list of strings.
static float64_t ceil(float64_t d)
virtual ST * apply_to_string(ST *f, int32_t &len)
apply preproc on single feature vector
bool load(FILE *f)
initialize preprocessor from file
Compression library for compressing and decompressing buffers using one of the standard compression a...
bool save(FILE *f)
save preprocessor init-data to file
virtual EFeatureClass get_feature_class() const =0
Template class StringPreprocessor, base class for preprocessors (cf. CPreprocessor) that apply to CSt...
virtual bool apply_to_string_features(CFeatures *f)
all of classes and functions are contained in the shogun namespace
The class Features is the base class of all feature objects.
virtual void cleanup()
cleanup
virtual ~CDecompressString()
Preprocessor that decompresses compressed strings.
virtual EPreprocessorType get_type() const
return a type of preprocessor TODO: template specification of get_type